forked from stephenh/ts-proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecho.ts
59 lines (50 loc) · 1.35 KB
/
echo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* eslint-disable */
export const protobufPackage = "services.echo.v1";
export interface EchoRequest {
msg: string;
long_message: string;
}
export interface EchoResponse {
want_to_camel_case: string;
}
function createBaseEchoRequest(): EchoRequest {
return { msg: "", long_message: "" };
}
export const EchoRequest = {
fromJSON(object: any): EchoRequest {
return {
msg: isSet(object.msg) ? String(object.msg) : "",
long_message: isSet(object.long_message)
? String(object.long_message)
: "",
};
},
toJSON(message: EchoRequest): unknown {
const obj: any = {};
message.msg !== undefined && (obj.msg = message.msg);
message.long_message !== undefined &&
(obj.long_message = message.long_message);
return obj;
},
};
function createBaseEchoResponse(): EchoResponse {
return { want_to_camel_case: "" };
}
export const EchoResponse = {
fromJSON(object: any): EchoResponse {
return {
want_to_camel_case: isSet(object.want_to_camel_case)
? String(object.want_to_camel_case)
: "",
};
},
toJSON(message: EchoResponse): unknown {
const obj: any = {};
message.want_to_camel_case !== undefined &&
(obj.want_to_camel_case = message.want_to_camel_case);
return obj;
},
};
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}