@raystack/proton 0.1.0-ce225175aa066e6f296bc489293bb83ed0edcef6

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 (197) hide show
  1. package/google/api/annotations_pb.ts +33 -0
  2. package/google/api/field_behavior.ts +95 -0
  3. package/google/api/field_behavior_pb.ts +139 -0
  4. package/google/api/http.ts +695 -0
  5. package/google/api/http_pb.ts +547 -0
  6. package/google/api/httpbody.ts +159 -0
  7. package/google/api/httpbody_pb.ts +122 -0
  8. package/google/protobuf/any.ts +322 -0
  9. package/google/protobuf/descriptor.ts +3475 -0
  10. package/google/protobuf/duration.ts +231 -0
  11. package/google/protobuf/struct.ts +484 -0
  12. package/google/protobuf/timestamp.ts +290 -0
  13. package/google/protobuf/wrappers.ts +752 -0
  14. package/package.json +47 -0
  15. package/protoc-gen-openapiv2/options/annotations_pb.ts +78 -0
  16. package/protoc-gen-openapiv2/options/openapiv2.ts +3110 -0
  17. package/protoc-gen-openapiv2/options/openapiv2_pb.ts +1995 -0
  18. package/raystack/assets/index.ts +29 -0
  19. package/raystack/assets/v1beta1/bucket.ts +362 -0
  20. package/raystack/assets/v1beta1/bucket_pb.ts +233 -0
  21. package/raystack/assets/v1beta1/dashboard.ts +426 -0
  22. package/raystack/assets/v1beta1/dashboard_pb.ts +275 -0
  23. package/raystack/assets/v1beta1/event.ts +105 -0
  24. package/raystack/assets/v1beta1/event_pb.ts +70 -0
  25. package/raystack/assets/v1beta1/group.ts +223 -0
  26. package/raystack/assets/v1beta1/group_pb.ts +149 -0
  27. package/raystack/assets/v1beta1/job.ts +147 -0
  28. package/raystack/assets/v1beta1/job_pb.ts +100 -0
  29. package/raystack/assets/v1beta1/lineage.ts +90 -0
  30. package/raystack/assets/v1beta1/lineage_pb.ts +61 -0
  31. package/raystack/assets/v1beta1/ownership.ts +179 -0
  32. package/raystack/assets/v1beta1/ownership_pb.ts +119 -0
  33. package/raystack/assets/v1beta1/preview.ts +87 -0
  34. package/raystack/assets/v1beta1/preview_pb.ts +58 -0
  35. package/raystack/assets/v1beta1/properties.ts +116 -0
  36. package/raystack/assets/v1beta1/properties_pb.ts +63 -0
  37. package/raystack/assets/v1beta1/resource.ts +149 -0
  38. package/raystack/assets/v1beta1/resource_pb.ts +96 -0
  39. package/raystack/assets/v1beta1/schema.ts +421 -0
  40. package/raystack/assets/v1beta1/schema_pb.ts +262 -0
  41. package/raystack/assets/v1beta1/table.ts +408 -0
  42. package/raystack/assets/v1beta1/table_pb.ts +266 -0
  43. package/raystack/assets/v1beta1/timestamp.ts +158 -0
  44. package/raystack/assets/v1beta1/timestamp_pb.ts +107 -0
  45. package/raystack/assets/v1beta1/topic.ts +253 -0
  46. package/raystack/assets/v1beta1/topic_pb.ts +171 -0
  47. package/raystack/assets/v1beta1/user.ts +451 -0
  48. package/raystack/assets/v1beta1/user_pb.ts +292 -0
  49. package/raystack/assets/v1beta2/application.ts +125 -0
  50. package/raystack/assets/v1beta2/application_pb.ts +79 -0
  51. package/raystack/assets/v1beta2/asset.ts +269 -0
  52. package/raystack/assets/v1beta2/asset_pb.ts +157 -0
  53. package/raystack/assets/v1beta2/bucket.ts +341 -0
  54. package/raystack/assets/v1beta2/bucket_pb.ts +215 -0
  55. package/raystack/assets/v1beta2/common.ts +392 -0
  56. package/raystack/assets/v1beta2/common_pb.ts +258 -0
  57. package/raystack/assets/v1beta2/dashboard.ts +393 -0
  58. package/raystack/assets/v1beta2/dashboard_pb.ts +247 -0
  59. package/raystack/assets/v1beta2/experiment.ts +274 -0
  60. package/raystack/assets/v1beta2/experiment_pb.ts +180 -0
  61. package/raystack/assets/v1beta2/feature_table.ts +387 -0
  62. package/raystack/assets/v1beta2/feature_table_pb.ts +237 -0
  63. package/raystack/assets/v1beta2/group.ts +178 -0
  64. package/raystack/assets/v1beta2/group_pb.ts +118 -0
  65. package/raystack/assets/v1beta2/job.ts +99 -0
  66. package/raystack/assets/v1beta2/job_pb.ts +65 -0
  67. package/raystack/assets/v1beta2/metric.ts +163 -0
  68. package/raystack/assets/v1beta2/metric_pb.ts +105 -0
  69. package/raystack/assets/v1beta2/model.ts +519 -0
  70. package/raystack/assets/v1beta2/model_pb.ts +322 -0
  71. package/raystack/assets/v1beta2/table.ts +663 -0
  72. package/raystack/assets/v1beta2/table_pb.ts +409 -0
  73. package/raystack/assets/v1beta2/topic.ts +275 -0
  74. package/raystack/assets/v1beta2/topic_pb.ts +181 -0
  75. package/raystack/assets/v1beta2/user.ts +433 -0
  76. package/raystack/assets/v1beta2/user_pb.ts +277 -0
  77. package/raystack/common/index.ts +3 -0
  78. package/raystack/common/v1/service-CommonService_connectquery.ts +21 -0
  79. package/raystack/common/v1/service.client.ts +37 -0
  80. package/raystack/common/v1/service.ts +245 -0
  81. package/raystack/common/v1/service_connect.ts +26 -0
  82. package/raystack/common/v1/service_pb.ts +149 -0
  83. package/raystack/compass/index.ts +3 -0
  84. package/raystack/compass/v1beta1/service-CompassService_connectquery.ts +605 -0
  85. package/raystack/compass/v1beta1/service.client.ts +594 -0
  86. package/raystack/compass/v1beta1/service.ts +8169 -0
  87. package/raystack/compass/v1beta1/service_connect.ts +407 -0
  88. package/raystack/compass/v1beta1/service_pb.ts +4975 -0
  89. package/raystack/entropy/index.ts +6 -0
  90. package/raystack/entropy/v1beta1/module-ModuleService_connectquery.ts +77 -0
  91. package/raystack/entropy/v1beta1/module.client.ts +89 -0
  92. package/raystack/entropy/v1beta1/module.ts +692 -0
  93. package/raystack/entropy/v1beta1/module_connect.ts +62 -0
  94. package/raystack/entropy/v1beta1/module_pb.ts +445 -0
  95. package/raystack/entropy/v1beta1/resource-ResourceService_connectquery.ts +105 -0
  96. package/raystack/entropy/v1beta1/resource.client.ts +129 -0
  97. package/raystack/entropy/v1beta1/resource.ts +1817 -0
  98. package/raystack/entropy/v1beta1/resource_connect.ts +89 -0
  99. package/raystack/entropy/v1beta1/resource_pb.ts +1092 -0
  100. package/raystack/frontier/index.ts +7 -0
  101. package/raystack/frontier/v1beta1/admin-AdminService_connectquery.ts +756 -0
  102. package/raystack/frontier/v1beta1/admin.client.ts +849 -0
  103. package/raystack/frontier/v1beta1/admin.ts +9007 -0
  104. package/raystack/frontier/v1beta1/admin_connect.ts +573 -0
  105. package/raystack/frontier/v1beta1/admin_pb.ts +5615 -0
  106. package/raystack/frontier/v1beta1/frontier-FrontierService_connectquery.ts +2399 -0
  107. package/raystack/frontier/v1beta1/frontier.client.ts +2307 -0
  108. package/raystack/frontier/v1beta1/frontier.ts +23706 -0
  109. package/raystack/frontier/v1beta1/frontier_connect.ts +1574 -0
  110. package/raystack/frontier/v1beta1/frontier_pb.ts +15258 -0
  111. package/raystack/frontier/v1beta1/models.ts +7433 -0
  112. package/raystack/frontier/v1beta1/models_pb.ts +4345 -0
  113. package/raystack/guardian/index.ts +3 -0
  114. package/raystack/guardian/v1beta1/guardian-GuardianService_connectquery.ts +569 -0
  115. package/raystack/guardian/v1beta1/guardian.client.ts +552 -0
  116. package/raystack/guardian/v1beta1/guardian.ts +9688 -0
  117. package/raystack/guardian/v1beta1/guardian_connect.ts +381 -0
  118. package/raystack/guardian/v1beta1/guardian_pb.ts +5858 -0
  119. package/raystack/optimus/core/v1beta1/backup-BackupService_connectquery.ts +49 -0
  120. package/raystack/optimus/core/v1beta1/backup.client.ts +63 -0
  121. package/raystack/optimus/core/v1beta1/backup.ts +708 -0
  122. package/raystack/optimus/core/v1beta1/backup_connect.ts +44 -0
  123. package/raystack/optimus/core/v1beta1/backup_pb.ts +406 -0
  124. package/raystack/optimus/core/v1beta1/job_run-JobRunService_connectquery.ts +71 -0
  125. package/raystack/optimus/core/v1beta1/job_run.client.ts +96 -0
  126. package/raystack/optimus/core/v1beta1/job_run.ts +1008 -0
  127. package/raystack/optimus/core/v1beta1/job_run_connect.ts +63 -0
  128. package/raystack/optimus/core/v1beta1/job_run_pb.ts +612 -0
  129. package/raystack/optimus/core/v1beta1/job_spec-JobSpecificationService_connectquery.ts +249 -0
  130. package/raystack/optimus/core/v1beta1/job_spec.client.ts +363 -0
  131. package/raystack/optimus/core/v1beta1/job_spec.ts +5134 -0
  132. package/raystack/optimus/core/v1beta1/job_spec_connect.ts +233 -0
  133. package/raystack/optimus/core/v1beta1/job_spec_pb.ts +3196 -0
  134. package/raystack/optimus/core/v1beta1/namespace-NamespaceService_connectquery.ts +55 -0
  135. package/raystack/optimus/core/v1beta1/namespace.client.ts +75 -0
  136. package/raystack/optimus/core/v1beta1/namespace.ts +477 -0
  137. package/raystack/optimus/core/v1beta1/namespace_connect.ts +50 -0
  138. package/raystack/optimus/core/v1beta1/namespace_pb.ts +291 -0
  139. package/raystack/optimus/core/v1beta1/project-ProjectService_connectquery.ts +55 -0
  140. package/raystack/optimus/core/v1beta1/project.client.ts +75 -0
  141. package/raystack/optimus/core/v1beta1/project.ts +520 -0
  142. package/raystack/optimus/core/v1beta1/project_connect.ts +50 -0
  143. package/raystack/optimus/core/v1beta1/project_pb.ts +322 -0
  144. package/raystack/optimus/core/v1beta1/replay-ReplayService_connectquery.ts +63 -0
  145. package/raystack/optimus/core/v1beta1/replay.client.ts +76 -0
  146. package/raystack/optimus/core/v1beta1/replay.ts +881 -0
  147. package/raystack/optimus/core/v1beta1/replay_connect.ts +53 -0
  148. package/raystack/optimus/core/v1beta1/replay_pb.ts +522 -0
  149. package/raystack/optimus/core/v1beta1/resource-ResourceService_connectquery.ts +104 -0
  150. package/raystack/optimus/core/v1beta1/resource.client.ts +148 -0
  151. package/raystack/optimus/core/v1beta1/resource.ts +1329 -0
  152. package/raystack/optimus/core/v1beta1/resource_connect.ts +96 -0
  153. package/raystack/optimus/core/v1beta1/resource_pb.ts +791 -0
  154. package/raystack/optimus/core/v1beta1/runtime-RuntimeService_connectquery.ts +23 -0
  155. package/raystack/optimus/core/v1beta1/runtime.client.ts +45 -0
  156. package/raystack/optimus/core/v1beta1/runtime.ts +131 -0
  157. package/raystack/optimus/core/v1beta1/runtime_connect.ts +30 -0
  158. package/raystack/optimus/core/v1beta1/runtime_pb.ts +82 -0
  159. package/raystack/optimus/core/v1beta1/secret-SecretService_connectquery.ts +71 -0
  160. package/raystack/optimus/core/v1beta1/secret.client.ts +92 -0
  161. package/raystack/optimus/core/v1beta1/secret.ts +619 -0
  162. package/raystack/optimus/core/v1beta1/secret_connect.ts +61 -0
  163. package/raystack/optimus/core/v1beta1/secret_pb.ts +393 -0
  164. package/raystack/optimus/core/v1beta1/status.ts +113 -0
  165. package/raystack/optimus/core/v1beta1/status_pb.ts +101 -0
  166. package/raystack/optimus/integration/v1beta1/event.ts +531 -0
  167. package/raystack/optimus/integration/v1beta1/event_pb.ts +362 -0
  168. package/raystack/optimus/plugins/v1beta1/dependency_resolver-DependencyResolverModService_connectquery.ts +72 -0
  169. package/raystack/optimus/plugins/v1beta1/dependency_resolver.client.ts +100 -0
  170. package/raystack/optimus/plugins/v1beta1/dependency_resolver.ts +950 -0
  171. package/raystack/optimus/plugins/v1beta1/dependency_resolver_connect.ts +65 -0
  172. package/raystack/optimus/plugins/v1beta1/dependency_resolver_pb.ts +604 -0
  173. package/raystack/predator/index.ts +2 -0
  174. package/raystack/predator/v1beta1/metrics_log.ts +457 -0
  175. package/raystack/predator/v1beta1/metrics_log_pb.ts +277 -0
  176. package/raystack/predator/v1beta1/result_log.ts +390 -0
  177. package/raystack/predator/v1beta1/result_log_pb.ts +235 -0
  178. package/raystack/raccoon/index.ts +3 -0
  179. package/raystack/raccoon/v1beta1/raccoon-EventService_connectquery.ts +21 -0
  180. package/raystack/raccoon/v1beta1/raccoon.client.ts +37 -0
  181. package/raystack/raccoon/v1beta1/raccoon.ts +442 -0
  182. package/raystack/raccoon/v1beta1/raccoon_connect.ts +26 -0
  183. package/raystack/raccoon/v1beta1/raccoon_pb.ts +324 -0
  184. package/raystack/siren/index.ts +3 -0
  185. package/raystack/siren/v1beta1/siren-SirenService_connectquery.ts +497 -0
  186. package/raystack/siren/v1beta1/siren.client.ts +479 -0
  187. package/raystack/siren/v1beta1/siren.ts +6507 -0
  188. package/raystack/siren/v1beta1/siren_connect.ts +332 -0
  189. package/raystack/siren/v1beta1/siren_pb.ts +3853 -0
  190. package/raystack/stencil/index.ts +3 -0
  191. package/raystack/stencil/v1beta1/stencil-StencilService_connectquery.ts +231 -0
  192. package/raystack/stencil/v1beta1/stencil.client.ts +232 -0
  193. package/raystack/stencil/v1beta1/stencil.ts +2716 -0
  194. package/raystack/stencil/v1beta1/stencil_connect.ts +161 -0
  195. package/raystack/stencil/v1beta1/stencil_pb.ts +1729 -0
  196. package/validate/validate.ts +4130 -0
  197. package/validate/validate_pb.ts +2621 -0
