@databricks/sdk-postgres 0.0.0-dev → 0.1.0-dev.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/LICENSE +203 -0
- package/dist/v1/client.d.ts +469 -0
- package/dist/v1/client.d.ts.map +1 -0
- package/dist/v1/client.js +2654 -0
- package/dist/v1/client.js.map +1 -0
- package/dist/v1/index.d.ts +5 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +5 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/model.d.ts +2013 -0
- package/dist/v1/model.d.ts.map +1 -0
- package/dist/v1/model.js +2409 -0
- package/dist/v1/model.js.map +1 -0
- package/dist/v1/transport.d.ts +5 -0
- package/dist/v1/transport.d.ts.map +1 -0
- package/dist/v1/transport.js +59 -0
- package/dist/v1/transport.js.map +1 -0
- package/dist/v1/utils.d.ts +22 -0
- package/dist/v1/utils.d.ts.map +1 -0
- package/dist/v1/utils.js +113 -0
- package/dist/v1/utils.js.map +1 -0
- package/package.json +38 -4
- package/src/v1/client.ts +3455 -0
- package/src/v1/index.ts +140 -0
- package/src/v1/model.ts +3932 -0
- package/src/v1/transport.ts +75 -0
- package/src/v1/utils.ts +156 -0
- package/README.md +0 -1
- package/index.js +0 -1
|
@@ -0,0 +1,2654 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
|
|
3
|
+
import { retryOn } from '@databricks/sdk-core/api';
|
|
4
|
+
import { createDefault } from '@databricks/sdk-core/clientinfo';
|
|
5
|
+
import { NoOpLogger } from '@databricks/sdk-core/logger';
|
|
6
|
+
import { newHttpClient } from './transport';
|
|
7
|
+
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, } from './utils';
|
|
8
|
+
import pkgJson from '../../package.json' with { type: 'json' };
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { marshalBranchSchema, marshalCatalogSchema, marshalDatabaseSchema, marshalEndpointSchema, marshalGenerateDatabaseCredentialRequestSchema, marshalProjectSchema, marshalRoleSchema, marshalSyncedTableSchema, marshalUndeleteBranchRequestSchema, marshalUndeleteProjectRequestSchema, unmarshalBranchOperationMetadataSchema, unmarshalBranchSchema, unmarshalCatalogOperationMetadataSchema, unmarshalCatalogSchema, unmarshalDatabaseCredentialSchema, unmarshalDatabaseOperationMetadataSchema, unmarshalDatabaseSchema, unmarshalEndpointOperationMetadataSchema, unmarshalEndpointSchema, unmarshalListBranchesResponseSchema, unmarshalListDatabasesResponseSchema, unmarshalListEndpointsResponseSchema, unmarshalListProjectsResponseSchema, unmarshalListRolesResponseSchema, unmarshalOperationSchema, unmarshalProjectOperationMetadataSchema, unmarshalProjectSchema, unmarshalRoleOperationMetadataSchema, unmarshalRoleSchema, unmarshalSyncedTableOperationMetadataSchema, unmarshalSyncedTableSchema, } from './model';
|
|
11
|
+
// Package identity segment for this client to be used in the User-Agent header.
|
|
12
|
+
const PACKAGE_SEGMENT = {
|
|
13
|
+
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
14
|
+
value: pkgJson.version,
|
|
15
|
+
};
|
|
16
|
+
export class Client {
|
|
17
|
+
host;
|
|
18
|
+
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
19
|
+
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
20
|
+
// request.
|
|
21
|
+
workspaceId;
|
|
22
|
+
httpClient;
|
|
23
|
+
logger;
|
|
24
|
+
// User-Agent header value. Composed once at construction from
|
|
25
|
+
// createDefault() merged with this package's identity and the active
|
|
26
|
+
// credential's name.
|
|
27
|
+
userAgent;
|
|
28
|
+
constructor(options) {
|
|
29
|
+
if (options.host === undefined) {
|
|
30
|
+
throw new Error('Host is required.');
|
|
31
|
+
}
|
|
32
|
+
this.host = options.host.replace(/\/$/, '');
|
|
33
|
+
this.workspaceId = options.workspaceId;
|
|
34
|
+
this.logger = options.logger ?? new NoOpLogger();
|
|
35
|
+
let info = createDefault().with(PACKAGE_SEGMENT);
|
|
36
|
+
if (options.credentials !== undefined) {
|
|
37
|
+
info = info
|
|
38
|
+
.with({ key: 'sdk-js-auth', value: AUTH_VERSION })
|
|
39
|
+
.with({ key: 'auth', value: options.credentials.name() });
|
|
40
|
+
}
|
|
41
|
+
this.userAgent = info.toString();
|
|
42
|
+
this.httpClient = newHttpClient(options);
|
|
43
|
+
}
|
|
44
|
+
/** Creates a new database branch in the project. */
|
|
45
|
+
async createBranch(req, options) {
|
|
46
|
+
const url = `${this.host}/api/2.0/postgres/${req.parent ?? ''}/branches`;
|
|
47
|
+
const params = new URLSearchParams();
|
|
48
|
+
if (req.branchId !== undefined) {
|
|
49
|
+
params.append('branch_id', req.branchId);
|
|
50
|
+
}
|
|
51
|
+
if (req.replaceExisting !== undefined) {
|
|
52
|
+
params.append('replace_existing', String(req.replaceExisting));
|
|
53
|
+
}
|
|
54
|
+
const query = params.toString();
|
|
55
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
56
|
+
const body = marshalRequest(req.branch, marshalBranchSchema);
|
|
57
|
+
let resp;
|
|
58
|
+
const call = async (callSignal) => {
|
|
59
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
60
|
+
if (this.workspaceId !== undefined) {
|
|
61
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
62
|
+
}
|
|
63
|
+
headers.set('User-Agent', this.userAgent);
|
|
64
|
+
const httpReq = buildHttpRequest('POST', fullUrl, headers, callSignal, body);
|
|
65
|
+
const respBody = await executeHttpCall({
|
|
66
|
+
request: httpReq,
|
|
67
|
+
httpClient: this.httpClient,
|
|
68
|
+
logger: this.logger,
|
|
69
|
+
});
|
|
70
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
71
|
+
};
|
|
72
|
+
await executeCall(call, options);
|
|
73
|
+
if (resp === undefined) {
|
|
74
|
+
throw new Error('API call completed without a result.');
|
|
75
|
+
}
|
|
76
|
+
return resp;
|
|
77
|
+
}
|
|
78
|
+
async createBranchOperation(req, options) {
|
|
79
|
+
const op = await this.createBranch(req, options);
|
|
80
|
+
return new CreateBranchOperation(this, op);
|
|
81
|
+
}
|
|
82
|
+
/** Register a Postgres database in the Unity Catalog. */
|
|
83
|
+
async createCatalog(req, options) {
|
|
84
|
+
const url = `${this.host}/api/2.0/postgres/catalogs`;
|
|
85
|
+
const params = new URLSearchParams();
|
|
86
|
+
if (req.catalogId !== undefined) {
|
|
87
|
+
params.append('catalog_id', req.catalogId);
|
|
88
|
+
}
|
|
89
|
+
const query = params.toString();
|
|
90
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
91
|
+
const body = marshalRequest(req.catalog, marshalCatalogSchema);
|
|
92
|
+
let resp;
|
|
93
|
+
const call = async (callSignal) => {
|
|
94
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
95
|
+
if (this.workspaceId !== undefined) {
|
|
96
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
97
|
+
}
|
|
98
|
+
headers.set('User-Agent', this.userAgent);
|
|
99
|
+
const httpReq = buildHttpRequest('POST', fullUrl, headers, callSignal, body);
|
|
100
|
+
const respBody = await executeHttpCall({
|
|
101
|
+
request: httpReq,
|
|
102
|
+
httpClient: this.httpClient,
|
|
103
|
+
logger: this.logger,
|
|
104
|
+
});
|
|
105
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
106
|
+
};
|
|
107
|
+
await executeCall(call, options);
|
|
108
|
+
if (resp === undefined) {
|
|
109
|
+
throw new Error('API call completed without a result.');
|
|
110
|
+
}
|
|
111
|
+
return resp;
|
|
112
|
+
}
|
|
113
|
+
async createCatalogOperation(req, options) {
|
|
114
|
+
const op = await this.createCatalog(req, options);
|
|
115
|
+
return new CreateCatalogOperation(this, op);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Create a Database.
|
|
119
|
+
*
|
|
120
|
+
* Creates a database in the specified branch. A branch can have multiple databases.
|
|
121
|
+
*/
|
|
122
|
+
async createDatabase(req, options) {
|
|
123
|
+
const url = `${this.host}/api/2.0/postgres/${req.parent ?? ''}/databases`;
|
|
124
|
+
const params = new URLSearchParams();
|
|
125
|
+
if (req.databaseId !== undefined) {
|
|
126
|
+
params.append('database_id', req.databaseId);
|
|
127
|
+
}
|
|
128
|
+
const query = params.toString();
|
|
129
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
130
|
+
const body = marshalRequest(req.database, marshalDatabaseSchema);
|
|
131
|
+
let resp;
|
|
132
|
+
const call = async (callSignal) => {
|
|
133
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
134
|
+
if (this.workspaceId !== undefined) {
|
|
135
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
136
|
+
}
|
|
137
|
+
headers.set('User-Agent', this.userAgent);
|
|
138
|
+
const httpReq = buildHttpRequest('POST', fullUrl, headers, callSignal, body);
|
|
139
|
+
const respBody = await executeHttpCall({
|
|
140
|
+
request: httpReq,
|
|
141
|
+
httpClient: this.httpClient,
|
|
142
|
+
logger: this.logger,
|
|
143
|
+
});
|
|
144
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
145
|
+
};
|
|
146
|
+
await executeCall(call, options);
|
|
147
|
+
if (resp === undefined) {
|
|
148
|
+
throw new Error('API call completed without a result.');
|
|
149
|
+
}
|
|
150
|
+
return resp;
|
|
151
|
+
}
|
|
152
|
+
async createDatabaseOperation(req, options) {
|
|
153
|
+
const op = await this.createDatabase(req, options);
|
|
154
|
+
return new CreateDatabaseOperation(this, op);
|
|
155
|
+
}
|
|
156
|
+
/** Creates a new compute endpoint in the branch. */
|
|
157
|
+
async createEndpoint(req, options) {
|
|
158
|
+
const url = `${this.host}/api/2.0/postgres/${req.parent ?? ''}/endpoints`;
|
|
159
|
+
const params = new URLSearchParams();
|
|
160
|
+
if (req.endpointId !== undefined) {
|
|
161
|
+
params.append('endpoint_id', req.endpointId);
|
|
162
|
+
}
|
|
163
|
+
if (req.replaceExisting !== undefined) {
|
|
164
|
+
params.append('replace_existing', String(req.replaceExisting));
|
|
165
|
+
}
|
|
166
|
+
const query = params.toString();
|
|
167
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
168
|
+
const body = marshalRequest(req.endpoint, marshalEndpointSchema);
|
|
169
|
+
let resp;
|
|
170
|
+
const call = async (callSignal) => {
|
|
171
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
172
|
+
if (this.workspaceId !== undefined) {
|
|
173
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
174
|
+
}
|
|
175
|
+
headers.set('User-Agent', this.userAgent);
|
|
176
|
+
const httpReq = buildHttpRequest('POST', fullUrl, headers, callSignal, body);
|
|
177
|
+
const respBody = await executeHttpCall({
|
|
178
|
+
request: httpReq,
|
|
179
|
+
httpClient: this.httpClient,
|
|
180
|
+
logger: this.logger,
|
|
181
|
+
});
|
|
182
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
183
|
+
};
|
|
184
|
+
await executeCall(call, options);
|
|
185
|
+
if (resp === undefined) {
|
|
186
|
+
throw new Error('API call completed without a result.');
|
|
187
|
+
}
|
|
188
|
+
return resp;
|
|
189
|
+
}
|
|
190
|
+
async createEndpointOperation(req, options) {
|
|
191
|
+
const op = await this.createEndpoint(req, options);
|
|
192
|
+
return new CreateEndpointOperation(this, op);
|
|
193
|
+
}
|
|
194
|
+
/** Creates a new Lakebase Autoscaling Postgres database project, which contains branches and compute endpoints. */
|
|
195
|
+
async createProject(req, options) {
|
|
196
|
+
const url = `${this.host}/api/2.0/postgres/projects`;
|
|
197
|
+
const params = new URLSearchParams();
|
|
198
|
+
if (req.projectId !== undefined) {
|
|
199
|
+
params.append('project_id', req.projectId);
|
|
200
|
+
}
|
|
201
|
+
const query = params.toString();
|
|
202
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
203
|
+
const body = marshalRequest(req.project, marshalProjectSchema);
|
|
204
|
+
let resp;
|
|
205
|
+
const call = async (callSignal) => {
|
|
206
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
207
|
+
if (this.workspaceId !== undefined) {
|
|
208
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
209
|
+
}
|
|
210
|
+
headers.set('User-Agent', this.userAgent);
|
|
211
|
+
const httpReq = buildHttpRequest('POST', fullUrl, headers, callSignal, body);
|
|
212
|
+
const respBody = await executeHttpCall({
|
|
213
|
+
request: httpReq,
|
|
214
|
+
httpClient: this.httpClient,
|
|
215
|
+
logger: this.logger,
|
|
216
|
+
});
|
|
217
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
218
|
+
};
|
|
219
|
+
await executeCall(call, options);
|
|
220
|
+
if (resp === undefined) {
|
|
221
|
+
throw new Error('API call completed without a result.');
|
|
222
|
+
}
|
|
223
|
+
return resp;
|
|
224
|
+
}
|
|
225
|
+
async createProjectOperation(req, options) {
|
|
226
|
+
const op = await this.createProject(req, options);
|
|
227
|
+
return new CreateProjectOperation(this, op);
|
|
228
|
+
}
|
|
229
|
+
/** Creates a new Postgres role in the branch. */
|
|
230
|
+
async createRole(req, options) {
|
|
231
|
+
const url = `${this.host}/api/2.0/postgres/${req.parent ?? ''}/roles`;
|
|
232
|
+
const params = new URLSearchParams();
|
|
233
|
+
if (req.roleId !== undefined) {
|
|
234
|
+
params.append('role_id', req.roleId);
|
|
235
|
+
}
|
|
236
|
+
const query = params.toString();
|
|
237
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
238
|
+
const body = marshalRequest(req.role, marshalRoleSchema);
|
|
239
|
+
let resp;
|
|
240
|
+
const call = async (callSignal) => {
|
|
241
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
242
|
+
if (this.workspaceId !== undefined) {
|
|
243
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
244
|
+
}
|
|
245
|
+
headers.set('User-Agent', this.userAgent);
|
|
246
|
+
const httpReq = buildHttpRequest('POST', fullUrl, headers, callSignal, body);
|
|
247
|
+
const respBody = await executeHttpCall({
|
|
248
|
+
request: httpReq,
|
|
249
|
+
httpClient: this.httpClient,
|
|
250
|
+
logger: this.logger,
|
|
251
|
+
});
|
|
252
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
253
|
+
};
|
|
254
|
+
await executeCall(call, options);
|
|
255
|
+
if (resp === undefined) {
|
|
256
|
+
throw new Error('API call completed without a result.');
|
|
257
|
+
}
|
|
258
|
+
return resp;
|
|
259
|
+
}
|
|
260
|
+
async createRoleOperation(req, options) {
|
|
261
|
+
const op = await this.createRole(req, options);
|
|
262
|
+
return new CreateRoleOperation(this, op);
|
|
263
|
+
}
|
|
264
|
+
/** Create a Synced Table. */
|
|
265
|
+
async createSyncedTable(req, options) {
|
|
266
|
+
const url = `${this.host}/api/2.0/postgres/synced_tables`;
|
|
267
|
+
const params = new URLSearchParams();
|
|
268
|
+
if (req.syncedTableId !== undefined) {
|
|
269
|
+
params.append('synced_table_id', req.syncedTableId);
|
|
270
|
+
}
|
|
271
|
+
const query = params.toString();
|
|
272
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
273
|
+
const body = marshalRequest(req.syncedTable, marshalSyncedTableSchema);
|
|
274
|
+
let resp;
|
|
275
|
+
const call = async (callSignal) => {
|
|
276
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
277
|
+
if (this.workspaceId !== undefined) {
|
|
278
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
279
|
+
}
|
|
280
|
+
headers.set('User-Agent', this.userAgent);
|
|
281
|
+
const httpReq = buildHttpRequest('POST', fullUrl, headers, callSignal, body);
|
|
282
|
+
const respBody = await executeHttpCall({
|
|
283
|
+
request: httpReq,
|
|
284
|
+
httpClient: this.httpClient,
|
|
285
|
+
logger: this.logger,
|
|
286
|
+
});
|
|
287
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
288
|
+
};
|
|
289
|
+
await executeCall(call, options);
|
|
290
|
+
if (resp === undefined) {
|
|
291
|
+
throw new Error('API call completed without a result.');
|
|
292
|
+
}
|
|
293
|
+
return resp;
|
|
294
|
+
}
|
|
295
|
+
async createSyncedTableOperation(req, options) {
|
|
296
|
+
const op = await this.createSyncedTable(req, options);
|
|
297
|
+
return new CreateSyncedTableOperation(this, op);
|
|
298
|
+
}
|
|
299
|
+
/** Deletes the specified database branch. */
|
|
300
|
+
async deleteBranch(req, options) {
|
|
301
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
302
|
+
const params = new URLSearchParams();
|
|
303
|
+
if (req.purge !== undefined) {
|
|
304
|
+
params.append('purge', String(req.purge));
|
|
305
|
+
}
|
|
306
|
+
const query = params.toString();
|
|
307
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
308
|
+
let resp;
|
|
309
|
+
const call = async (callSignal) => {
|
|
310
|
+
const headers = new Headers();
|
|
311
|
+
if (this.workspaceId !== undefined) {
|
|
312
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
313
|
+
}
|
|
314
|
+
headers.set('User-Agent', this.userAgent);
|
|
315
|
+
const httpReq = buildHttpRequest('DELETE', fullUrl, headers, callSignal);
|
|
316
|
+
const respBody = await executeHttpCall({
|
|
317
|
+
request: httpReq,
|
|
318
|
+
httpClient: this.httpClient,
|
|
319
|
+
logger: this.logger,
|
|
320
|
+
});
|
|
321
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
322
|
+
};
|
|
323
|
+
await executeCall(call, options);
|
|
324
|
+
if (resp === undefined) {
|
|
325
|
+
throw new Error('API call completed without a result.');
|
|
326
|
+
}
|
|
327
|
+
return resp;
|
|
328
|
+
}
|
|
329
|
+
async deleteBranchOperation(req, options) {
|
|
330
|
+
const op = await this.deleteBranch(req, options);
|
|
331
|
+
return new DeleteBranchOperation(this, op);
|
|
332
|
+
}
|
|
333
|
+
/** Delete a Database Catalog. */
|
|
334
|
+
async deleteCatalog(req, options) {
|
|
335
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
336
|
+
let resp;
|
|
337
|
+
const call = async (callSignal) => {
|
|
338
|
+
const headers = new Headers();
|
|
339
|
+
if (this.workspaceId !== undefined) {
|
|
340
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
341
|
+
}
|
|
342
|
+
headers.set('User-Agent', this.userAgent);
|
|
343
|
+
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
344
|
+
const respBody = await executeHttpCall({
|
|
345
|
+
request: httpReq,
|
|
346
|
+
httpClient: this.httpClient,
|
|
347
|
+
logger: this.logger,
|
|
348
|
+
});
|
|
349
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
350
|
+
};
|
|
351
|
+
await executeCall(call, options);
|
|
352
|
+
if (resp === undefined) {
|
|
353
|
+
throw new Error('API call completed without a result.');
|
|
354
|
+
}
|
|
355
|
+
return resp;
|
|
356
|
+
}
|
|
357
|
+
async deleteCatalogOperation(req, options) {
|
|
358
|
+
const op = await this.deleteCatalog(req, options);
|
|
359
|
+
return new DeleteCatalogOperation(this, op);
|
|
360
|
+
}
|
|
361
|
+
/** Delete a Database. */
|
|
362
|
+
async deleteDatabase(req, options) {
|
|
363
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
364
|
+
let resp;
|
|
365
|
+
const call = async (callSignal) => {
|
|
366
|
+
const headers = new Headers();
|
|
367
|
+
if (this.workspaceId !== undefined) {
|
|
368
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
369
|
+
}
|
|
370
|
+
headers.set('User-Agent', this.userAgent);
|
|
371
|
+
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
372
|
+
const respBody = await executeHttpCall({
|
|
373
|
+
request: httpReq,
|
|
374
|
+
httpClient: this.httpClient,
|
|
375
|
+
logger: this.logger,
|
|
376
|
+
});
|
|
377
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
378
|
+
};
|
|
379
|
+
await executeCall(call, options);
|
|
380
|
+
if (resp === undefined) {
|
|
381
|
+
throw new Error('API call completed without a result.');
|
|
382
|
+
}
|
|
383
|
+
return resp;
|
|
384
|
+
}
|
|
385
|
+
async deleteDatabaseOperation(req, options) {
|
|
386
|
+
const op = await this.deleteDatabase(req, options);
|
|
387
|
+
return new DeleteDatabaseOperation(this, op);
|
|
388
|
+
}
|
|
389
|
+
/** Deletes the specified compute endpoint. */
|
|
390
|
+
async deleteEndpoint(req, options) {
|
|
391
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
392
|
+
let resp;
|
|
393
|
+
const call = async (callSignal) => {
|
|
394
|
+
const headers = new Headers();
|
|
395
|
+
if (this.workspaceId !== undefined) {
|
|
396
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
397
|
+
}
|
|
398
|
+
headers.set('User-Agent', this.userAgent);
|
|
399
|
+
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
400
|
+
const respBody = await executeHttpCall({
|
|
401
|
+
request: httpReq,
|
|
402
|
+
httpClient: this.httpClient,
|
|
403
|
+
logger: this.logger,
|
|
404
|
+
});
|
|
405
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
406
|
+
};
|
|
407
|
+
await executeCall(call, options);
|
|
408
|
+
if (resp === undefined) {
|
|
409
|
+
throw new Error('API call completed without a result.');
|
|
410
|
+
}
|
|
411
|
+
return resp;
|
|
412
|
+
}
|
|
413
|
+
async deleteEndpointOperation(req, options) {
|
|
414
|
+
const op = await this.deleteEndpoint(req, options);
|
|
415
|
+
return new DeleteEndpointOperation(this, op);
|
|
416
|
+
}
|
|
417
|
+
/** Deletes the specified database project. */
|
|
418
|
+
async deleteProject(req, options) {
|
|
419
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
420
|
+
const params = new URLSearchParams();
|
|
421
|
+
if (req.purge !== undefined) {
|
|
422
|
+
params.append('purge', String(req.purge));
|
|
423
|
+
}
|
|
424
|
+
const query = params.toString();
|
|
425
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
426
|
+
let resp;
|
|
427
|
+
const call = async (callSignal) => {
|
|
428
|
+
const headers = new Headers();
|
|
429
|
+
if (this.workspaceId !== undefined) {
|
|
430
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
431
|
+
}
|
|
432
|
+
headers.set('User-Agent', this.userAgent);
|
|
433
|
+
const httpReq = buildHttpRequest('DELETE', fullUrl, headers, callSignal);
|
|
434
|
+
const respBody = await executeHttpCall({
|
|
435
|
+
request: httpReq,
|
|
436
|
+
httpClient: this.httpClient,
|
|
437
|
+
logger: this.logger,
|
|
438
|
+
});
|
|
439
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
440
|
+
};
|
|
441
|
+
await executeCall(call, options);
|
|
442
|
+
if (resp === undefined) {
|
|
443
|
+
throw new Error('API call completed without a result.');
|
|
444
|
+
}
|
|
445
|
+
return resp;
|
|
446
|
+
}
|
|
447
|
+
async deleteProjectOperation(req, options) {
|
|
448
|
+
const op = await this.deleteProject(req, options);
|
|
449
|
+
return new DeleteProjectOperation(this, op);
|
|
450
|
+
}
|
|
451
|
+
/** Deletes the specified Postgres role. */
|
|
452
|
+
async deleteRole(req, options) {
|
|
453
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
454
|
+
const params = new URLSearchParams();
|
|
455
|
+
if (req.reassignOwnedTo !== undefined) {
|
|
456
|
+
params.append('reassign_owned_to', req.reassignOwnedTo);
|
|
457
|
+
}
|
|
458
|
+
const query = params.toString();
|
|
459
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
460
|
+
let resp;
|
|
461
|
+
const call = async (callSignal) => {
|
|
462
|
+
const headers = new Headers();
|
|
463
|
+
if (this.workspaceId !== undefined) {
|
|
464
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
465
|
+
}
|
|
466
|
+
headers.set('User-Agent', this.userAgent);
|
|
467
|
+
const httpReq = buildHttpRequest('DELETE', fullUrl, headers, callSignal);
|
|
468
|
+
const respBody = await executeHttpCall({
|
|
469
|
+
request: httpReq,
|
|
470
|
+
httpClient: this.httpClient,
|
|
471
|
+
logger: this.logger,
|
|
472
|
+
});
|
|
473
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
474
|
+
};
|
|
475
|
+
await executeCall(call, options);
|
|
476
|
+
if (resp === undefined) {
|
|
477
|
+
throw new Error('API call completed without a result.');
|
|
478
|
+
}
|
|
479
|
+
return resp;
|
|
480
|
+
}
|
|
481
|
+
async deleteRoleOperation(req, options) {
|
|
482
|
+
const op = await this.deleteRole(req, options);
|
|
483
|
+
return new DeleteRoleOperation(this, op);
|
|
484
|
+
}
|
|
485
|
+
/** Delete a Synced Table. */
|
|
486
|
+
async deleteSyncedTable(req, options) {
|
|
487
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
488
|
+
let resp;
|
|
489
|
+
const call = async (callSignal) => {
|
|
490
|
+
const headers = new Headers();
|
|
491
|
+
if (this.workspaceId !== undefined) {
|
|
492
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
493
|
+
}
|
|
494
|
+
headers.set('User-Agent', this.userAgent);
|
|
495
|
+
const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
|
|
496
|
+
const respBody = await executeHttpCall({
|
|
497
|
+
request: httpReq,
|
|
498
|
+
httpClient: this.httpClient,
|
|
499
|
+
logger: this.logger,
|
|
500
|
+
});
|
|
501
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
502
|
+
};
|
|
503
|
+
await executeCall(call, options);
|
|
504
|
+
if (resp === undefined) {
|
|
505
|
+
throw new Error('API call completed without a result.');
|
|
506
|
+
}
|
|
507
|
+
return resp;
|
|
508
|
+
}
|
|
509
|
+
async deleteSyncedTableOperation(req, options) {
|
|
510
|
+
const op = await this.deleteSyncedTable(req, options);
|
|
511
|
+
return new DeleteSyncedTableOperation(this, op);
|
|
512
|
+
}
|
|
513
|
+
/** Generate OAuth credentials for a Postgres database. */
|
|
514
|
+
async generateDatabaseCredential(req, options) {
|
|
515
|
+
const url = `${this.host}/api/2.0/postgres/credentials`;
|
|
516
|
+
const body = marshalRequest(req, marshalGenerateDatabaseCredentialRequestSchema);
|
|
517
|
+
let resp;
|
|
518
|
+
const call = async (callSignal) => {
|
|
519
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
520
|
+
if (this.workspaceId !== undefined) {
|
|
521
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
522
|
+
}
|
|
523
|
+
headers.set('User-Agent', this.userAgent);
|
|
524
|
+
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
525
|
+
const respBody = await executeHttpCall({
|
|
526
|
+
request: httpReq,
|
|
527
|
+
httpClient: this.httpClient,
|
|
528
|
+
logger: this.logger,
|
|
529
|
+
});
|
|
530
|
+
resp = parseResponse(respBody, unmarshalDatabaseCredentialSchema);
|
|
531
|
+
};
|
|
532
|
+
await executeCall(call, options);
|
|
533
|
+
if (resp === undefined) {
|
|
534
|
+
throw new Error('API call completed without a result.');
|
|
535
|
+
}
|
|
536
|
+
return resp;
|
|
537
|
+
}
|
|
538
|
+
/** Retrieves information about the specified database branch. */
|
|
539
|
+
async getBranch(req, options) {
|
|
540
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
541
|
+
let resp;
|
|
542
|
+
const call = async (callSignal) => {
|
|
543
|
+
const headers = new Headers();
|
|
544
|
+
if (this.workspaceId !== undefined) {
|
|
545
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
546
|
+
}
|
|
547
|
+
headers.set('User-Agent', this.userAgent);
|
|
548
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
549
|
+
const respBody = await executeHttpCall({
|
|
550
|
+
request: httpReq,
|
|
551
|
+
httpClient: this.httpClient,
|
|
552
|
+
logger: this.logger,
|
|
553
|
+
});
|
|
554
|
+
resp = parseResponse(respBody, unmarshalBranchSchema);
|
|
555
|
+
};
|
|
556
|
+
await executeCall(call, options);
|
|
557
|
+
if (resp === undefined) {
|
|
558
|
+
throw new Error('API call completed without a result.');
|
|
559
|
+
}
|
|
560
|
+
return resp;
|
|
561
|
+
}
|
|
562
|
+
/** Get a Database Catalog. */
|
|
563
|
+
async getCatalog(req, options) {
|
|
564
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
565
|
+
let resp;
|
|
566
|
+
const call = async (callSignal) => {
|
|
567
|
+
const headers = new Headers();
|
|
568
|
+
if (this.workspaceId !== undefined) {
|
|
569
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
570
|
+
}
|
|
571
|
+
headers.set('User-Agent', this.userAgent);
|
|
572
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
573
|
+
const respBody = await executeHttpCall({
|
|
574
|
+
request: httpReq,
|
|
575
|
+
httpClient: this.httpClient,
|
|
576
|
+
logger: this.logger,
|
|
577
|
+
});
|
|
578
|
+
resp = parseResponse(respBody, unmarshalCatalogSchema);
|
|
579
|
+
};
|
|
580
|
+
await executeCall(call, options);
|
|
581
|
+
if (resp === undefined) {
|
|
582
|
+
throw new Error('API call completed without a result.');
|
|
583
|
+
}
|
|
584
|
+
return resp;
|
|
585
|
+
}
|
|
586
|
+
/** Get a Database. */
|
|
587
|
+
async getDatabase(req, options) {
|
|
588
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
589
|
+
let resp;
|
|
590
|
+
const call = async (callSignal) => {
|
|
591
|
+
const headers = new Headers();
|
|
592
|
+
if (this.workspaceId !== undefined) {
|
|
593
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
594
|
+
}
|
|
595
|
+
headers.set('User-Agent', this.userAgent);
|
|
596
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
597
|
+
const respBody = await executeHttpCall({
|
|
598
|
+
request: httpReq,
|
|
599
|
+
httpClient: this.httpClient,
|
|
600
|
+
logger: this.logger,
|
|
601
|
+
});
|
|
602
|
+
resp = parseResponse(respBody, unmarshalDatabaseSchema);
|
|
603
|
+
};
|
|
604
|
+
await executeCall(call, options);
|
|
605
|
+
if (resp === undefined) {
|
|
606
|
+
throw new Error('API call completed without a result.');
|
|
607
|
+
}
|
|
608
|
+
return resp;
|
|
609
|
+
}
|
|
610
|
+
/** Retrieves information about the specified compute endpoint, including its connection details and operational state. */
|
|
611
|
+
async getEndpoint(req, options) {
|
|
612
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
613
|
+
let resp;
|
|
614
|
+
const call = async (callSignal) => {
|
|
615
|
+
const headers = new Headers();
|
|
616
|
+
if (this.workspaceId !== undefined) {
|
|
617
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
618
|
+
}
|
|
619
|
+
headers.set('User-Agent', this.userAgent);
|
|
620
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
621
|
+
const respBody = await executeHttpCall({
|
|
622
|
+
request: httpReq,
|
|
623
|
+
httpClient: this.httpClient,
|
|
624
|
+
logger: this.logger,
|
|
625
|
+
});
|
|
626
|
+
resp = parseResponse(respBody, unmarshalEndpointSchema);
|
|
627
|
+
};
|
|
628
|
+
await executeCall(call, options);
|
|
629
|
+
if (resp === undefined) {
|
|
630
|
+
throw new Error('API call completed without a result.');
|
|
631
|
+
}
|
|
632
|
+
return resp;
|
|
633
|
+
}
|
|
634
|
+
/** Retrieves the status of a long-running operation. */
|
|
635
|
+
async getOperation(req, options) {
|
|
636
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
637
|
+
let resp;
|
|
638
|
+
const call = async (callSignal) => {
|
|
639
|
+
const headers = new Headers();
|
|
640
|
+
if (this.workspaceId !== undefined) {
|
|
641
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
642
|
+
}
|
|
643
|
+
headers.set('User-Agent', this.userAgent);
|
|
644
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
645
|
+
const respBody = await executeHttpCall({
|
|
646
|
+
request: httpReq,
|
|
647
|
+
httpClient: this.httpClient,
|
|
648
|
+
logger: this.logger,
|
|
649
|
+
});
|
|
650
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
651
|
+
};
|
|
652
|
+
await executeCall(call, options);
|
|
653
|
+
if (resp === undefined) {
|
|
654
|
+
throw new Error('API call completed without a result.');
|
|
655
|
+
}
|
|
656
|
+
return resp;
|
|
657
|
+
}
|
|
658
|
+
/** Retrieves information about the specified database project. */
|
|
659
|
+
async getProject(req, options) {
|
|
660
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
661
|
+
let resp;
|
|
662
|
+
const call = async (callSignal) => {
|
|
663
|
+
const headers = new Headers();
|
|
664
|
+
if (this.workspaceId !== undefined) {
|
|
665
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
666
|
+
}
|
|
667
|
+
headers.set('User-Agent', this.userAgent);
|
|
668
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
669
|
+
const respBody = await executeHttpCall({
|
|
670
|
+
request: httpReq,
|
|
671
|
+
httpClient: this.httpClient,
|
|
672
|
+
logger: this.logger,
|
|
673
|
+
});
|
|
674
|
+
resp = parseResponse(respBody, unmarshalProjectSchema);
|
|
675
|
+
};
|
|
676
|
+
await executeCall(call, options);
|
|
677
|
+
if (resp === undefined) {
|
|
678
|
+
throw new Error('API call completed without a result.');
|
|
679
|
+
}
|
|
680
|
+
return resp;
|
|
681
|
+
}
|
|
682
|
+
/** Retrieves information about the specified Postgres role, including its authentication method and permissions. */
|
|
683
|
+
async getRole(req, options) {
|
|
684
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
685
|
+
let resp;
|
|
686
|
+
const call = async (callSignal) => {
|
|
687
|
+
const headers = new Headers();
|
|
688
|
+
if (this.workspaceId !== undefined) {
|
|
689
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
690
|
+
}
|
|
691
|
+
headers.set('User-Agent', this.userAgent);
|
|
692
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
693
|
+
const respBody = await executeHttpCall({
|
|
694
|
+
request: httpReq,
|
|
695
|
+
httpClient: this.httpClient,
|
|
696
|
+
logger: this.logger,
|
|
697
|
+
});
|
|
698
|
+
resp = parseResponse(respBody, unmarshalRoleSchema);
|
|
699
|
+
};
|
|
700
|
+
await executeCall(call, options);
|
|
701
|
+
if (resp === undefined) {
|
|
702
|
+
throw new Error('API call completed without a result.');
|
|
703
|
+
}
|
|
704
|
+
return resp;
|
|
705
|
+
}
|
|
706
|
+
/** Get a Synced Table. */
|
|
707
|
+
async getSyncedTable(req, options) {
|
|
708
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}`;
|
|
709
|
+
let resp;
|
|
710
|
+
const call = async (callSignal) => {
|
|
711
|
+
const headers = new Headers();
|
|
712
|
+
if (this.workspaceId !== undefined) {
|
|
713
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
714
|
+
}
|
|
715
|
+
headers.set('User-Agent', this.userAgent);
|
|
716
|
+
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
717
|
+
const respBody = await executeHttpCall({
|
|
718
|
+
request: httpReq,
|
|
719
|
+
httpClient: this.httpClient,
|
|
720
|
+
logger: this.logger,
|
|
721
|
+
});
|
|
722
|
+
resp = parseResponse(respBody, unmarshalSyncedTableSchema);
|
|
723
|
+
};
|
|
724
|
+
await executeCall(call, options);
|
|
725
|
+
if (resp === undefined) {
|
|
726
|
+
throw new Error('API call completed without a result.');
|
|
727
|
+
}
|
|
728
|
+
return resp;
|
|
729
|
+
}
|
|
730
|
+
/** Returns a paginated list of database branches in the project. */
|
|
731
|
+
async listBranches(req, options) {
|
|
732
|
+
const url = `${this.host}/api/2.0/postgres/${req.parent ?? ''}/branches`;
|
|
733
|
+
const params = new URLSearchParams();
|
|
734
|
+
if (req.pageToken !== undefined) {
|
|
735
|
+
params.append('page_token', req.pageToken);
|
|
736
|
+
}
|
|
737
|
+
if (req.pageSize !== undefined) {
|
|
738
|
+
params.append('page_size', String(req.pageSize));
|
|
739
|
+
}
|
|
740
|
+
if (req.showDeleted !== undefined) {
|
|
741
|
+
params.append('show_deleted', String(req.showDeleted));
|
|
742
|
+
}
|
|
743
|
+
const query = params.toString();
|
|
744
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
745
|
+
let resp;
|
|
746
|
+
const call = async (callSignal) => {
|
|
747
|
+
const headers = new Headers();
|
|
748
|
+
if (this.workspaceId !== undefined) {
|
|
749
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
750
|
+
}
|
|
751
|
+
headers.set('User-Agent', this.userAgent);
|
|
752
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
753
|
+
const respBody = await executeHttpCall({
|
|
754
|
+
request: httpReq,
|
|
755
|
+
httpClient: this.httpClient,
|
|
756
|
+
logger: this.logger,
|
|
757
|
+
});
|
|
758
|
+
resp = parseResponse(respBody, unmarshalListBranchesResponseSchema);
|
|
759
|
+
};
|
|
760
|
+
await executeCall(call, options);
|
|
761
|
+
if (resp === undefined) {
|
|
762
|
+
throw new Error('API call completed without a result.');
|
|
763
|
+
}
|
|
764
|
+
return resp;
|
|
765
|
+
}
|
|
766
|
+
async *listBranchesIter(req, options) {
|
|
767
|
+
const pageReq = { ...req };
|
|
768
|
+
for (;;) {
|
|
769
|
+
const resp = await this.listBranches(pageReq, options);
|
|
770
|
+
for (const item of resp.branches ?? []) {
|
|
771
|
+
yield item;
|
|
772
|
+
}
|
|
773
|
+
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
pageReq.pageToken = resp.nextPageToken;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
/** List Databases. */
|
|
780
|
+
async listDatabases(req, options) {
|
|
781
|
+
const url = `${this.host}/api/2.0/postgres/${req.parent ?? ''}/databases`;
|
|
782
|
+
const params = new URLSearchParams();
|
|
783
|
+
if (req.pageToken !== undefined) {
|
|
784
|
+
params.append('page_token', req.pageToken);
|
|
785
|
+
}
|
|
786
|
+
if (req.pageSize !== undefined) {
|
|
787
|
+
params.append('page_size', String(req.pageSize));
|
|
788
|
+
}
|
|
789
|
+
const query = params.toString();
|
|
790
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
791
|
+
let resp;
|
|
792
|
+
const call = async (callSignal) => {
|
|
793
|
+
const headers = new Headers();
|
|
794
|
+
if (this.workspaceId !== undefined) {
|
|
795
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
796
|
+
}
|
|
797
|
+
headers.set('User-Agent', this.userAgent);
|
|
798
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
799
|
+
const respBody = await executeHttpCall({
|
|
800
|
+
request: httpReq,
|
|
801
|
+
httpClient: this.httpClient,
|
|
802
|
+
logger: this.logger,
|
|
803
|
+
});
|
|
804
|
+
resp = parseResponse(respBody, unmarshalListDatabasesResponseSchema);
|
|
805
|
+
};
|
|
806
|
+
await executeCall(call, options);
|
|
807
|
+
if (resp === undefined) {
|
|
808
|
+
throw new Error('API call completed without a result.');
|
|
809
|
+
}
|
|
810
|
+
return resp;
|
|
811
|
+
}
|
|
812
|
+
async *listDatabasesIter(req, options) {
|
|
813
|
+
const pageReq = { ...req };
|
|
814
|
+
for (;;) {
|
|
815
|
+
const resp = await this.listDatabases(pageReq, options);
|
|
816
|
+
for (const item of resp.databases ?? []) {
|
|
817
|
+
yield item;
|
|
818
|
+
}
|
|
819
|
+
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
pageReq.pageToken = resp.nextPageToken;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
/** Returns a paginated list of compute endpoints in the branch. */
|
|
826
|
+
async listEndpoints(req, options) {
|
|
827
|
+
const url = `${this.host}/api/2.0/postgres/${req.parent ?? ''}/endpoints`;
|
|
828
|
+
const params = new URLSearchParams();
|
|
829
|
+
if (req.pageToken !== undefined) {
|
|
830
|
+
params.append('page_token', req.pageToken);
|
|
831
|
+
}
|
|
832
|
+
if (req.pageSize !== undefined) {
|
|
833
|
+
params.append('page_size', String(req.pageSize));
|
|
834
|
+
}
|
|
835
|
+
const query = params.toString();
|
|
836
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
837
|
+
let resp;
|
|
838
|
+
const call = async (callSignal) => {
|
|
839
|
+
const headers = new Headers();
|
|
840
|
+
if (this.workspaceId !== undefined) {
|
|
841
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
842
|
+
}
|
|
843
|
+
headers.set('User-Agent', this.userAgent);
|
|
844
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
845
|
+
const respBody = await executeHttpCall({
|
|
846
|
+
request: httpReq,
|
|
847
|
+
httpClient: this.httpClient,
|
|
848
|
+
logger: this.logger,
|
|
849
|
+
});
|
|
850
|
+
resp = parseResponse(respBody, unmarshalListEndpointsResponseSchema);
|
|
851
|
+
};
|
|
852
|
+
await executeCall(call, options);
|
|
853
|
+
if (resp === undefined) {
|
|
854
|
+
throw new Error('API call completed without a result.');
|
|
855
|
+
}
|
|
856
|
+
return resp;
|
|
857
|
+
}
|
|
858
|
+
async *listEndpointsIter(req, options) {
|
|
859
|
+
const pageReq = { ...req };
|
|
860
|
+
for (;;) {
|
|
861
|
+
const resp = await this.listEndpoints(pageReq, options);
|
|
862
|
+
for (const item of resp.endpoints ?? []) {
|
|
863
|
+
yield item;
|
|
864
|
+
}
|
|
865
|
+
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
pageReq.pageToken = resp.nextPageToken;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
/** Returns a paginated list of database projects in the workspace that the user has permission to access. */
|
|
872
|
+
async listProjects(req, options) {
|
|
873
|
+
const url = `${this.host}/api/2.0/postgres/projects`;
|
|
874
|
+
const params = new URLSearchParams();
|
|
875
|
+
if (req.pageToken !== undefined) {
|
|
876
|
+
params.append('page_token', req.pageToken);
|
|
877
|
+
}
|
|
878
|
+
if (req.pageSize !== undefined) {
|
|
879
|
+
params.append('page_size', String(req.pageSize));
|
|
880
|
+
}
|
|
881
|
+
if (req.showDeleted !== undefined) {
|
|
882
|
+
params.append('show_deleted', String(req.showDeleted));
|
|
883
|
+
}
|
|
884
|
+
const query = params.toString();
|
|
885
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
886
|
+
let resp;
|
|
887
|
+
const call = async (callSignal) => {
|
|
888
|
+
const headers = new Headers();
|
|
889
|
+
if (this.workspaceId !== undefined) {
|
|
890
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
891
|
+
}
|
|
892
|
+
headers.set('User-Agent', this.userAgent);
|
|
893
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
894
|
+
const respBody = await executeHttpCall({
|
|
895
|
+
request: httpReq,
|
|
896
|
+
httpClient: this.httpClient,
|
|
897
|
+
logger: this.logger,
|
|
898
|
+
});
|
|
899
|
+
resp = parseResponse(respBody, unmarshalListProjectsResponseSchema);
|
|
900
|
+
};
|
|
901
|
+
await executeCall(call, options);
|
|
902
|
+
if (resp === undefined) {
|
|
903
|
+
throw new Error('API call completed without a result.');
|
|
904
|
+
}
|
|
905
|
+
return resp;
|
|
906
|
+
}
|
|
907
|
+
async *listProjectsIter(req, options) {
|
|
908
|
+
const pageReq = { ...req };
|
|
909
|
+
for (;;) {
|
|
910
|
+
const resp = await this.listProjects(pageReq, options);
|
|
911
|
+
for (const item of resp.projects ?? []) {
|
|
912
|
+
yield item;
|
|
913
|
+
}
|
|
914
|
+
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
pageReq.pageToken = resp.nextPageToken;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
/** Returns a paginated list of Postgres roles in the branch. */
|
|
921
|
+
async listRoles(req, options) {
|
|
922
|
+
const url = `${this.host}/api/2.0/postgres/${req.parent ?? ''}/roles`;
|
|
923
|
+
const params = new URLSearchParams();
|
|
924
|
+
if (req.pageToken !== undefined) {
|
|
925
|
+
params.append('page_token', req.pageToken);
|
|
926
|
+
}
|
|
927
|
+
if (req.pageSize !== undefined) {
|
|
928
|
+
params.append('page_size', String(req.pageSize));
|
|
929
|
+
}
|
|
930
|
+
const query = params.toString();
|
|
931
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
932
|
+
let resp;
|
|
933
|
+
const call = async (callSignal) => {
|
|
934
|
+
const headers = new Headers();
|
|
935
|
+
if (this.workspaceId !== undefined) {
|
|
936
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
937
|
+
}
|
|
938
|
+
headers.set('User-Agent', this.userAgent);
|
|
939
|
+
const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
|
|
940
|
+
const respBody = await executeHttpCall({
|
|
941
|
+
request: httpReq,
|
|
942
|
+
httpClient: this.httpClient,
|
|
943
|
+
logger: this.logger,
|
|
944
|
+
});
|
|
945
|
+
resp = parseResponse(respBody, unmarshalListRolesResponseSchema);
|
|
946
|
+
};
|
|
947
|
+
await executeCall(call, options);
|
|
948
|
+
if (resp === undefined) {
|
|
949
|
+
throw new Error('API call completed without a result.');
|
|
950
|
+
}
|
|
951
|
+
return resp;
|
|
952
|
+
}
|
|
953
|
+
async *listRolesIter(req, options) {
|
|
954
|
+
const pageReq = { ...req };
|
|
955
|
+
for (;;) {
|
|
956
|
+
const resp = await this.listRoles(pageReq, options);
|
|
957
|
+
for (const item of resp.roles ?? []) {
|
|
958
|
+
yield item;
|
|
959
|
+
}
|
|
960
|
+
if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
pageReq.pageToken = resp.nextPageToken;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
/** Undeletes the specified database branch. */
|
|
967
|
+
async undeleteBranch(req, options) {
|
|
968
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}/undelete`;
|
|
969
|
+
const body = marshalRequest(req, marshalUndeleteBranchRequestSchema);
|
|
970
|
+
let resp;
|
|
971
|
+
const call = async (callSignal) => {
|
|
972
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
973
|
+
if (this.workspaceId !== undefined) {
|
|
974
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
975
|
+
}
|
|
976
|
+
headers.set('User-Agent', this.userAgent);
|
|
977
|
+
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
978
|
+
const respBody = await executeHttpCall({
|
|
979
|
+
request: httpReq,
|
|
980
|
+
httpClient: this.httpClient,
|
|
981
|
+
logger: this.logger,
|
|
982
|
+
});
|
|
983
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
984
|
+
};
|
|
985
|
+
await executeCall(call, options);
|
|
986
|
+
if (resp === undefined) {
|
|
987
|
+
throw new Error('API call completed without a result.');
|
|
988
|
+
}
|
|
989
|
+
return resp;
|
|
990
|
+
}
|
|
991
|
+
async undeleteBranchOperation(req, options) {
|
|
992
|
+
const op = await this.undeleteBranch(req, options);
|
|
993
|
+
return new UndeleteBranchOperation(this, op);
|
|
994
|
+
}
|
|
995
|
+
/** Undeletes a soft-deleted project. */
|
|
996
|
+
async undeleteProject(req, options) {
|
|
997
|
+
const url = `${this.host}/api/2.0/postgres/${req.name ?? ''}/undelete`;
|
|
998
|
+
const body = marshalRequest(req, marshalUndeleteProjectRequestSchema);
|
|
999
|
+
let resp;
|
|
1000
|
+
const call = async (callSignal) => {
|
|
1001
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1002
|
+
if (this.workspaceId !== undefined) {
|
|
1003
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
1004
|
+
}
|
|
1005
|
+
headers.set('User-Agent', this.userAgent);
|
|
1006
|
+
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
1007
|
+
const respBody = await executeHttpCall({
|
|
1008
|
+
request: httpReq,
|
|
1009
|
+
httpClient: this.httpClient,
|
|
1010
|
+
logger: this.logger,
|
|
1011
|
+
});
|
|
1012
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
1013
|
+
};
|
|
1014
|
+
await executeCall(call, options);
|
|
1015
|
+
if (resp === undefined) {
|
|
1016
|
+
throw new Error('API call completed without a result.');
|
|
1017
|
+
}
|
|
1018
|
+
return resp;
|
|
1019
|
+
}
|
|
1020
|
+
async undeleteProjectOperation(req, options) {
|
|
1021
|
+
const op = await this.undeleteProject(req, options);
|
|
1022
|
+
return new UndeleteProjectOperation(this, op);
|
|
1023
|
+
}
|
|
1024
|
+
/** Updates the specified database branch. You can set this branch as the project's default branch, or protect/unprotect it. */
|
|
1025
|
+
async updateBranch(req, options) {
|
|
1026
|
+
const url = `${this.host}/api/2.0/postgres/${req.branch?.name ?? ''}`;
|
|
1027
|
+
const params = new URLSearchParams();
|
|
1028
|
+
if (req.updateMask !== undefined) {
|
|
1029
|
+
params.append('update_mask', req.updateMask.toString());
|
|
1030
|
+
}
|
|
1031
|
+
const query = params.toString();
|
|
1032
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
1033
|
+
const body = marshalRequest(req.branch, marshalBranchSchema);
|
|
1034
|
+
let resp;
|
|
1035
|
+
const call = async (callSignal) => {
|
|
1036
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1037
|
+
if (this.workspaceId !== undefined) {
|
|
1038
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
1039
|
+
}
|
|
1040
|
+
headers.set('User-Agent', this.userAgent);
|
|
1041
|
+
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
1042
|
+
const respBody = await executeHttpCall({
|
|
1043
|
+
request: httpReq,
|
|
1044
|
+
httpClient: this.httpClient,
|
|
1045
|
+
logger: this.logger,
|
|
1046
|
+
});
|
|
1047
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
1048
|
+
};
|
|
1049
|
+
await executeCall(call, options);
|
|
1050
|
+
if (resp === undefined) {
|
|
1051
|
+
throw new Error('API call completed without a result.');
|
|
1052
|
+
}
|
|
1053
|
+
return resp;
|
|
1054
|
+
}
|
|
1055
|
+
async updateBranchOperation(req, options) {
|
|
1056
|
+
const op = await this.updateBranch(req, options);
|
|
1057
|
+
return new UpdateBranchOperation(this, op);
|
|
1058
|
+
}
|
|
1059
|
+
/** Update a Database. */
|
|
1060
|
+
async updateDatabase(req, options) {
|
|
1061
|
+
const url = `${this.host}/api/2.0/postgres/${req.database?.name ?? ''}`;
|
|
1062
|
+
const params = new URLSearchParams();
|
|
1063
|
+
if (req.updateMask !== undefined) {
|
|
1064
|
+
params.append('update_mask', req.updateMask.toString());
|
|
1065
|
+
}
|
|
1066
|
+
const query = params.toString();
|
|
1067
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
1068
|
+
const body = marshalRequest(req.database, marshalDatabaseSchema);
|
|
1069
|
+
let resp;
|
|
1070
|
+
const call = async (callSignal) => {
|
|
1071
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1072
|
+
if (this.workspaceId !== undefined) {
|
|
1073
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
1074
|
+
}
|
|
1075
|
+
headers.set('User-Agent', this.userAgent);
|
|
1076
|
+
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
1077
|
+
const respBody = await executeHttpCall({
|
|
1078
|
+
request: httpReq,
|
|
1079
|
+
httpClient: this.httpClient,
|
|
1080
|
+
logger: this.logger,
|
|
1081
|
+
});
|
|
1082
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
1083
|
+
};
|
|
1084
|
+
await executeCall(call, options);
|
|
1085
|
+
if (resp === undefined) {
|
|
1086
|
+
throw new Error('API call completed without a result.');
|
|
1087
|
+
}
|
|
1088
|
+
return resp;
|
|
1089
|
+
}
|
|
1090
|
+
async updateDatabaseOperation(req, options) {
|
|
1091
|
+
const op = await this.updateDatabase(req, options);
|
|
1092
|
+
return new UpdateDatabaseOperation(this, op);
|
|
1093
|
+
}
|
|
1094
|
+
/** Updates the specified compute endpoint. You can update autoscaling limits, suspend timeout, or enable/disable the compute endpoint. */
|
|
1095
|
+
async updateEndpoint(req, options) {
|
|
1096
|
+
const url = `${this.host}/api/2.0/postgres/${req.endpoint?.name ?? ''}`;
|
|
1097
|
+
const params = new URLSearchParams();
|
|
1098
|
+
if (req.updateMask !== undefined) {
|
|
1099
|
+
params.append('update_mask', req.updateMask.toString());
|
|
1100
|
+
}
|
|
1101
|
+
const query = params.toString();
|
|
1102
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
1103
|
+
const body = marshalRequest(req.endpoint, marshalEndpointSchema);
|
|
1104
|
+
let resp;
|
|
1105
|
+
const call = async (callSignal) => {
|
|
1106
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1107
|
+
if (this.workspaceId !== undefined) {
|
|
1108
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
1109
|
+
}
|
|
1110
|
+
headers.set('User-Agent', this.userAgent);
|
|
1111
|
+
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
1112
|
+
const respBody = await executeHttpCall({
|
|
1113
|
+
request: httpReq,
|
|
1114
|
+
httpClient: this.httpClient,
|
|
1115
|
+
logger: this.logger,
|
|
1116
|
+
});
|
|
1117
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
1118
|
+
};
|
|
1119
|
+
await executeCall(call, options);
|
|
1120
|
+
if (resp === undefined) {
|
|
1121
|
+
throw new Error('API call completed without a result.');
|
|
1122
|
+
}
|
|
1123
|
+
return resp;
|
|
1124
|
+
}
|
|
1125
|
+
async updateEndpointOperation(req, options) {
|
|
1126
|
+
const op = await this.updateEndpoint(req, options);
|
|
1127
|
+
return new UpdateEndpointOperation(this, op);
|
|
1128
|
+
}
|
|
1129
|
+
/** Updates the specified database project. */
|
|
1130
|
+
async updateProject(req, options) {
|
|
1131
|
+
const url = `${this.host}/api/2.0/postgres/${req.project?.name ?? ''}`;
|
|
1132
|
+
const params = new URLSearchParams();
|
|
1133
|
+
if (req.updateMask !== undefined) {
|
|
1134
|
+
params.append('update_mask', req.updateMask.toString());
|
|
1135
|
+
}
|
|
1136
|
+
const query = params.toString();
|
|
1137
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
1138
|
+
const body = marshalRequest(req.project, marshalProjectSchema);
|
|
1139
|
+
let resp;
|
|
1140
|
+
const call = async (callSignal) => {
|
|
1141
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1142
|
+
if (this.workspaceId !== undefined) {
|
|
1143
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
1144
|
+
}
|
|
1145
|
+
headers.set('User-Agent', this.userAgent);
|
|
1146
|
+
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
1147
|
+
const respBody = await executeHttpCall({
|
|
1148
|
+
request: httpReq,
|
|
1149
|
+
httpClient: this.httpClient,
|
|
1150
|
+
logger: this.logger,
|
|
1151
|
+
});
|
|
1152
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
1153
|
+
};
|
|
1154
|
+
await executeCall(call, options);
|
|
1155
|
+
if (resp === undefined) {
|
|
1156
|
+
throw new Error('API call completed without a result.');
|
|
1157
|
+
}
|
|
1158
|
+
return resp;
|
|
1159
|
+
}
|
|
1160
|
+
async updateProjectOperation(req, options) {
|
|
1161
|
+
const op = await this.updateProject(req, options);
|
|
1162
|
+
return new UpdateProjectOperation(this, op);
|
|
1163
|
+
}
|
|
1164
|
+
/** Update a role for a branch. */
|
|
1165
|
+
async updateRole(req, options) {
|
|
1166
|
+
const url = `${this.host}/api/2.0/postgres/${req.role?.name ?? ''}`;
|
|
1167
|
+
const params = new URLSearchParams();
|
|
1168
|
+
if (req.updateMask !== undefined) {
|
|
1169
|
+
params.append('update_mask', req.updateMask.toString());
|
|
1170
|
+
}
|
|
1171
|
+
const query = params.toString();
|
|
1172
|
+
const fullUrl = query !== '' ? `${url}?${query}` : url;
|
|
1173
|
+
const body = marshalRequest(req.role, marshalRoleSchema);
|
|
1174
|
+
let resp;
|
|
1175
|
+
const call = async (callSignal) => {
|
|
1176
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
1177
|
+
if (this.workspaceId !== undefined) {
|
|
1178
|
+
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
1179
|
+
}
|
|
1180
|
+
headers.set('User-Agent', this.userAgent);
|
|
1181
|
+
const httpReq = buildHttpRequest('PATCH', fullUrl, headers, callSignal, body);
|
|
1182
|
+
const respBody = await executeHttpCall({
|
|
1183
|
+
request: httpReq,
|
|
1184
|
+
httpClient: this.httpClient,
|
|
1185
|
+
logger: this.logger,
|
|
1186
|
+
});
|
|
1187
|
+
resp = parseResponse(respBody, unmarshalOperationSchema);
|
|
1188
|
+
};
|
|
1189
|
+
await executeCall(call, options);
|
|
1190
|
+
if (resp === undefined) {
|
|
1191
|
+
throw new Error('API call completed without a result.');
|
|
1192
|
+
}
|
|
1193
|
+
return resp;
|
|
1194
|
+
}
|
|
1195
|
+
async updateRoleOperation(req, options) {
|
|
1196
|
+
const op = await this.updateRole(req, options);
|
|
1197
|
+
return new UpdateRoleOperation(this, op);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
export class CreateBranchOperation {
|
|
1201
|
+
client;
|
|
1202
|
+
operation;
|
|
1203
|
+
constructor(client, operation) {
|
|
1204
|
+
this.client = client;
|
|
1205
|
+
this.operation = operation;
|
|
1206
|
+
}
|
|
1207
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1208
|
+
name() {
|
|
1209
|
+
return Promise.resolve(this.operation.name);
|
|
1210
|
+
}
|
|
1211
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1212
|
+
metadata() {
|
|
1213
|
+
if (this.operation.metadata === undefined) {
|
|
1214
|
+
return Promise.resolve(undefined);
|
|
1215
|
+
}
|
|
1216
|
+
return Promise.resolve(z
|
|
1217
|
+
.lazy(() => unmarshalBranchOperationMetadataSchema)
|
|
1218
|
+
.parse(this.operation.metadata));
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Polls the operation until it completes.
|
|
1222
|
+
*
|
|
1223
|
+
* Throws if the operation failed.
|
|
1224
|
+
*/
|
|
1225
|
+
async wait(options) {
|
|
1226
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1227
|
+
let result;
|
|
1228
|
+
const call = async (callSignal) => {
|
|
1229
|
+
const op = await this.client.getOperation({
|
|
1230
|
+
name: this.operation.name,
|
|
1231
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1232
|
+
this.operation = op;
|
|
1233
|
+
if (op.done === undefined) {
|
|
1234
|
+
throw new Error('operation is missing the done field');
|
|
1235
|
+
}
|
|
1236
|
+
if (!op.done) {
|
|
1237
|
+
throw errStillRunning;
|
|
1238
|
+
}
|
|
1239
|
+
if (op.result?.$case === 'error') {
|
|
1240
|
+
const err = op.result.error;
|
|
1241
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1242
|
+
? err.message
|
|
1243
|
+
: 'unknown error';
|
|
1244
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1245
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1246
|
+
cause: err,
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
if (op.result?.$case !== 'response') {
|
|
1250
|
+
throw new Error('operation completed without a response');
|
|
1251
|
+
}
|
|
1252
|
+
result = z.lazy(() => unmarshalBranchSchema).parse(op.result.response);
|
|
1253
|
+
};
|
|
1254
|
+
const retryOptions = {
|
|
1255
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1256
|
+
retrier: () => retryOn({}, (err) => {
|
|
1257
|
+
return err.message.includes('operation still in progress');
|
|
1258
|
+
}),
|
|
1259
|
+
};
|
|
1260
|
+
await executeCall(call, retryOptions);
|
|
1261
|
+
if (result === undefined) {
|
|
1262
|
+
throw new Error('API call completed without a result.');
|
|
1263
|
+
}
|
|
1264
|
+
return result;
|
|
1265
|
+
}
|
|
1266
|
+
/** Checks whether the operation has completed */
|
|
1267
|
+
async done(options) {
|
|
1268
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1269
|
+
this.operation = op;
|
|
1270
|
+
return op.done;
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
export class CreateCatalogOperation {
|
|
1274
|
+
client;
|
|
1275
|
+
operation;
|
|
1276
|
+
constructor(client, operation) {
|
|
1277
|
+
this.client = client;
|
|
1278
|
+
this.operation = operation;
|
|
1279
|
+
}
|
|
1280
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1281
|
+
name() {
|
|
1282
|
+
return Promise.resolve(this.operation.name);
|
|
1283
|
+
}
|
|
1284
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1285
|
+
metadata() {
|
|
1286
|
+
if (this.operation.metadata === undefined) {
|
|
1287
|
+
return Promise.resolve(undefined);
|
|
1288
|
+
}
|
|
1289
|
+
return Promise.resolve(z
|
|
1290
|
+
.lazy(() => unmarshalCatalogOperationMetadataSchema)
|
|
1291
|
+
.parse(this.operation.metadata));
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Polls the operation until it completes.
|
|
1295
|
+
*
|
|
1296
|
+
* Throws if the operation failed.
|
|
1297
|
+
*/
|
|
1298
|
+
async wait(options) {
|
|
1299
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1300
|
+
let result;
|
|
1301
|
+
const call = async (callSignal) => {
|
|
1302
|
+
const op = await this.client.getOperation({
|
|
1303
|
+
name: this.operation.name,
|
|
1304
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1305
|
+
this.operation = op;
|
|
1306
|
+
if (op.done === undefined) {
|
|
1307
|
+
throw new Error('operation is missing the done field');
|
|
1308
|
+
}
|
|
1309
|
+
if (!op.done) {
|
|
1310
|
+
throw errStillRunning;
|
|
1311
|
+
}
|
|
1312
|
+
if (op.result?.$case === 'error') {
|
|
1313
|
+
const err = op.result.error;
|
|
1314
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1315
|
+
? err.message
|
|
1316
|
+
: 'unknown error';
|
|
1317
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1318
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1319
|
+
cause: err,
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
if (op.result?.$case !== 'response') {
|
|
1323
|
+
throw new Error('operation completed without a response');
|
|
1324
|
+
}
|
|
1325
|
+
result = z.lazy(() => unmarshalCatalogSchema).parse(op.result.response);
|
|
1326
|
+
};
|
|
1327
|
+
const retryOptions = {
|
|
1328
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1329
|
+
retrier: () => retryOn({}, (err) => {
|
|
1330
|
+
return err.message.includes('operation still in progress');
|
|
1331
|
+
}),
|
|
1332
|
+
};
|
|
1333
|
+
await executeCall(call, retryOptions);
|
|
1334
|
+
if (result === undefined) {
|
|
1335
|
+
throw new Error('API call completed without a result.');
|
|
1336
|
+
}
|
|
1337
|
+
return result;
|
|
1338
|
+
}
|
|
1339
|
+
/** Checks whether the operation has completed */
|
|
1340
|
+
async done(options) {
|
|
1341
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1342
|
+
this.operation = op;
|
|
1343
|
+
return op.done;
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
export class CreateDatabaseOperation {
|
|
1347
|
+
client;
|
|
1348
|
+
operation;
|
|
1349
|
+
constructor(client, operation) {
|
|
1350
|
+
this.client = client;
|
|
1351
|
+
this.operation = operation;
|
|
1352
|
+
}
|
|
1353
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1354
|
+
name() {
|
|
1355
|
+
return Promise.resolve(this.operation.name);
|
|
1356
|
+
}
|
|
1357
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1358
|
+
metadata() {
|
|
1359
|
+
if (this.operation.metadata === undefined) {
|
|
1360
|
+
return Promise.resolve(undefined);
|
|
1361
|
+
}
|
|
1362
|
+
return Promise.resolve(z
|
|
1363
|
+
.lazy(() => unmarshalDatabaseOperationMetadataSchema)
|
|
1364
|
+
.parse(this.operation.metadata));
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Polls the operation until it completes.
|
|
1368
|
+
*
|
|
1369
|
+
* Throws if the operation failed.
|
|
1370
|
+
*/
|
|
1371
|
+
async wait(options) {
|
|
1372
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1373
|
+
let result;
|
|
1374
|
+
const call = async (callSignal) => {
|
|
1375
|
+
const op = await this.client.getOperation({
|
|
1376
|
+
name: this.operation.name,
|
|
1377
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1378
|
+
this.operation = op;
|
|
1379
|
+
if (op.done === undefined) {
|
|
1380
|
+
throw new Error('operation is missing the done field');
|
|
1381
|
+
}
|
|
1382
|
+
if (!op.done) {
|
|
1383
|
+
throw errStillRunning;
|
|
1384
|
+
}
|
|
1385
|
+
if (op.result?.$case === 'error') {
|
|
1386
|
+
const err = op.result.error;
|
|
1387
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1388
|
+
? err.message
|
|
1389
|
+
: 'unknown error';
|
|
1390
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1391
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1392
|
+
cause: err,
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
if (op.result?.$case !== 'response') {
|
|
1396
|
+
throw new Error('operation completed without a response');
|
|
1397
|
+
}
|
|
1398
|
+
result = z.lazy(() => unmarshalDatabaseSchema).parse(op.result.response);
|
|
1399
|
+
};
|
|
1400
|
+
const retryOptions = {
|
|
1401
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1402
|
+
retrier: () => retryOn({}, (err) => {
|
|
1403
|
+
return err.message.includes('operation still in progress');
|
|
1404
|
+
}),
|
|
1405
|
+
};
|
|
1406
|
+
await executeCall(call, retryOptions);
|
|
1407
|
+
if (result === undefined) {
|
|
1408
|
+
throw new Error('API call completed without a result.');
|
|
1409
|
+
}
|
|
1410
|
+
return result;
|
|
1411
|
+
}
|
|
1412
|
+
/** Checks whether the operation has completed */
|
|
1413
|
+
async done(options) {
|
|
1414
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1415
|
+
this.operation = op;
|
|
1416
|
+
return op.done;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
export class CreateEndpointOperation {
|
|
1420
|
+
client;
|
|
1421
|
+
operation;
|
|
1422
|
+
constructor(client, operation) {
|
|
1423
|
+
this.client = client;
|
|
1424
|
+
this.operation = operation;
|
|
1425
|
+
}
|
|
1426
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1427
|
+
name() {
|
|
1428
|
+
return Promise.resolve(this.operation.name);
|
|
1429
|
+
}
|
|
1430
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1431
|
+
metadata() {
|
|
1432
|
+
if (this.operation.metadata === undefined) {
|
|
1433
|
+
return Promise.resolve(undefined);
|
|
1434
|
+
}
|
|
1435
|
+
return Promise.resolve(z
|
|
1436
|
+
.lazy(() => unmarshalEndpointOperationMetadataSchema)
|
|
1437
|
+
.parse(this.operation.metadata));
|
|
1438
|
+
}
|
|
1439
|
+
/**
|
|
1440
|
+
* Polls the operation until it completes.
|
|
1441
|
+
*
|
|
1442
|
+
* Throws if the operation failed.
|
|
1443
|
+
*/
|
|
1444
|
+
async wait(options) {
|
|
1445
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1446
|
+
let result;
|
|
1447
|
+
const call = async (callSignal) => {
|
|
1448
|
+
const op = await this.client.getOperation({
|
|
1449
|
+
name: this.operation.name,
|
|
1450
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1451
|
+
this.operation = op;
|
|
1452
|
+
if (op.done === undefined) {
|
|
1453
|
+
throw new Error('operation is missing the done field');
|
|
1454
|
+
}
|
|
1455
|
+
if (!op.done) {
|
|
1456
|
+
throw errStillRunning;
|
|
1457
|
+
}
|
|
1458
|
+
if (op.result?.$case === 'error') {
|
|
1459
|
+
const err = op.result.error;
|
|
1460
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1461
|
+
? err.message
|
|
1462
|
+
: 'unknown error';
|
|
1463
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1464
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1465
|
+
cause: err,
|
|
1466
|
+
});
|
|
1467
|
+
}
|
|
1468
|
+
if (op.result?.$case !== 'response') {
|
|
1469
|
+
throw new Error('operation completed without a response');
|
|
1470
|
+
}
|
|
1471
|
+
result = z.lazy(() => unmarshalEndpointSchema).parse(op.result.response);
|
|
1472
|
+
};
|
|
1473
|
+
const retryOptions = {
|
|
1474
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1475
|
+
retrier: () => retryOn({}, (err) => {
|
|
1476
|
+
return err.message.includes('operation still in progress');
|
|
1477
|
+
}),
|
|
1478
|
+
};
|
|
1479
|
+
await executeCall(call, retryOptions);
|
|
1480
|
+
if (result === undefined) {
|
|
1481
|
+
throw new Error('API call completed without a result.');
|
|
1482
|
+
}
|
|
1483
|
+
return result;
|
|
1484
|
+
}
|
|
1485
|
+
/** Checks whether the operation has completed */
|
|
1486
|
+
async done(options) {
|
|
1487
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1488
|
+
this.operation = op;
|
|
1489
|
+
return op.done;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
export class CreateProjectOperation {
|
|
1493
|
+
client;
|
|
1494
|
+
operation;
|
|
1495
|
+
constructor(client, operation) {
|
|
1496
|
+
this.client = client;
|
|
1497
|
+
this.operation = operation;
|
|
1498
|
+
}
|
|
1499
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1500
|
+
name() {
|
|
1501
|
+
return Promise.resolve(this.operation.name);
|
|
1502
|
+
}
|
|
1503
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1504
|
+
metadata() {
|
|
1505
|
+
if (this.operation.metadata === undefined) {
|
|
1506
|
+
return Promise.resolve(undefined);
|
|
1507
|
+
}
|
|
1508
|
+
return Promise.resolve(z
|
|
1509
|
+
.lazy(() => unmarshalProjectOperationMetadataSchema)
|
|
1510
|
+
.parse(this.operation.metadata));
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Polls the operation until it completes.
|
|
1514
|
+
*
|
|
1515
|
+
* Throws if the operation failed.
|
|
1516
|
+
*/
|
|
1517
|
+
async wait(options) {
|
|
1518
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1519
|
+
let result;
|
|
1520
|
+
const call = async (callSignal) => {
|
|
1521
|
+
const op = await this.client.getOperation({
|
|
1522
|
+
name: this.operation.name,
|
|
1523
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1524
|
+
this.operation = op;
|
|
1525
|
+
if (op.done === undefined) {
|
|
1526
|
+
throw new Error('operation is missing the done field');
|
|
1527
|
+
}
|
|
1528
|
+
if (!op.done) {
|
|
1529
|
+
throw errStillRunning;
|
|
1530
|
+
}
|
|
1531
|
+
if (op.result?.$case === 'error') {
|
|
1532
|
+
const err = op.result.error;
|
|
1533
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1534
|
+
? err.message
|
|
1535
|
+
: 'unknown error';
|
|
1536
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1537
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1538
|
+
cause: err,
|
|
1539
|
+
});
|
|
1540
|
+
}
|
|
1541
|
+
if (op.result?.$case !== 'response') {
|
|
1542
|
+
throw new Error('operation completed without a response');
|
|
1543
|
+
}
|
|
1544
|
+
result = z.lazy(() => unmarshalProjectSchema).parse(op.result.response);
|
|
1545
|
+
};
|
|
1546
|
+
const retryOptions = {
|
|
1547
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1548
|
+
retrier: () => retryOn({}, (err) => {
|
|
1549
|
+
return err.message.includes('operation still in progress');
|
|
1550
|
+
}),
|
|
1551
|
+
};
|
|
1552
|
+
await executeCall(call, retryOptions);
|
|
1553
|
+
if (result === undefined) {
|
|
1554
|
+
throw new Error('API call completed without a result.');
|
|
1555
|
+
}
|
|
1556
|
+
return result;
|
|
1557
|
+
}
|
|
1558
|
+
/** Checks whether the operation has completed */
|
|
1559
|
+
async done(options) {
|
|
1560
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1561
|
+
this.operation = op;
|
|
1562
|
+
return op.done;
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
export class CreateRoleOperation {
|
|
1566
|
+
client;
|
|
1567
|
+
operation;
|
|
1568
|
+
constructor(client, operation) {
|
|
1569
|
+
this.client = client;
|
|
1570
|
+
this.operation = operation;
|
|
1571
|
+
}
|
|
1572
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1573
|
+
name() {
|
|
1574
|
+
return Promise.resolve(this.operation.name);
|
|
1575
|
+
}
|
|
1576
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1577
|
+
metadata() {
|
|
1578
|
+
if (this.operation.metadata === undefined) {
|
|
1579
|
+
return Promise.resolve(undefined);
|
|
1580
|
+
}
|
|
1581
|
+
return Promise.resolve(z
|
|
1582
|
+
.lazy(() => unmarshalRoleOperationMetadataSchema)
|
|
1583
|
+
.parse(this.operation.metadata));
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* Polls the operation until it completes.
|
|
1587
|
+
*
|
|
1588
|
+
* Throws if the operation failed.
|
|
1589
|
+
*/
|
|
1590
|
+
async wait(options) {
|
|
1591
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1592
|
+
let result;
|
|
1593
|
+
const call = async (callSignal) => {
|
|
1594
|
+
const op = await this.client.getOperation({
|
|
1595
|
+
name: this.operation.name,
|
|
1596
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1597
|
+
this.operation = op;
|
|
1598
|
+
if (op.done === undefined) {
|
|
1599
|
+
throw new Error('operation is missing the done field');
|
|
1600
|
+
}
|
|
1601
|
+
if (!op.done) {
|
|
1602
|
+
throw errStillRunning;
|
|
1603
|
+
}
|
|
1604
|
+
if (op.result?.$case === 'error') {
|
|
1605
|
+
const err = op.result.error;
|
|
1606
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1607
|
+
? err.message
|
|
1608
|
+
: 'unknown error';
|
|
1609
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1610
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1611
|
+
cause: err,
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
if (op.result?.$case !== 'response') {
|
|
1615
|
+
throw new Error('operation completed without a response');
|
|
1616
|
+
}
|
|
1617
|
+
result = z.lazy(() => unmarshalRoleSchema).parse(op.result.response);
|
|
1618
|
+
};
|
|
1619
|
+
const retryOptions = {
|
|
1620
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1621
|
+
retrier: () => retryOn({}, (err) => {
|
|
1622
|
+
return err.message.includes('operation still in progress');
|
|
1623
|
+
}),
|
|
1624
|
+
};
|
|
1625
|
+
await executeCall(call, retryOptions);
|
|
1626
|
+
if (result === undefined) {
|
|
1627
|
+
throw new Error('API call completed without a result.');
|
|
1628
|
+
}
|
|
1629
|
+
return result;
|
|
1630
|
+
}
|
|
1631
|
+
/** Checks whether the operation has completed */
|
|
1632
|
+
async done(options) {
|
|
1633
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1634
|
+
this.operation = op;
|
|
1635
|
+
return op.done;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
export class CreateSyncedTableOperation {
|
|
1639
|
+
client;
|
|
1640
|
+
operation;
|
|
1641
|
+
constructor(client, operation) {
|
|
1642
|
+
this.client = client;
|
|
1643
|
+
this.operation = operation;
|
|
1644
|
+
}
|
|
1645
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1646
|
+
name() {
|
|
1647
|
+
return Promise.resolve(this.operation.name);
|
|
1648
|
+
}
|
|
1649
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1650
|
+
metadata() {
|
|
1651
|
+
if (this.operation.metadata === undefined) {
|
|
1652
|
+
return Promise.resolve(undefined);
|
|
1653
|
+
}
|
|
1654
|
+
return Promise.resolve(z
|
|
1655
|
+
.lazy(() => unmarshalSyncedTableOperationMetadataSchema)
|
|
1656
|
+
.parse(this.operation.metadata));
|
|
1657
|
+
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Polls the operation until it completes.
|
|
1660
|
+
*
|
|
1661
|
+
* Throws if the operation failed.
|
|
1662
|
+
*/
|
|
1663
|
+
async wait(options) {
|
|
1664
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1665
|
+
let result;
|
|
1666
|
+
const call = async (callSignal) => {
|
|
1667
|
+
const op = await this.client.getOperation({
|
|
1668
|
+
name: this.operation.name,
|
|
1669
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1670
|
+
this.operation = op;
|
|
1671
|
+
if (op.done === undefined) {
|
|
1672
|
+
throw new Error('operation is missing the done field');
|
|
1673
|
+
}
|
|
1674
|
+
if (!op.done) {
|
|
1675
|
+
throw errStillRunning;
|
|
1676
|
+
}
|
|
1677
|
+
if (op.result?.$case === 'error') {
|
|
1678
|
+
const err = op.result.error;
|
|
1679
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1680
|
+
? err.message
|
|
1681
|
+
: 'unknown error';
|
|
1682
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1683
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1684
|
+
cause: err,
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
if (op.result?.$case !== 'response') {
|
|
1688
|
+
throw new Error('operation completed without a response');
|
|
1689
|
+
}
|
|
1690
|
+
result = z
|
|
1691
|
+
.lazy(() => unmarshalSyncedTableSchema)
|
|
1692
|
+
.parse(op.result.response);
|
|
1693
|
+
};
|
|
1694
|
+
const retryOptions = {
|
|
1695
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1696
|
+
retrier: () => retryOn({}, (err) => {
|
|
1697
|
+
return err.message.includes('operation still in progress');
|
|
1698
|
+
}),
|
|
1699
|
+
};
|
|
1700
|
+
await executeCall(call, retryOptions);
|
|
1701
|
+
if (result === undefined) {
|
|
1702
|
+
throw new Error('API call completed without a result.');
|
|
1703
|
+
}
|
|
1704
|
+
return result;
|
|
1705
|
+
}
|
|
1706
|
+
/** Checks whether the operation has completed */
|
|
1707
|
+
async done(options) {
|
|
1708
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1709
|
+
this.operation = op;
|
|
1710
|
+
return op.done;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
export class DeleteBranchOperation {
|
|
1714
|
+
client;
|
|
1715
|
+
operation;
|
|
1716
|
+
constructor(client, operation) {
|
|
1717
|
+
this.client = client;
|
|
1718
|
+
this.operation = operation;
|
|
1719
|
+
}
|
|
1720
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1721
|
+
name() {
|
|
1722
|
+
return Promise.resolve(this.operation.name);
|
|
1723
|
+
}
|
|
1724
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1725
|
+
metadata() {
|
|
1726
|
+
if (this.operation.metadata === undefined) {
|
|
1727
|
+
return Promise.resolve(undefined);
|
|
1728
|
+
}
|
|
1729
|
+
return Promise.resolve(z
|
|
1730
|
+
.lazy(() => unmarshalBranchOperationMetadataSchema)
|
|
1731
|
+
.parse(this.operation.metadata));
|
|
1732
|
+
}
|
|
1733
|
+
/**
|
|
1734
|
+
* Polls the operation until it completes.
|
|
1735
|
+
*
|
|
1736
|
+
* Throws if the operation failed.
|
|
1737
|
+
*/
|
|
1738
|
+
async wait(options) {
|
|
1739
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1740
|
+
const call = async (callSignal) => {
|
|
1741
|
+
const op = await this.client.getOperation({
|
|
1742
|
+
name: this.operation.name,
|
|
1743
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1744
|
+
this.operation = op;
|
|
1745
|
+
if (op.done === undefined) {
|
|
1746
|
+
throw new Error('operation is missing the done field');
|
|
1747
|
+
}
|
|
1748
|
+
if (!op.done) {
|
|
1749
|
+
throw errStillRunning;
|
|
1750
|
+
}
|
|
1751
|
+
if (op.result?.$case === 'error') {
|
|
1752
|
+
const err = op.result.error;
|
|
1753
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1754
|
+
? err.message
|
|
1755
|
+
: 'unknown error';
|
|
1756
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1757
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1758
|
+
cause: err,
|
|
1759
|
+
});
|
|
1760
|
+
}
|
|
1761
|
+
};
|
|
1762
|
+
const retryOptions = {
|
|
1763
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1764
|
+
retrier: () => retryOn({}, (err) => {
|
|
1765
|
+
return err.message.includes('operation still in progress');
|
|
1766
|
+
}),
|
|
1767
|
+
};
|
|
1768
|
+
await executeCall(call, retryOptions);
|
|
1769
|
+
}
|
|
1770
|
+
/** Checks whether the operation has completed */
|
|
1771
|
+
async done(options) {
|
|
1772
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1773
|
+
this.operation = op;
|
|
1774
|
+
return op.done;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
export class DeleteCatalogOperation {
|
|
1778
|
+
client;
|
|
1779
|
+
operation;
|
|
1780
|
+
constructor(client, operation) {
|
|
1781
|
+
this.client = client;
|
|
1782
|
+
this.operation = operation;
|
|
1783
|
+
}
|
|
1784
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1785
|
+
name() {
|
|
1786
|
+
return Promise.resolve(this.operation.name);
|
|
1787
|
+
}
|
|
1788
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1789
|
+
metadata() {
|
|
1790
|
+
if (this.operation.metadata === undefined) {
|
|
1791
|
+
return Promise.resolve(undefined);
|
|
1792
|
+
}
|
|
1793
|
+
return Promise.resolve(z
|
|
1794
|
+
.lazy(() => unmarshalCatalogOperationMetadataSchema)
|
|
1795
|
+
.parse(this.operation.metadata));
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* Polls the operation until it completes.
|
|
1799
|
+
*
|
|
1800
|
+
* Throws if the operation failed.
|
|
1801
|
+
*/
|
|
1802
|
+
async wait(options) {
|
|
1803
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1804
|
+
const call = async (callSignal) => {
|
|
1805
|
+
const op = await this.client.getOperation({
|
|
1806
|
+
name: this.operation.name,
|
|
1807
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1808
|
+
this.operation = op;
|
|
1809
|
+
if (op.done === undefined) {
|
|
1810
|
+
throw new Error('operation is missing the done field');
|
|
1811
|
+
}
|
|
1812
|
+
if (!op.done) {
|
|
1813
|
+
throw errStillRunning;
|
|
1814
|
+
}
|
|
1815
|
+
if (op.result?.$case === 'error') {
|
|
1816
|
+
const err = op.result.error;
|
|
1817
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1818
|
+
? err.message
|
|
1819
|
+
: 'unknown error';
|
|
1820
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1821
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1822
|
+
cause: err,
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
};
|
|
1826
|
+
const retryOptions = {
|
|
1827
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1828
|
+
retrier: () => retryOn({}, (err) => {
|
|
1829
|
+
return err.message.includes('operation still in progress');
|
|
1830
|
+
}),
|
|
1831
|
+
};
|
|
1832
|
+
await executeCall(call, retryOptions);
|
|
1833
|
+
}
|
|
1834
|
+
/** Checks whether the operation has completed */
|
|
1835
|
+
async done(options) {
|
|
1836
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1837
|
+
this.operation = op;
|
|
1838
|
+
return op.done;
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
export class DeleteDatabaseOperation {
|
|
1842
|
+
client;
|
|
1843
|
+
operation;
|
|
1844
|
+
constructor(client, operation) {
|
|
1845
|
+
this.client = client;
|
|
1846
|
+
this.operation = operation;
|
|
1847
|
+
}
|
|
1848
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1849
|
+
name() {
|
|
1850
|
+
return Promise.resolve(this.operation.name);
|
|
1851
|
+
}
|
|
1852
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1853
|
+
metadata() {
|
|
1854
|
+
if (this.operation.metadata === undefined) {
|
|
1855
|
+
return Promise.resolve(undefined);
|
|
1856
|
+
}
|
|
1857
|
+
return Promise.resolve(z
|
|
1858
|
+
.lazy(() => unmarshalDatabaseOperationMetadataSchema)
|
|
1859
|
+
.parse(this.operation.metadata));
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* Polls the operation until it completes.
|
|
1863
|
+
*
|
|
1864
|
+
* Throws if the operation failed.
|
|
1865
|
+
*/
|
|
1866
|
+
async wait(options) {
|
|
1867
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1868
|
+
const call = async (callSignal) => {
|
|
1869
|
+
const op = await this.client.getOperation({
|
|
1870
|
+
name: this.operation.name,
|
|
1871
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1872
|
+
this.operation = op;
|
|
1873
|
+
if (op.done === undefined) {
|
|
1874
|
+
throw new Error('operation is missing the done field');
|
|
1875
|
+
}
|
|
1876
|
+
if (!op.done) {
|
|
1877
|
+
throw errStillRunning;
|
|
1878
|
+
}
|
|
1879
|
+
if (op.result?.$case === 'error') {
|
|
1880
|
+
const err = op.result.error;
|
|
1881
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1882
|
+
? err.message
|
|
1883
|
+
: 'unknown error';
|
|
1884
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1885
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1886
|
+
cause: err,
|
|
1887
|
+
});
|
|
1888
|
+
}
|
|
1889
|
+
};
|
|
1890
|
+
const retryOptions = {
|
|
1891
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1892
|
+
retrier: () => retryOn({}, (err) => {
|
|
1893
|
+
return err.message.includes('operation still in progress');
|
|
1894
|
+
}),
|
|
1895
|
+
};
|
|
1896
|
+
await executeCall(call, retryOptions);
|
|
1897
|
+
}
|
|
1898
|
+
/** Checks whether the operation has completed */
|
|
1899
|
+
async done(options) {
|
|
1900
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1901
|
+
this.operation = op;
|
|
1902
|
+
return op.done;
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
export class DeleteEndpointOperation {
|
|
1906
|
+
client;
|
|
1907
|
+
operation;
|
|
1908
|
+
constructor(client, operation) {
|
|
1909
|
+
this.client = client;
|
|
1910
|
+
this.operation = operation;
|
|
1911
|
+
}
|
|
1912
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1913
|
+
name() {
|
|
1914
|
+
return Promise.resolve(this.operation.name);
|
|
1915
|
+
}
|
|
1916
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1917
|
+
metadata() {
|
|
1918
|
+
if (this.operation.metadata === undefined) {
|
|
1919
|
+
return Promise.resolve(undefined);
|
|
1920
|
+
}
|
|
1921
|
+
return Promise.resolve(z
|
|
1922
|
+
.lazy(() => unmarshalEndpointOperationMetadataSchema)
|
|
1923
|
+
.parse(this.operation.metadata));
|
|
1924
|
+
}
|
|
1925
|
+
/**
|
|
1926
|
+
* Polls the operation until it completes.
|
|
1927
|
+
*
|
|
1928
|
+
* Throws if the operation failed.
|
|
1929
|
+
*/
|
|
1930
|
+
async wait(options) {
|
|
1931
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1932
|
+
const call = async (callSignal) => {
|
|
1933
|
+
const op = await this.client.getOperation({
|
|
1934
|
+
name: this.operation.name,
|
|
1935
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
1936
|
+
this.operation = op;
|
|
1937
|
+
if (op.done === undefined) {
|
|
1938
|
+
throw new Error('operation is missing the done field');
|
|
1939
|
+
}
|
|
1940
|
+
if (!op.done) {
|
|
1941
|
+
throw errStillRunning;
|
|
1942
|
+
}
|
|
1943
|
+
if (op.result?.$case === 'error') {
|
|
1944
|
+
const err = op.result.error;
|
|
1945
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
1946
|
+
? err.message
|
|
1947
|
+
: 'unknown error';
|
|
1948
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
1949
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
1950
|
+
cause: err,
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
};
|
|
1954
|
+
const retryOptions = {
|
|
1955
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
1956
|
+
retrier: () => retryOn({}, (err) => {
|
|
1957
|
+
return err.message.includes('operation still in progress');
|
|
1958
|
+
}),
|
|
1959
|
+
};
|
|
1960
|
+
await executeCall(call, retryOptions);
|
|
1961
|
+
}
|
|
1962
|
+
/** Checks whether the operation has completed */
|
|
1963
|
+
async done(options) {
|
|
1964
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
1965
|
+
this.operation = op;
|
|
1966
|
+
return op.done;
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
export class DeleteProjectOperation {
|
|
1970
|
+
client;
|
|
1971
|
+
operation;
|
|
1972
|
+
constructor(client, operation) {
|
|
1973
|
+
this.client = client;
|
|
1974
|
+
this.operation = operation;
|
|
1975
|
+
}
|
|
1976
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
1977
|
+
name() {
|
|
1978
|
+
return Promise.resolve(this.operation.name);
|
|
1979
|
+
}
|
|
1980
|
+
/** Returns metadata associated with the long-running operation. */
|
|
1981
|
+
metadata() {
|
|
1982
|
+
if (this.operation.metadata === undefined) {
|
|
1983
|
+
return Promise.resolve(undefined);
|
|
1984
|
+
}
|
|
1985
|
+
return Promise.resolve(z
|
|
1986
|
+
.lazy(() => unmarshalProjectOperationMetadataSchema)
|
|
1987
|
+
.parse(this.operation.metadata));
|
|
1988
|
+
}
|
|
1989
|
+
/**
|
|
1990
|
+
* Polls the operation until it completes.
|
|
1991
|
+
*
|
|
1992
|
+
* Throws if the operation failed.
|
|
1993
|
+
*/
|
|
1994
|
+
async wait(options) {
|
|
1995
|
+
const errStillRunning = new Error('operation still in progress');
|
|
1996
|
+
const call = async (callSignal) => {
|
|
1997
|
+
const op = await this.client.getOperation({
|
|
1998
|
+
name: this.operation.name,
|
|
1999
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2000
|
+
this.operation = op;
|
|
2001
|
+
if (op.done === undefined) {
|
|
2002
|
+
throw new Error('operation is missing the done field');
|
|
2003
|
+
}
|
|
2004
|
+
if (!op.done) {
|
|
2005
|
+
throw errStillRunning;
|
|
2006
|
+
}
|
|
2007
|
+
if (op.result?.$case === 'error') {
|
|
2008
|
+
const err = op.result.error;
|
|
2009
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2010
|
+
? err.message
|
|
2011
|
+
: 'unknown error';
|
|
2012
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2013
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2014
|
+
cause: err,
|
|
2015
|
+
});
|
|
2016
|
+
}
|
|
2017
|
+
};
|
|
2018
|
+
const retryOptions = {
|
|
2019
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2020
|
+
retrier: () => retryOn({}, (err) => {
|
|
2021
|
+
return err.message.includes('operation still in progress');
|
|
2022
|
+
}),
|
|
2023
|
+
};
|
|
2024
|
+
await executeCall(call, retryOptions);
|
|
2025
|
+
}
|
|
2026
|
+
/** Checks whether the operation has completed */
|
|
2027
|
+
async done(options) {
|
|
2028
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2029
|
+
this.operation = op;
|
|
2030
|
+
return op.done;
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
export class DeleteRoleOperation {
|
|
2034
|
+
client;
|
|
2035
|
+
operation;
|
|
2036
|
+
constructor(client, operation) {
|
|
2037
|
+
this.client = client;
|
|
2038
|
+
this.operation = operation;
|
|
2039
|
+
}
|
|
2040
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2041
|
+
name() {
|
|
2042
|
+
return Promise.resolve(this.operation.name);
|
|
2043
|
+
}
|
|
2044
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2045
|
+
metadata() {
|
|
2046
|
+
if (this.operation.metadata === undefined) {
|
|
2047
|
+
return Promise.resolve(undefined);
|
|
2048
|
+
}
|
|
2049
|
+
return Promise.resolve(z
|
|
2050
|
+
.lazy(() => unmarshalRoleOperationMetadataSchema)
|
|
2051
|
+
.parse(this.operation.metadata));
|
|
2052
|
+
}
|
|
2053
|
+
/**
|
|
2054
|
+
* Polls the operation until it completes.
|
|
2055
|
+
*
|
|
2056
|
+
* Throws if the operation failed.
|
|
2057
|
+
*/
|
|
2058
|
+
async wait(options) {
|
|
2059
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2060
|
+
const call = async (callSignal) => {
|
|
2061
|
+
const op = await this.client.getOperation({
|
|
2062
|
+
name: this.operation.name,
|
|
2063
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2064
|
+
this.operation = op;
|
|
2065
|
+
if (op.done === undefined) {
|
|
2066
|
+
throw new Error('operation is missing the done field');
|
|
2067
|
+
}
|
|
2068
|
+
if (!op.done) {
|
|
2069
|
+
throw errStillRunning;
|
|
2070
|
+
}
|
|
2071
|
+
if (op.result?.$case === 'error') {
|
|
2072
|
+
const err = op.result.error;
|
|
2073
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2074
|
+
? err.message
|
|
2075
|
+
: 'unknown error';
|
|
2076
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2077
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2078
|
+
cause: err,
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
const retryOptions = {
|
|
2083
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2084
|
+
retrier: () => retryOn({}, (err) => {
|
|
2085
|
+
return err.message.includes('operation still in progress');
|
|
2086
|
+
}),
|
|
2087
|
+
};
|
|
2088
|
+
await executeCall(call, retryOptions);
|
|
2089
|
+
}
|
|
2090
|
+
/** Checks whether the operation has completed */
|
|
2091
|
+
async done(options) {
|
|
2092
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2093
|
+
this.operation = op;
|
|
2094
|
+
return op.done;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
export class DeleteSyncedTableOperation {
|
|
2098
|
+
client;
|
|
2099
|
+
operation;
|
|
2100
|
+
constructor(client, operation) {
|
|
2101
|
+
this.client = client;
|
|
2102
|
+
this.operation = operation;
|
|
2103
|
+
}
|
|
2104
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2105
|
+
name() {
|
|
2106
|
+
return Promise.resolve(this.operation.name);
|
|
2107
|
+
}
|
|
2108
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2109
|
+
metadata() {
|
|
2110
|
+
if (this.operation.metadata === undefined) {
|
|
2111
|
+
return Promise.resolve(undefined);
|
|
2112
|
+
}
|
|
2113
|
+
return Promise.resolve(z
|
|
2114
|
+
.lazy(() => unmarshalSyncedTableOperationMetadataSchema)
|
|
2115
|
+
.parse(this.operation.metadata));
|
|
2116
|
+
}
|
|
2117
|
+
/**
|
|
2118
|
+
* Polls the operation until it completes.
|
|
2119
|
+
*
|
|
2120
|
+
* Throws if the operation failed.
|
|
2121
|
+
*/
|
|
2122
|
+
async wait(options) {
|
|
2123
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2124
|
+
const call = async (callSignal) => {
|
|
2125
|
+
const op = await this.client.getOperation({
|
|
2126
|
+
name: this.operation.name,
|
|
2127
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2128
|
+
this.operation = op;
|
|
2129
|
+
if (op.done === undefined) {
|
|
2130
|
+
throw new Error('operation is missing the done field');
|
|
2131
|
+
}
|
|
2132
|
+
if (!op.done) {
|
|
2133
|
+
throw errStillRunning;
|
|
2134
|
+
}
|
|
2135
|
+
if (op.result?.$case === 'error') {
|
|
2136
|
+
const err = op.result.error;
|
|
2137
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2138
|
+
? err.message
|
|
2139
|
+
: 'unknown error';
|
|
2140
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2141
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2142
|
+
cause: err,
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2146
|
+
const retryOptions = {
|
|
2147
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2148
|
+
retrier: () => retryOn({}, (err) => {
|
|
2149
|
+
return err.message.includes('operation still in progress');
|
|
2150
|
+
}),
|
|
2151
|
+
};
|
|
2152
|
+
await executeCall(call, retryOptions);
|
|
2153
|
+
}
|
|
2154
|
+
/** Checks whether the operation has completed */
|
|
2155
|
+
async done(options) {
|
|
2156
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2157
|
+
this.operation = op;
|
|
2158
|
+
return op.done;
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
export class UndeleteBranchOperation {
|
|
2162
|
+
client;
|
|
2163
|
+
operation;
|
|
2164
|
+
constructor(client, operation) {
|
|
2165
|
+
this.client = client;
|
|
2166
|
+
this.operation = operation;
|
|
2167
|
+
}
|
|
2168
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2169
|
+
name() {
|
|
2170
|
+
return Promise.resolve(this.operation.name);
|
|
2171
|
+
}
|
|
2172
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2173
|
+
metadata() {
|
|
2174
|
+
if (this.operation.metadata === undefined) {
|
|
2175
|
+
return Promise.resolve(undefined);
|
|
2176
|
+
}
|
|
2177
|
+
return Promise.resolve(z
|
|
2178
|
+
.lazy(() => unmarshalBranchOperationMetadataSchema)
|
|
2179
|
+
.parse(this.operation.metadata));
|
|
2180
|
+
}
|
|
2181
|
+
/**
|
|
2182
|
+
* Polls the operation until it completes.
|
|
2183
|
+
*
|
|
2184
|
+
* Throws if the operation failed.
|
|
2185
|
+
*/
|
|
2186
|
+
async wait(options) {
|
|
2187
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2188
|
+
const call = async (callSignal) => {
|
|
2189
|
+
const op = await this.client.getOperation({
|
|
2190
|
+
name: this.operation.name,
|
|
2191
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2192
|
+
this.operation = op;
|
|
2193
|
+
if (op.done === undefined) {
|
|
2194
|
+
throw new Error('operation is missing the done field');
|
|
2195
|
+
}
|
|
2196
|
+
if (!op.done) {
|
|
2197
|
+
throw errStillRunning;
|
|
2198
|
+
}
|
|
2199
|
+
if (op.result?.$case === 'error') {
|
|
2200
|
+
const err = op.result.error;
|
|
2201
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2202
|
+
? err.message
|
|
2203
|
+
: 'unknown error';
|
|
2204
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2205
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2206
|
+
cause: err,
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
};
|
|
2210
|
+
const retryOptions = {
|
|
2211
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2212
|
+
retrier: () => retryOn({}, (err) => {
|
|
2213
|
+
return err.message.includes('operation still in progress');
|
|
2214
|
+
}),
|
|
2215
|
+
};
|
|
2216
|
+
await executeCall(call, retryOptions);
|
|
2217
|
+
}
|
|
2218
|
+
/** Checks whether the operation has completed */
|
|
2219
|
+
async done(options) {
|
|
2220
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2221
|
+
this.operation = op;
|
|
2222
|
+
return op.done;
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
export class UndeleteProjectOperation {
|
|
2226
|
+
client;
|
|
2227
|
+
operation;
|
|
2228
|
+
constructor(client, operation) {
|
|
2229
|
+
this.client = client;
|
|
2230
|
+
this.operation = operation;
|
|
2231
|
+
}
|
|
2232
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2233
|
+
name() {
|
|
2234
|
+
return Promise.resolve(this.operation.name);
|
|
2235
|
+
}
|
|
2236
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2237
|
+
metadata() {
|
|
2238
|
+
if (this.operation.metadata === undefined) {
|
|
2239
|
+
return Promise.resolve(undefined);
|
|
2240
|
+
}
|
|
2241
|
+
return Promise.resolve(z
|
|
2242
|
+
.lazy(() => unmarshalProjectOperationMetadataSchema)
|
|
2243
|
+
.parse(this.operation.metadata));
|
|
2244
|
+
}
|
|
2245
|
+
/**
|
|
2246
|
+
* Polls the operation until it completes.
|
|
2247
|
+
*
|
|
2248
|
+
* Throws if the operation failed.
|
|
2249
|
+
*/
|
|
2250
|
+
async wait(options) {
|
|
2251
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2252
|
+
const call = async (callSignal) => {
|
|
2253
|
+
const op = await this.client.getOperation({
|
|
2254
|
+
name: this.operation.name,
|
|
2255
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2256
|
+
this.operation = op;
|
|
2257
|
+
if (op.done === undefined) {
|
|
2258
|
+
throw new Error('operation is missing the done field');
|
|
2259
|
+
}
|
|
2260
|
+
if (!op.done) {
|
|
2261
|
+
throw errStillRunning;
|
|
2262
|
+
}
|
|
2263
|
+
if (op.result?.$case === 'error') {
|
|
2264
|
+
const err = op.result.error;
|
|
2265
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2266
|
+
? err.message
|
|
2267
|
+
: 'unknown error';
|
|
2268
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2269
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2270
|
+
cause: err,
|
|
2271
|
+
});
|
|
2272
|
+
}
|
|
2273
|
+
};
|
|
2274
|
+
const retryOptions = {
|
|
2275
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2276
|
+
retrier: () => retryOn({}, (err) => {
|
|
2277
|
+
return err.message.includes('operation still in progress');
|
|
2278
|
+
}),
|
|
2279
|
+
};
|
|
2280
|
+
await executeCall(call, retryOptions);
|
|
2281
|
+
}
|
|
2282
|
+
/** Checks whether the operation has completed */
|
|
2283
|
+
async done(options) {
|
|
2284
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2285
|
+
this.operation = op;
|
|
2286
|
+
return op.done;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
export class UpdateBranchOperation {
|
|
2290
|
+
client;
|
|
2291
|
+
operation;
|
|
2292
|
+
constructor(client, operation) {
|
|
2293
|
+
this.client = client;
|
|
2294
|
+
this.operation = operation;
|
|
2295
|
+
}
|
|
2296
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2297
|
+
name() {
|
|
2298
|
+
return Promise.resolve(this.operation.name);
|
|
2299
|
+
}
|
|
2300
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2301
|
+
metadata() {
|
|
2302
|
+
if (this.operation.metadata === undefined) {
|
|
2303
|
+
return Promise.resolve(undefined);
|
|
2304
|
+
}
|
|
2305
|
+
return Promise.resolve(z
|
|
2306
|
+
.lazy(() => unmarshalBranchOperationMetadataSchema)
|
|
2307
|
+
.parse(this.operation.metadata));
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* Polls the operation until it completes.
|
|
2311
|
+
*
|
|
2312
|
+
* Throws if the operation failed.
|
|
2313
|
+
*/
|
|
2314
|
+
async wait(options) {
|
|
2315
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2316
|
+
let result;
|
|
2317
|
+
const call = async (callSignal) => {
|
|
2318
|
+
const op = await this.client.getOperation({
|
|
2319
|
+
name: this.operation.name,
|
|
2320
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2321
|
+
this.operation = op;
|
|
2322
|
+
if (op.done === undefined) {
|
|
2323
|
+
throw new Error('operation is missing the done field');
|
|
2324
|
+
}
|
|
2325
|
+
if (!op.done) {
|
|
2326
|
+
throw errStillRunning;
|
|
2327
|
+
}
|
|
2328
|
+
if (op.result?.$case === 'error') {
|
|
2329
|
+
const err = op.result.error;
|
|
2330
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2331
|
+
? err.message
|
|
2332
|
+
: 'unknown error';
|
|
2333
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2334
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2335
|
+
cause: err,
|
|
2336
|
+
});
|
|
2337
|
+
}
|
|
2338
|
+
if (op.result?.$case !== 'response') {
|
|
2339
|
+
throw new Error('operation completed without a response');
|
|
2340
|
+
}
|
|
2341
|
+
result = z.lazy(() => unmarshalBranchSchema).parse(op.result.response);
|
|
2342
|
+
};
|
|
2343
|
+
const retryOptions = {
|
|
2344
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2345
|
+
retrier: () => retryOn({}, (err) => {
|
|
2346
|
+
return err.message.includes('operation still in progress');
|
|
2347
|
+
}),
|
|
2348
|
+
};
|
|
2349
|
+
await executeCall(call, retryOptions);
|
|
2350
|
+
if (result === undefined) {
|
|
2351
|
+
throw new Error('API call completed without a result.');
|
|
2352
|
+
}
|
|
2353
|
+
return result;
|
|
2354
|
+
}
|
|
2355
|
+
/** Checks whether the operation has completed */
|
|
2356
|
+
async done(options) {
|
|
2357
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2358
|
+
this.operation = op;
|
|
2359
|
+
return op.done;
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
export class UpdateDatabaseOperation {
|
|
2363
|
+
client;
|
|
2364
|
+
operation;
|
|
2365
|
+
constructor(client, operation) {
|
|
2366
|
+
this.client = client;
|
|
2367
|
+
this.operation = operation;
|
|
2368
|
+
}
|
|
2369
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2370
|
+
name() {
|
|
2371
|
+
return Promise.resolve(this.operation.name);
|
|
2372
|
+
}
|
|
2373
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2374
|
+
metadata() {
|
|
2375
|
+
if (this.operation.metadata === undefined) {
|
|
2376
|
+
return Promise.resolve(undefined);
|
|
2377
|
+
}
|
|
2378
|
+
return Promise.resolve(z
|
|
2379
|
+
.lazy(() => unmarshalDatabaseOperationMetadataSchema)
|
|
2380
|
+
.parse(this.operation.metadata));
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2383
|
+
* Polls the operation until it completes.
|
|
2384
|
+
*
|
|
2385
|
+
* Throws if the operation failed.
|
|
2386
|
+
*/
|
|
2387
|
+
async wait(options) {
|
|
2388
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2389
|
+
let result;
|
|
2390
|
+
const call = async (callSignal) => {
|
|
2391
|
+
const op = await this.client.getOperation({
|
|
2392
|
+
name: this.operation.name,
|
|
2393
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2394
|
+
this.operation = op;
|
|
2395
|
+
if (op.done === undefined) {
|
|
2396
|
+
throw new Error('operation is missing the done field');
|
|
2397
|
+
}
|
|
2398
|
+
if (!op.done) {
|
|
2399
|
+
throw errStillRunning;
|
|
2400
|
+
}
|
|
2401
|
+
if (op.result?.$case === 'error') {
|
|
2402
|
+
const err = op.result.error;
|
|
2403
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2404
|
+
? err.message
|
|
2405
|
+
: 'unknown error';
|
|
2406
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2407
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2408
|
+
cause: err,
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
if (op.result?.$case !== 'response') {
|
|
2412
|
+
throw new Error('operation completed without a response');
|
|
2413
|
+
}
|
|
2414
|
+
result = z.lazy(() => unmarshalDatabaseSchema).parse(op.result.response);
|
|
2415
|
+
};
|
|
2416
|
+
const retryOptions = {
|
|
2417
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2418
|
+
retrier: () => retryOn({}, (err) => {
|
|
2419
|
+
return err.message.includes('operation still in progress');
|
|
2420
|
+
}),
|
|
2421
|
+
};
|
|
2422
|
+
await executeCall(call, retryOptions);
|
|
2423
|
+
if (result === undefined) {
|
|
2424
|
+
throw new Error('API call completed without a result.');
|
|
2425
|
+
}
|
|
2426
|
+
return result;
|
|
2427
|
+
}
|
|
2428
|
+
/** Checks whether the operation has completed */
|
|
2429
|
+
async done(options) {
|
|
2430
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2431
|
+
this.operation = op;
|
|
2432
|
+
return op.done;
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
export class UpdateEndpointOperation {
|
|
2436
|
+
client;
|
|
2437
|
+
operation;
|
|
2438
|
+
constructor(client, operation) {
|
|
2439
|
+
this.client = client;
|
|
2440
|
+
this.operation = operation;
|
|
2441
|
+
}
|
|
2442
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2443
|
+
name() {
|
|
2444
|
+
return Promise.resolve(this.operation.name);
|
|
2445
|
+
}
|
|
2446
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2447
|
+
metadata() {
|
|
2448
|
+
if (this.operation.metadata === undefined) {
|
|
2449
|
+
return Promise.resolve(undefined);
|
|
2450
|
+
}
|
|
2451
|
+
return Promise.resolve(z
|
|
2452
|
+
.lazy(() => unmarshalEndpointOperationMetadataSchema)
|
|
2453
|
+
.parse(this.operation.metadata));
|
|
2454
|
+
}
|
|
2455
|
+
/**
|
|
2456
|
+
* Polls the operation until it completes.
|
|
2457
|
+
*
|
|
2458
|
+
* Throws if the operation failed.
|
|
2459
|
+
*/
|
|
2460
|
+
async wait(options) {
|
|
2461
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2462
|
+
let result;
|
|
2463
|
+
const call = async (callSignal) => {
|
|
2464
|
+
const op = await this.client.getOperation({
|
|
2465
|
+
name: this.operation.name,
|
|
2466
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2467
|
+
this.operation = op;
|
|
2468
|
+
if (op.done === undefined) {
|
|
2469
|
+
throw new Error('operation is missing the done field');
|
|
2470
|
+
}
|
|
2471
|
+
if (!op.done) {
|
|
2472
|
+
throw errStillRunning;
|
|
2473
|
+
}
|
|
2474
|
+
if (op.result?.$case === 'error') {
|
|
2475
|
+
const err = op.result.error;
|
|
2476
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2477
|
+
? err.message
|
|
2478
|
+
: 'unknown error';
|
|
2479
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2480
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2481
|
+
cause: err,
|
|
2482
|
+
});
|
|
2483
|
+
}
|
|
2484
|
+
if (op.result?.$case !== 'response') {
|
|
2485
|
+
throw new Error('operation completed without a response');
|
|
2486
|
+
}
|
|
2487
|
+
result = z.lazy(() => unmarshalEndpointSchema).parse(op.result.response);
|
|
2488
|
+
};
|
|
2489
|
+
const retryOptions = {
|
|
2490
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2491
|
+
retrier: () => retryOn({}, (err) => {
|
|
2492
|
+
return err.message.includes('operation still in progress');
|
|
2493
|
+
}),
|
|
2494
|
+
};
|
|
2495
|
+
await executeCall(call, retryOptions);
|
|
2496
|
+
if (result === undefined) {
|
|
2497
|
+
throw new Error('API call completed without a result.');
|
|
2498
|
+
}
|
|
2499
|
+
return result;
|
|
2500
|
+
}
|
|
2501
|
+
/** Checks whether the operation has completed */
|
|
2502
|
+
async done(options) {
|
|
2503
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2504
|
+
this.operation = op;
|
|
2505
|
+
return op.done;
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
export class UpdateProjectOperation {
|
|
2509
|
+
client;
|
|
2510
|
+
operation;
|
|
2511
|
+
constructor(client, operation) {
|
|
2512
|
+
this.client = client;
|
|
2513
|
+
this.operation = operation;
|
|
2514
|
+
}
|
|
2515
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2516
|
+
name() {
|
|
2517
|
+
return Promise.resolve(this.operation.name);
|
|
2518
|
+
}
|
|
2519
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2520
|
+
metadata() {
|
|
2521
|
+
if (this.operation.metadata === undefined) {
|
|
2522
|
+
return Promise.resolve(undefined);
|
|
2523
|
+
}
|
|
2524
|
+
return Promise.resolve(z
|
|
2525
|
+
.lazy(() => unmarshalProjectOperationMetadataSchema)
|
|
2526
|
+
.parse(this.operation.metadata));
|
|
2527
|
+
}
|
|
2528
|
+
/**
|
|
2529
|
+
* Polls the operation until it completes.
|
|
2530
|
+
*
|
|
2531
|
+
* Throws if the operation failed.
|
|
2532
|
+
*/
|
|
2533
|
+
async wait(options) {
|
|
2534
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2535
|
+
let result;
|
|
2536
|
+
const call = async (callSignal) => {
|
|
2537
|
+
const op = await this.client.getOperation({
|
|
2538
|
+
name: this.operation.name,
|
|
2539
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2540
|
+
this.operation = op;
|
|
2541
|
+
if (op.done === undefined) {
|
|
2542
|
+
throw new Error('operation is missing the done field');
|
|
2543
|
+
}
|
|
2544
|
+
if (!op.done) {
|
|
2545
|
+
throw errStillRunning;
|
|
2546
|
+
}
|
|
2547
|
+
if (op.result?.$case === 'error') {
|
|
2548
|
+
const err = op.result.error;
|
|
2549
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2550
|
+
? err.message
|
|
2551
|
+
: 'unknown error';
|
|
2552
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2553
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2554
|
+
cause: err,
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
if (op.result?.$case !== 'response') {
|
|
2558
|
+
throw new Error('operation completed without a response');
|
|
2559
|
+
}
|
|
2560
|
+
result = z.lazy(() => unmarshalProjectSchema).parse(op.result.response);
|
|
2561
|
+
};
|
|
2562
|
+
const retryOptions = {
|
|
2563
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2564
|
+
retrier: () => retryOn({}, (err) => {
|
|
2565
|
+
return err.message.includes('operation still in progress');
|
|
2566
|
+
}),
|
|
2567
|
+
};
|
|
2568
|
+
await executeCall(call, retryOptions);
|
|
2569
|
+
if (result === undefined) {
|
|
2570
|
+
throw new Error('API call completed without a result.');
|
|
2571
|
+
}
|
|
2572
|
+
return result;
|
|
2573
|
+
}
|
|
2574
|
+
/** Checks whether the operation has completed */
|
|
2575
|
+
async done(options) {
|
|
2576
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2577
|
+
this.operation = op;
|
|
2578
|
+
return op.done;
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
export class UpdateRoleOperation {
|
|
2582
|
+
client;
|
|
2583
|
+
operation;
|
|
2584
|
+
constructor(client, operation) {
|
|
2585
|
+
this.client = client;
|
|
2586
|
+
this.operation = operation;
|
|
2587
|
+
}
|
|
2588
|
+
/** Returns the server-assigned name of the long-running operation. */
|
|
2589
|
+
name() {
|
|
2590
|
+
return Promise.resolve(this.operation.name);
|
|
2591
|
+
}
|
|
2592
|
+
/** Returns metadata associated with the long-running operation. */
|
|
2593
|
+
metadata() {
|
|
2594
|
+
if (this.operation.metadata === undefined) {
|
|
2595
|
+
return Promise.resolve(undefined);
|
|
2596
|
+
}
|
|
2597
|
+
return Promise.resolve(z
|
|
2598
|
+
.lazy(() => unmarshalRoleOperationMetadataSchema)
|
|
2599
|
+
.parse(this.operation.metadata));
|
|
2600
|
+
}
|
|
2601
|
+
/**
|
|
2602
|
+
* Polls the operation until it completes.
|
|
2603
|
+
*
|
|
2604
|
+
* Throws if the operation failed.
|
|
2605
|
+
*/
|
|
2606
|
+
async wait(options) {
|
|
2607
|
+
const errStillRunning = new Error('operation still in progress');
|
|
2608
|
+
let result;
|
|
2609
|
+
const call = async (callSignal) => {
|
|
2610
|
+
const op = await this.client.getOperation({
|
|
2611
|
+
name: this.operation.name,
|
|
2612
|
+
}, { ...options, ...(callSignal !== undefined && { signal: callSignal }) });
|
|
2613
|
+
this.operation = op;
|
|
2614
|
+
if (op.done === undefined) {
|
|
2615
|
+
throw new Error('operation is missing the done field');
|
|
2616
|
+
}
|
|
2617
|
+
if (!op.done) {
|
|
2618
|
+
throw errStillRunning;
|
|
2619
|
+
}
|
|
2620
|
+
if (op.result?.$case === 'error') {
|
|
2621
|
+
const err = op.result.error;
|
|
2622
|
+
const msg = err.message !== undefined && err.message !== ''
|
|
2623
|
+
? err.message
|
|
2624
|
+
: 'unknown error';
|
|
2625
|
+
const errorMsg = err.errorCode !== undefined ? `[${err.errorCode}] ${msg}` : msg;
|
|
2626
|
+
throw new Error(`operation failed: ${errorMsg}`, {
|
|
2627
|
+
cause: err,
|
|
2628
|
+
});
|
|
2629
|
+
}
|
|
2630
|
+
if (op.result?.$case !== 'response') {
|
|
2631
|
+
throw new Error('operation completed without a response');
|
|
2632
|
+
}
|
|
2633
|
+
result = z.lazy(() => unmarshalRoleSchema).parse(op.result.response);
|
|
2634
|
+
};
|
|
2635
|
+
const retryOptions = {
|
|
2636
|
+
...(options?.signal !== undefined && { signal: options.signal }),
|
|
2637
|
+
retrier: () => retryOn({}, (err) => {
|
|
2638
|
+
return err.message.includes('operation still in progress');
|
|
2639
|
+
}),
|
|
2640
|
+
};
|
|
2641
|
+
await executeCall(call, retryOptions);
|
|
2642
|
+
if (result === undefined) {
|
|
2643
|
+
throw new Error('API call completed without a result.');
|
|
2644
|
+
}
|
|
2645
|
+
return result;
|
|
2646
|
+
}
|
|
2647
|
+
/** Checks whether the operation has completed */
|
|
2648
|
+
async done(options) {
|
|
2649
|
+
const op = await this.client.getOperation({ name: this.operation.name }, options);
|
|
2650
|
+
this.operation = op;
|
|
2651
|
+
return op.done;
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
//# sourceMappingURL=client.js.map
|