@miradorlabs/web-grpc 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +5 -0
  2. package/google/protobuf/timestamp.ts +229 -0
  3. package/package.json +11 -0
  4. package/proto/gateway/common/v1/status.ts +179 -0
  5. package/proto/gateway/common/v1/status_grpc_pb.js +1 -0
  6. package/proto/gateway/common/v1/status_pb.js +237 -0
  7. package/proto/gateway/common/v1/types.ts +176 -0
  8. package/proto/gateway/common/v1/types_grpc_pb.js +1 -0
  9. package/proto/gateway/common/v1/types_pb.js +216 -0
  10. package/proto/gateway/web/v1/account_gateway.ts +7037 -0
  11. package/proto/gateway/web/v1/account_gateway_grpc_pb.js +813 -0
  12. package/proto/gateway/web/v1/account_gateway_pb.js +14338 -0
  13. package/proto/gateway/web/v1/automation_gateway.ts +5605 -0
  14. package/proto/gateway/web/v1/automation_gateway_grpc_pb.js +485 -0
  15. package/proto/gateway/web/v1/automation_gateway_pb.js +11618 -0
  16. package/proto/gateway/web/v1/chain_gateway.ts +3805 -0
  17. package/proto/gateway/web/v1/chain_gateway_grpc_pb.js +115 -0
  18. package/proto/gateway/web/v1/chain_gateway_pb.js +7049 -0
  19. package/proto/gateway/web/v1/market_gateway.ts +492 -0
  20. package/proto/gateway/web/v1/market_gateway_grpc_pb.js +45 -0
  21. package/proto/gateway/web/v1/market_gateway_pb.js +1063 -0
  22. package/proto/gateway/web/v1/oauth_gateway.ts +1163 -0
  23. package/proto/gateway/web/v1/oauth_gateway_grpc_pb.js +150 -0
  24. package/proto/gateway/web/v1/oauth_gateway_pb.js +2316 -0
  25. package/proto/gateway/web/v1/plan_gateway.ts +2463 -0
  26. package/proto/gateway/web/v1/plan_gateway_grpc_pb.js +152 -0
  27. package/proto/gateway/web/v1/plan_gateway_pb.js +4840 -0
  28. package/proto/gateway/web/v1/stream_gateway.ts +2354 -0
  29. package/proto/gateway/web/v1/stream_gateway_grpc_pb.js +145 -0
  30. package/proto/gateway/web/v1/stream_gateway_pb.js +4593 -0
  31. package/proto/gateway/web/v1/trace_gateway.ts +16320 -0
  32. package/proto/gateway/web/v1/trace_gateway_grpc_pb.js +280 -0
  33. package/proto/gateway/web/v1/trace_gateway_pb.js +28667 -0
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @miradorlabs/web-grpc
2
+
3
+ Generated gRPC stubs for the Mirador `proto/gateway/web` gateway.
4
+
5
+ This package is **SDK plumbing**. You almost certainly want `@miradorlabs/web-sdk` or `@miradorlabs/nodejs-sdk` instead.
@@ -0,0 +1,229 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v3.21.12
5
+ // source: google/protobuf/timestamp.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export const protobufPackage = "google.protobuf";
11
+
12
+ /**
13
+ * A Timestamp represents a point in time independent of any time zone or local
14
+ * calendar, encoded as a count of seconds and fractions of seconds at
15
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
16
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
17
+ * Gregorian calendar backwards to year one.
18
+ *
19
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
20
+ * second table is needed for interpretation, using a [24-hour linear
21
+ * smear](https://developers.google.com/time/smear).
22
+ *
23
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
24
+ * restricting to that range, we ensure that we can convert to and from [RFC
25
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
26
+ *
27
+ * # Examples
28
+ *
29
+ * Example 1: Compute Timestamp from POSIX `time()`.
30
+ *
31
+ * Timestamp timestamp;
32
+ * timestamp.set_seconds(time(NULL));
33
+ * timestamp.set_nanos(0);
34
+ *
35
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
36
+ *
37
+ * struct timeval tv;
38
+ * gettimeofday(&tv, NULL);
39
+ *
40
+ * Timestamp timestamp;
41
+ * timestamp.set_seconds(tv.tv_sec);
42
+ * timestamp.set_nanos(tv.tv_usec * 1000);
43
+ *
44
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
45
+ *
46
+ * FILETIME ft;
47
+ * GetSystemTimeAsFileTime(&ft);
48
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
49
+ *
50
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
51
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
52
+ * Timestamp timestamp;
53
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
54
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
55
+ *
56
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
57
+ *
58
+ * long millis = System.currentTimeMillis();
59
+ *
60
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
61
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
62
+ *
63
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
64
+ *
65
+ * Instant now = Instant.now();
66
+ *
67
+ * Timestamp timestamp =
68
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
69
+ * .setNanos(now.getNano()).build();
70
+ *
71
+ * Example 6: Compute Timestamp from current time in Python.
72
+ *
73
+ * timestamp = Timestamp()
74
+ * timestamp.GetCurrentTime()
75
+ *
76
+ * # JSON Mapping
77
+ *
78
+ * In JSON format, the Timestamp type is encoded as a string in the
79
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
80
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
81
+ * where {year} is always expressed using four digits while {month}, {day},
82
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
83
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
84
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
85
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
86
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
87
+ * able to accept both UTC and other timezones (as indicated by an offset).
88
+ *
89
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
90
+ * 01:30 UTC on January 15, 2017.
91
+ *
92
+ * In JavaScript, one can convert a Date object to this format using the
93
+ * standard
94
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
95
+ * method. In Python, a standard `datetime.datetime` object can be converted
96
+ * to this format using
97
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
98
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
99
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
100
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
101
+ * ) to obtain a formatter capable of generating timestamps in this format.
102
+ */
103
+ export interface Timestamp {
104
+ /**
105
+ * Represents seconds of UTC time since Unix epoch
106
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
107
+ * 9999-12-31T23:59:59Z inclusive.
108
+ */
109
+ seconds: number;
110
+ /**
111
+ * Non-negative fractions of a second at nanosecond resolution. Negative
112
+ * second values with fractions must still have non-negative nanos values
113
+ * that count forward in time. Must be from 0 to 999,999,999
114
+ * inclusive.
115
+ */
116
+ nanos: number;
117
+ }
118
+
119
+ function createBaseTimestamp(): Timestamp {
120
+ return { seconds: 0, nanos: 0 };
121
+ }
122
+
123
+ export const Timestamp: MessageFns<Timestamp> = {
124
+ encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
125
+ if (message.seconds !== 0) {
126
+ writer.uint32(8).int64(message.seconds);
127
+ }
128
+ if (message.nanos !== 0) {
129
+ writer.uint32(16).int32(message.nanos);
130
+ }
131
+ return writer;
132
+ },
133
+
134
+ decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {
135
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
136
+ const end = length === undefined ? reader.len : reader.pos + length;
137
+ const message = createBaseTimestamp();
138
+ while (reader.pos < end) {
139
+ const tag = reader.uint32();
140
+ switch (tag >>> 3) {
141
+ case 1: {
142
+ if (tag !== 8) {
143
+ break;
144
+ }
145
+
146
+ message.seconds = longToNumber(reader.int64());
147
+ continue;
148
+ }
149
+ case 2: {
150
+ if (tag !== 16) {
151
+ break;
152
+ }
153
+
154
+ message.nanos = reader.int32();
155
+ continue;
156
+ }
157
+ }
158
+ if ((tag & 7) === 4 || tag === 0) {
159
+ break;
160
+ }
161
+ reader.skip(tag & 7);
162
+ }
163
+ return message;
164
+ },
165
+
166
+ fromJSON(object: any): Timestamp {
167
+ return {
168
+ seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0,
169
+ nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
170
+ };
171
+ },
172
+
173
+ toJSON(message: Timestamp): unknown {
174
+ const obj: any = {};
175
+ if (message.seconds !== 0) {
176
+ obj.seconds = Math.round(message.seconds);
177
+ }
178
+ if (message.nanos !== 0) {
179
+ obj.nanos = Math.round(message.nanos);
180
+ }
181
+ return obj;
182
+ },
183
+
184
+ create<I extends Exact<DeepPartial<Timestamp>, I>>(base?: I): Timestamp {
185
+ return Timestamp.fromPartial(base ?? ({} as any));
186
+ },
187
+ fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(object: I): Timestamp {
188
+ const message = createBaseTimestamp();
189
+ message.seconds = object.seconds ?? 0;
190
+ message.nanos = object.nanos ?? 0;
191
+ return message;
192
+ },
193
+ };
194
+
195
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
196
+
197
+ export type DeepPartial<T> = T extends Builtin ? T
198
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
199
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
200
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
201
+ : Partial<T>;
202
+
203
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
204
+ export type Exact<P, I extends P> = P extends Builtin ? P
205
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
206
+
207
+ function longToNumber(int64: { toString(): string }): number {
208
+ const num = globalThis.Number(int64.toString());
209
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
210
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
211
+ }
212
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
213
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
214
+ }
215
+ return num;
216
+ }
217
+
218
+ function isSet(value: any): boolean {
219
+ return value !== null && value !== undefined;
220
+ }
221
+
222
+ export interface MessageFns<T> {
223
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
224
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
225
+ fromJSON(object: any): T;
226
+ toJSON(message: T): unknown;
227
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
228
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
229
+ }
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@miradorlabs/web-grpc",
3
+ "version": "1.0.0",
4
+ "description": "Generated gRPC stubs for the Mirador proto/gateway/web gateway. SDK plumbing — you probably want @miradorlabs/web-sdk or @miradorlabs/nodejs-sdk.",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "license": "Apache-2.0",
8
+ "repository": { "type": "git", "url": "git+https://github.com/miradorlabs/mirador-platform.git" },
9
+ "peerDependencies": {"@grpc/grpc-js":"^1.14.1","google-protobuf":"^4.0.1"},
10
+ "publishConfig": { "access": "public" }
11
+ }
@@ -0,0 +1,179 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v3.21.12
5
+ // source: proto/gateway/common/v1/status.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+
10
+ export const protobufPackage = "gateway.common.v1";
11
+
12
+ export interface ResponseStatus {
13
+ code: ResponseStatus_StatusCode;
14
+ errorMessage?: string | undefined;
15
+ }
16
+
17
+ export enum ResponseStatus_StatusCode {
18
+ STATUS_CODE_UNSPECIFIED = 0,
19
+ STATUS_CODE_SUCCESS = 1,
20
+ STATUS_CODE_NOT_FOUND = 2,
21
+ STATUS_CODE_VALIDATION_ERROR = 3,
22
+ /** STATUS_CODE_INTERNAL_ERROR - general server error */
23
+ STATUS_CODE_INTERNAL_ERROR = 4,
24
+ /** STATUS_CODE_UNAUTHENTICATED - missing or invalid authentication */
25
+ STATUS_CODE_UNAUTHENTICATED = 5,
26
+ UNRECOGNIZED = -1,
27
+ }
28
+
29
+ export function responseStatus_StatusCodeFromJSON(object: any): ResponseStatus_StatusCode {
30
+ switch (object) {
31
+ case 0:
32
+ case "STATUS_CODE_UNSPECIFIED":
33
+ return ResponseStatus_StatusCode.STATUS_CODE_UNSPECIFIED;
34
+ case 1:
35
+ case "STATUS_CODE_SUCCESS":
36
+ return ResponseStatus_StatusCode.STATUS_CODE_SUCCESS;
37
+ case 2:
38
+ case "STATUS_CODE_NOT_FOUND":
39
+ return ResponseStatus_StatusCode.STATUS_CODE_NOT_FOUND;
40
+ case 3:
41
+ case "STATUS_CODE_VALIDATION_ERROR":
42
+ return ResponseStatus_StatusCode.STATUS_CODE_VALIDATION_ERROR;
43
+ case 4:
44
+ case "STATUS_CODE_INTERNAL_ERROR":
45
+ return ResponseStatus_StatusCode.STATUS_CODE_INTERNAL_ERROR;
46
+ case 5:
47
+ case "STATUS_CODE_UNAUTHENTICATED":
48
+ return ResponseStatus_StatusCode.STATUS_CODE_UNAUTHENTICATED;
49
+ case -1:
50
+ case "UNRECOGNIZED":
51
+ default:
52
+ return ResponseStatus_StatusCode.UNRECOGNIZED;
53
+ }
54
+ }
55
+
56
+ export function responseStatus_StatusCodeToJSON(object: ResponseStatus_StatusCode): string {
57
+ switch (object) {
58
+ case ResponseStatus_StatusCode.STATUS_CODE_UNSPECIFIED:
59
+ return "STATUS_CODE_UNSPECIFIED";
60
+ case ResponseStatus_StatusCode.STATUS_CODE_SUCCESS:
61
+ return "STATUS_CODE_SUCCESS";
62
+ case ResponseStatus_StatusCode.STATUS_CODE_NOT_FOUND:
63
+ return "STATUS_CODE_NOT_FOUND";
64
+ case ResponseStatus_StatusCode.STATUS_CODE_VALIDATION_ERROR:
65
+ return "STATUS_CODE_VALIDATION_ERROR";
66
+ case ResponseStatus_StatusCode.STATUS_CODE_INTERNAL_ERROR:
67
+ return "STATUS_CODE_INTERNAL_ERROR";
68
+ case ResponseStatus_StatusCode.STATUS_CODE_UNAUTHENTICATED:
69
+ return "STATUS_CODE_UNAUTHENTICATED";
70
+ case ResponseStatus_StatusCode.UNRECOGNIZED:
71
+ default:
72
+ return "UNRECOGNIZED";
73
+ }
74
+ }
75
+
76
+ function createBaseResponseStatus(): ResponseStatus {
77
+ return { code: 0, errorMessage: undefined };
78
+ }
79
+
80
+ export const ResponseStatus: MessageFns<ResponseStatus> = {
81
+ encode(message: ResponseStatus, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
82
+ if (message.code !== 0) {
83
+ writer.uint32(8).int32(message.code);
84
+ }
85
+ if (message.errorMessage !== undefined) {
86
+ writer.uint32(18).string(message.errorMessage);
87
+ }
88
+ return writer;
89
+ },
90
+
91
+ decode(input: BinaryReader | Uint8Array, length?: number): ResponseStatus {
92
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
93
+ const end = length === undefined ? reader.len : reader.pos + length;
94
+ const message = createBaseResponseStatus();
95
+ while (reader.pos < end) {
96
+ const tag = reader.uint32();
97
+ switch (tag >>> 3) {
98
+ case 1: {
99
+ if (tag !== 8) {
100
+ break;
101
+ }
102
+
103
+ message.code = reader.int32() as any;
104
+ continue;
105
+ }
106
+ case 2: {
107
+ if (tag !== 18) {
108
+ break;
109
+ }
110
+
111
+ message.errorMessage = reader.string();
112
+ continue;
113
+ }
114
+ }
115
+ if ((tag & 7) === 4 || tag === 0) {
116
+ break;
117
+ }
118
+ reader.skip(tag & 7);
119
+ }
120
+ return message;
121
+ },
122
+
123
+ fromJSON(object: any): ResponseStatus {
124
+ return {
125
+ code: isSet(object.code) ? responseStatus_StatusCodeFromJSON(object.code) : 0,
126
+ errorMessage: isSet(object.errorMessage)
127
+ ? globalThis.String(object.errorMessage)
128
+ : isSet(object.error_message)
129
+ ? globalThis.String(object.error_message)
130
+ : undefined,
131
+ };
132
+ },
133
+
134
+ toJSON(message: ResponseStatus): unknown {
135
+ const obj: any = {};
136
+ if (message.code !== 0) {
137
+ obj.code = responseStatus_StatusCodeToJSON(message.code);
138
+ }
139
+ if (message.errorMessage !== undefined) {
140
+ obj.errorMessage = message.errorMessage;
141
+ }
142
+ return obj;
143
+ },
144
+
145
+ create<I extends Exact<DeepPartial<ResponseStatus>, I>>(base?: I): ResponseStatus {
146
+ return ResponseStatus.fromPartial(base ?? ({} as any));
147
+ },
148
+ fromPartial<I extends Exact<DeepPartial<ResponseStatus>, I>>(object: I): ResponseStatus {
149
+ const message = createBaseResponseStatus();
150
+ message.code = object.code ?? 0;
151
+ message.errorMessage = object.errorMessage ?? undefined;
152
+ return message;
153
+ },
154
+ };
155
+
156
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
157
+
158
+ export type DeepPartial<T> = T extends Builtin ? T
159
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
160
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
161
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
162
+ : Partial<T>;
163
+
164
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
165
+ export type Exact<P, I extends P> = P extends Builtin ? P
166
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
167
+
168
+ function isSet(value: any): boolean {
169
+ return value !== null && value !== undefined;
170
+ }
171
+
172
+ export interface MessageFns<T> {
173
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
174
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
175
+ fromJSON(object: any): T;
176
+ toJSON(message: T): unknown;
177
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
178
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
179
+ }
@@ -0,0 +1 @@
1
+ // GENERATED CODE -- NO SERVICES IN PROTO
@@ -0,0 +1,237 @@
1
+ // source: proto/gateway/common/v1/status.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global =
17
+ (typeof globalThis !== 'undefined' && globalThis) ||
18
+ (typeof window !== 'undefined' && window) ||
19
+ (typeof global !== 'undefined' && global) ||
20
+ (typeof self !== 'undefined' && self) ||
21
+ (function () { return this; }).call(null) ||
22
+ Function('return this')();
23
+
24
+ goog.exportSymbol('proto.gateway.common.v1.ResponseStatus', null, global);
25
+ goog.exportSymbol('proto.gateway.common.v1.ResponseStatus.StatusCode', null, global);
26
+ /**
27
+ * Generated by JsPbCodeGenerator.
28
+ * @param {Array=} opt_data Optional initial data array, typically from a
29
+ * server response, or constructed directly in Javascript. The array is used
30
+ * in place and becomes part of the constructed object. It is not cloned.
31
+ * If no data is provided, the constructed object will be empty, but still
32
+ * valid.
33
+ * @extends {jspb.Message}
34
+ * @constructor
35
+ */
36
+ proto.gateway.common.v1.ResponseStatus = function(opt_data) {
37
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
38
+ };
39
+ goog.inherits(proto.gateway.common.v1.ResponseStatus, jspb.Message);
40
+ if (goog.DEBUG && !COMPILED) {
41
+ /**
42
+ * @public
43
+ * @override
44
+ */
45
+ proto.gateway.common.v1.ResponseStatus.displayName = 'proto.gateway.common.v1.ResponseStatus';
46
+ }
47
+
48
+
49
+
50
+ if (jspb.Message.GENERATE_TO_OBJECT) {
51
+ /**
52
+ * Creates an object representation of this proto.
53
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
54
+ * Optional fields that are not set will be set to undefined.
55
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
56
+ * For the list of reserved names please see:
57
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
58
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
59
+ * JSPB instance for transitional soy proto support:
60
+ * http://goto/soy-param-migration
61
+ * @return {!Object}
62
+ */
63
+ proto.gateway.common.v1.ResponseStatus.prototype.toObject = function(opt_includeInstance) {
64
+ return proto.gateway.common.v1.ResponseStatus.toObject(opt_includeInstance, this);
65
+ };
66
+
67
+
68
+ /**
69
+ * Static version of the {@see toObject} method.
70
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
71
+ * the JSPB instance for transitional soy proto support:
72
+ * http://goto/soy-param-migration
73
+ * @param {!proto.gateway.common.v1.ResponseStatus} msg The msg instance to transform.
74
+ * @return {!Object}
75
+ * @suppress {unusedLocalVariables} f is only used for nested messages
76
+ */
77
+ proto.gateway.common.v1.ResponseStatus.toObject = function(includeInstance, msg) {
78
+ var f, obj = {
79
+ code: jspb.Message.getFieldWithDefault(msg, 1, 0),
80
+ errorMessage: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f
81
+ };
82
+
83
+ if (includeInstance) {
84
+ obj.$jspbMessageInstance = msg;
85
+ }
86
+ return obj;
87
+ };
88
+ }
89
+
90
+
91
+ /**
92
+ * Deserializes binary data (in protobuf wire format).
93
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
94
+ * @return {!proto.gateway.common.v1.ResponseStatus}
95
+ */
96
+ proto.gateway.common.v1.ResponseStatus.deserializeBinary = function(bytes) {
97
+ var reader = new jspb.BinaryReader(bytes);
98
+ var msg = new proto.gateway.common.v1.ResponseStatus;
99
+ return proto.gateway.common.v1.ResponseStatus.deserializeBinaryFromReader(msg, reader);
100
+ };
101
+
102
+
103
+ /**
104
+ * Deserializes binary data (in protobuf wire format) from the
105
+ * given reader into the given message object.
106
+ * @param {!proto.gateway.common.v1.ResponseStatus} msg The message object to deserialize into.
107
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
108
+ * @return {!proto.gateway.common.v1.ResponseStatus}
109
+ */
110
+ proto.gateway.common.v1.ResponseStatus.deserializeBinaryFromReader = function(msg, reader) {
111
+ while (reader.nextField()) {
112
+ if (reader.isEndGroup()) {
113
+ break;
114
+ }
115
+ var field = reader.getFieldNumber();
116
+ switch (field) {
117
+ case 1:
118
+ var value = /** @type {!proto.gateway.common.v1.ResponseStatus.StatusCode} */ (reader.readEnum());
119
+ msg.setCode(value);
120
+ break;
121
+ case 2:
122
+ var value = /** @type {string} */ (reader.readString());
123
+ msg.setErrorMessage(value);
124
+ break;
125
+ default:
126
+ reader.skipField();
127
+ break;
128
+ }
129
+ }
130
+ return msg;
131
+ };
132
+
133
+
134
+ /**
135
+ * Serializes the message to binary data (in protobuf wire format).
136
+ * @return {!Uint8Array}
137
+ */
138
+ proto.gateway.common.v1.ResponseStatus.prototype.serializeBinary = function() {
139
+ var writer = new jspb.BinaryWriter();
140
+ proto.gateway.common.v1.ResponseStatus.serializeBinaryToWriter(this, writer);
141
+ return writer.getResultBuffer();
142
+ };
143
+
144
+
145
+ /**
146
+ * Serializes the given message to binary data (in protobuf wire
147
+ * format), writing to the given BinaryWriter.
148
+ * @param {!proto.gateway.common.v1.ResponseStatus} message
149
+ * @param {!jspb.BinaryWriter} writer
150
+ * @suppress {unusedLocalVariables} f is only used for nested messages
151
+ */
152
+ proto.gateway.common.v1.ResponseStatus.serializeBinaryToWriter = function(message, writer) {
153
+ var f = undefined;
154
+ f = message.getCode();
155
+ if (f !== 0.0) {
156
+ writer.writeEnum(
157
+ 1,
158
+ f
159
+ );
160
+ }
161
+ f = /** @type {string} */ (jspb.Message.getField(message, 2));
162
+ if (f != null) {
163
+ writer.writeString(
164
+ 2,
165
+ f
166
+ );
167
+ }
168
+ };
169
+
170
+
171
+ /**
172
+ * @enum {number}
173
+ */
174
+ proto.gateway.common.v1.ResponseStatus.StatusCode = {
175
+ STATUS_CODE_UNSPECIFIED: 0,
176
+ STATUS_CODE_SUCCESS: 1,
177
+ STATUS_CODE_NOT_FOUND: 2,
178
+ STATUS_CODE_VALIDATION_ERROR: 3,
179
+ STATUS_CODE_INTERNAL_ERROR: 4,
180
+ STATUS_CODE_UNAUTHENTICATED: 5
181
+ };
182
+
183
+ /**
184
+ * optional StatusCode code = 1;
185
+ * @return {!proto.gateway.common.v1.ResponseStatus.StatusCode}
186
+ */
187
+ proto.gateway.common.v1.ResponseStatus.prototype.getCode = function() {
188
+ return /** @type {!proto.gateway.common.v1.ResponseStatus.StatusCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
189
+ };
190
+
191
+
192
+ /**
193
+ * @param {!proto.gateway.common.v1.ResponseStatus.StatusCode} value
194
+ * @return {!proto.gateway.common.v1.ResponseStatus} returns this
195
+ */
196
+ proto.gateway.common.v1.ResponseStatus.prototype.setCode = function(value) {
197
+ return jspb.Message.setProto3EnumField(this, 1, value);
198
+ };
199
+
200
+
201
+ /**
202
+ * optional string error_message = 2;
203
+ * @return {string}
204
+ */
205
+ proto.gateway.common.v1.ResponseStatus.prototype.getErrorMessage = function() {
206
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
207
+ };
208
+
209
+
210
+ /**
211
+ * @param {string} value
212
+ * @return {!proto.gateway.common.v1.ResponseStatus} returns this
213
+ */
214
+ proto.gateway.common.v1.ResponseStatus.prototype.setErrorMessage = function(value) {
215
+ return jspb.Message.setField(this, 2, value);
216
+ };
217
+
218
+
219
+ /**
220
+ * Clears the field making it undefined.
221
+ * @return {!proto.gateway.common.v1.ResponseStatus} returns this
222
+ */
223
+ proto.gateway.common.v1.ResponseStatus.prototype.clearErrorMessage = function() {
224
+ return jspb.Message.setField(this, 2, undefined);
225
+ };
226
+
227
+
228
+ /**
229
+ * Returns whether this field is set.
230
+ * @return {boolean}
231
+ */
232
+ proto.gateway.common.v1.ResponseStatus.prototype.hasErrorMessage = function() {
233
+ return jspb.Message.getField(this, 2) != null;
234
+ };
235
+
236
+
237
+ goog.object.extend(exports, proto.gateway.common.v1);