@databricks/sdk-uc-catalogs 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 +39 -0
- package/dist/v1/client.d.ts.map +1 -0
- package/dist/v1/client.js +219 -0
- package/dist/v1/client.js.map +1 -0
- package/dist/v1/index.d.ts +4 -0
- package/dist/v1/index.d.ts.map +1 -0
- package/dist/v1/index.js +4 -0
- package/dist/v1/index.js.map +1 -0
- package/dist/v1/model.d.ts +310 -0
- package/dist/v1/model.d.ts.map +1 -0
- package/dist/v1/model.js +328 -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 +57 -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 +279 -0
- package/src/v1/index.ts +31 -0
- package/src/v1/model.ts +632 -0
- package/src/v1/transport.ts +73 -0
- package/src/v1/utils.ts +156 -0
- package/README.md +0 -1
- package/index.js +0 -1
package/src/v1/model.ts
ADDED
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import {z} from 'zod';
|
|
4
|
+
|
|
5
|
+
export enum CatalogIsolationMode {
|
|
6
|
+
OPEN = 'OPEN',
|
|
7
|
+
ISOLATED = 'ISOLATED',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** The type of the catalog. */
|
|
11
|
+
export enum CatalogType {
|
|
12
|
+
MANAGED_CATALOG = 'MANAGED_CATALOG',
|
|
13
|
+
DELTASHARING_CATALOG = 'DELTASHARING_CATALOG',
|
|
14
|
+
SYSTEM_CATALOG = 'SYSTEM_CATALOG',
|
|
15
|
+
INTERNAL_CATALOG = 'INTERNAL_CATALOG',
|
|
16
|
+
FOREIGN_CATALOG = 'FOREIGN_CATALOG',
|
|
17
|
+
MANAGED_ONLINE_CATALOG = 'MANAGED_ONLINE_CATALOG',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** The type of Unity Catalog securable. */
|
|
21
|
+
export enum SecurableType {
|
|
22
|
+
CATALOG = 'CATALOG',
|
|
23
|
+
SCHEMA = 'SCHEMA',
|
|
24
|
+
TABLE = 'TABLE',
|
|
25
|
+
STORAGE_CREDENTIAL = 'STORAGE_CREDENTIAL',
|
|
26
|
+
EXTERNAL_LOCATION = 'EXTERNAL_LOCATION',
|
|
27
|
+
FUNCTION = 'FUNCTION',
|
|
28
|
+
SHARE = 'SHARE',
|
|
29
|
+
PROVIDER = 'PROVIDER',
|
|
30
|
+
RECIPIENT = 'RECIPIENT',
|
|
31
|
+
CLEAN_ROOM = 'CLEAN_ROOM',
|
|
32
|
+
METASTORE = 'METASTORE',
|
|
33
|
+
PIPELINE = 'PIPELINE',
|
|
34
|
+
VOLUME = 'VOLUME',
|
|
35
|
+
CONNECTION = 'CONNECTION',
|
|
36
|
+
CREDENTIAL = 'CREDENTIAL',
|
|
37
|
+
EXTERNAL_METADATA = 'EXTERNAL_METADATA',
|
|
38
|
+
/** TODO: [UC-2980] Staging tables aren't full-fleged securables yet. */
|
|
39
|
+
STAGING_TABLE = 'STAGING_TABLE',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
|
|
43
|
+
export enum ProvisioningInfo_State {
|
|
44
|
+
STATE_UNSPECIFIED = 'STATE_UNSPECIFIED',
|
|
45
|
+
PROVISIONING = 'PROVISIONING',
|
|
46
|
+
ACTIVE = 'ACTIVE',
|
|
47
|
+
FAILED = 'FAILED',
|
|
48
|
+
DELETING = 'DELETING',
|
|
49
|
+
UPDATING = 'UPDATING',
|
|
50
|
+
DEGRADED = 'DEGRADED',
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface AzureEncryptionSettings {
|
|
54
|
+
azureTenantId?: string | undefined;
|
|
55
|
+
azureCmkAccessConnectorId?: string | undefined;
|
|
56
|
+
azureCmkManagedIdentityId?: string | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface CatalogInfo {
|
|
60
|
+
/** Name of catalog. */
|
|
61
|
+
name?: string | undefined;
|
|
62
|
+
/** Username of current owner of catalog. */
|
|
63
|
+
owner?: string | undefined;
|
|
64
|
+
/** User-provided free-form text description. */
|
|
65
|
+
comment?: string | undefined;
|
|
66
|
+
/** Storage root URL for managed tables within catalog. */
|
|
67
|
+
storageRoot?: string | undefined;
|
|
68
|
+
/** Whether predictive optimization should be enabled for this object and objects under it. */
|
|
69
|
+
enablePredictiveOptimization?: string | undefined;
|
|
70
|
+
catalogType?: CatalogType | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* The name of delta sharing provider.
|
|
73
|
+
*
|
|
74
|
+
* A Delta Sharing catalog is a catalog that is based on a Delta share on a remote sharing server.
|
|
75
|
+
*/
|
|
76
|
+
providerName?: string | undefined;
|
|
77
|
+
/** The name of the share under the share provider. */
|
|
78
|
+
shareName?: string | undefined;
|
|
79
|
+
/** The name of the connection to an external data source. */
|
|
80
|
+
connectionName?: string | undefined;
|
|
81
|
+
/** Unique identifier of parent metastore. */
|
|
82
|
+
metastoreId?: string | undefined;
|
|
83
|
+
/** Time at which this catalog was created, in epoch milliseconds. */
|
|
84
|
+
createdAt?: bigint | undefined;
|
|
85
|
+
/** Username of catalog creator. */
|
|
86
|
+
createdBy?: string | undefined;
|
|
87
|
+
/** Time at which this catalog was last modified, in epoch milliseconds. */
|
|
88
|
+
updatedAt?: bigint | undefined;
|
|
89
|
+
/** Username of user who last modified catalog. */
|
|
90
|
+
updatedBy?: string | undefined;
|
|
91
|
+
/** Storage Location URL (full path) for managed tables within catalog. */
|
|
92
|
+
storageLocation?: string | undefined;
|
|
93
|
+
/** Whether the current securable is accessible from all workspaces or a specific set of workspaces. */
|
|
94
|
+
isolationMode?: CatalogIsolationMode | undefined;
|
|
95
|
+
effectivePredictiveOptimizationFlag?:
|
|
96
|
+
| EffectivePredictiveOptimizationFlag
|
|
97
|
+
| undefined;
|
|
98
|
+
/** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
|
|
99
|
+
browseOnly?: boolean | undefined;
|
|
100
|
+
provisioningInfo?: ProvisioningInfo | undefined;
|
|
101
|
+
/** The full name of the catalog. Corresponds with the name field. */
|
|
102
|
+
fullName?: string | undefined;
|
|
103
|
+
securableType?: SecurableType | undefined;
|
|
104
|
+
/** Control CMK encryption for managed catalog data */
|
|
105
|
+
managedEncryptionSettings?: EncryptionSettings | undefined;
|
|
106
|
+
/** A map of key-value properties attached to the securable. */
|
|
107
|
+
properties?: Record<string, string> | undefined;
|
|
108
|
+
/** A map of key-value properties attached to the securable. */
|
|
109
|
+
options?: Record<string, string> | undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
113
|
+
export interface CatalogInfo_OptionsEntry {
|
|
114
|
+
key?: string | undefined;
|
|
115
|
+
value?: string | undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
119
|
+
export interface CatalogInfo_PropertiesEntry {
|
|
120
|
+
key?: string | undefined;
|
|
121
|
+
value?: string | undefined;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface CreateCatalogRequest {
|
|
125
|
+
/** Name of catalog. */
|
|
126
|
+
name?: string | undefined;
|
|
127
|
+
/** Username of current owner of catalog. */
|
|
128
|
+
owner?: string | undefined;
|
|
129
|
+
/** User-provided free-form text description. */
|
|
130
|
+
comment?: string | undefined;
|
|
131
|
+
/** Storage root URL for managed tables within catalog. */
|
|
132
|
+
storageRoot?: string | undefined;
|
|
133
|
+
/** Whether predictive optimization should be enabled for this object and objects under it. */
|
|
134
|
+
enablePredictiveOptimization?: string | undefined;
|
|
135
|
+
catalogType?: CatalogType | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* The name of delta sharing provider.
|
|
138
|
+
*
|
|
139
|
+
* A Delta Sharing catalog is a catalog that is based on a Delta share on a remote sharing server.
|
|
140
|
+
*/
|
|
141
|
+
providerName?: string | undefined;
|
|
142
|
+
/** The name of the share under the share provider. */
|
|
143
|
+
shareName?: string | undefined;
|
|
144
|
+
/** The name of the connection to an external data source. */
|
|
145
|
+
connectionName?: string | undefined;
|
|
146
|
+
/** Unique identifier of parent metastore. */
|
|
147
|
+
metastoreId?: string | undefined;
|
|
148
|
+
/** Time at which this catalog was created, in epoch milliseconds. */
|
|
149
|
+
createdAt?: bigint | undefined;
|
|
150
|
+
/** Username of catalog creator. */
|
|
151
|
+
createdBy?: string | undefined;
|
|
152
|
+
/** Time at which this catalog was last modified, in epoch milliseconds. */
|
|
153
|
+
updatedAt?: bigint | undefined;
|
|
154
|
+
/** Username of user who last modified catalog. */
|
|
155
|
+
updatedBy?: string | undefined;
|
|
156
|
+
/** Storage Location URL (full path) for managed tables within catalog. */
|
|
157
|
+
storageLocation?: string | undefined;
|
|
158
|
+
/** Whether the current securable is accessible from all workspaces or a specific set of workspaces. */
|
|
159
|
+
isolationMode?: CatalogIsolationMode | undefined;
|
|
160
|
+
effectivePredictiveOptimizationFlag?:
|
|
161
|
+
| EffectivePredictiveOptimizationFlag
|
|
162
|
+
| undefined;
|
|
163
|
+
/** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
|
|
164
|
+
browseOnly?: boolean | undefined;
|
|
165
|
+
provisioningInfo?: ProvisioningInfo | undefined;
|
|
166
|
+
/** The full name of the catalog. Corresponds with the name field. */
|
|
167
|
+
fullName?: string | undefined;
|
|
168
|
+
securableType?: SecurableType | undefined;
|
|
169
|
+
/** Control CMK encryption for managed catalog data */
|
|
170
|
+
managedEncryptionSettings?: EncryptionSettings | undefined;
|
|
171
|
+
/** A map of key-value properties attached to the securable. */
|
|
172
|
+
properties?: Record<string, string> | undefined;
|
|
173
|
+
/** A map of key-value properties attached to the securable. */
|
|
174
|
+
options?: Record<string, string> | undefined;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
178
|
+
export interface CreateCatalogRequest_OptionsEntry {
|
|
179
|
+
key?: string | undefined;
|
|
180
|
+
value?: string | undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
184
|
+
export interface CreateCatalogRequest_PropertiesEntry {
|
|
185
|
+
key?: string | undefined;
|
|
186
|
+
value?: string | undefined;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface DeleteCatalogRequest {
|
|
190
|
+
/** The name of the catalog. */
|
|
191
|
+
nameArg?: string | undefined;
|
|
192
|
+
/** Force deletion even if the catalog is not empty. */
|
|
193
|
+
force?: boolean | undefined;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-empty-object-type -- Proto-style nested message name.
|
|
197
|
+
export interface DeleteCatalogRequest_Response {}
|
|
198
|
+
|
|
199
|
+
export interface EffectivePredictiveOptimizationFlag {
|
|
200
|
+
/** Whether predictive optimization should be enabled for this object and objects under it. */
|
|
201
|
+
value?: string | undefined;
|
|
202
|
+
/** The type of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */
|
|
203
|
+
inheritedFromType?: string | undefined;
|
|
204
|
+
/** The name of the object from which the flag was inherited. If there was no inheritance, this field is left blank. */
|
|
205
|
+
inheritedFromName?: string | undefined;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Encryption Settings are used to carry metadata for securable encryption at rest.
|
|
210
|
+
* Currently used for catalogs, we can use the information supplied here to interact with a CMK.
|
|
211
|
+
*/
|
|
212
|
+
export interface EncryptionSettings {
|
|
213
|
+
/** the CMK uuid in AWS and GCP, null otherwise. */
|
|
214
|
+
customerManagedKeyId?: string | undefined;
|
|
215
|
+
/** the AKV URL in Azure, null otherwise. */
|
|
216
|
+
azureKeyVaultKeyId?: string | undefined;
|
|
217
|
+
/** optional Azure settings - only required if an Azure CMK is used. */
|
|
218
|
+
azureEncryptionSettings?: AzureEncryptionSettings | undefined;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface GetCatalogRequest {
|
|
222
|
+
/** The name of the catalog. */
|
|
223
|
+
nameArg?: string | undefined;
|
|
224
|
+
/** Whether to include catalogs in the response for which the principal can only access selective metadata for */
|
|
225
|
+
includeBrowse?: boolean | undefined;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export interface ListCatalogsRequest {
|
|
229
|
+
/** Whether to include catalogs in the response for which the principal can only access selective metadata for */
|
|
230
|
+
includeBrowse?: boolean | undefined;
|
|
231
|
+
/**
|
|
232
|
+
* Maximum number of catalogs to return.
|
|
233
|
+
* - when set to 0, the page length is set to a server configured value (recommended);
|
|
234
|
+
* - when set to a value greater than 0, the page length is the minimum of this value and a server configured value;
|
|
235
|
+
* - when set to a value less than 0, an invalid parameter error is returned;
|
|
236
|
+
* - If not set, all valid catalogs are returned (not recommended).
|
|
237
|
+
* - Note: The number of returned catalogs might be less than the specified max_results size, even zero.
|
|
238
|
+
* The only definitive indication that no further catalogs can be fetched is when the next_page_token is unset from the response.
|
|
239
|
+
*/
|
|
240
|
+
maxResults?: number | undefined;
|
|
241
|
+
/** Opaque pagination token to go to next page based on previous query. */
|
|
242
|
+
pageToken?: string | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Whether to include catalogs not bound to the workspace.
|
|
245
|
+
* Effective only if the user has permission to update the catalog–workspace binding.
|
|
246
|
+
*/
|
|
247
|
+
includeUnbound?: boolean | undefined;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
251
|
+
export interface ListCatalogsRequest_Response {
|
|
252
|
+
/** An array of catalog information objects. */
|
|
253
|
+
catalogs?: CatalogInfo[] | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
256
|
+
* __page_token__ should be set to this value for the next request (for the next page of results).
|
|
257
|
+
*/
|
|
258
|
+
nextPageToken?: string | undefined;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** Status of an asynchronously provisioned resource. */
|
|
262
|
+
export interface ProvisioningInfo {
|
|
263
|
+
/** The provisioning state of the resource. */
|
|
264
|
+
state?: ProvisioningInfo_State | undefined;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface UpdateCatalogRequest {
|
|
268
|
+
/** The name of the catalog. */
|
|
269
|
+
nameArg?: string | undefined;
|
|
270
|
+
/** New name for the catalog. */
|
|
271
|
+
newName?: string | undefined;
|
|
272
|
+
/** Name of catalog. */
|
|
273
|
+
name?: string | undefined;
|
|
274
|
+
/** Username of current owner of catalog. */
|
|
275
|
+
owner?: string | undefined;
|
|
276
|
+
/** User-provided free-form text description. */
|
|
277
|
+
comment?: string | undefined;
|
|
278
|
+
/** Storage root URL for managed tables within catalog. */
|
|
279
|
+
storageRoot?: string | undefined;
|
|
280
|
+
/** Whether predictive optimization should be enabled for this object and objects under it. */
|
|
281
|
+
enablePredictiveOptimization?: string | undefined;
|
|
282
|
+
catalogType?: CatalogType | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* The name of delta sharing provider.
|
|
285
|
+
*
|
|
286
|
+
* A Delta Sharing catalog is a catalog that is based on a Delta share on a remote sharing server.
|
|
287
|
+
*/
|
|
288
|
+
providerName?: string | undefined;
|
|
289
|
+
/** The name of the share under the share provider. */
|
|
290
|
+
shareName?: string | undefined;
|
|
291
|
+
/** The name of the connection to an external data source. */
|
|
292
|
+
connectionName?: string | undefined;
|
|
293
|
+
/** Unique identifier of parent metastore. */
|
|
294
|
+
metastoreId?: string | undefined;
|
|
295
|
+
/** Time at which this catalog was created, in epoch milliseconds. */
|
|
296
|
+
createdAt?: bigint | undefined;
|
|
297
|
+
/** Username of catalog creator. */
|
|
298
|
+
createdBy?: string | undefined;
|
|
299
|
+
/** Time at which this catalog was last modified, in epoch milliseconds. */
|
|
300
|
+
updatedAt?: bigint | undefined;
|
|
301
|
+
/** Username of user who last modified catalog. */
|
|
302
|
+
updatedBy?: string | undefined;
|
|
303
|
+
/** Storage Location URL (full path) for managed tables within catalog. */
|
|
304
|
+
storageLocation?: string | undefined;
|
|
305
|
+
/** Whether the current securable is accessible from all workspaces or a specific set of workspaces. */
|
|
306
|
+
isolationMode?: CatalogIsolationMode | undefined;
|
|
307
|
+
effectivePredictiveOptimizationFlag?:
|
|
308
|
+
| EffectivePredictiveOptimizationFlag
|
|
309
|
+
| undefined;
|
|
310
|
+
/** Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. */
|
|
311
|
+
browseOnly?: boolean | undefined;
|
|
312
|
+
provisioningInfo?: ProvisioningInfo | undefined;
|
|
313
|
+
/** The full name of the catalog. Corresponds with the name field. */
|
|
314
|
+
fullName?: string | undefined;
|
|
315
|
+
securableType?: SecurableType | undefined;
|
|
316
|
+
/** Control CMK encryption for managed catalog data */
|
|
317
|
+
managedEncryptionSettings?: EncryptionSettings | undefined;
|
|
318
|
+
/** A map of key-value properties attached to the securable. */
|
|
319
|
+
properties?: Record<string, string> | undefined;
|
|
320
|
+
/** A map of key-value properties attached to the securable. */
|
|
321
|
+
options?: Record<string, string> | undefined;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
325
|
+
export interface UpdateCatalogRequest_OptionsEntry {
|
|
326
|
+
key?: string | undefined;
|
|
327
|
+
value?: string | undefined;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
331
|
+
export interface UpdateCatalogRequest_PropertiesEntry {
|
|
332
|
+
key?: string | undefined;
|
|
333
|
+
value?: string | undefined;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export const unmarshalAzureEncryptionSettingsSchema: z.ZodType<AzureEncryptionSettings> =
|
|
337
|
+
z
|
|
338
|
+
.object({
|
|
339
|
+
azure_tenant_id: z.string().optional(),
|
|
340
|
+
azure_cmk_access_connector_id: z.string().optional(),
|
|
341
|
+
azure_cmk_managed_identity_id: z.string().optional(),
|
|
342
|
+
})
|
|
343
|
+
.transform(d => ({
|
|
344
|
+
azureTenantId: d.azure_tenant_id,
|
|
345
|
+
azureCmkAccessConnectorId: d.azure_cmk_access_connector_id,
|
|
346
|
+
azureCmkManagedIdentityId: d.azure_cmk_managed_identity_id,
|
|
347
|
+
}));
|
|
348
|
+
|
|
349
|
+
export const unmarshalCatalogInfoSchema: z.ZodType<CatalogInfo> = z
|
|
350
|
+
.object({
|
|
351
|
+
name: z.string().optional(),
|
|
352
|
+
owner: z.string().optional(),
|
|
353
|
+
comment: z.string().optional(),
|
|
354
|
+
storage_root: z.string().optional(),
|
|
355
|
+
enable_predictive_optimization: z.string().optional(),
|
|
356
|
+
catalog_type: z.enum(CatalogType).optional(),
|
|
357
|
+
provider_name: z.string().optional(),
|
|
358
|
+
share_name: z.string().optional(),
|
|
359
|
+
connection_name: z.string().optional(),
|
|
360
|
+
metastore_id: z.string().optional(),
|
|
361
|
+
created_at: z
|
|
362
|
+
.union([z.number(), z.bigint()])
|
|
363
|
+
.transform(v => BigInt(v))
|
|
364
|
+
.optional(),
|
|
365
|
+
created_by: z.string().optional(),
|
|
366
|
+
updated_at: z
|
|
367
|
+
.union([z.number(), z.bigint()])
|
|
368
|
+
.transform(v => BigInt(v))
|
|
369
|
+
.optional(),
|
|
370
|
+
updated_by: z.string().optional(),
|
|
371
|
+
storage_location: z.string().optional(),
|
|
372
|
+
isolation_mode: z.enum(CatalogIsolationMode).optional(),
|
|
373
|
+
effective_predictive_optimization_flag: z
|
|
374
|
+
.lazy(() => unmarshalEffectivePredictiveOptimizationFlagSchema)
|
|
375
|
+
.optional(),
|
|
376
|
+
browse_only: z.boolean().optional(),
|
|
377
|
+
provisioning_info: z.lazy(() => unmarshalProvisioningInfoSchema).optional(),
|
|
378
|
+
full_name: z.string().optional(),
|
|
379
|
+
securable_type: z.enum(SecurableType).optional(),
|
|
380
|
+
managed_encryption_settings: z
|
|
381
|
+
.lazy(() => unmarshalEncryptionSettingsSchema)
|
|
382
|
+
.optional(),
|
|
383
|
+
properties: z.record(z.string(), z.string()).optional(),
|
|
384
|
+
options: z.record(z.string(), z.string()).optional(),
|
|
385
|
+
})
|
|
386
|
+
.transform(d => ({
|
|
387
|
+
name: d.name,
|
|
388
|
+
owner: d.owner,
|
|
389
|
+
comment: d.comment,
|
|
390
|
+
storageRoot: d.storage_root,
|
|
391
|
+
enablePredictiveOptimization: d.enable_predictive_optimization,
|
|
392
|
+
catalogType: d.catalog_type,
|
|
393
|
+
providerName: d.provider_name,
|
|
394
|
+
shareName: d.share_name,
|
|
395
|
+
connectionName: d.connection_name,
|
|
396
|
+
metastoreId: d.metastore_id,
|
|
397
|
+
createdAt: d.created_at,
|
|
398
|
+
createdBy: d.created_by,
|
|
399
|
+
updatedAt: d.updated_at,
|
|
400
|
+
updatedBy: d.updated_by,
|
|
401
|
+
storageLocation: d.storage_location,
|
|
402
|
+
isolationMode: d.isolation_mode,
|
|
403
|
+
effectivePredictiveOptimizationFlag:
|
|
404
|
+
d.effective_predictive_optimization_flag,
|
|
405
|
+
browseOnly: d.browse_only,
|
|
406
|
+
provisioningInfo: d.provisioning_info,
|
|
407
|
+
fullName: d.full_name,
|
|
408
|
+
securableType: d.securable_type,
|
|
409
|
+
managedEncryptionSettings: d.managed_encryption_settings,
|
|
410
|
+
properties: d.properties,
|
|
411
|
+
options: d.options,
|
|
412
|
+
}));
|
|
413
|
+
|
|
414
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
415
|
+
export const unmarshalDeleteCatalogRequest_ResponseSchema: z.ZodType<DeleteCatalogRequest_Response> =
|
|
416
|
+
z.object({});
|
|
417
|
+
|
|
418
|
+
export const unmarshalEffectivePredictiveOptimizationFlagSchema: z.ZodType<EffectivePredictiveOptimizationFlag> =
|
|
419
|
+
z
|
|
420
|
+
.object({
|
|
421
|
+
value: z.string().optional(),
|
|
422
|
+
inherited_from_type: z.string().optional(),
|
|
423
|
+
inherited_from_name: z.string().optional(),
|
|
424
|
+
})
|
|
425
|
+
.transform(d => ({
|
|
426
|
+
value: d.value,
|
|
427
|
+
inheritedFromType: d.inherited_from_type,
|
|
428
|
+
inheritedFromName: d.inherited_from_name,
|
|
429
|
+
}));
|
|
430
|
+
|
|
431
|
+
export const unmarshalEncryptionSettingsSchema: z.ZodType<EncryptionSettings> =
|
|
432
|
+
z
|
|
433
|
+
.object({
|
|
434
|
+
customer_managed_key_id: z.string().optional(),
|
|
435
|
+
azure_key_vault_key_id: z.string().optional(),
|
|
436
|
+
azure_encryption_settings: z
|
|
437
|
+
.lazy(() => unmarshalAzureEncryptionSettingsSchema)
|
|
438
|
+
.optional(),
|
|
439
|
+
})
|
|
440
|
+
.transform(d => ({
|
|
441
|
+
customerManagedKeyId: d.customer_managed_key_id,
|
|
442
|
+
azureKeyVaultKeyId: d.azure_key_vault_key_id,
|
|
443
|
+
azureEncryptionSettings: d.azure_encryption_settings,
|
|
444
|
+
}));
|
|
445
|
+
|
|
446
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
|
|
447
|
+
export const unmarshalListCatalogsRequest_ResponseSchema: z.ZodType<ListCatalogsRequest_Response> =
|
|
448
|
+
z
|
|
449
|
+
.object({
|
|
450
|
+
catalogs: z.array(z.lazy(() => unmarshalCatalogInfoSchema)).optional(),
|
|
451
|
+
next_page_token: z.string().optional(),
|
|
452
|
+
})
|
|
453
|
+
.transform(d => ({
|
|
454
|
+
catalogs: d.catalogs,
|
|
455
|
+
nextPageToken: d.next_page_token,
|
|
456
|
+
}));
|
|
457
|
+
|
|
458
|
+
export const unmarshalProvisioningInfoSchema: z.ZodType<ProvisioningInfo> = z
|
|
459
|
+
.object({
|
|
460
|
+
state: z.enum(ProvisioningInfo_State).optional(),
|
|
461
|
+
})
|
|
462
|
+
.transform(d => ({
|
|
463
|
+
state: d.state,
|
|
464
|
+
}));
|
|
465
|
+
|
|
466
|
+
export const marshalAzureEncryptionSettingsSchema: z.ZodType = z
|
|
467
|
+
.object({
|
|
468
|
+
azureTenantId: z.string().optional(),
|
|
469
|
+
azureCmkAccessConnectorId: z.string().optional(),
|
|
470
|
+
azureCmkManagedIdentityId: z.string().optional(),
|
|
471
|
+
})
|
|
472
|
+
.transform(d => ({
|
|
473
|
+
azure_tenant_id: d.azureTenantId,
|
|
474
|
+
azure_cmk_access_connector_id: d.azureCmkAccessConnectorId,
|
|
475
|
+
azure_cmk_managed_identity_id: d.azureCmkManagedIdentityId,
|
|
476
|
+
}));
|
|
477
|
+
|
|
478
|
+
export const marshalCreateCatalogRequestSchema: z.ZodType = z
|
|
479
|
+
.object({
|
|
480
|
+
name: z.string().optional(),
|
|
481
|
+
owner: z.string().optional(),
|
|
482
|
+
comment: z.string().optional(),
|
|
483
|
+
storageRoot: z.string().optional(),
|
|
484
|
+
enablePredictiveOptimization: z.string().optional(),
|
|
485
|
+
catalogType: z.enum(CatalogType).optional(),
|
|
486
|
+
providerName: z.string().optional(),
|
|
487
|
+
shareName: z.string().optional(),
|
|
488
|
+
connectionName: z.string().optional(),
|
|
489
|
+
metastoreId: z.string().optional(),
|
|
490
|
+
createdAt: z.bigint().optional(),
|
|
491
|
+
createdBy: z.string().optional(),
|
|
492
|
+
updatedAt: z.bigint().optional(),
|
|
493
|
+
updatedBy: z.string().optional(),
|
|
494
|
+
storageLocation: z.string().optional(),
|
|
495
|
+
isolationMode: z.enum(CatalogIsolationMode).optional(),
|
|
496
|
+
effectivePredictiveOptimizationFlag: z
|
|
497
|
+
.lazy(() => marshalEffectivePredictiveOptimizationFlagSchema)
|
|
498
|
+
.optional(),
|
|
499
|
+
browseOnly: z.boolean().optional(),
|
|
500
|
+
provisioningInfo: z.lazy(() => marshalProvisioningInfoSchema).optional(),
|
|
501
|
+
fullName: z.string().optional(),
|
|
502
|
+
securableType: z.enum(SecurableType).optional(),
|
|
503
|
+
managedEncryptionSettings: z
|
|
504
|
+
.lazy(() => marshalEncryptionSettingsSchema)
|
|
505
|
+
.optional(),
|
|
506
|
+
properties: z.record(z.string(), z.string()).optional(),
|
|
507
|
+
options: z.record(z.string(), z.string()).optional(),
|
|
508
|
+
})
|
|
509
|
+
.transform(d => ({
|
|
510
|
+
name: d.name,
|
|
511
|
+
owner: d.owner,
|
|
512
|
+
comment: d.comment,
|
|
513
|
+
storage_root: d.storageRoot,
|
|
514
|
+
enable_predictive_optimization: d.enablePredictiveOptimization,
|
|
515
|
+
catalog_type: d.catalogType,
|
|
516
|
+
provider_name: d.providerName,
|
|
517
|
+
share_name: d.shareName,
|
|
518
|
+
connection_name: d.connectionName,
|
|
519
|
+
metastore_id: d.metastoreId,
|
|
520
|
+
created_at: d.createdAt,
|
|
521
|
+
created_by: d.createdBy,
|
|
522
|
+
updated_at: d.updatedAt,
|
|
523
|
+
updated_by: d.updatedBy,
|
|
524
|
+
storage_location: d.storageLocation,
|
|
525
|
+
isolation_mode: d.isolationMode,
|
|
526
|
+
effective_predictive_optimization_flag:
|
|
527
|
+
d.effectivePredictiveOptimizationFlag,
|
|
528
|
+
browse_only: d.browseOnly,
|
|
529
|
+
provisioning_info: d.provisioningInfo,
|
|
530
|
+
full_name: d.fullName,
|
|
531
|
+
securable_type: d.securableType,
|
|
532
|
+
managed_encryption_settings: d.managedEncryptionSettings,
|
|
533
|
+
properties: d.properties,
|
|
534
|
+
options: d.options,
|
|
535
|
+
}));
|
|
536
|
+
|
|
537
|
+
export const marshalEffectivePredictiveOptimizationFlagSchema: z.ZodType = z
|
|
538
|
+
.object({
|
|
539
|
+
value: z.string().optional(),
|
|
540
|
+
inheritedFromType: z.string().optional(),
|
|
541
|
+
inheritedFromName: z.string().optional(),
|
|
542
|
+
})
|
|
543
|
+
.transform(d => ({
|
|
544
|
+
value: d.value,
|
|
545
|
+
inherited_from_type: d.inheritedFromType,
|
|
546
|
+
inherited_from_name: d.inheritedFromName,
|
|
547
|
+
}));
|
|
548
|
+
|
|
549
|
+
export const marshalEncryptionSettingsSchema: z.ZodType = z
|
|
550
|
+
.object({
|
|
551
|
+
customerManagedKeyId: z.string().optional(),
|
|
552
|
+
azureKeyVaultKeyId: z.string().optional(),
|
|
553
|
+
azureEncryptionSettings: z
|
|
554
|
+
.lazy(() => marshalAzureEncryptionSettingsSchema)
|
|
555
|
+
.optional(),
|
|
556
|
+
})
|
|
557
|
+
.transform(d => ({
|
|
558
|
+
customer_managed_key_id: d.customerManagedKeyId,
|
|
559
|
+
azure_key_vault_key_id: d.azureKeyVaultKeyId,
|
|
560
|
+
azure_encryption_settings: d.azureEncryptionSettings,
|
|
561
|
+
}));
|
|
562
|
+
|
|
563
|
+
export const marshalProvisioningInfoSchema: z.ZodType = z
|
|
564
|
+
.object({
|
|
565
|
+
state: z.enum(ProvisioningInfo_State).optional(),
|
|
566
|
+
})
|
|
567
|
+
.transform(d => ({
|
|
568
|
+
state: d.state,
|
|
569
|
+
}));
|
|
570
|
+
|
|
571
|
+
export const marshalUpdateCatalogRequestSchema: z.ZodType = z
|
|
572
|
+
.object({
|
|
573
|
+
nameArg: z.string().optional(),
|
|
574
|
+
newName: z.string().optional(),
|
|
575
|
+
name: z.string().optional(),
|
|
576
|
+
owner: z.string().optional(),
|
|
577
|
+
comment: z.string().optional(),
|
|
578
|
+
storageRoot: z.string().optional(),
|
|
579
|
+
enablePredictiveOptimization: z.string().optional(),
|
|
580
|
+
catalogType: z.enum(CatalogType).optional(),
|
|
581
|
+
providerName: z.string().optional(),
|
|
582
|
+
shareName: z.string().optional(),
|
|
583
|
+
connectionName: z.string().optional(),
|
|
584
|
+
metastoreId: z.string().optional(),
|
|
585
|
+
createdAt: z.bigint().optional(),
|
|
586
|
+
createdBy: z.string().optional(),
|
|
587
|
+
updatedAt: z.bigint().optional(),
|
|
588
|
+
updatedBy: z.string().optional(),
|
|
589
|
+
storageLocation: z.string().optional(),
|
|
590
|
+
isolationMode: z.enum(CatalogIsolationMode).optional(),
|
|
591
|
+
effectivePredictiveOptimizationFlag: z
|
|
592
|
+
.lazy(() => marshalEffectivePredictiveOptimizationFlagSchema)
|
|
593
|
+
.optional(),
|
|
594
|
+
browseOnly: z.boolean().optional(),
|
|
595
|
+
provisioningInfo: z.lazy(() => marshalProvisioningInfoSchema).optional(),
|
|
596
|
+
fullName: z.string().optional(),
|
|
597
|
+
securableType: z.enum(SecurableType).optional(),
|
|
598
|
+
managedEncryptionSettings: z
|
|
599
|
+
.lazy(() => marshalEncryptionSettingsSchema)
|
|
600
|
+
.optional(),
|
|
601
|
+
properties: z.record(z.string(), z.string()).optional(),
|
|
602
|
+
options: z.record(z.string(), z.string()).optional(),
|
|
603
|
+
})
|
|
604
|
+
.transform(d => ({
|
|
605
|
+
name_arg: d.nameArg,
|
|
606
|
+
new_name: d.newName,
|
|
607
|
+
name: d.name,
|
|
608
|
+
owner: d.owner,
|
|
609
|
+
comment: d.comment,
|
|
610
|
+
storage_root: d.storageRoot,
|
|
611
|
+
enable_predictive_optimization: d.enablePredictiveOptimization,
|
|
612
|
+
catalog_type: d.catalogType,
|
|
613
|
+
provider_name: d.providerName,
|
|
614
|
+
share_name: d.shareName,
|
|
615
|
+
connection_name: d.connectionName,
|
|
616
|
+
metastore_id: d.metastoreId,
|
|
617
|
+
created_at: d.createdAt,
|
|
618
|
+
created_by: d.createdBy,
|
|
619
|
+
updated_at: d.updatedAt,
|
|
620
|
+
updated_by: d.updatedBy,
|
|
621
|
+
storage_location: d.storageLocation,
|
|
622
|
+
isolation_mode: d.isolationMode,
|
|
623
|
+
effective_predictive_optimization_flag:
|
|
624
|
+
d.effectivePredictiveOptimizationFlag,
|
|
625
|
+
browse_only: d.browseOnly,
|
|
626
|
+
provisioning_info: d.provisioningInfo,
|
|
627
|
+
full_name: d.fullName,
|
|
628
|
+
securable_type: d.securableType,
|
|
629
|
+
managed_encryption_settings: d.managedEncryptionSettings,
|
|
630
|
+
properties: d.properties,
|
|
631
|
+
options: d.options,
|
|
632
|
+
}));
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
import type {Credentials} from '@databricks/sdk-auth';
|
|
4
|
+
import {defaultCredentials} from '@databricks/sdk-auth/credentials';
|
|
5
|
+
import type {
|
|
6
|
+
HttpClient,
|
|
7
|
+
HttpRequest,
|
|
8
|
+
HttpResponse,
|
|
9
|
+
} from '@databricks/sdk-core/http';
|
|
10
|
+
import {newFetchHttpClient} from '@databricks/sdk-core/http';
|
|
11
|
+
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
12
|
+
|
|
13
|
+
/** Creates a new HTTP client with the given options. */
|
|
14
|
+
export function newHttpClient(options?: ClientOptions): HttpClient {
|
|
15
|
+
const opts = options ?? {};
|
|
16
|
+
|
|
17
|
+
// If an HTTP client is provided, use it as-is. Throw if other options are
|
|
18
|
+
// also set, since they would be silently ignored.
|
|
19
|
+
if (opts.httpClient !== undefined) {
|
|
20
|
+
if (opts.credentials !== undefined || opts.timeout !== undefined) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
'httpClient cannot be combined with credentials or timeout'
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return opts.httpClient;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const credentials = opts.credentials ?? defaultCredentials();
|
|
29
|
+
|
|
30
|
+
const base = newFetchHttpClient();
|
|
31
|
+
let client: HttpClient = new AuthHttpClient(base, credentials);
|
|
32
|
+
|
|
33
|
+
if (opts.timeout !== undefined) {
|
|
34
|
+
client = new TimeoutHttpClient(client, opts.timeout);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return client;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
+
class AuthHttpClient implements HttpClient {
|
|
42
|
+
constructor(
|
|
43
|
+
private readonly base: HttpClient,
|
|
44
|
+
private readonly credentials: Credentials
|
|
45
|
+
) {}
|
|
46
|
+
|
|
47
|
+
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
48
|
+
const authHeaders = await this.credentials.authHeaders();
|
|
49
|
+
// Do not modify the original request.
|
|
50
|
+
const headers = new Headers(request.headers);
|
|
51
|
+
for (const h of authHeaders) {
|
|
52
|
+
headers.set(h.key, h.value);
|
|
53
|
+
}
|
|
54
|
+
return this.base.send({...request, headers});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
+
class TimeoutHttpClient implements HttpClient {
|
|
60
|
+
constructor(
|
|
61
|
+
private readonly base: HttpClient,
|
|
62
|
+
private readonly timeout: number
|
|
63
|
+
) {}
|
|
64
|
+
|
|
65
|
+
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
66
|
+
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
67
|
+
const signal =
|
|
68
|
+
request.signal !== undefined
|
|
69
|
+
? AbortSignal.any([request.signal, timeoutSignal])
|
|
70
|
+
: timeoutSignal;
|
|
71
|
+
return this.base.send({...request, signal});
|
|
72
|
+
}
|
|
73
|
+
}
|