@@ -0,0 +1,231 @@
1
+ // @generated by protobuf-ts 2.11.1
2
+ // @generated from protobuf file "google/protobuf/duration.proto" (package "google.protobuf", syntax proto3)
3
+ // tslint:disable
4
+ //
5
+ // Protocol Buffers - Google's data interchange format
6
+ // Copyright 2008 Google Inc. All rights reserved.
7
+ // https://developers.google.com/protocol-buffers/
8
+ //
9
+ // Redistribution and use in source and binary forms, with or without
10
+ // modification, are permitted provided that the following conditions are
11
+ // met:
12
+ //
13
+ // * Redistributions of source code must retain the above copyright
14
+ // notice, this list of conditions and the following disclaimer.
15
+ // * Redistributions in binary form must reproduce the above
16
+ // copyright notice, this list of conditions and the following disclaimer
17
+ // in the documentation and/or other materials provided with the
18
+ // distribution.
19
+ // * Neither the name of Google Inc. nor the names of its
20
+ // contributors may be used to endorse or promote products derived from
21
+ // this software without specific prior written permission.
22
+ //
23
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
+ //
35
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
36
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
37
+ import { WireType } from "@protobuf-ts/runtime";
38
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
39
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
40
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
41
+ import type { PartialMessage } from "@protobuf-ts/runtime";
42
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
43
+ import { typeofJsonValue } from "@protobuf-ts/runtime";
44
+ import type { JsonValue } from "@protobuf-ts/runtime";
45
+ import type { JsonReadOptions } from "@protobuf-ts/runtime";
46
+ import type { JsonWriteOptions } from "@protobuf-ts/runtime";
47
+ import { PbLong } from "@protobuf-ts/runtime";
48
+ import { MessageType } from "@protobuf-ts/runtime";
49
+ /**
50
+ * A Duration represents a signed, fixed-length span of time represented
51
+ * as a count of seconds and fractions of seconds at nanosecond
52
+ * resolution. It is independent of any calendar and concepts like "day"
53
+ * or "month". It is related to Timestamp in that the difference between
54
+ * two Timestamp values is a Duration and it can be added or subtracted
55
+ * from a Timestamp. Range is approximately +-10,000 years.
56
+ *
57
+ * # Examples
58
+ *
59
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
60
+ *
61
+ * Timestamp start = ...;
62
+ * Timestamp end = ...;
63
+ * Duration duration = ...;
64
+ *
65
+ * duration.seconds = end.seconds - start.seconds;
66
+ * duration.nanos = end.nanos - start.nanos;
67
+ *
68
+ * if (duration.seconds < 0 && duration.nanos > 0) {
69
+ * duration.seconds += 1;
70
+ * duration.nanos -= 1000000000;
71
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
72
+ * duration.seconds -= 1;
73
+ * duration.nanos += 1000000000;
74
+ * }
75
+ *
76
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
77
+ *
78
+ * Timestamp start = ...;
79
+ * Duration duration = ...;
80
+ * Timestamp end = ...;
81
+ *
82
+ * end.seconds = start.seconds + duration.seconds;
83
+ * end.nanos = start.nanos + duration.nanos;
84
+ *
85
+ * if (end.nanos < 0) {
86
+ * end.seconds -= 1;
87
+ * end.nanos += 1000000000;
88
+ * } else if (end.nanos >= 1000000000) {
89
+ * end.seconds += 1;
90
+ * end.nanos -= 1000000000;
91
+ * }
92
+ *
93
+ * Example 3: Compute Duration from datetime.timedelta in Python.
94
+ *
95
+ * td = datetime.timedelta(days=3, minutes=10)
96
+ * duration = Duration()
97
+ * duration.FromTimedelta(td)
98
+ *
99
+ * # JSON Mapping
100
+ *
101
+ * In JSON format, the Duration type is encoded as a string rather than an
102
+ * object, where the string ends in the suffix "s" (indicating seconds) and
103
+ * is preceded by the number of seconds, with nanoseconds expressed as
104
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
105
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
106
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
107
+ * microsecond should be expressed in JSON format as "3.000001s".
108
+ *
109
+ *
110
+ *
111
+ * @generated from protobuf message google.protobuf.Duration
112
+ */
113
+ export interface Duration {
114
+ /**
115
+ * Signed seconds of the span of time. Must be from -315,576,000,000
116
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
117
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
118
+ *
119
+ * @generated from protobuf field: int64 seconds = 1
120
+ */
121
+ seconds: bigint;
122
+ /**
123
+ * Signed fractions of a second at nanosecond resolution of the span
124
+ * of time. Durations less than one second are represented with a 0
125
+ * `seconds` field and a positive or negative `nanos` field. For durations
126
+ * of one second or more, a non-zero value for the `nanos` field must be
127
+ * of the same sign as the `seconds` field. Must be from -999,999,999
128
+ * to +999,999,999 inclusive.
129
+ *
130
+ * @generated from protobuf field: int32 nanos = 2
131
+ */
132
+ nanos: number;
133
+ }
134
+ // @generated message type with reflection information, may provide speed optimized methods
135
+ class Duration$Type extends MessageType<Duration> {
136
+ constructor() {
137
+ super("google.protobuf.Duration", [
138
+ { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
139
+ { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ }
140
+ ]);
141
+ }
142
+ /**
143
+ * Encode `Duration` to JSON string like "3.000001s".
144
+ */
145
+ internalJsonWrite(message: Duration, options: JsonWriteOptions): JsonValue {
146
+ let s = PbLong.from(message.seconds).toNumber();
147
+ if (s > 315576000000 || s < -315576000000)
148
+ throw new Error("Duration value out of range.");
149
+ let text = message.seconds.toString();
150
+ if (s === 0 && message.nanos < 0)
151
+ text = "-" + text;
152
+ if (message.nanos !== 0) {
153
+ let nanosStr = Math.abs(message.nanos).toString();
154
+ nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr;
155
+ if (nanosStr.substring(3) === "000000")
156
+ nanosStr = nanosStr.substring(0, 3);
157
+ else if (nanosStr.substring(6) === "000")
158
+ nanosStr = nanosStr.substring(0, 6);
159
+ text += "." + nanosStr;
160
+ }
161
+ return text + "s";
162
+ }
163
+ /**
164
+ * Decode `Duration` from JSON string like "3.000001s"
165
+ */
166
+ internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Duration): Duration {
167
+ if (typeof json !== "string")
168
+ throw new Error("Unable to parse Duration from JSON " + typeofJsonValue(json) + ". Expected string.");
169
+ let match = json.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);
170
+ if (match === null)
171
+ throw new Error("Unable to parse Duration from JSON string. Invalid format.");
172
+ if (!target)
173
+ target = this.create();
174
+ let [, sign, secs, nanos] = match;
175
+ let longSeconds = PbLong.from(sign + secs);
176
+ if (longSeconds.toNumber() > 315576000000 || longSeconds.toNumber() < -315576000000)
177
+ throw new Error("Unable to parse Duration from JSON string. Value out of range.");
178
+ target.seconds = longSeconds.toBigInt();
179
+ if (typeof nanos == "string") {
180
+ let nanosStr = sign + nanos + "0".repeat(9 - nanos.length);
181
+ target.nanos = parseInt(nanosStr);
182
+ }
183
+ return target;
184
+ }
185
+ create(value?: PartialMessage<Duration>): Duration {
186
+ const message = globalThis.Object.create((this.messagePrototype!));
187
+ message.seconds = 0n;
188
+ message.nanos = 0;
189
+ if (value !== undefined)
190
+ reflectionMergePartial<Duration>(this, message, value);
191
+ return message;
192
+ }
193
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Duration): Duration {
194
+ let message = target ?? this.create(), end = reader.pos + length;
195
+ while (reader.pos < end) {
196
+ let [fieldNo, wireType] = reader.tag();
197
+ switch (fieldNo) {
198
+ case /* int64 seconds */ 1:
199
+ message.seconds = reader.int64().toBigInt();
200
+ break;
201
+ case /* int32 nanos */ 2:
202
+ message.nanos = reader.int32();
203
+ break;
204
+ default:
205
+ let u = options.readUnknownField;
206
+ if (u === "throw")
207
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
208
+ let d = reader.skip(wireType);
209
+ if (u !== false)
210
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
211
+ }
212
+ }
213
+ return message;
214
+ }
215
+ internalBinaryWrite(message: Duration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
216
+ /* int64 seconds = 1; */
217
+ if (message.seconds !== 0n)
218
+ writer.tag(1, WireType.Varint).int64(message.seconds);
219
+ /* int32 nanos = 2; */
220
+ if (message.nanos !== 0)
221
+ writer.tag(2, WireType.Varint).int32(message.nanos);
222
+ let u = options.writeUnknownFields;
223
+ if (u !== false)
224
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
225
+ return writer;
226
+ }
227
+ }
228
+ /**
229
+ * @generated MessageType for protobuf message google.protobuf.Duration
230
+ */
231
+ export const Duration = new Duration$Type();