@databricks/sdk-uc-tables 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.
@@ -0,0 +1,567 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+
3
+ import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
4
+ import type {Call} from '@databricks/sdk-core/api';
5
+ import {createDefault} from '@databricks/sdk-core/clientinfo';
6
+ import type {Logger} from '@databricks/sdk-core/logger';
7
+ import {NoOpLogger} from '@databricks/sdk-core/logger';
8
+ import type {CallOptions} from '@databricks/sdk-options/call';
9
+ import type {ClientOptions} from '@databricks/sdk-options/client';
10
+ import type {HttpClient} from '@databricks/sdk-core/http';
11
+ import {newHttpClient} from './transport';
12
+ import {
13
+ buildHttpRequest,
14
+ executeCall,
15
+ executeHttpCall,
16
+ marshalRequest,
17
+ parseResponse,
18
+ } from './utils';
19
+ import pkgJson from '../../package.json' with {type: 'json'};
20
+ import type {
21
+ CreateTableConstraintRequest,
22
+ CreateTableRequest,
23
+ DeleteTableConstraintRequest,
24
+ DeleteTableConstraintRequest_Response,
25
+ DeleteTableRequest,
26
+ DeleteTableRequest_Response,
27
+ GetTableRequest,
28
+ ListTableSummariesRequest,
29
+ ListTableSummariesRequest_Response,
30
+ ListTablesRequest,
31
+ ListTablesRequest_Response,
32
+ TableConstraint,
33
+ TableExistsRequest,
34
+ TableExistsRequest_Response,
35
+ TableInfo,
36
+ TableSummary,
37
+ UpdateTableRequest,
38
+ UpdateTableRequest_Response,
39
+ } from './model';
40
+ import {
41
+ marshalCreateTableConstraintRequestSchema,
42
+ marshalCreateTableRequestSchema,
43
+ marshalUpdateTableRequestSchema,
44
+ unmarshalDeleteTableConstraintRequest_ResponseSchema,
45
+ unmarshalDeleteTableRequest_ResponseSchema,
46
+ unmarshalListTableSummariesRequest_ResponseSchema,
47
+ unmarshalListTablesRequest_ResponseSchema,
48
+ unmarshalTableConstraintSchema,
49
+ unmarshalTableExistsRequest_ResponseSchema,
50
+ unmarshalTableInfoSchema,
51
+ unmarshalUpdateTableRequest_ResponseSchema,
52
+ } from './model';
53
+
54
+ // Package identity segment for this client to be used in the User-Agent header.
55
+ const PACKAGE_SEGMENT = {
56
+ key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
57
+ value: pkgJson.version,
58
+ };
59
+
60
+ export class TablesClient {
61
+ private readonly host: string;
62
+ // Workspace ID used to route workspace-level calls on unified hosts (SPOG).
63
+ // When set, workspace-level methods send X-Databricks-Org-Id on every
64
+ // request.
65
+ private readonly workspaceId: string | undefined;
66
+ private readonly httpClient: HttpClient;
67
+ private readonly logger: Logger;
68
+ // User-Agent header value. Composed once at construction from
69
+ // createDefault() merged with this package's identity and the active
70
+ // credential's name.
71
+ private readonly userAgent: string;
72
+
73
+ constructor(options: ClientOptions) {
74
+ if (options.host === undefined) {
75
+ throw new Error('Host is required.');
76
+ }
77
+ this.host = options.host.replace(/\/$/, '');
78
+ this.workspaceId = options.workspaceId;
79
+ this.logger = options.logger ?? new NoOpLogger();
80
+ const info = createDefault()
81
+ .with(PACKAGE_SEGMENT)
82
+ .with({key: 'sdk-js-auth', value: AUTH_VERSION})
83
+ .with({key: 'auth', value: options.credentials?.name() ?? 'default'});
84
+ this.userAgent = info.toString();
85
+ this.httpClient = newHttpClient(options);
86
+ }
87
+
88
+ /**
89
+ * Creates a new table in the specified catalog and schema.
90
+ *
91
+ * To create an external delta table, the caller must have the **EXTERNAL_USE_SCHEMA** privilege on the parent schema
92
+ * and the **EXTERNAL_USE_LOCATION** privilege on the external location. These privileges must always be granted explicitly,
93
+ * and cannot be inherited through ownership or **ALL_PRIVILEGES**.
94
+ *
95
+ * Standard UC permissions needed to create tables still apply: **USE_CATALOG** on the parent catalog (or ownership of
96
+ * the parent catalog), **CREATE_TABLE** and **USE_SCHEMA** on the parent schema (or ownership of the parent schema),
97
+ * and **CREATE_EXTERNAL_TABLE** on external location.
98
+ *
99
+ * The **columns** field needs to be in a Spark compatible format, so we recommend you use Spark to create these tables.
100
+ * The API itself does not validate the correctness of the column spec. If the spec is not Spark compatible,
101
+ * the tables may not be readable by Databricks Runtime.
102
+ *
103
+ *
104
+ *
105
+ *
106
+ *
107
+ *
108
+ *
109
+ * NOTE: The Create Table API for external clients only supports creating **external delta tables**. The values shown
110
+ * in the respective enums are all values supported by <Databricks>, however for this specific Create Table API,
111
+ * only **table_type** **EXTERNAL** and **data_source_format** **DELTA** are supported. Additionally, column masks
112
+ * are not supported when creating tables through this API.
113
+ */
114
+ async createTable(
115
+ req: CreateTableRequest,
116
+ options?: CallOptions
117
+ ): Promise<TableInfo> {
118
+ const url = `${this.host}/api/2.1/unity-catalog/tables`;
119
+ const body = marshalRequest(req, marshalCreateTableRequestSchema);
120
+ let resp: TableInfo | undefined;
121
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
122
+ const headers = new Headers({'Content-Type': 'application/json'});
123
+ if (this.workspaceId !== undefined) {
124
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
125
+ }
126
+ headers.set('User-Agent', this.userAgent);
127
+ const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
128
+ const respBody = await executeHttpCall({
129
+ request: httpReq,
130
+ httpClient: this.httpClient,
131
+ logger: this.logger,
132
+ });
133
+ resp = parseResponse(respBody, unmarshalTableInfoSchema);
134
+ };
135
+ await executeCall(call, options);
136
+ if (resp === undefined) {
137
+ throw new Error('API call completed without a result.');
138
+ }
139
+ return resp;
140
+ }
141
+
142
+ /**
143
+ * Creates a new table constraint.
144
+ *
145
+ * For the table constraint creation to succeed, the user must satisfy both of these conditions:
146
+ * - the user must have the **USE_CATALOG** privilege on the table's parent catalog,
147
+ * the **USE_SCHEMA** privilege on the table's parent schema, and be the owner of the table.
148
+ * - if the new constraint is a __ForeignKeyConstraint__,
149
+ * the user must have the **USE_CATALOG** privilege on the referenced parent table's catalog,
150
+ * the **USE_SCHEMA** privilege on the referenced parent table's schema,
151
+ * and be the owner of the referenced parent table.
152
+ */
153
+ async createTableConstraint(
154
+ req: CreateTableConstraintRequest,
155
+ options?: CallOptions
156
+ ): Promise<TableConstraint> {
157
+ const url = `${this.host}/api/2.1/unity-catalog/constraints`;
158
+ const body = marshalRequest(req, marshalCreateTableConstraintRequestSchema);
159
+ let resp: TableConstraint | undefined;
160
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
161
+ const headers = new Headers({'Content-Type': 'application/json'});
162
+ if (this.workspaceId !== undefined) {
163
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
164
+ }
165
+ headers.set('User-Agent', this.userAgent);
166
+ const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
167
+ const respBody = await executeHttpCall({
168
+ request: httpReq,
169
+ httpClient: this.httpClient,
170
+ logger: this.logger,
171
+ });
172
+ resp = parseResponse(respBody, unmarshalTableConstraintSchema);
173
+ };
174
+ await executeCall(call, options);
175
+ if (resp === undefined) {
176
+ throw new Error('API call completed without a result.');
177
+ }
178
+ return resp;
179
+ }
180
+
181
+ /**
182
+ * Deletes a table from the specified parent catalog and schema.
183
+ * The caller must be the owner of the parent catalog, have the **USE_CATALOG** privilege on the parent catalog and be the owner of the parent schema,
184
+ * or be the owner of the table and have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
185
+ */
186
+ async deleteTable(
187
+ req: DeleteTableRequest,
188
+ options?: CallOptions
189
+ ): Promise<DeleteTableRequest_Response> {
190
+ const url = `${this.host}/api/2.1/unity-catalog/tables/${req.fullNameArg ?? ''}`;
191
+ let resp: DeleteTableRequest_Response | undefined;
192
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
193
+ const headers = new Headers();
194
+ if (this.workspaceId !== undefined) {
195
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
196
+ }
197
+ headers.set('User-Agent', this.userAgent);
198
+ const httpReq = buildHttpRequest('DELETE', url, headers, callSignal);
199
+ const respBody = await executeHttpCall({
200
+ request: httpReq,
201
+ httpClient: this.httpClient,
202
+ logger: this.logger,
203
+ });
204
+ resp = parseResponse(
205
+ respBody,
206
+ unmarshalDeleteTableRequest_ResponseSchema
207
+ );
208
+ };
209
+ await executeCall(call, options);
210
+ if (resp === undefined) {
211
+ throw new Error('API call completed without a result.');
212
+ }
213
+ return resp;
214
+ }
215
+
216
+ /**
217
+ * Deletes a table constraint.
218
+ *
219
+ * For the table constraint deletion to succeed, the user must satisfy both of these conditions:
220
+ * - the user must have the **USE_CATALOG** privilege on the table's parent catalog,
221
+ * the **USE_SCHEMA** privilege on the table's parent schema, and be the owner of the table.
222
+ * - if __cascade__ argument is **true**, the user must have the following permissions on all of the child tables:
223
+ * the **USE_CATALOG** privilege on the table's catalog,
224
+ * the **USE_SCHEMA** privilege on the table's schema,
225
+ * and be the owner of the table.
226
+ */
227
+ async deleteTableConstraint(
228
+ req: DeleteTableConstraintRequest,
229
+ options?: CallOptions
230
+ ): Promise<DeleteTableConstraintRequest_Response> {
231
+ const url = `${this.host}/api/2.1/unity-catalog/constraints/${req.fullNameArg ?? ''}`;
232
+ const params = new URLSearchParams();
233
+ if (req.constraintName !== undefined) {
234
+ params.append('constraint_name', req.constraintName);
235
+ }
236
+ if (req.cascade !== undefined) {
237
+ params.append('cascade', String(req.cascade));
238
+ }
239
+ const query = params.toString();
240
+ const fullUrl = query !== '' ? `${url}?${query}` : url;
241
+ let resp: DeleteTableConstraintRequest_Response | undefined;
242
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
243
+ const headers = new Headers();
244
+ if (this.workspaceId !== undefined) {
245
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
246
+ }
247
+ headers.set('User-Agent', this.userAgent);
248
+ const httpReq = buildHttpRequest('DELETE', fullUrl, headers, callSignal);
249
+ const respBody = await executeHttpCall({
250
+ request: httpReq,
251
+ httpClient: this.httpClient,
252
+ logger: this.logger,
253
+ });
254
+ resp = parseResponse(
255
+ respBody,
256
+ unmarshalDeleteTableConstraintRequest_ResponseSchema
257
+ );
258
+ };
259
+ await executeCall(call, options);
260
+ if (resp === undefined) {
261
+ throw new Error('API call completed without a result.');
262
+ }
263
+ return resp;
264
+ }
265
+
266
+ /**
267
+ * Gets a table from the metastore for a specific catalog and schema.
268
+ * The caller must satisfy one of the following requirements:
269
+ * * Be a metastore admin
270
+ * * Be the owner of the parent catalog
271
+ * * Be the owner of the parent schema and have the **USE_CATALOG** privilege on the parent catalog
272
+ * * Have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema,
273
+ * and either be the table owner or have the **SELECT** privilege on the table.
274
+ */
275
+ async getTable(
276
+ req: GetTableRequest,
277
+ options?: CallOptions
278
+ ): Promise<TableInfo> {
279
+ const url = `${this.host}/api/2.1/unity-catalog/tables/${req.fullNameArg ?? ''}`;
280
+ const params = new URLSearchParams();
281
+ if (req.includeDeltaMetadata !== undefined) {
282
+ params.append('include_delta_metadata', String(req.includeDeltaMetadata));
283
+ }
284
+ if (req.includeBrowse !== undefined) {
285
+ params.append('include_browse', String(req.includeBrowse));
286
+ }
287
+ if (req.includeManifestCapabilities !== undefined) {
288
+ params.append(
289
+ 'include_manifest_capabilities',
290
+ String(req.includeManifestCapabilities)
291
+ );
292
+ }
293
+ const query = params.toString();
294
+ const fullUrl = query !== '' ? `${url}?${query}` : url;
295
+ let resp: TableInfo | undefined;
296
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
297
+ const headers = new Headers();
298
+ if (this.workspaceId !== undefined) {
299
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
300
+ }
301
+ headers.set('User-Agent', this.userAgent);
302
+ const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
303
+ const respBody = await executeHttpCall({
304
+ request: httpReq,
305
+ httpClient: this.httpClient,
306
+ logger: this.logger,
307
+ });
308
+ resp = parseResponse(respBody, unmarshalTableInfoSchema);
309
+ };
310
+ await executeCall(call, options);
311
+ if (resp === undefined) {
312
+ throw new Error('API call completed without a result.');
313
+ }
314
+ return resp;
315
+ }
316
+
317
+ /**
318
+ * Gets an array of summaries for tables for a schema and catalog within the metastore. The table summaries returned are either:
319
+ *
320
+ * * summaries for tables (within the current metastore and parent catalog and schema), when the user is a metastore admin, or:
321
+ * * summaries for tables and schemas (within the current metastore and parent catalog)
322
+ * for which the user has ownership or the **SELECT** privilege on the table and ownership or **USE_SCHEMA** privilege on the schema,
323
+ * provided that the user also has ownership or the **USE_CATALOG** privilege on the parent catalog.
324
+ *
325
+ * There is no guarantee of a specific ordering of the elements in the array.
326
+ *
327
+ * PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero results while still providing a next_page_token.
328
+ * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
329
+ */
330
+ async listTableSummaries(
331
+ req: ListTableSummariesRequest,
332
+ options?: CallOptions
333
+ ): Promise<ListTableSummariesRequest_Response> {
334
+ const url = `${this.host}/api/2.1/unity-catalog/table-summaries`;
335
+ const params = new URLSearchParams();
336
+ if (req.catalogName !== undefined) {
337
+ params.append('catalog_name', req.catalogName);
338
+ }
339
+ if (req.schemaNamePattern !== undefined) {
340
+ params.append('schema_name_pattern', req.schemaNamePattern);
341
+ }
342
+ if (req.tableNamePattern !== undefined) {
343
+ params.append('table_name_pattern', req.tableNamePattern);
344
+ }
345
+ if (req.maxResults !== undefined) {
346
+ params.append('max_results', String(req.maxResults));
347
+ }
348
+ if (req.pageToken !== undefined) {
349
+ params.append('page_token', req.pageToken);
350
+ }
351
+ if (req.includeManifestCapabilities !== undefined) {
352
+ params.append(
353
+ 'include_manifest_capabilities',
354
+ String(req.includeManifestCapabilities)
355
+ );
356
+ }
357
+ const query = params.toString();
358
+ const fullUrl = query !== '' ? `${url}?${query}` : url;
359
+ let resp: ListTableSummariesRequest_Response | undefined;
360
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
361
+ const headers = new Headers();
362
+ if (this.workspaceId !== undefined) {
363
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
364
+ }
365
+ headers.set('User-Agent', this.userAgent);
366
+ const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
367
+ const respBody = await executeHttpCall({
368
+ request: httpReq,
369
+ httpClient: this.httpClient,
370
+ logger: this.logger,
371
+ });
372
+ resp = parseResponse(
373
+ respBody,
374
+ unmarshalListTableSummariesRequest_ResponseSchema
375
+ );
376
+ };
377
+ await executeCall(call, options);
378
+ if (resp === undefined) {
379
+ throw new Error('API call completed without a result.');
380
+ }
381
+ return resp;
382
+ }
383
+
384
+ async *listTableSummariesIter(
385
+ req: ListTableSummariesRequest,
386
+ options?: CallOptions
387
+ ): AsyncGenerator<TableSummary> {
388
+ const pageReq: ListTableSummariesRequest = {...req};
389
+ for (;;) {
390
+ const resp = await this.listTableSummaries(pageReq, options);
391
+ for (const item of resp.tables ?? []) {
392
+ yield item;
393
+ }
394
+ if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
395
+ return;
396
+ }
397
+ pageReq.pageToken = resp.nextPageToken;
398
+ }
399
+ }
400
+
401
+ /**
402
+ * Gets an array of all tables for the current metastore under the parent catalog and schema.
403
+ * The caller must be a metastore admin or an owner of (or have the **SELECT** privilege on) the table.
404
+ * For the latter case, the caller must also be the owner or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
405
+ * There is no guarantee of a specific ordering of the elements in the array.
406
+ *
407
+ * NOTE: **view_dependencies** and **table_constraints** are not returned by ListTables queries.
408
+ *
409
+ * NOTE: we recommend using max_results=0 to use the paginated version of this API. Unpaginated calls will be deprecated soon.
410
+ *
411
+ * PAGINATION BEHAVIOR: When using pagination (max_results >= 0), a page may contain zero results while still providing a next_page_token.
412
+ * Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.
413
+ */
414
+ async listTables(
415
+ req: ListTablesRequest,
416
+ options?: CallOptions
417
+ ): Promise<ListTablesRequest_Response> {
418
+ const url = `${this.host}/api/2.1/unity-catalog/tables`;
419
+ const params = new URLSearchParams();
420
+ if (req.catalogName !== undefined) {
421
+ params.append('catalog_name', req.catalogName);
422
+ }
423
+ if (req.schemaName !== undefined) {
424
+ params.append('schema_name', req.schemaName);
425
+ }
426
+ if (req.maxResults !== undefined) {
427
+ params.append('max_results', String(req.maxResults));
428
+ }
429
+ if (req.pageToken !== undefined) {
430
+ params.append('page_token', req.pageToken);
431
+ }
432
+ if (req.omitColumns !== undefined) {
433
+ params.append('omit_columns', String(req.omitColumns));
434
+ }
435
+ if (req.omitProperties !== undefined) {
436
+ params.append('omit_properties', String(req.omitProperties));
437
+ }
438
+ if (req.omitUsername !== undefined) {
439
+ params.append('omit_username', String(req.omitUsername));
440
+ }
441
+ if (req.includeBrowse !== undefined) {
442
+ params.append('include_browse', String(req.includeBrowse));
443
+ }
444
+ if (req.includeManifestCapabilities !== undefined) {
445
+ params.append(
446
+ 'include_manifest_capabilities',
447
+ String(req.includeManifestCapabilities)
448
+ );
449
+ }
450
+ const query = params.toString();
451
+ const fullUrl = query !== '' ? `${url}?${query}` : url;
452
+ let resp: ListTablesRequest_Response | undefined;
453
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
454
+ const headers = new Headers();
455
+ if (this.workspaceId !== undefined) {
456
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
457
+ }
458
+ headers.set('User-Agent', this.userAgent);
459
+ const httpReq = buildHttpRequest('GET', fullUrl, headers, callSignal);
460
+ const respBody = await executeHttpCall({
461
+ request: httpReq,
462
+ httpClient: this.httpClient,
463
+ logger: this.logger,
464
+ });
465
+ resp = parseResponse(respBody, unmarshalListTablesRequest_ResponseSchema);
466
+ };
467
+ await executeCall(call, options);
468
+ if (resp === undefined) {
469
+ throw new Error('API call completed without a result.');
470
+ }
471
+ return resp;
472
+ }
473
+
474
+ async *listTablesIter(
475
+ req: ListTablesRequest,
476
+ options?: CallOptions
477
+ ): AsyncGenerator<TableInfo> {
478
+ const pageReq: ListTablesRequest = {...req};
479
+ for (;;) {
480
+ const resp = await this.listTables(pageReq, options);
481
+ for (const item of resp.tables ?? []) {
482
+ yield item;
483
+ }
484
+ if (resp.nextPageToken === undefined || resp.nextPageToken === '') {
485
+ return;
486
+ }
487
+ pageReq.pageToken = resp.nextPageToken;
488
+ }
489
+ }
490
+
491
+ /**
492
+ * Gets if a table exists in the metastore for a specific catalog and schema.
493
+ * The caller must satisfy one of the following requirements:
494
+ * * Be a metastore admin
495
+ * * Be the owner of the parent catalog
496
+ * * Be the owner of the parent schema and have the **USE_CATALOG** privilege on the parent catalog
497
+ * * Have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema,
498
+ * and either be the table owner or have the **SELECT** privilege on the table.
499
+ * * Have **BROWSE** privilege on the parent catalog
500
+ * * Have **BROWSE** privilege on the parent schema
501
+ */
502
+ async tableExists(
503
+ req: TableExistsRequest,
504
+ options?: CallOptions
505
+ ): Promise<TableExistsRequest_Response> {
506
+ const url = `${this.host}/api/2.1/unity-catalog/tables/${req.fullNameArg ?? ''}/exists`;
507
+ let resp: TableExistsRequest_Response | undefined;
508
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
509
+ const headers = new Headers();
510
+ if (this.workspaceId !== undefined) {
511
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
512
+ }
513
+ headers.set('User-Agent', this.userAgent);
514
+ const httpReq = buildHttpRequest('GET', url, headers, callSignal);
515
+ const respBody = await executeHttpCall({
516
+ request: httpReq,
517
+ httpClient: this.httpClient,
518
+ logger: this.logger,
519
+ });
520
+ resp = parseResponse(
521
+ respBody,
522
+ unmarshalTableExistsRequest_ResponseSchema
523
+ );
524
+ };
525
+ await executeCall(call, options);
526
+ if (resp === undefined) {
527
+ throw new Error('API call completed without a result.');
528
+ }
529
+ return resp;
530
+ }
531
+
532
+ /**
533
+ * Change the owner of the table.
534
+ * The caller must be the owner of the parent catalog, have the **USE_CATALOG** privilege on the parent catalog and be the owner of the parent schema,
535
+ * or be the owner of the table and have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema.
536
+ */
537
+ async updateTable(
538
+ req: UpdateTableRequest,
539
+ options?: CallOptions
540
+ ): Promise<UpdateTableRequest_Response> {
541
+ const url = `${this.host}/api/2.1/unity-catalog/tables/${req.fullNameArg ?? ''}`;
542
+ const body = marshalRequest(req, marshalUpdateTableRequestSchema);
543
+ let resp: UpdateTableRequest_Response | undefined;
544
+ const call: Call = async (callSignal?: AbortSignal): Promise<void> => {
545
+ const headers = new Headers({'Content-Type': 'application/json'});
546
+ if (this.workspaceId !== undefined) {
547
+ headers.set('X-Databricks-Org-Id', this.workspaceId);
548
+ }
549
+ headers.set('User-Agent', this.userAgent);
550
+ const httpReq = buildHttpRequest('PATCH', url, headers, callSignal, body);
551
+ const respBody = await executeHttpCall({
552
+ request: httpReq,
553
+ httpClient: this.httpClient,
554
+ logger: this.logger,
555
+ });
556
+ resp = parseResponse(
557
+ respBody,
558
+ unmarshalUpdateTableRequest_ResponseSchema
559
+ );
560
+ };
561
+ await executeCall(call, options);
562
+ if (resp === undefined) {
563
+ throw new Error('API call completed without a result.');
564
+ }
565
+ return resp;
566
+ }
567
+ }
@@ -0,0 +1,58 @@
1
+ // Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
2
+
3
+ export {TablesClient} from './client';
4
+
5
+ export {
6
+ ColumnTypeName,
7
+ DataSourceFormat,
8
+ SecurableKind,
9
+ SecurableType,
10
+ SseEncryptionAlgorithm,
11
+ TableType,
12
+ OptionSpec_OauthStage,
13
+ OptionSpec_OptionType,
14
+ } from './model';
15
+
16
+ export type {
17
+ ColumnInfo,
18
+ ColumnMask,
19
+ ConnectionDependency,
20
+ CreateTableConstraintRequest,
21
+ CreateTableRequest,
22
+ CreateTableRequest_PropertiesEntry,
23
+ CredentialDependency,
24
+ DeleteTableConstraintRequest,
25
+ DeleteTableConstraintRequest_Response,
26
+ DeleteTableRequest,
27
+ DeleteTableRequest_Response,
28
+ DeltaRuntimePropertiesKvPairs,
29
+ DeltaRuntimePropertiesKvPairs_DeltaRuntimePropertiesEntry,
30
+ Dependency,
31
+ DependencyList,
32
+ EffectivePredictiveOptimizationFlag,
33
+ EncryptionDetails,
34
+ ForeignKeyConstraint,
35
+ FunctionDependency,
36
+ GetTableRequest,
37
+ ListTableSummariesRequest,
38
+ ListTableSummariesRequest_Response,
39
+ ListTablesRequest,
40
+ ListTablesRequest_Response,
41
+ NamedTableConstraint,
42
+ OptionSpec,
43
+ PolicyFunctionArgument,
44
+ PrimaryKeyConstraint,
45
+ RowFilter,
46
+ SecurableKindManifest,
47
+ SseEncryptionDetails,
48
+ TableConstraint,
49
+ TableDependency,
50
+ TableExistsRequest,
51
+ TableExistsRequest_Response,
52
+ TableInfo,
53
+ TableInfo_PropertiesEntry,
54
+ TableSummary,
55
+ UpdateTableRequest,
56
+ UpdateTableRequest_PropertiesEntry,
57
+ UpdateTableRequest_Response,
58
+ } from './model';