instill-sdk 0.0.1
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.
- package/README.md +369 -0
- package/dist/chunk-2VZRNT6D.mjs +0 -0
- package/dist/chunk-3VVR3XHW.mjs +56 -0
- package/dist/chunk-42SCMPQP.mjs +0 -0
- package/dist/chunk-4KLHN5HK.mjs +0 -0
- package/dist/chunk-4TKUHGUZ.mjs +244 -0
- package/dist/chunk-4VWYH26Q.mjs +145 -0
- package/dist/chunk-6M57XUNI.mjs +64 -0
- package/dist/chunk-6NTCWRRC.mjs +0 -0
- package/dist/chunk-6ZXT6X3H.mjs +0 -0
- package/dist/chunk-73EPIL2R.mjs +0 -0
- package/dist/chunk-7KV3Y36U.mjs +17 -0
- package/dist/chunk-D5OKZ665.mjs +32 -0
- package/dist/chunk-DXEIDDIA.mjs +32 -0
- package/dist/chunk-EBWGEVUX.mjs +33 -0
- package/dist/chunk-ECC5KF6S.mjs +150 -0
- package/dist/chunk-EHG2FVLQ.mjs +0 -0
- package/dist/chunk-EXJ4UK7Q.mjs +49 -0
- package/dist/chunk-FAXYADOP.mjs +0 -0
- package/dist/chunk-FNCXOA62.mjs +0 -0
- package/dist/chunk-GPM5FDRS.mjs +154 -0
- package/dist/chunk-IB43VC55.mjs +41 -0
- package/dist/chunk-IPW3WQCQ.mjs +35 -0
- package/dist/chunk-IWAQMUMR.mjs +42 -0
- package/dist/chunk-JONZWFL5.mjs +168 -0
- package/dist/chunk-JTTE7IZY.mjs +14 -0
- package/dist/chunk-JY37AKV6.mjs +0 -0
- package/dist/chunk-KCKTAMXW.mjs +0 -0
- package/dist/chunk-KHFNAMT4.mjs +160 -0
- package/dist/chunk-NRP5M7FG.mjs +128 -0
- package/dist/chunk-QLWRKSUE.mjs +104 -0
- package/dist/chunk-QV7PYP7E.mjs +0 -0
- package/dist/chunk-QZOKJQTL.mjs +102 -0
- package/dist/chunk-RVRM4NPL.mjs +29 -0
- package/dist/chunk-VASX6R4R.mjs +0 -0
- package/dist/chunk-VIPORJ6H.mjs +77 -0
- package/dist/chunk-WBQAMGXK.mjs +0 -0
- package/dist/chunk-WL54JNC6.mjs +64 -0
- package/dist/chunk-WLPBUHMI.mjs +0 -0
- package/dist/chunk-YT6ZGA4J.mjs +46 -0
- package/dist/chunk-YXNMG2RZ.mjs +98 -0
- package/dist/chunk-ZRC43MN3.mjs +111 -0
- package/dist/chunk-magic-string.3a794426-OWTMMGNR.mjs +1253 -0
- package/dist/connector/ConnectorClient.d.ts +54 -0
- package/dist/connector/ConnectorClient.js +457 -0
- package/dist/connector/ConnectorClient.mjs +16 -0
- package/dist/connector/action.d.ts +13 -0
- package/dist/connector/action.js +72 -0
- package/dist/connector/action.mjs +11 -0
- package/dist/connector/index.d.ts +2 -0
- package/dist/connector/index.js +37 -0
- package/dist/connector/index.mjs +13 -0
- package/dist/connector/mutation.d.ts +19 -0
- package/dist/connector/mutation.js +91 -0
- package/dist/connector/mutation.mjs +13 -0
- package/dist/connector/queries.d.ts +34 -0
- package/dist/connector/queries.js +227 -0
- package/dist/connector/queries.mjs +23 -0
- package/dist/connector/types.d.ts +102 -0
- package/dist/connector/types.js +18 -0
- package/dist/connector/types.mjs +1 -0
- package/dist/helper/axiosInstance.d.ts +3 -0
- package/dist/helper/axiosInstance.js +44 -0
- package/dist/helper/axiosInstance.mjs +7 -0
- package/dist/helper/config.d.ts +1 -0
- package/dist/helper/config.js +53 -0
- package/dist/helper/config.mjs +7 -0
- package/dist/helper/createClient.d.ts +2 -0
- package/dist/helper/createClient.js +90 -0
- package/dist/helper/createClient.mjs +8 -0
- package/dist/helper/getInstillApiErrorMessage.d.ts +2 -0
- package/dist/helper/getInstillApiErrorMessage.js +41 -0
- package/dist/helper/getInstillApiErrorMessage.mjs +7 -0
- package/dist/helper/getQueryString.d.ts +7 -0
- package/dist/helper/getQueryString.js +57 -0
- package/dist/helper/getQueryString.mjs +7 -0
- package/dist/helper/getQueryString.test.d.ts +1 -0
- package/dist/helper/getQueryString.test.js +15769 -0
- package/dist/helper/getQueryString.test.mjs +14458 -0
- package/dist/helper/index.d.ts +5 -0
- package/dist/helper/index.js +145 -0
- package/dist/helper/index.mjs +21 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +1978 -0
- package/dist/index.mjs +87 -0
- package/dist/metric/MetricClient.d.ts +21 -0
- package/dist/metric/MetricClient.js +215 -0
- package/dist/metric/MetricClient.mjs +14 -0
- package/dist/metric/index.d.ts +1 -0
- package/dist/metric/index.js +18 -0
- package/dist/metric/index.mjs +3 -0
- package/dist/metric/pipeline/index.d.ts +1 -0
- package/dist/metric/pipeline/index.js +18 -0
- package/dist/metric/pipeline/index.mjs +2 -0
- package/dist/metric/pipeline/queries.d.ts +21 -0
- package/dist/metric/pipeline/queries.js +168 -0
- package/dist/metric/pipeline/queries.mjs +17 -0
- package/dist/metric/pipeline/types.d.ts +63 -0
- package/dist/metric/pipeline/types.js +18 -0
- package/dist/metric/pipeline/types.mjs +1 -0
- package/dist/mgmt/AuthClient.d.ts +35 -0
- package/dist/mgmt/AuthClient.js +308 -0
- package/dist/mgmt/AuthClient.mjs +16 -0
- package/dist/mgmt/action.d.ts +8 -0
- package/dist/mgmt/action.js +61 -0
- package/dist/mgmt/action.mjs +11 -0
- package/dist/mgmt/index.d.ts +2 -0
- package/dist/mgmt/index.js +37 -0
- package/dist/mgmt/index.mjs +13 -0
- package/dist/mgmt/mutation.d.ts +18 -0
- package/dist/mgmt/mutation.js +83 -0
- package/dist/mgmt/mutation.mjs +13 -0
- package/dist/mgmt/queries.d.ts +17 -0
- package/dist/mgmt/queries.js +148 -0
- package/dist/mgmt/queries.mjs +19 -0
- package/dist/mgmt/types.d.ts +62 -0
- package/dist/mgmt/types.js +18 -0
- package/dist/mgmt/types.mjs +1 -0
- package/dist/model/ModelClient.d.ts +48 -0
- package/dist/model/ModelClient.js +466 -0
- package/dist/model/ModelClient.mjs +16 -0
- package/dist/model/action.d.ts +9 -0
- package/dist/model/action.js +57 -0
- package/dist/model/action.mjs +9 -0
- package/dist/model/index.d.ts +2 -0
- package/dist/model/index.js +37 -0
- package/dist/model/index.mjs +13 -0
- package/dist/model/mutation.d.ts +15 -0
- package/dist/model/mutation.js +128 -0
- package/dist/model/mutation.mjs +11 -0
- package/dist/model/queries.d.ts +35 -0
- package/dist/model/queries.js +234 -0
- package/dist/model/queries.mjs +25 -0
- package/dist/model/types.d.ts +141 -0
- package/dist/model/types.js +18 -0
- package/dist/model/types.mjs +1 -0
- package/dist/operation/OperationClient.d.ts +11 -0
- package/dist/operation/OperationClient.js +106 -0
- package/dist/operation/OperationClient.mjs +8 -0
- package/dist/operation/index.d.ts +2 -0
- package/dist/operation/index.js +31 -0
- package/dist/operation/index.mjs +5 -0
- package/dist/operation/queries.d.ts +9 -0
- package/dist/operation/queries.js +67 -0
- package/dist/operation/queries.mjs +9 -0
- package/dist/operation/types.d.ts +9 -0
- package/dist/operation/types.js +18 -0
- package/dist/operation/types.mjs +1 -0
- package/dist/pipeline/PipelineClient.d.ts +80 -0
- package/dist/pipeline/PipelineClient.js +639 -0
- package/dist/pipeline/PipelineClient.mjs +16 -0
- package/dist/pipeline/action.d.ts +34 -0
- package/dist/pipeline/action.js +157 -0
- package/dist/pipeline/action.mjs +17 -0
- package/dist/pipeline/index.d.ts +2 -0
- package/dist/pipeline/index.js +37 -0
- package/dist/pipeline/index.mjs +13 -0
- package/dist/pipeline/mutation.d.ts +33 -0
- package/dist/pipeline/mutation.js +134 -0
- package/dist/pipeline/mutation.mjs +19 -0
- package/dist/pipeline/queries.d.ts +32 -0
- package/dist/pipeline/queries.js +223 -0
- package/dist/pipeline/queries.mjs +23 -0
- package/dist/pipeline/types.d.ts +204 -0
- package/dist/pipeline/types.js +18 -0
- package/dist/pipeline/types.mjs +1 -0
- package/dist/protogen-ts/base/metric/v1alpha/metric.ts +4522 -0
- package/dist/protogen-ts/base/metric/v1alpha/metric_service.ts +314 -0
- package/dist/protogen-ts/base/mgmt/v1alpha/metric.ts +2486 -0
- package/dist/protogen-ts/base/mgmt/v1alpha/mgmt.ts +3787 -0
- package/dist/protogen-ts/base/mgmt/v1alpha/mgmt_private_service.ts +107 -0
- package/dist/protogen-ts/base/mgmt/v1alpha/mgmt_public_service.ts +326 -0
- package/dist/protogen-ts/base/usage/v1alpha/usage.ts +2185 -0
- package/dist/protogen-ts/base/usage/v1alpha/usage_service.ts +81 -0
- package/dist/protogen-ts/common/healthcheck/v1alpha/healthcheck.ts +188 -0
- package/dist/protogen-ts/common/task/v1alpha/task.ts +109 -0
- package/dist/protogen-ts/google/api/annotations.ts +3 -0
- package/dist/protogen-ts/google/api/client.ts +2073 -0
- package/dist/protogen-ts/google/api/field_behavior.ts +119 -0
- package/dist/protogen-ts/google/api/http.ts +745 -0
- package/dist/protogen-ts/google/api/launch_stage.ts +115 -0
- package/dist/protogen-ts/google/api/resource.ts +529 -0
- package/dist/protogen-ts/google/longrunning/operations.ts +890 -0
- package/dist/protogen-ts/google/protobuf/any.ts +259 -0
- package/dist/protogen-ts/google/protobuf/descriptor.ts +4831 -0
- package/dist/protogen-ts/google/protobuf/duration.ts +203 -0
- package/dist/protogen-ts/google/protobuf/empty.ts +70 -0
- package/dist/protogen-ts/google/protobuf/field_mask.ts +289 -0
- package/dist/protogen-ts/google/protobuf/struct.ts +543 -0
- package/dist/protogen-ts/google/protobuf/timestamp.ts +232 -0
- package/dist/protogen-ts/google/rpc/status.ts +138 -0
- package/dist/protogen-ts/model/controller/v1alpha/controller.ts +823 -0
- package/dist/protogen-ts/model/controller/v1alpha/controller_service.ts +95 -0
- package/dist/protogen-ts/model/model/v1alpha/common.ts +135 -0
- package/dist/protogen-ts/model/model/v1alpha/model.ts +5682 -0
- package/dist/protogen-ts/model/model/v1alpha/model_definition.ts +775 -0
- package/dist/protogen-ts/model/model/v1alpha/model_private_service.ts +87 -0
- package/dist/protogen-ts/model/model/v1alpha/model_public_service.ts +383 -0
- package/dist/protogen-ts/model/model/v1alpha/task_classification.ts +326 -0
- package/dist/protogen-ts/model/model/v1alpha/task_detection.ts +411 -0
- package/dist/protogen-ts/model/model/v1alpha/task_instance_segmentation.ts +435 -0
- package/dist/protogen-ts/model/model/v1alpha/task_keypoint.ts +510 -0
- package/dist/protogen-ts/model/model/v1alpha/task_ocr.ts +406 -0
- package/dist/protogen-ts/model/model/v1alpha/task_semantic_segmentation.ts +396 -0
- package/dist/protogen-ts/model/model/v1alpha/task_text_generation.ts +247 -0
- package/dist/protogen-ts/model/model/v1alpha/task_text_to_image.ts +221 -0
- package/dist/protogen-ts/model/model/v1alpha/task_unspecified.ts +142 -0
- package/dist/protogen-ts/protoc-gen-openapiv2/options/annotations.ts +3 -0
- package/dist/protogen-ts/protoc-gen-openapiv2/options/openapiv2.ts +5095 -0
- package/dist/protogen-ts/vdp/connector/v1alpha/connector.ts +3637 -0
- package/dist/protogen-ts/vdp/connector/v1alpha/connector_definition.ts +1043 -0
- package/dist/protogen-ts/vdp/connector/v1alpha/connector_private_service.ts +92 -0
- package/dist/protogen-ts/vdp/connector/v1alpha/connector_public_service.ts +310 -0
- package/dist/protogen-ts/vdp/connector/v1alpha/spec.ts +126 -0
- package/dist/protogen-ts/vdp/controller/v1alpha/controller.ts +853 -0
- package/dist/protogen-ts/vdp/controller/v1alpha/controller_service.ts +95 -0
- package/dist/protogen-ts/vdp/pipeline/v1alpha/common.ts +498 -0
- package/dist/protogen-ts/vdp/pipeline/v1alpha/operator_definition.ts +948 -0
- package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline.ts +6006 -0
- package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline_private_service.ts +83 -0
- package/dist/protogen-ts/vdp/pipeline/v1alpha/pipeline_public_service.ts +413 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +23 -0
- package/dist/types.js +18 -0
- package/dist/types.mjs +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,890 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import * as _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Any } from "../protobuf/any";
|
|
4
|
+
import { Duration } from "../protobuf/duration";
|
|
5
|
+
import { Empty } from "../protobuf/empty";
|
|
6
|
+
import { Status } from "../rpc/status";
|
|
7
|
+
|
|
8
|
+
export const protobufPackage = "google.longrunning";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This resource represents a long-running operation that is the result of a
|
|
12
|
+
* network API call.
|
|
13
|
+
*/
|
|
14
|
+
export interface Operation {
|
|
15
|
+
/**
|
|
16
|
+
* The server-assigned name, which is only unique within the same service that
|
|
17
|
+
* originally returns it. If you use the default HTTP mapping, the
|
|
18
|
+
* `name` should be a resource name ending with `operations/{unique_id}`.
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* Service-specific metadata associated with the operation. It typically
|
|
23
|
+
* contains progress information and common metadata such as create time.
|
|
24
|
+
* Some services might not provide such metadata. Any method that returns a
|
|
25
|
+
* long-running operation should document the metadata type, if any.
|
|
26
|
+
*/
|
|
27
|
+
metadata:
|
|
28
|
+
| Any
|
|
29
|
+
| undefined;
|
|
30
|
+
/**
|
|
31
|
+
* If the value is `false`, it means the operation is still in progress.
|
|
32
|
+
* If `true`, the operation is completed, and either `error` or `response` is
|
|
33
|
+
* available.
|
|
34
|
+
*/
|
|
35
|
+
done: boolean;
|
|
36
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
37
|
+
error?:
|
|
38
|
+
| Status
|
|
39
|
+
| undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The normal response of the operation in case of success. If the original
|
|
42
|
+
* method returns no data on success, such as `Delete`, the response is
|
|
43
|
+
* `google.protobuf.Empty`. If the original method is standard
|
|
44
|
+
* `Get`/`Create`/`Update`, the response should be the resource. For other
|
|
45
|
+
* methods, the response should have the type `XxxResponse`, where `Xxx`
|
|
46
|
+
* is the original method name. For example, if the original method name
|
|
47
|
+
* is `TakeSnapshot()`, the inferred response type is
|
|
48
|
+
* `TakeSnapshotResponse`.
|
|
49
|
+
*/
|
|
50
|
+
response?: Any | undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation]. */
|
|
54
|
+
export interface GetOperationRequest {
|
|
55
|
+
/** The name of the operation resource. */
|
|
56
|
+
name: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. */
|
|
60
|
+
export interface ListOperationsRequest {
|
|
61
|
+
/** The name of the operation's parent resource. */
|
|
62
|
+
name: string;
|
|
63
|
+
/** The standard list filter. */
|
|
64
|
+
filter: string;
|
|
65
|
+
/** The standard list page size. */
|
|
66
|
+
pageSize: number;
|
|
67
|
+
/** The standard list page token. */
|
|
68
|
+
pageToken: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. */
|
|
72
|
+
export interface ListOperationsResponse {
|
|
73
|
+
/** A list of operations that matches the specified filter in the request. */
|
|
74
|
+
operations: Operation[];
|
|
75
|
+
/** The standard List next-page token. */
|
|
76
|
+
nextPageToken: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. */
|
|
80
|
+
export interface CancelOperationRequest {
|
|
81
|
+
/** The name of the operation resource to be cancelled. */
|
|
82
|
+
name: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. */
|
|
86
|
+
export interface DeleteOperationRequest {
|
|
87
|
+
/** The name of the operation resource to be deleted. */
|
|
88
|
+
name: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. */
|
|
92
|
+
export interface WaitOperationRequest {
|
|
93
|
+
/** The name of the operation resource to wait on. */
|
|
94
|
+
name: string;
|
|
95
|
+
/**
|
|
96
|
+
* The maximum duration to wait before timing out. If left blank, the wait
|
|
97
|
+
* will be at most the time permitted by the underlying HTTP/RPC protocol.
|
|
98
|
+
* If RPC context deadline is also specified, the shorter one will be used.
|
|
99
|
+
*/
|
|
100
|
+
timeout: Duration | undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A message representing the message types used by a long-running operation.
|
|
105
|
+
*
|
|
106
|
+
* Example:
|
|
107
|
+
*
|
|
108
|
+
* rpc LongRunningRecognize(LongRunningRecognizeRequest)
|
|
109
|
+
* returns (google.longrunning.Operation) {
|
|
110
|
+
* option (google.longrunning.operation_info) = {
|
|
111
|
+
* response_type: "LongRunningRecognizeResponse"
|
|
112
|
+
* metadata_type: "LongRunningRecognizeMetadata"
|
|
113
|
+
* };
|
|
114
|
+
* }
|
|
115
|
+
*/
|
|
116
|
+
export interface OperationInfo {
|
|
117
|
+
/**
|
|
118
|
+
* Required. The message name of the primary return type for this
|
|
119
|
+
* long-running operation.
|
|
120
|
+
* This type will be used to deserialize the LRO's response.
|
|
121
|
+
*
|
|
122
|
+
* If the response is in a different package from the rpc, a fully-qualified
|
|
123
|
+
* message name must be used (e.g. `google.protobuf.Struct`).
|
|
124
|
+
*
|
|
125
|
+
* Note: Altering this value constitutes a breaking change.
|
|
126
|
+
*/
|
|
127
|
+
responseType: string;
|
|
128
|
+
/**
|
|
129
|
+
* Required. The message name of the metadata type for this long-running
|
|
130
|
+
* operation.
|
|
131
|
+
*
|
|
132
|
+
* If the response is in a different package from the rpc, a fully-qualified
|
|
133
|
+
* message name must be used (e.g. `google.protobuf.Struct`).
|
|
134
|
+
*
|
|
135
|
+
* Note: Altering this value constitutes a breaking change.
|
|
136
|
+
*/
|
|
137
|
+
metadataType: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function createBaseOperation(): Operation {
|
|
141
|
+
return { name: "", metadata: undefined, done: false, error: undefined, response: undefined };
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export const Operation = {
|
|
145
|
+
encode(message: Operation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
146
|
+
if (message.name !== "") {
|
|
147
|
+
writer.uint32(10).string(message.name);
|
|
148
|
+
}
|
|
149
|
+
if (message.metadata !== undefined) {
|
|
150
|
+
Any.encode(message.metadata, writer.uint32(18).fork()).ldelim();
|
|
151
|
+
}
|
|
152
|
+
if (message.done === true) {
|
|
153
|
+
writer.uint32(24).bool(message.done);
|
|
154
|
+
}
|
|
155
|
+
if (message.error !== undefined) {
|
|
156
|
+
Status.encode(message.error, writer.uint32(34).fork()).ldelim();
|
|
157
|
+
}
|
|
158
|
+
if (message.response !== undefined) {
|
|
159
|
+
Any.encode(message.response, writer.uint32(42).fork()).ldelim();
|
|
160
|
+
}
|
|
161
|
+
return writer;
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Operation {
|
|
165
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
166
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
167
|
+
const message = createBaseOperation();
|
|
168
|
+
while (reader.pos < end) {
|
|
169
|
+
const tag = reader.uint32();
|
|
170
|
+
switch (tag >>> 3) {
|
|
171
|
+
case 1:
|
|
172
|
+
if (tag !== 10) {
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
message.name = reader.string();
|
|
177
|
+
continue;
|
|
178
|
+
case 2:
|
|
179
|
+
if (tag !== 18) {
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
message.metadata = Any.decode(reader, reader.uint32());
|
|
184
|
+
continue;
|
|
185
|
+
case 3:
|
|
186
|
+
if (tag !== 24) {
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
message.done = reader.bool();
|
|
191
|
+
continue;
|
|
192
|
+
case 4:
|
|
193
|
+
if (tag !== 34) {
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
message.error = Status.decode(reader, reader.uint32());
|
|
198
|
+
continue;
|
|
199
|
+
case 5:
|
|
200
|
+
if (tag !== 42) {
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
message.response = Any.decode(reader, reader.uint32());
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
reader.skipType(tag & 7);
|
|
211
|
+
}
|
|
212
|
+
return message;
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
fromJSON(object: any): Operation {
|
|
216
|
+
return {
|
|
217
|
+
name: isSet(object.name) ? String(object.name) : "",
|
|
218
|
+
metadata: isSet(object.metadata) ? Any.fromJSON(object.metadata) : undefined,
|
|
219
|
+
done: isSet(object.done) ? Boolean(object.done) : false,
|
|
220
|
+
error: isSet(object.error) ? Status.fromJSON(object.error) : undefined,
|
|
221
|
+
response: isSet(object.response) ? Any.fromJSON(object.response) : undefined,
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
toJSON(message: Operation): unknown {
|
|
226
|
+
const obj: any = {};
|
|
227
|
+
if (message.name !== "") {
|
|
228
|
+
obj.name = message.name;
|
|
229
|
+
}
|
|
230
|
+
if (message.metadata !== undefined) {
|
|
231
|
+
obj.metadata = Any.toJSON(message.metadata);
|
|
232
|
+
}
|
|
233
|
+
if (message.done === true) {
|
|
234
|
+
obj.done = message.done;
|
|
235
|
+
}
|
|
236
|
+
if (message.error !== undefined) {
|
|
237
|
+
obj.error = Status.toJSON(message.error);
|
|
238
|
+
}
|
|
239
|
+
if (message.response !== undefined) {
|
|
240
|
+
obj.response = Any.toJSON(message.response);
|
|
241
|
+
}
|
|
242
|
+
return obj;
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
create<I extends Exact<DeepPartial<Operation>, I>>(base?: I): Operation {
|
|
246
|
+
return Operation.fromPartial(base ?? ({} as any));
|
|
247
|
+
},
|
|
248
|
+
fromPartial<I extends Exact<DeepPartial<Operation>, I>>(object: I): Operation {
|
|
249
|
+
const message = createBaseOperation();
|
|
250
|
+
message.name = object.name ?? "";
|
|
251
|
+
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
252
|
+
? Any.fromPartial(object.metadata)
|
|
253
|
+
: undefined;
|
|
254
|
+
message.done = object.done ?? false;
|
|
255
|
+
message.error = (object.error !== undefined && object.error !== null)
|
|
256
|
+
? Status.fromPartial(object.error)
|
|
257
|
+
: undefined;
|
|
258
|
+
message.response = (object.response !== undefined && object.response !== null)
|
|
259
|
+
? Any.fromPartial(object.response)
|
|
260
|
+
: undefined;
|
|
261
|
+
return message;
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
function createBaseGetOperationRequest(): GetOperationRequest {
|
|
266
|
+
return { name: "" };
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export const GetOperationRequest = {
|
|
270
|
+
encode(message: GetOperationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
271
|
+
if (message.name !== "") {
|
|
272
|
+
writer.uint32(10).string(message.name);
|
|
273
|
+
}
|
|
274
|
+
return writer;
|
|
275
|
+
},
|
|
276
|
+
|
|
277
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): GetOperationRequest {
|
|
278
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
279
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
280
|
+
const message = createBaseGetOperationRequest();
|
|
281
|
+
while (reader.pos < end) {
|
|
282
|
+
const tag = reader.uint32();
|
|
283
|
+
switch (tag >>> 3) {
|
|
284
|
+
case 1:
|
|
285
|
+
if (tag !== 10) {
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
message.name = reader.string();
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
reader.skipType(tag & 7);
|
|
296
|
+
}
|
|
297
|
+
return message;
|
|
298
|
+
},
|
|
299
|
+
|
|
300
|
+
fromJSON(object: any): GetOperationRequest {
|
|
301
|
+
return { name: isSet(object.name) ? String(object.name) : "" };
|
|
302
|
+
},
|
|
303
|
+
|
|
304
|
+
toJSON(message: GetOperationRequest): unknown {
|
|
305
|
+
const obj: any = {};
|
|
306
|
+
if (message.name !== "") {
|
|
307
|
+
obj.name = message.name;
|
|
308
|
+
}
|
|
309
|
+
return obj;
|
|
310
|
+
},
|
|
311
|
+
|
|
312
|
+
create<I extends Exact<DeepPartial<GetOperationRequest>, I>>(base?: I): GetOperationRequest {
|
|
313
|
+
return GetOperationRequest.fromPartial(base ?? ({} as any));
|
|
314
|
+
},
|
|
315
|
+
fromPartial<I extends Exact<DeepPartial<GetOperationRequest>, I>>(object: I): GetOperationRequest {
|
|
316
|
+
const message = createBaseGetOperationRequest();
|
|
317
|
+
message.name = object.name ?? "";
|
|
318
|
+
return message;
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
function createBaseListOperationsRequest(): ListOperationsRequest {
|
|
323
|
+
return { name: "", filter: "", pageSize: 0, pageToken: "" };
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export const ListOperationsRequest = {
|
|
327
|
+
encode(message: ListOperationsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
328
|
+
if (message.name !== "") {
|
|
329
|
+
writer.uint32(34).string(message.name);
|
|
330
|
+
}
|
|
331
|
+
if (message.filter !== "") {
|
|
332
|
+
writer.uint32(10).string(message.filter);
|
|
333
|
+
}
|
|
334
|
+
if (message.pageSize !== 0) {
|
|
335
|
+
writer.uint32(16).int32(message.pageSize);
|
|
336
|
+
}
|
|
337
|
+
if (message.pageToken !== "") {
|
|
338
|
+
writer.uint32(26).string(message.pageToken);
|
|
339
|
+
}
|
|
340
|
+
return writer;
|
|
341
|
+
},
|
|
342
|
+
|
|
343
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ListOperationsRequest {
|
|
344
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
345
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
346
|
+
const message = createBaseListOperationsRequest();
|
|
347
|
+
while (reader.pos < end) {
|
|
348
|
+
const tag = reader.uint32();
|
|
349
|
+
switch (tag >>> 3) {
|
|
350
|
+
case 4:
|
|
351
|
+
if (tag !== 34) {
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
message.name = reader.string();
|
|
356
|
+
continue;
|
|
357
|
+
case 1:
|
|
358
|
+
if (tag !== 10) {
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
message.filter = reader.string();
|
|
363
|
+
continue;
|
|
364
|
+
case 2:
|
|
365
|
+
if (tag !== 16) {
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
message.pageSize = reader.int32();
|
|
370
|
+
continue;
|
|
371
|
+
case 3:
|
|
372
|
+
if (tag !== 26) {
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
message.pageToken = reader.string();
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
379
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
reader.skipType(tag & 7);
|
|
383
|
+
}
|
|
384
|
+
return message;
|
|
385
|
+
},
|
|
386
|
+
|
|
387
|
+
fromJSON(object: any): ListOperationsRequest {
|
|
388
|
+
return {
|
|
389
|
+
name: isSet(object.name) ? String(object.name) : "",
|
|
390
|
+
filter: isSet(object.filter) ? String(object.filter) : "",
|
|
391
|
+
pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0,
|
|
392
|
+
pageToken: isSet(object.pageToken) ? String(object.pageToken) : "",
|
|
393
|
+
};
|
|
394
|
+
},
|
|
395
|
+
|
|
396
|
+
toJSON(message: ListOperationsRequest): unknown {
|
|
397
|
+
const obj: any = {};
|
|
398
|
+
if (message.name !== "") {
|
|
399
|
+
obj.name = message.name;
|
|
400
|
+
}
|
|
401
|
+
if (message.filter !== "") {
|
|
402
|
+
obj.filter = message.filter;
|
|
403
|
+
}
|
|
404
|
+
if (message.pageSize !== 0) {
|
|
405
|
+
obj.pageSize = Math.round(message.pageSize);
|
|
406
|
+
}
|
|
407
|
+
if (message.pageToken !== "") {
|
|
408
|
+
obj.pageToken = message.pageToken;
|
|
409
|
+
}
|
|
410
|
+
return obj;
|
|
411
|
+
},
|
|
412
|
+
|
|
413
|
+
create<I extends Exact<DeepPartial<ListOperationsRequest>, I>>(base?: I): ListOperationsRequest {
|
|
414
|
+
return ListOperationsRequest.fromPartial(base ?? ({} as any));
|
|
415
|
+
},
|
|
416
|
+
fromPartial<I extends Exact<DeepPartial<ListOperationsRequest>, I>>(object: I): ListOperationsRequest {
|
|
417
|
+
const message = createBaseListOperationsRequest();
|
|
418
|
+
message.name = object.name ?? "";
|
|
419
|
+
message.filter = object.filter ?? "";
|
|
420
|
+
message.pageSize = object.pageSize ?? 0;
|
|
421
|
+
message.pageToken = object.pageToken ?? "";
|
|
422
|
+
return message;
|
|
423
|
+
},
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
function createBaseListOperationsResponse(): ListOperationsResponse {
|
|
427
|
+
return { operations: [], nextPageToken: "" };
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export const ListOperationsResponse = {
|
|
431
|
+
encode(message: ListOperationsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
432
|
+
for (const v of message.operations) {
|
|
433
|
+
Operation.encode(v!, writer.uint32(10).fork()).ldelim();
|
|
434
|
+
}
|
|
435
|
+
if (message.nextPageToken !== "") {
|
|
436
|
+
writer.uint32(18).string(message.nextPageToken);
|
|
437
|
+
}
|
|
438
|
+
return writer;
|
|
439
|
+
},
|
|
440
|
+
|
|
441
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ListOperationsResponse {
|
|
442
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
443
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
444
|
+
const message = createBaseListOperationsResponse();
|
|
445
|
+
while (reader.pos < end) {
|
|
446
|
+
const tag = reader.uint32();
|
|
447
|
+
switch (tag >>> 3) {
|
|
448
|
+
case 1:
|
|
449
|
+
if (tag !== 10) {
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
message.operations.push(Operation.decode(reader, reader.uint32()));
|
|
454
|
+
continue;
|
|
455
|
+
case 2:
|
|
456
|
+
if (tag !== 18) {
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
message.nextPageToken = reader.string();
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
reader.skipType(tag & 7);
|
|
467
|
+
}
|
|
468
|
+
return message;
|
|
469
|
+
},
|
|
470
|
+
|
|
471
|
+
fromJSON(object: any): ListOperationsResponse {
|
|
472
|
+
return {
|
|
473
|
+
operations: Array.isArray(object?.operations) ? object.operations.map((e: any) => Operation.fromJSON(e)) : [],
|
|
474
|
+
nextPageToken: isSet(object.nextPageToken) ? String(object.nextPageToken) : "",
|
|
475
|
+
};
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
toJSON(message: ListOperationsResponse): unknown {
|
|
479
|
+
const obj: any = {};
|
|
480
|
+
if (message.operations?.length) {
|
|
481
|
+
obj.operations = message.operations.map((e) => Operation.toJSON(e));
|
|
482
|
+
}
|
|
483
|
+
if (message.nextPageToken !== "") {
|
|
484
|
+
obj.nextPageToken = message.nextPageToken;
|
|
485
|
+
}
|
|
486
|
+
return obj;
|
|
487
|
+
},
|
|
488
|
+
|
|
489
|
+
create<I extends Exact<DeepPartial<ListOperationsResponse>, I>>(base?: I): ListOperationsResponse {
|
|
490
|
+
return ListOperationsResponse.fromPartial(base ?? ({} as any));
|
|
491
|
+
},
|
|
492
|
+
fromPartial<I extends Exact<DeepPartial<ListOperationsResponse>, I>>(object: I): ListOperationsResponse {
|
|
493
|
+
const message = createBaseListOperationsResponse();
|
|
494
|
+
message.operations = object.operations?.map((e) => Operation.fromPartial(e)) || [];
|
|
495
|
+
message.nextPageToken = object.nextPageToken ?? "";
|
|
496
|
+
return message;
|
|
497
|
+
},
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
function createBaseCancelOperationRequest(): CancelOperationRequest {
|
|
501
|
+
return { name: "" };
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export const CancelOperationRequest = {
|
|
505
|
+
encode(message: CancelOperationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
506
|
+
if (message.name !== "") {
|
|
507
|
+
writer.uint32(10).string(message.name);
|
|
508
|
+
}
|
|
509
|
+
return writer;
|
|
510
|
+
},
|
|
511
|
+
|
|
512
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): CancelOperationRequest {
|
|
513
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
514
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
515
|
+
const message = createBaseCancelOperationRequest();
|
|
516
|
+
while (reader.pos < end) {
|
|
517
|
+
const tag = reader.uint32();
|
|
518
|
+
switch (tag >>> 3) {
|
|
519
|
+
case 1:
|
|
520
|
+
if (tag !== 10) {
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
message.name = reader.string();
|
|
525
|
+
continue;
|
|
526
|
+
}
|
|
527
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
reader.skipType(tag & 7);
|
|
531
|
+
}
|
|
532
|
+
return message;
|
|
533
|
+
},
|
|
534
|
+
|
|
535
|
+
fromJSON(object: any): CancelOperationRequest {
|
|
536
|
+
return { name: isSet(object.name) ? String(object.name) : "" };
|
|
537
|
+
},
|
|
538
|
+
|
|
539
|
+
toJSON(message: CancelOperationRequest): unknown {
|
|
540
|
+
const obj: any = {};
|
|
541
|
+
if (message.name !== "") {
|
|
542
|
+
obj.name = message.name;
|
|
543
|
+
}
|
|
544
|
+
return obj;
|
|
545
|
+
},
|
|
546
|
+
|
|
547
|
+
create<I extends Exact<DeepPartial<CancelOperationRequest>, I>>(base?: I): CancelOperationRequest {
|
|
548
|
+
return CancelOperationRequest.fromPartial(base ?? ({} as any));
|
|
549
|
+
},
|
|
550
|
+
fromPartial<I extends Exact<DeepPartial<CancelOperationRequest>, I>>(object: I): CancelOperationRequest {
|
|
551
|
+
const message = createBaseCancelOperationRequest();
|
|
552
|
+
message.name = object.name ?? "";
|
|
553
|
+
return message;
|
|
554
|
+
},
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
function createBaseDeleteOperationRequest(): DeleteOperationRequest {
|
|
558
|
+
return { name: "" };
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export const DeleteOperationRequest = {
|
|
562
|
+
encode(message: DeleteOperationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
563
|
+
if (message.name !== "") {
|
|
564
|
+
writer.uint32(10).string(message.name);
|
|
565
|
+
}
|
|
566
|
+
return writer;
|
|
567
|
+
},
|
|
568
|
+
|
|
569
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): DeleteOperationRequest {
|
|
570
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
571
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
572
|
+
const message = createBaseDeleteOperationRequest();
|
|
573
|
+
while (reader.pos < end) {
|
|
574
|
+
const tag = reader.uint32();
|
|
575
|
+
switch (tag >>> 3) {
|
|
576
|
+
case 1:
|
|
577
|
+
if (tag !== 10) {
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
message.name = reader.string();
|
|
582
|
+
continue;
|
|
583
|
+
}
|
|
584
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
reader.skipType(tag & 7);
|
|
588
|
+
}
|
|
589
|
+
return message;
|
|
590
|
+
},
|
|
591
|
+
|
|
592
|
+
fromJSON(object: any): DeleteOperationRequest {
|
|
593
|
+
return { name: isSet(object.name) ? String(object.name) : "" };
|
|
594
|
+
},
|
|
595
|
+
|
|
596
|
+
toJSON(message: DeleteOperationRequest): unknown {
|
|
597
|
+
const obj: any = {};
|
|
598
|
+
if (message.name !== "") {
|
|
599
|
+
obj.name = message.name;
|
|
600
|
+
}
|
|
601
|
+
return obj;
|
|
602
|
+
},
|
|
603
|
+
|
|
604
|
+
create<I extends Exact<DeepPartial<DeleteOperationRequest>, I>>(base?: I): DeleteOperationRequest {
|
|
605
|
+
return DeleteOperationRequest.fromPartial(base ?? ({} as any));
|
|
606
|
+
},
|
|
607
|
+
fromPartial<I extends Exact<DeepPartial<DeleteOperationRequest>, I>>(object: I): DeleteOperationRequest {
|
|
608
|
+
const message = createBaseDeleteOperationRequest();
|
|
609
|
+
message.name = object.name ?? "";
|
|
610
|
+
return message;
|
|
611
|
+
},
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
function createBaseWaitOperationRequest(): WaitOperationRequest {
|
|
615
|
+
return { name: "", timeout: undefined };
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export const WaitOperationRequest = {
|
|
619
|
+
encode(message: WaitOperationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
620
|
+
if (message.name !== "") {
|
|
621
|
+
writer.uint32(10).string(message.name);
|
|
622
|
+
}
|
|
623
|
+
if (message.timeout !== undefined) {
|
|
624
|
+
Duration.encode(message.timeout, writer.uint32(18).fork()).ldelim();
|
|
625
|
+
}
|
|
626
|
+
return writer;
|
|
627
|
+
},
|
|
628
|
+
|
|
629
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WaitOperationRequest {
|
|
630
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
631
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
632
|
+
const message = createBaseWaitOperationRequest();
|
|
633
|
+
while (reader.pos < end) {
|
|
634
|
+
const tag = reader.uint32();
|
|
635
|
+
switch (tag >>> 3) {
|
|
636
|
+
case 1:
|
|
637
|
+
if (tag !== 10) {
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
message.name = reader.string();
|
|
642
|
+
continue;
|
|
643
|
+
case 2:
|
|
644
|
+
if (tag !== 18) {
|
|
645
|
+
break;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
message.timeout = Duration.decode(reader, reader.uint32());
|
|
649
|
+
continue;
|
|
650
|
+
}
|
|
651
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
652
|
+
break;
|
|
653
|
+
}
|
|
654
|
+
reader.skipType(tag & 7);
|
|
655
|
+
}
|
|
656
|
+
return message;
|
|
657
|
+
},
|
|
658
|
+
|
|
659
|
+
fromJSON(object: any): WaitOperationRequest {
|
|
660
|
+
return {
|
|
661
|
+
name: isSet(object.name) ? String(object.name) : "",
|
|
662
|
+
timeout: isSet(object.timeout) ? Duration.fromJSON(object.timeout) : undefined,
|
|
663
|
+
};
|
|
664
|
+
},
|
|
665
|
+
|
|
666
|
+
toJSON(message: WaitOperationRequest): unknown {
|
|
667
|
+
const obj: any = {};
|
|
668
|
+
if (message.name !== "") {
|
|
669
|
+
obj.name = message.name;
|
|
670
|
+
}
|
|
671
|
+
if (message.timeout !== undefined) {
|
|
672
|
+
obj.timeout = Duration.toJSON(message.timeout);
|
|
673
|
+
}
|
|
674
|
+
return obj;
|
|
675
|
+
},
|
|
676
|
+
|
|
677
|
+
create<I extends Exact<DeepPartial<WaitOperationRequest>, I>>(base?: I): WaitOperationRequest {
|
|
678
|
+
return WaitOperationRequest.fromPartial(base ?? ({} as any));
|
|
679
|
+
},
|
|
680
|
+
fromPartial<I extends Exact<DeepPartial<WaitOperationRequest>, I>>(object: I): WaitOperationRequest {
|
|
681
|
+
const message = createBaseWaitOperationRequest();
|
|
682
|
+
message.name = object.name ?? "";
|
|
683
|
+
message.timeout = (object.timeout !== undefined && object.timeout !== null)
|
|
684
|
+
? Duration.fromPartial(object.timeout)
|
|
685
|
+
: undefined;
|
|
686
|
+
return message;
|
|
687
|
+
},
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
function createBaseOperationInfo(): OperationInfo {
|
|
691
|
+
return { responseType: "", metadataType: "" };
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
export const OperationInfo = {
|
|
695
|
+
encode(message: OperationInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
696
|
+
if (message.responseType !== "") {
|
|
697
|
+
writer.uint32(10).string(message.responseType);
|
|
698
|
+
}
|
|
699
|
+
if (message.metadataType !== "") {
|
|
700
|
+
writer.uint32(18).string(message.metadataType);
|
|
701
|
+
}
|
|
702
|
+
return writer;
|
|
703
|
+
},
|
|
704
|
+
|
|
705
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): OperationInfo {
|
|
706
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
707
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
708
|
+
const message = createBaseOperationInfo();
|
|
709
|
+
while (reader.pos < end) {
|
|
710
|
+
const tag = reader.uint32();
|
|
711
|
+
switch (tag >>> 3) {
|
|
712
|
+
case 1:
|
|
713
|
+
if (tag !== 10) {
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
message.responseType = reader.string();
|
|
718
|
+
continue;
|
|
719
|
+
case 2:
|
|
720
|
+
if (tag !== 18) {
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
message.metadataType = reader.string();
|
|
725
|
+
continue;
|
|
726
|
+
}
|
|
727
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
728
|
+
break;
|
|
729
|
+
}
|
|
730
|
+
reader.skipType(tag & 7);
|
|
731
|
+
}
|
|
732
|
+
return message;
|
|
733
|
+
},
|
|
734
|
+
|
|
735
|
+
fromJSON(object: any): OperationInfo {
|
|
736
|
+
return {
|
|
737
|
+
responseType: isSet(object.responseType) ? String(object.responseType) : "",
|
|
738
|
+
metadataType: isSet(object.metadataType) ? String(object.metadataType) : "",
|
|
739
|
+
};
|
|
740
|
+
},
|
|
741
|
+
|
|
742
|
+
toJSON(message: OperationInfo): unknown {
|
|
743
|
+
const obj: any = {};
|
|
744
|
+
if (message.responseType !== "") {
|
|
745
|
+
obj.responseType = message.responseType;
|
|
746
|
+
}
|
|
747
|
+
if (message.metadataType !== "") {
|
|
748
|
+
obj.metadataType = message.metadataType;
|
|
749
|
+
}
|
|
750
|
+
return obj;
|
|
751
|
+
},
|
|
752
|
+
|
|
753
|
+
create<I extends Exact<DeepPartial<OperationInfo>, I>>(base?: I): OperationInfo {
|
|
754
|
+
return OperationInfo.fromPartial(base ?? ({} as any));
|
|
755
|
+
},
|
|
756
|
+
fromPartial<I extends Exact<DeepPartial<OperationInfo>, I>>(object: I): OperationInfo {
|
|
757
|
+
const message = createBaseOperationInfo();
|
|
758
|
+
message.responseType = object.responseType ?? "";
|
|
759
|
+
message.metadataType = object.metadataType ?? "";
|
|
760
|
+
return message;
|
|
761
|
+
},
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Manages long-running operations with an API service.
|
|
766
|
+
*
|
|
767
|
+
* When an API method normally takes long time to complete, it can be designed
|
|
768
|
+
* to return [Operation][google.longrunning.Operation] to the client, and the client can use this
|
|
769
|
+
* interface to receive the real response asynchronously by polling the
|
|
770
|
+
* operation resource, or pass the operation resource to another API (such as
|
|
771
|
+
* Google Cloud Pub/Sub API) to receive the response. Any API service that
|
|
772
|
+
* returns long-running operations should implement the `Operations` interface
|
|
773
|
+
* so developers can have a consistent client experience.
|
|
774
|
+
*/
|
|
775
|
+
export interface Operations {
|
|
776
|
+
/**
|
|
777
|
+
* Lists operations that match the specified filter in the request. If the
|
|
778
|
+
* server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
779
|
+
*
|
|
780
|
+
* NOTE: the `name` binding allows API services to override the binding
|
|
781
|
+
* to use different resource name schemes, such as `users/* /operations`. To
|
|
782
|
+
* override the binding, API services can add a binding such as
|
|
783
|
+
* `"/v1/{name=users/*}/operations"` to their service configuration.
|
|
784
|
+
* For backwards compatibility, the default name includes the operations
|
|
785
|
+
* collection id, however overriding users must ensure the name binding
|
|
786
|
+
* is the parent resource, without the operations collection id.
|
|
787
|
+
*/
|
|
788
|
+
ListOperations(request: ListOperationsRequest): Promise<ListOperationsResponse>;
|
|
789
|
+
/**
|
|
790
|
+
* Gets the latest state of a long-running operation. Clients can use this
|
|
791
|
+
* method to poll the operation result at intervals as recommended by the API
|
|
792
|
+
* service.
|
|
793
|
+
*/
|
|
794
|
+
GetOperation(request: GetOperationRequest): Promise<Operation>;
|
|
795
|
+
/**
|
|
796
|
+
* Deletes a long-running operation. This method indicates that the client is
|
|
797
|
+
* no longer interested in the operation result. It does not cancel the
|
|
798
|
+
* operation. If the server doesn't support this method, it returns
|
|
799
|
+
* `google.rpc.Code.UNIMPLEMENTED`.
|
|
800
|
+
*/
|
|
801
|
+
DeleteOperation(request: DeleteOperationRequest): Promise<Empty>;
|
|
802
|
+
/**
|
|
803
|
+
* Starts asynchronous cancellation on a long-running operation. The server
|
|
804
|
+
* makes a best effort to cancel the operation, but success is not
|
|
805
|
+
* guaranteed. If the server doesn't support this method, it returns
|
|
806
|
+
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
|
|
807
|
+
* [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
|
|
808
|
+
* other methods to check whether the cancellation succeeded or whether the
|
|
809
|
+
* operation completed despite cancellation. On successful cancellation,
|
|
810
|
+
* the operation is not deleted; instead, it becomes an operation with
|
|
811
|
+
* an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
|
|
812
|
+
* corresponding to `Code.CANCELLED`.
|
|
813
|
+
*/
|
|
814
|
+
CancelOperation(request: CancelOperationRequest): Promise<Empty>;
|
|
815
|
+
/**
|
|
816
|
+
* Waits until the specified long-running operation is done or reaches at most
|
|
817
|
+
* a specified timeout, returning the latest state. If the operation is
|
|
818
|
+
* already done, the latest state is immediately returned. If the timeout
|
|
819
|
+
* specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
|
820
|
+
* timeout is used. If the server does not support this method, it returns
|
|
821
|
+
* `google.rpc.Code.UNIMPLEMENTED`.
|
|
822
|
+
* Note that this method is on a best-effort basis. It may return the latest
|
|
823
|
+
* state before the specified timeout (including immediately), meaning even an
|
|
824
|
+
* immediate response is no guarantee that the operation is done.
|
|
825
|
+
*/
|
|
826
|
+
WaitOperation(request: WaitOperationRequest): Promise<Operation>;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
export const OperationsServiceName = "google.longrunning.Operations";
|
|
830
|
+
export class OperationsClientImpl implements Operations {
|
|
831
|
+
private readonly rpc: Rpc;
|
|
832
|
+
private readonly service: string;
|
|
833
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
834
|
+
this.service = opts?.service || OperationsServiceName;
|
|
835
|
+
this.rpc = rpc;
|
|
836
|
+
this.ListOperations = this.ListOperations.bind(this);
|
|
837
|
+
this.GetOperation = this.GetOperation.bind(this);
|
|
838
|
+
this.DeleteOperation = this.DeleteOperation.bind(this);
|
|
839
|
+
this.CancelOperation = this.CancelOperation.bind(this);
|
|
840
|
+
this.WaitOperation = this.WaitOperation.bind(this);
|
|
841
|
+
}
|
|
842
|
+
ListOperations(request: ListOperationsRequest): Promise<ListOperationsResponse> {
|
|
843
|
+
const data = ListOperationsRequest.encode(request).finish();
|
|
844
|
+
const promise = this.rpc.request(this.service, "ListOperations", data);
|
|
845
|
+
return promise.then((data) => ListOperationsResponse.decode(_m0.Reader.create(data)));
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
GetOperation(request: GetOperationRequest): Promise<Operation> {
|
|
849
|
+
const data = GetOperationRequest.encode(request).finish();
|
|
850
|
+
const promise = this.rpc.request(this.service, "GetOperation", data);
|
|
851
|
+
return promise.then((data) => Operation.decode(_m0.Reader.create(data)));
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
DeleteOperation(request: DeleteOperationRequest): Promise<Empty> {
|
|
855
|
+
const data = DeleteOperationRequest.encode(request).finish();
|
|
856
|
+
const promise = this.rpc.request(this.service, "DeleteOperation", data);
|
|
857
|
+
return promise.then((data) => Empty.decode(_m0.Reader.create(data)));
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
CancelOperation(request: CancelOperationRequest): Promise<Empty> {
|
|
861
|
+
const data = CancelOperationRequest.encode(request).finish();
|
|
862
|
+
const promise = this.rpc.request(this.service, "CancelOperation", data);
|
|
863
|
+
return promise.then((data) => Empty.decode(_m0.Reader.create(data)));
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
WaitOperation(request: WaitOperationRequest): Promise<Operation> {
|
|
867
|
+
const data = WaitOperationRequest.encode(request).finish();
|
|
868
|
+
const promise = this.rpc.request(this.service, "WaitOperation", data);
|
|
869
|
+
return promise.then((data) => Operation.decode(_m0.Reader.create(data)));
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
interface Rpc {
|
|
874
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
878
|
+
|
|
879
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
880
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
881
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
882
|
+
: Partial<T>;
|
|
883
|
+
|
|
884
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
885
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
886
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
887
|
+
|
|
888
|
+
function isSet(value: any): boolean {
|
|
889
|
+
return value !== null && value !== undefined;
|
|
890
|
+
}
|