databricks-sdk 0.44.1__py3-none-any.whl → 0.45.0__py3-none-any.whl
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.
Potentially problematic release.
This version of databricks-sdk might be problematic. Click here for more details.
- databricks/sdk/__init__.py +123 -115
- databricks/sdk/_base_client.py +112 -88
- databricks/sdk/_property.py +12 -7
- databricks/sdk/_widgets/__init__.py +13 -2
- databricks/sdk/_widgets/default_widgets_utils.py +21 -15
- databricks/sdk/_widgets/ipywidgets_utils.py +47 -24
- databricks/sdk/azure.py +8 -6
- databricks/sdk/casing.py +5 -5
- databricks/sdk/config.py +152 -99
- databricks/sdk/core.py +57 -47
- databricks/sdk/credentials_provider.py +300 -205
- databricks/sdk/data_plane.py +86 -3
- databricks/sdk/dbutils.py +123 -87
- databricks/sdk/environments.py +52 -35
- databricks/sdk/errors/base.py +61 -35
- databricks/sdk/errors/customizer.py +3 -3
- databricks/sdk/errors/deserializer.py +38 -25
- databricks/sdk/errors/details.py +417 -0
- databricks/sdk/errors/mapper.py +1 -1
- databricks/sdk/errors/overrides.py +27 -24
- databricks/sdk/errors/parser.py +26 -14
- databricks/sdk/errors/platform.py +10 -10
- databricks/sdk/errors/private_link.py +24 -24
- databricks/sdk/logger/round_trip_logger.py +28 -20
- databricks/sdk/mixins/compute.py +90 -60
- databricks/sdk/mixins/files.py +815 -145
- databricks/sdk/mixins/jobs.py +191 -16
- databricks/sdk/mixins/open_ai_client.py +26 -20
- databricks/sdk/mixins/workspace.py +45 -34
- databricks/sdk/oauth.py +372 -196
- databricks/sdk/retries.py +14 -12
- databricks/sdk/runtime/__init__.py +34 -17
- databricks/sdk/runtime/dbutils_stub.py +52 -39
- databricks/sdk/service/_internal.py +12 -7
- databricks/sdk/service/apps.py +618 -418
- databricks/sdk/service/billing.py +827 -604
- databricks/sdk/service/catalog.py +6552 -4474
- databricks/sdk/service/cleanrooms.py +550 -388
- databricks/sdk/service/compute.py +5241 -3531
- databricks/sdk/service/dashboards.py +1313 -923
- databricks/sdk/service/files.py +442 -309
- databricks/sdk/service/iam.py +2115 -1483
- databricks/sdk/service/jobs.py +4151 -2588
- databricks/sdk/service/marketplace.py +2210 -1517
- databricks/sdk/service/ml.py +3364 -2255
- databricks/sdk/service/oauth2.py +922 -584
- databricks/sdk/service/pipelines.py +1865 -1203
- databricks/sdk/service/provisioning.py +1435 -1029
- databricks/sdk/service/serving.py +2040 -1278
- databricks/sdk/service/settings.py +2846 -1929
- databricks/sdk/service/sharing.py +2201 -877
- databricks/sdk/service/sql.py +4650 -3103
- databricks/sdk/service/vectorsearch.py +816 -550
- databricks/sdk/service/workspace.py +1330 -906
- databricks/sdk/useragent.py +36 -22
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.44.1.dist-info → databricks_sdk-0.45.0.dist-info}/METADATA +31 -31
- databricks_sdk-0.45.0.dist-info/RECORD +70 -0
- {databricks_sdk-0.44.1.dist-info → databricks_sdk-0.45.0.dist-info}/WHEEL +1 -1
- databricks_sdk-0.44.1.dist-info/RECORD +0 -69
- {databricks_sdk-0.44.1.dist-info → databricks_sdk-0.45.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.44.1.dist-info → databricks_sdk-0.45.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.44.1.dist-info → databricks_sdk-0.45.0.dist-info}/top_level.txt +0 -0
|
@@ -5,11 +5,12 @@ from __future__ import annotations
|
|
|
5
5
|
import logging
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
from enum import Enum
|
|
8
|
-
from typing import Dict, Iterator, List, Optional
|
|
8
|
+
from typing import Any, Dict, Iterator, List, Optional
|
|
9
9
|
|
|
10
10
|
from ._internal import _enum, _from_dict, _repeated_dict, _repeated_enum
|
|
11
11
|
|
|
12
|
-
_LOG = logging.getLogger(
|
|
12
|
+
_LOG = logging.getLogger("databricks.sdk")
|
|
13
|
+
|
|
13
14
|
|
|
14
15
|
from databricks.sdk.service import catalog
|
|
15
16
|
|
|
@@ -19,8 +20,38 @@ from databricks.sdk.service import catalog
|
|
|
19
20
|
class AuthenticationType(Enum):
|
|
20
21
|
"""The delta sharing authentication type."""
|
|
21
22
|
|
|
22
|
-
DATABRICKS =
|
|
23
|
-
|
|
23
|
+
DATABRICKS = "DATABRICKS"
|
|
24
|
+
OAUTH_CLIENT_CREDENTIALS = "OAUTH_CLIENT_CREDENTIALS"
|
|
25
|
+
TOKEN = "TOKEN"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ColumnTypeName(Enum):
|
|
29
|
+
"""UC supported column types Copied from
|
|
30
|
+
https://src.dev.databricks.com/databricks/universe@23a85902bb58695ab9293adc9f327b0714b55e72/-/blob/managed-catalog/api/messages/table.proto?L68
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
ARRAY = "ARRAY"
|
|
34
|
+
BINARY = "BINARY"
|
|
35
|
+
BOOLEAN = "BOOLEAN"
|
|
36
|
+
BYTE = "BYTE"
|
|
37
|
+
CHAR = "CHAR"
|
|
38
|
+
DATE = "DATE"
|
|
39
|
+
DECIMAL = "DECIMAL"
|
|
40
|
+
DOUBLE = "DOUBLE"
|
|
41
|
+
FLOAT = "FLOAT"
|
|
42
|
+
INT = "INT"
|
|
43
|
+
INTERVAL = "INTERVAL"
|
|
44
|
+
LONG = "LONG"
|
|
45
|
+
MAP = "MAP"
|
|
46
|
+
NULL = "NULL"
|
|
47
|
+
SHORT = "SHORT"
|
|
48
|
+
STRING = "STRING"
|
|
49
|
+
STRUCT = "STRUCT"
|
|
50
|
+
TABLE_TYPE = "TABLE_TYPE"
|
|
51
|
+
TIMESTAMP = "TIMESTAMP"
|
|
52
|
+
TIMESTAMP_NTZ = "TIMESTAMP_NTZ"
|
|
53
|
+
USER_DEFINED_TYPE = "USER_DEFINED_TYPE"
|
|
54
|
+
VARIANT = "VARIANT"
|
|
24
55
|
|
|
25
56
|
|
|
26
57
|
@dataclass
|
|
@@ -41,28 +72,38 @@ class CreateProvider:
|
|
|
41
72
|
def as_dict(self) -> dict:
|
|
42
73
|
"""Serializes the CreateProvider into a dictionary suitable for use as a JSON request body."""
|
|
43
74
|
body = {}
|
|
44
|
-
if self.authentication_type is not None:
|
|
45
|
-
|
|
46
|
-
if self.
|
|
47
|
-
|
|
75
|
+
if self.authentication_type is not None:
|
|
76
|
+
body["authentication_type"] = self.authentication_type.value
|
|
77
|
+
if self.comment is not None:
|
|
78
|
+
body["comment"] = self.comment
|
|
79
|
+
if self.name is not None:
|
|
80
|
+
body["name"] = self.name
|
|
81
|
+
if self.recipient_profile_str is not None:
|
|
82
|
+
body["recipient_profile_str"] = self.recipient_profile_str
|
|
48
83
|
return body
|
|
49
84
|
|
|
50
85
|
def as_shallow_dict(self) -> dict:
|
|
51
86
|
"""Serializes the CreateProvider into a shallow dictionary of its immediate attributes."""
|
|
52
87
|
body = {}
|
|
53
|
-
if self.authentication_type is not None:
|
|
54
|
-
|
|
55
|
-
if self.
|
|
56
|
-
|
|
88
|
+
if self.authentication_type is not None:
|
|
89
|
+
body["authentication_type"] = self.authentication_type
|
|
90
|
+
if self.comment is not None:
|
|
91
|
+
body["comment"] = self.comment
|
|
92
|
+
if self.name is not None:
|
|
93
|
+
body["name"] = self.name
|
|
94
|
+
if self.recipient_profile_str is not None:
|
|
95
|
+
body["recipient_profile_str"] = self.recipient_profile_str
|
|
57
96
|
return body
|
|
58
97
|
|
|
59
98
|
@classmethod
|
|
60
|
-
def from_dict(cls, d: Dict[str,
|
|
99
|
+
def from_dict(cls, d: Dict[str, Any]) -> CreateProvider:
|
|
61
100
|
"""Deserializes the CreateProvider from a dictionary."""
|
|
62
|
-
return cls(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
101
|
+
return cls(
|
|
102
|
+
authentication_type=_enum(d, "authentication_type", AuthenticationType),
|
|
103
|
+
comment=d.get("comment", None),
|
|
104
|
+
name=d.get("name", None),
|
|
105
|
+
recipient_profile_str=d.get("recipient_profile_str", None),
|
|
106
|
+
)
|
|
66
107
|
|
|
67
108
|
|
|
68
109
|
@dataclass
|
|
@@ -102,45 +143,63 @@ class CreateRecipient:
|
|
|
102
143
|
def as_dict(self) -> dict:
|
|
103
144
|
"""Serializes the CreateRecipient into a dictionary suitable for use as a JSON request body."""
|
|
104
145
|
body = {}
|
|
105
|
-
if self.authentication_type is not None:
|
|
106
|
-
|
|
146
|
+
if self.authentication_type is not None:
|
|
147
|
+
body["authentication_type"] = self.authentication_type.value
|
|
148
|
+
if self.comment is not None:
|
|
149
|
+
body["comment"] = self.comment
|
|
107
150
|
if self.data_recipient_global_metastore_id is not None:
|
|
108
|
-
body[
|
|
109
|
-
if self.expiration_time is not None:
|
|
110
|
-
|
|
111
|
-
if self.
|
|
112
|
-
|
|
113
|
-
if self.
|
|
114
|
-
|
|
151
|
+
body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id
|
|
152
|
+
if self.expiration_time is not None:
|
|
153
|
+
body["expiration_time"] = self.expiration_time
|
|
154
|
+
if self.ip_access_list:
|
|
155
|
+
body["ip_access_list"] = self.ip_access_list.as_dict()
|
|
156
|
+
if self.name is not None:
|
|
157
|
+
body["name"] = self.name
|
|
158
|
+
if self.owner is not None:
|
|
159
|
+
body["owner"] = self.owner
|
|
160
|
+
if self.properties_kvpairs:
|
|
161
|
+
body["properties_kvpairs"] = self.properties_kvpairs.as_dict()
|
|
162
|
+
if self.sharing_code is not None:
|
|
163
|
+
body["sharing_code"] = self.sharing_code
|
|
115
164
|
return body
|
|
116
165
|
|
|
117
166
|
def as_shallow_dict(self) -> dict:
|
|
118
167
|
"""Serializes the CreateRecipient into a shallow dictionary of its immediate attributes."""
|
|
119
168
|
body = {}
|
|
120
|
-
if self.authentication_type is not None:
|
|
121
|
-
|
|
169
|
+
if self.authentication_type is not None:
|
|
170
|
+
body["authentication_type"] = self.authentication_type
|
|
171
|
+
if self.comment is not None:
|
|
172
|
+
body["comment"] = self.comment
|
|
122
173
|
if self.data_recipient_global_metastore_id is not None:
|
|
123
|
-
body[
|
|
124
|
-
if self.expiration_time is not None:
|
|
125
|
-
|
|
126
|
-
if self.
|
|
127
|
-
|
|
128
|
-
if self.
|
|
129
|
-
|
|
174
|
+
body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id
|
|
175
|
+
if self.expiration_time is not None:
|
|
176
|
+
body["expiration_time"] = self.expiration_time
|
|
177
|
+
if self.ip_access_list:
|
|
178
|
+
body["ip_access_list"] = self.ip_access_list
|
|
179
|
+
if self.name is not None:
|
|
180
|
+
body["name"] = self.name
|
|
181
|
+
if self.owner is not None:
|
|
182
|
+
body["owner"] = self.owner
|
|
183
|
+
if self.properties_kvpairs:
|
|
184
|
+
body["properties_kvpairs"] = self.properties_kvpairs
|
|
185
|
+
if self.sharing_code is not None:
|
|
186
|
+
body["sharing_code"] = self.sharing_code
|
|
130
187
|
return body
|
|
131
188
|
|
|
132
189
|
@classmethod
|
|
133
|
-
def from_dict(cls, d: Dict[str,
|
|
190
|
+
def from_dict(cls, d: Dict[str, Any]) -> CreateRecipient:
|
|
134
191
|
"""Deserializes the CreateRecipient from a dictionary."""
|
|
135
|
-
return cls(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
192
|
+
return cls(
|
|
193
|
+
authentication_type=_enum(d, "authentication_type", AuthenticationType),
|
|
194
|
+
comment=d.get("comment", None),
|
|
195
|
+
data_recipient_global_metastore_id=d.get("data_recipient_global_metastore_id", None),
|
|
196
|
+
expiration_time=d.get("expiration_time", None),
|
|
197
|
+
ip_access_list=_from_dict(d, "ip_access_list", IpAccessList),
|
|
198
|
+
name=d.get("name", None),
|
|
199
|
+
owner=d.get("owner", None),
|
|
200
|
+
properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs),
|
|
201
|
+
sharing_code=d.get("sharing_code", None),
|
|
202
|
+
)
|
|
144
203
|
|
|
145
204
|
|
|
146
205
|
@dataclass
|
|
@@ -157,30 +216,33 @@ class CreateShare:
|
|
|
157
216
|
def as_dict(self) -> dict:
|
|
158
217
|
"""Serializes the CreateShare into a dictionary suitable for use as a JSON request body."""
|
|
159
218
|
body = {}
|
|
160
|
-
if self.comment is not None:
|
|
161
|
-
|
|
162
|
-
if self.
|
|
219
|
+
if self.comment is not None:
|
|
220
|
+
body["comment"] = self.comment
|
|
221
|
+
if self.name is not None:
|
|
222
|
+
body["name"] = self.name
|
|
223
|
+
if self.storage_root is not None:
|
|
224
|
+
body["storage_root"] = self.storage_root
|
|
163
225
|
return body
|
|
164
226
|
|
|
165
227
|
def as_shallow_dict(self) -> dict:
|
|
166
228
|
"""Serializes the CreateShare into a shallow dictionary of its immediate attributes."""
|
|
167
229
|
body = {}
|
|
168
|
-
if self.comment is not None:
|
|
169
|
-
|
|
170
|
-
if self.
|
|
230
|
+
if self.comment is not None:
|
|
231
|
+
body["comment"] = self.comment
|
|
232
|
+
if self.name is not None:
|
|
233
|
+
body["name"] = self.name
|
|
234
|
+
if self.storage_root is not None:
|
|
235
|
+
body["storage_root"] = self.storage_root
|
|
171
236
|
return body
|
|
172
237
|
|
|
173
238
|
@classmethod
|
|
174
|
-
def from_dict(cls, d: Dict[str,
|
|
239
|
+
def from_dict(cls, d: Dict[str, Any]) -> CreateShare:
|
|
175
240
|
"""Deserializes the CreateShare from a dictionary."""
|
|
176
|
-
return cls(comment=d.get(
|
|
177
|
-
name=d.get('name', None),
|
|
178
|
-
storage_root=d.get('storage_root', None))
|
|
241
|
+
return cls(comment=d.get("comment", None), name=d.get("name", None), storage_root=d.get("storage_root", None))
|
|
179
242
|
|
|
180
243
|
|
|
181
244
|
@dataclass
|
|
182
245
|
class DeleteResponse:
|
|
183
|
-
|
|
184
246
|
def as_dict(self) -> dict:
|
|
185
247
|
"""Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body."""
|
|
186
248
|
body = {}
|
|
@@ -192,14 +254,444 @@ class DeleteResponse:
|
|
|
192
254
|
return body
|
|
193
255
|
|
|
194
256
|
@classmethod
|
|
195
|
-
def from_dict(cls, d: Dict[str,
|
|
257
|
+
def from_dict(cls, d: Dict[str, Any]) -> DeleteResponse:
|
|
196
258
|
"""Deserializes the DeleteResponse from a dictionary."""
|
|
197
259
|
return cls()
|
|
198
260
|
|
|
199
261
|
|
|
200
262
|
@dataclass
|
|
201
|
-
class
|
|
263
|
+
class DeltaSharingDependency:
|
|
264
|
+
"""Represents a UC dependency."""
|
|
265
|
+
|
|
266
|
+
function: Optional[DeltaSharingFunctionDependency] = None
|
|
267
|
+
"""A Function in UC as a dependency."""
|
|
268
|
+
|
|
269
|
+
table: Optional[DeltaSharingTableDependency] = None
|
|
270
|
+
"""A Table in UC as a dependency."""
|
|
271
|
+
|
|
272
|
+
def as_dict(self) -> dict:
|
|
273
|
+
"""Serializes the DeltaSharingDependency into a dictionary suitable for use as a JSON request body."""
|
|
274
|
+
body = {}
|
|
275
|
+
if self.function:
|
|
276
|
+
body["function"] = self.function.as_dict()
|
|
277
|
+
if self.table:
|
|
278
|
+
body["table"] = self.table.as_dict()
|
|
279
|
+
return body
|
|
280
|
+
|
|
281
|
+
def as_shallow_dict(self) -> dict:
|
|
282
|
+
"""Serializes the DeltaSharingDependency into a shallow dictionary of its immediate attributes."""
|
|
283
|
+
body = {}
|
|
284
|
+
if self.function:
|
|
285
|
+
body["function"] = self.function
|
|
286
|
+
if self.table:
|
|
287
|
+
body["table"] = self.table
|
|
288
|
+
return body
|
|
289
|
+
|
|
290
|
+
@classmethod
|
|
291
|
+
def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingDependency:
|
|
292
|
+
"""Deserializes the DeltaSharingDependency from a dictionary."""
|
|
293
|
+
return cls(
|
|
294
|
+
function=_from_dict(d, "function", DeltaSharingFunctionDependency),
|
|
295
|
+
table=_from_dict(d, "table", DeltaSharingTableDependency),
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
@dataclass
|
|
300
|
+
class DeltaSharingDependencyList:
|
|
301
|
+
"""Represents a list of dependencies."""
|
|
302
|
+
|
|
303
|
+
dependencies: Optional[List[DeltaSharingDependency]] = None
|
|
304
|
+
"""An array of Dependency."""
|
|
305
|
+
|
|
306
|
+
def as_dict(self) -> dict:
|
|
307
|
+
"""Serializes the DeltaSharingDependencyList into a dictionary suitable for use as a JSON request body."""
|
|
308
|
+
body = {}
|
|
309
|
+
if self.dependencies:
|
|
310
|
+
body["dependencies"] = [v.as_dict() for v in self.dependencies]
|
|
311
|
+
return body
|
|
312
|
+
|
|
313
|
+
def as_shallow_dict(self) -> dict:
|
|
314
|
+
"""Serializes the DeltaSharingDependencyList into a shallow dictionary of its immediate attributes."""
|
|
315
|
+
body = {}
|
|
316
|
+
if self.dependencies:
|
|
317
|
+
body["dependencies"] = self.dependencies
|
|
318
|
+
return body
|
|
319
|
+
|
|
320
|
+
@classmethod
|
|
321
|
+
def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingDependencyList:
|
|
322
|
+
"""Deserializes the DeltaSharingDependencyList from a dictionary."""
|
|
323
|
+
return cls(dependencies=_repeated_dict(d, "dependencies", DeltaSharingDependency))
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
@dataclass
|
|
327
|
+
class DeltaSharingFunctionDependency:
|
|
328
|
+
"""A Function in UC as a dependency."""
|
|
329
|
+
|
|
330
|
+
function_name: Optional[str] = None
|
|
331
|
+
|
|
332
|
+
schema_name: Optional[str] = None
|
|
333
|
+
|
|
334
|
+
def as_dict(self) -> dict:
|
|
335
|
+
"""Serializes the DeltaSharingFunctionDependency into a dictionary suitable for use as a JSON request body."""
|
|
336
|
+
body = {}
|
|
337
|
+
if self.function_name is not None:
|
|
338
|
+
body["function_name"] = self.function_name
|
|
339
|
+
if self.schema_name is not None:
|
|
340
|
+
body["schema_name"] = self.schema_name
|
|
341
|
+
return body
|
|
342
|
+
|
|
343
|
+
def as_shallow_dict(self) -> dict:
|
|
344
|
+
"""Serializes the DeltaSharingFunctionDependency into a shallow dictionary of its immediate attributes."""
|
|
345
|
+
body = {}
|
|
346
|
+
if self.function_name is not None:
|
|
347
|
+
body["function_name"] = self.function_name
|
|
348
|
+
if self.schema_name is not None:
|
|
349
|
+
body["schema_name"] = self.schema_name
|
|
350
|
+
return body
|
|
351
|
+
|
|
352
|
+
@classmethod
|
|
353
|
+
def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingFunctionDependency:
|
|
354
|
+
"""Deserializes the DeltaSharingFunctionDependency from a dictionary."""
|
|
355
|
+
return cls(function_name=d.get("function_name", None), schema_name=d.get("schema_name", None))
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
@dataclass
|
|
359
|
+
class DeltaSharingTableDependency:
|
|
360
|
+
"""A Table in UC as a dependency."""
|
|
361
|
+
|
|
362
|
+
schema_name: Optional[str] = None
|
|
363
|
+
|
|
364
|
+
table_name: Optional[str] = None
|
|
365
|
+
|
|
366
|
+
def as_dict(self) -> dict:
|
|
367
|
+
"""Serializes the DeltaSharingTableDependency into a dictionary suitable for use as a JSON request body."""
|
|
368
|
+
body = {}
|
|
369
|
+
if self.schema_name is not None:
|
|
370
|
+
body["schema_name"] = self.schema_name
|
|
371
|
+
if self.table_name is not None:
|
|
372
|
+
body["table_name"] = self.table_name
|
|
373
|
+
return body
|
|
374
|
+
|
|
375
|
+
def as_shallow_dict(self) -> dict:
|
|
376
|
+
"""Serializes the DeltaSharingTableDependency into a shallow dictionary of its immediate attributes."""
|
|
377
|
+
body = {}
|
|
378
|
+
if self.schema_name is not None:
|
|
379
|
+
body["schema_name"] = self.schema_name
|
|
380
|
+
if self.table_name is not None:
|
|
381
|
+
body["table_name"] = self.table_name
|
|
382
|
+
return body
|
|
383
|
+
|
|
384
|
+
@classmethod
|
|
385
|
+
def from_dict(cls, d: Dict[str, Any]) -> DeltaSharingTableDependency:
|
|
386
|
+
"""Deserializes the DeltaSharingTableDependency from a dictionary."""
|
|
387
|
+
return cls(schema_name=d.get("schema_name", None), table_name=d.get("table_name", None))
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
@dataclass
|
|
391
|
+
class Function:
|
|
392
|
+
aliases: Optional[List[RegisteredModelAlias]] = None
|
|
393
|
+
"""The aliass of registered model."""
|
|
394
|
+
|
|
395
|
+
comment: Optional[str] = None
|
|
396
|
+
"""The comment of the function."""
|
|
397
|
+
|
|
398
|
+
data_type: Optional[ColumnTypeName] = None
|
|
399
|
+
"""The data type of the function."""
|
|
400
|
+
|
|
401
|
+
dependency_list: Optional[DeltaSharingDependencyList] = None
|
|
402
|
+
"""The dependency list of the function."""
|
|
403
|
+
|
|
404
|
+
full_data_type: Optional[str] = None
|
|
405
|
+
"""The full data type of the function."""
|
|
406
|
+
|
|
407
|
+
id: Optional[str] = None
|
|
408
|
+
"""The id of the function."""
|
|
409
|
+
|
|
410
|
+
input_params: Optional[FunctionParameterInfos] = None
|
|
411
|
+
"""The function parameter information."""
|
|
412
|
+
|
|
413
|
+
name: Optional[str] = None
|
|
414
|
+
"""The name of the function."""
|
|
415
|
+
|
|
416
|
+
properties: Optional[str] = None
|
|
417
|
+
"""The properties of the function."""
|
|
418
|
+
|
|
419
|
+
routine_definition: Optional[str] = None
|
|
420
|
+
"""The routine definition of the function."""
|
|
421
|
+
|
|
422
|
+
schema: Optional[str] = None
|
|
423
|
+
"""The name of the schema that the function belongs to."""
|
|
424
|
+
|
|
425
|
+
securable_kind: Optional[SharedSecurableKind] = None
|
|
426
|
+
"""The securable kind of the function."""
|
|
427
|
+
|
|
428
|
+
share: Optional[str] = None
|
|
429
|
+
"""The name of the share that the function belongs to."""
|
|
430
|
+
|
|
431
|
+
share_id: Optional[str] = None
|
|
432
|
+
"""The id of the share that the function belongs to."""
|
|
433
|
+
|
|
434
|
+
storage_location: Optional[str] = None
|
|
435
|
+
"""The storage location of the function."""
|
|
436
|
+
|
|
437
|
+
tags: Optional[List[catalog.TagKeyValue]] = None
|
|
438
|
+
"""The tags of the function."""
|
|
439
|
+
|
|
440
|
+
def as_dict(self) -> dict:
|
|
441
|
+
"""Serializes the Function into a dictionary suitable for use as a JSON request body."""
|
|
442
|
+
body = {}
|
|
443
|
+
if self.aliases:
|
|
444
|
+
body["aliases"] = [v.as_dict() for v in self.aliases]
|
|
445
|
+
if self.comment is not None:
|
|
446
|
+
body["comment"] = self.comment
|
|
447
|
+
if self.data_type is not None:
|
|
448
|
+
body["data_type"] = self.data_type.value
|
|
449
|
+
if self.dependency_list:
|
|
450
|
+
body["dependency_list"] = self.dependency_list.as_dict()
|
|
451
|
+
if self.full_data_type is not None:
|
|
452
|
+
body["full_data_type"] = self.full_data_type
|
|
453
|
+
if self.id is not None:
|
|
454
|
+
body["id"] = self.id
|
|
455
|
+
if self.input_params:
|
|
456
|
+
body["input_params"] = self.input_params.as_dict()
|
|
457
|
+
if self.name is not None:
|
|
458
|
+
body["name"] = self.name
|
|
459
|
+
if self.properties is not None:
|
|
460
|
+
body["properties"] = self.properties
|
|
461
|
+
if self.routine_definition is not None:
|
|
462
|
+
body["routine_definition"] = self.routine_definition
|
|
463
|
+
if self.schema is not None:
|
|
464
|
+
body["schema"] = self.schema
|
|
465
|
+
if self.securable_kind is not None:
|
|
466
|
+
body["securable_kind"] = self.securable_kind.value
|
|
467
|
+
if self.share is not None:
|
|
468
|
+
body["share"] = self.share
|
|
469
|
+
if self.share_id is not None:
|
|
470
|
+
body["share_id"] = self.share_id
|
|
471
|
+
if self.storage_location is not None:
|
|
472
|
+
body["storage_location"] = self.storage_location
|
|
473
|
+
if self.tags:
|
|
474
|
+
body["tags"] = [v.as_dict() for v in self.tags]
|
|
475
|
+
return body
|
|
476
|
+
|
|
477
|
+
def as_shallow_dict(self) -> dict:
|
|
478
|
+
"""Serializes the Function into a shallow dictionary of its immediate attributes."""
|
|
479
|
+
body = {}
|
|
480
|
+
if self.aliases:
|
|
481
|
+
body["aliases"] = self.aliases
|
|
482
|
+
if self.comment is not None:
|
|
483
|
+
body["comment"] = self.comment
|
|
484
|
+
if self.data_type is not None:
|
|
485
|
+
body["data_type"] = self.data_type
|
|
486
|
+
if self.dependency_list:
|
|
487
|
+
body["dependency_list"] = self.dependency_list
|
|
488
|
+
if self.full_data_type is not None:
|
|
489
|
+
body["full_data_type"] = self.full_data_type
|
|
490
|
+
if self.id is not None:
|
|
491
|
+
body["id"] = self.id
|
|
492
|
+
if self.input_params:
|
|
493
|
+
body["input_params"] = self.input_params
|
|
494
|
+
if self.name is not None:
|
|
495
|
+
body["name"] = self.name
|
|
496
|
+
if self.properties is not None:
|
|
497
|
+
body["properties"] = self.properties
|
|
498
|
+
if self.routine_definition is not None:
|
|
499
|
+
body["routine_definition"] = self.routine_definition
|
|
500
|
+
if self.schema is not None:
|
|
501
|
+
body["schema"] = self.schema
|
|
502
|
+
if self.securable_kind is not None:
|
|
503
|
+
body["securable_kind"] = self.securable_kind
|
|
504
|
+
if self.share is not None:
|
|
505
|
+
body["share"] = self.share
|
|
506
|
+
if self.share_id is not None:
|
|
507
|
+
body["share_id"] = self.share_id
|
|
508
|
+
if self.storage_location is not None:
|
|
509
|
+
body["storage_location"] = self.storage_location
|
|
510
|
+
if self.tags:
|
|
511
|
+
body["tags"] = self.tags
|
|
512
|
+
return body
|
|
513
|
+
|
|
514
|
+
@classmethod
|
|
515
|
+
def from_dict(cls, d: Dict[str, Any]) -> Function:
|
|
516
|
+
"""Deserializes the Function from a dictionary."""
|
|
517
|
+
return cls(
|
|
518
|
+
aliases=_repeated_dict(d, "aliases", RegisteredModelAlias),
|
|
519
|
+
comment=d.get("comment", None),
|
|
520
|
+
data_type=_enum(d, "data_type", ColumnTypeName),
|
|
521
|
+
dependency_list=_from_dict(d, "dependency_list", DeltaSharingDependencyList),
|
|
522
|
+
full_data_type=d.get("full_data_type", None),
|
|
523
|
+
id=d.get("id", None),
|
|
524
|
+
input_params=_from_dict(d, "input_params", FunctionParameterInfos),
|
|
525
|
+
name=d.get("name", None),
|
|
526
|
+
properties=d.get("properties", None),
|
|
527
|
+
routine_definition=d.get("routine_definition", None),
|
|
528
|
+
schema=d.get("schema", None),
|
|
529
|
+
securable_kind=_enum(d, "securable_kind", SharedSecurableKind),
|
|
530
|
+
share=d.get("share", None),
|
|
531
|
+
share_id=d.get("share_id", None),
|
|
532
|
+
storage_location=d.get("storage_location", None),
|
|
533
|
+
tags=_repeated_dict(d, "tags", catalog.TagKeyValue),
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
@dataclass
|
|
538
|
+
class FunctionParameterInfo:
|
|
539
|
+
"""Represents a parameter of a function. The same message is used for both input and output
|
|
540
|
+
columns."""
|
|
541
|
+
|
|
542
|
+
comment: Optional[str] = None
|
|
543
|
+
"""The comment of the parameter."""
|
|
544
|
+
|
|
545
|
+
name: Optional[str] = None
|
|
546
|
+
"""The name of the parameter."""
|
|
547
|
+
|
|
548
|
+
parameter_default: Optional[str] = None
|
|
549
|
+
"""The default value of the parameter."""
|
|
550
|
+
|
|
551
|
+
parameter_mode: Optional[FunctionParameterMode] = None
|
|
552
|
+
"""The mode of the function parameter."""
|
|
553
|
+
|
|
554
|
+
parameter_type: Optional[FunctionParameterType] = None
|
|
555
|
+
"""The type of the function parameter."""
|
|
556
|
+
|
|
557
|
+
position: Optional[int] = None
|
|
558
|
+
"""The position of the parameter."""
|
|
559
|
+
|
|
560
|
+
type_interval_type: Optional[str] = None
|
|
561
|
+
"""The interval type of the parameter type."""
|
|
562
|
+
|
|
563
|
+
type_json: Optional[str] = None
|
|
564
|
+
"""The type of the parameter in JSON format."""
|
|
565
|
+
|
|
566
|
+
type_name: Optional[ColumnTypeName] = None
|
|
567
|
+
"""The type of the parameter in Enum format."""
|
|
568
|
+
|
|
569
|
+
type_precision: Optional[int] = None
|
|
570
|
+
"""The precision of the parameter type."""
|
|
571
|
+
|
|
572
|
+
type_scale: Optional[int] = None
|
|
573
|
+
"""The scale of the parameter type."""
|
|
574
|
+
|
|
575
|
+
type_text: Optional[str] = None
|
|
576
|
+
"""The type of the parameter in text format."""
|
|
577
|
+
|
|
578
|
+
def as_dict(self) -> dict:
|
|
579
|
+
"""Serializes the FunctionParameterInfo into a dictionary suitable for use as a JSON request body."""
|
|
580
|
+
body = {}
|
|
581
|
+
if self.comment is not None:
|
|
582
|
+
body["comment"] = self.comment
|
|
583
|
+
if self.name is not None:
|
|
584
|
+
body["name"] = self.name
|
|
585
|
+
if self.parameter_default is not None:
|
|
586
|
+
body["parameter_default"] = self.parameter_default
|
|
587
|
+
if self.parameter_mode is not None:
|
|
588
|
+
body["parameter_mode"] = self.parameter_mode.value
|
|
589
|
+
if self.parameter_type is not None:
|
|
590
|
+
body["parameter_type"] = self.parameter_type.value
|
|
591
|
+
if self.position is not None:
|
|
592
|
+
body["position"] = self.position
|
|
593
|
+
if self.type_interval_type is not None:
|
|
594
|
+
body["type_interval_type"] = self.type_interval_type
|
|
595
|
+
if self.type_json is not None:
|
|
596
|
+
body["type_json"] = self.type_json
|
|
597
|
+
if self.type_name is not None:
|
|
598
|
+
body["type_name"] = self.type_name.value
|
|
599
|
+
if self.type_precision is not None:
|
|
600
|
+
body["type_precision"] = self.type_precision
|
|
601
|
+
if self.type_scale is not None:
|
|
602
|
+
body["type_scale"] = self.type_scale
|
|
603
|
+
if self.type_text is not None:
|
|
604
|
+
body["type_text"] = self.type_text
|
|
605
|
+
return body
|
|
606
|
+
|
|
607
|
+
def as_shallow_dict(self) -> dict:
|
|
608
|
+
"""Serializes the FunctionParameterInfo into a shallow dictionary of its immediate attributes."""
|
|
609
|
+
body = {}
|
|
610
|
+
if self.comment is not None:
|
|
611
|
+
body["comment"] = self.comment
|
|
612
|
+
if self.name is not None:
|
|
613
|
+
body["name"] = self.name
|
|
614
|
+
if self.parameter_default is not None:
|
|
615
|
+
body["parameter_default"] = self.parameter_default
|
|
616
|
+
if self.parameter_mode is not None:
|
|
617
|
+
body["parameter_mode"] = self.parameter_mode
|
|
618
|
+
if self.parameter_type is not None:
|
|
619
|
+
body["parameter_type"] = self.parameter_type
|
|
620
|
+
if self.position is not None:
|
|
621
|
+
body["position"] = self.position
|
|
622
|
+
if self.type_interval_type is not None:
|
|
623
|
+
body["type_interval_type"] = self.type_interval_type
|
|
624
|
+
if self.type_json is not None:
|
|
625
|
+
body["type_json"] = self.type_json
|
|
626
|
+
if self.type_name is not None:
|
|
627
|
+
body["type_name"] = self.type_name
|
|
628
|
+
if self.type_precision is not None:
|
|
629
|
+
body["type_precision"] = self.type_precision
|
|
630
|
+
if self.type_scale is not None:
|
|
631
|
+
body["type_scale"] = self.type_scale
|
|
632
|
+
if self.type_text is not None:
|
|
633
|
+
body["type_text"] = self.type_text
|
|
634
|
+
return body
|
|
635
|
+
|
|
636
|
+
@classmethod
|
|
637
|
+
def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfo:
|
|
638
|
+
"""Deserializes the FunctionParameterInfo from a dictionary."""
|
|
639
|
+
return cls(
|
|
640
|
+
comment=d.get("comment", None),
|
|
641
|
+
name=d.get("name", None),
|
|
642
|
+
parameter_default=d.get("parameter_default", None),
|
|
643
|
+
parameter_mode=_enum(d, "parameter_mode", FunctionParameterMode),
|
|
644
|
+
parameter_type=_enum(d, "parameter_type", FunctionParameterType),
|
|
645
|
+
position=d.get("position", None),
|
|
646
|
+
type_interval_type=d.get("type_interval_type", None),
|
|
647
|
+
type_json=d.get("type_json", None),
|
|
648
|
+
type_name=_enum(d, "type_name", ColumnTypeName),
|
|
649
|
+
type_precision=d.get("type_precision", None),
|
|
650
|
+
type_scale=d.get("type_scale", None),
|
|
651
|
+
type_text=d.get("type_text", None),
|
|
652
|
+
)
|
|
653
|
+
|
|
202
654
|
|
|
655
|
+
@dataclass
|
|
656
|
+
class FunctionParameterInfos:
|
|
657
|
+
parameters: Optional[List[FunctionParameterInfo]] = None
|
|
658
|
+
"""The list of parameters of the function."""
|
|
659
|
+
|
|
660
|
+
def as_dict(self) -> dict:
|
|
661
|
+
"""Serializes the FunctionParameterInfos into a dictionary suitable for use as a JSON request body."""
|
|
662
|
+
body = {}
|
|
663
|
+
if self.parameters:
|
|
664
|
+
body["parameters"] = [v.as_dict() for v in self.parameters]
|
|
665
|
+
return body
|
|
666
|
+
|
|
667
|
+
def as_shallow_dict(self) -> dict:
|
|
668
|
+
"""Serializes the FunctionParameterInfos into a shallow dictionary of its immediate attributes."""
|
|
669
|
+
body = {}
|
|
670
|
+
if self.parameters:
|
|
671
|
+
body["parameters"] = self.parameters
|
|
672
|
+
return body
|
|
673
|
+
|
|
674
|
+
@classmethod
|
|
675
|
+
def from_dict(cls, d: Dict[str, Any]) -> FunctionParameterInfos:
|
|
676
|
+
"""Deserializes the FunctionParameterInfos from a dictionary."""
|
|
677
|
+
return cls(parameters=_repeated_dict(d, "parameters", FunctionParameterInfo))
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
class FunctionParameterMode(Enum):
|
|
681
|
+
|
|
682
|
+
IN = "IN"
|
|
683
|
+
INOUT = "INOUT"
|
|
684
|
+
OUT = "OUT"
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
class FunctionParameterType(Enum):
|
|
688
|
+
|
|
689
|
+
COLUMN = "COLUMN"
|
|
690
|
+
PARAM = "PARAM"
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
@dataclass
|
|
694
|
+
class GetActivationUrlInfoResponse:
|
|
203
695
|
def as_dict(self) -> dict:
|
|
204
696
|
"""Serializes the GetActivationUrlInfoResponse into a dictionary suitable for use as a JSON request body."""
|
|
205
697
|
body = {}
|
|
@@ -211,7 +703,7 @@ class GetActivationUrlInfoResponse:
|
|
|
211
703
|
return body
|
|
212
704
|
|
|
213
705
|
@classmethod
|
|
214
|
-
def from_dict(cls, d: Dict[str,
|
|
706
|
+
def from_dict(cls, d: Dict[str, Any]) -> GetActivationUrlInfoResponse:
|
|
215
707
|
"""Deserializes the GetActivationUrlInfoResponse from a dictionary."""
|
|
216
708
|
return cls()
|
|
217
709
|
|
|
@@ -228,22 +720,64 @@ class GetRecipientSharePermissionsResponse:
|
|
|
228
720
|
def as_dict(self) -> dict:
|
|
229
721
|
"""Serializes the GetRecipientSharePermissionsResponse into a dictionary suitable for use as a JSON request body."""
|
|
230
722
|
body = {}
|
|
231
|
-
if self.next_page_token is not None:
|
|
232
|
-
|
|
723
|
+
if self.next_page_token is not None:
|
|
724
|
+
body["next_page_token"] = self.next_page_token
|
|
725
|
+
if self.permissions_out:
|
|
726
|
+
body["permissions_out"] = [v.as_dict() for v in self.permissions_out]
|
|
233
727
|
return body
|
|
234
728
|
|
|
235
729
|
def as_shallow_dict(self) -> dict:
|
|
236
730
|
"""Serializes the GetRecipientSharePermissionsResponse into a shallow dictionary of its immediate attributes."""
|
|
237
731
|
body = {}
|
|
238
|
-
if self.next_page_token is not None:
|
|
239
|
-
|
|
732
|
+
if self.next_page_token is not None:
|
|
733
|
+
body["next_page_token"] = self.next_page_token
|
|
734
|
+
if self.permissions_out:
|
|
735
|
+
body["permissions_out"] = self.permissions_out
|
|
240
736
|
return body
|
|
241
737
|
|
|
242
738
|
@classmethod
|
|
243
|
-
def from_dict(cls, d: Dict[str,
|
|
739
|
+
def from_dict(cls, d: Dict[str, Any]) -> GetRecipientSharePermissionsResponse:
|
|
244
740
|
"""Deserializes the GetRecipientSharePermissionsResponse from a dictionary."""
|
|
245
|
-
return cls(
|
|
246
|
-
|
|
741
|
+
return cls(
|
|
742
|
+
next_page_token=d.get("next_page_token", None),
|
|
743
|
+
permissions_out=_repeated_dict(d, "permissions_out", ShareToPrivilegeAssignment),
|
|
744
|
+
)
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
@dataclass
|
|
748
|
+
class GetSharePermissionsResponse:
|
|
749
|
+
next_page_token: Optional[str] = None
|
|
750
|
+
"""Opaque token to retrieve the next page of results. Absent if there are no more pages.
|
|
751
|
+
__page_token__ should be set to this value for the next request (for the next page of results)."""
|
|
752
|
+
|
|
753
|
+
privilege_assignments: Optional[List[PrivilegeAssignment]] = None
|
|
754
|
+
"""The privileges assigned to each principal"""
|
|
755
|
+
|
|
756
|
+
def as_dict(self) -> dict:
|
|
757
|
+
"""Serializes the GetSharePermissionsResponse into a dictionary suitable for use as a JSON request body."""
|
|
758
|
+
body = {}
|
|
759
|
+
if self.next_page_token is not None:
|
|
760
|
+
body["next_page_token"] = self.next_page_token
|
|
761
|
+
if self.privilege_assignments:
|
|
762
|
+
body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments]
|
|
763
|
+
return body
|
|
764
|
+
|
|
765
|
+
def as_shallow_dict(self) -> dict:
|
|
766
|
+
"""Serializes the GetSharePermissionsResponse into a shallow dictionary of its immediate attributes."""
|
|
767
|
+
body = {}
|
|
768
|
+
if self.next_page_token is not None:
|
|
769
|
+
body["next_page_token"] = self.next_page_token
|
|
770
|
+
if self.privilege_assignments:
|
|
771
|
+
body["privilege_assignments"] = self.privilege_assignments
|
|
772
|
+
return body
|
|
773
|
+
|
|
774
|
+
@classmethod
|
|
775
|
+
def from_dict(cls, d: Dict[str, Any]) -> GetSharePermissionsResponse:
|
|
776
|
+
"""Deserializes the GetSharePermissionsResponse from a dictionary."""
|
|
777
|
+
return cls(
|
|
778
|
+
next_page_token=d.get("next_page_token", None),
|
|
779
|
+
privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment),
|
|
780
|
+
)
|
|
247
781
|
|
|
248
782
|
|
|
249
783
|
@dataclass
|
|
@@ -254,19 +788,74 @@ class IpAccessList:
|
|
|
254
788
|
def as_dict(self) -> dict:
|
|
255
789
|
"""Serializes the IpAccessList into a dictionary suitable for use as a JSON request body."""
|
|
256
790
|
body = {}
|
|
257
|
-
if self.allowed_ip_addresses:
|
|
791
|
+
if self.allowed_ip_addresses:
|
|
792
|
+
body["allowed_ip_addresses"] = [v for v in self.allowed_ip_addresses]
|
|
258
793
|
return body
|
|
259
794
|
|
|
260
795
|
def as_shallow_dict(self) -> dict:
|
|
261
796
|
"""Serializes the IpAccessList into a shallow dictionary of its immediate attributes."""
|
|
262
797
|
body = {}
|
|
263
|
-
if self.allowed_ip_addresses:
|
|
798
|
+
if self.allowed_ip_addresses:
|
|
799
|
+
body["allowed_ip_addresses"] = self.allowed_ip_addresses
|
|
264
800
|
return body
|
|
265
801
|
|
|
266
802
|
@classmethod
|
|
267
|
-
def from_dict(cls, d: Dict[str,
|
|
803
|
+
def from_dict(cls, d: Dict[str, Any]) -> IpAccessList:
|
|
268
804
|
"""Deserializes the IpAccessList from a dictionary."""
|
|
269
|
-
return cls(allowed_ip_addresses=d.get(
|
|
805
|
+
return cls(allowed_ip_addresses=d.get("allowed_ip_addresses", None))
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
@dataclass
|
|
809
|
+
class ListProviderShareAssetsResponse:
|
|
810
|
+
"""Response to ListProviderShareAssets, which contains the list of assets of a share."""
|
|
811
|
+
|
|
812
|
+
functions: Optional[List[Function]] = None
|
|
813
|
+
"""The list of functions in the share."""
|
|
814
|
+
|
|
815
|
+
notebooks: Optional[List[NotebookFile]] = None
|
|
816
|
+
"""The list of notebooks in the share."""
|
|
817
|
+
|
|
818
|
+
tables: Optional[List[Table]] = None
|
|
819
|
+
"""The list of tables in the share."""
|
|
820
|
+
|
|
821
|
+
volumes: Optional[List[Volume]] = None
|
|
822
|
+
"""The list of volumes in the share."""
|
|
823
|
+
|
|
824
|
+
def as_dict(self) -> dict:
|
|
825
|
+
"""Serializes the ListProviderShareAssetsResponse into a dictionary suitable for use as a JSON request body."""
|
|
826
|
+
body = {}
|
|
827
|
+
if self.functions:
|
|
828
|
+
body["functions"] = [v.as_dict() for v in self.functions]
|
|
829
|
+
if self.notebooks:
|
|
830
|
+
body["notebooks"] = [v.as_dict() for v in self.notebooks]
|
|
831
|
+
if self.tables:
|
|
832
|
+
body["tables"] = [v.as_dict() for v in self.tables]
|
|
833
|
+
if self.volumes:
|
|
834
|
+
body["volumes"] = [v.as_dict() for v in self.volumes]
|
|
835
|
+
return body
|
|
836
|
+
|
|
837
|
+
def as_shallow_dict(self) -> dict:
|
|
838
|
+
"""Serializes the ListProviderShareAssetsResponse into a shallow dictionary of its immediate attributes."""
|
|
839
|
+
body = {}
|
|
840
|
+
if self.functions:
|
|
841
|
+
body["functions"] = self.functions
|
|
842
|
+
if self.notebooks:
|
|
843
|
+
body["notebooks"] = self.notebooks
|
|
844
|
+
if self.tables:
|
|
845
|
+
body["tables"] = self.tables
|
|
846
|
+
if self.volumes:
|
|
847
|
+
body["volumes"] = self.volumes
|
|
848
|
+
return body
|
|
849
|
+
|
|
850
|
+
@classmethod
|
|
851
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListProviderShareAssetsResponse:
|
|
852
|
+
"""Deserializes the ListProviderShareAssetsResponse from a dictionary."""
|
|
853
|
+
return cls(
|
|
854
|
+
functions=_repeated_dict(d, "functions", Function),
|
|
855
|
+
notebooks=_repeated_dict(d, "notebooks", NotebookFile),
|
|
856
|
+
tables=_repeated_dict(d, "tables", Table),
|
|
857
|
+
volumes=_repeated_dict(d, "volumes", Volume),
|
|
858
|
+
)
|
|
270
859
|
|
|
271
860
|
|
|
272
861
|
@dataclass
|
|
@@ -281,22 +870,25 @@ class ListProviderSharesResponse:
|
|
|
281
870
|
def as_dict(self) -> dict:
|
|
282
871
|
"""Serializes the ListProviderSharesResponse into a dictionary suitable for use as a JSON request body."""
|
|
283
872
|
body = {}
|
|
284
|
-
if self.next_page_token is not None:
|
|
285
|
-
|
|
873
|
+
if self.next_page_token is not None:
|
|
874
|
+
body["next_page_token"] = self.next_page_token
|
|
875
|
+
if self.shares:
|
|
876
|
+
body["shares"] = [v.as_dict() for v in self.shares]
|
|
286
877
|
return body
|
|
287
878
|
|
|
288
879
|
def as_shallow_dict(self) -> dict:
|
|
289
880
|
"""Serializes the ListProviderSharesResponse into a shallow dictionary of its immediate attributes."""
|
|
290
881
|
body = {}
|
|
291
|
-
if self.next_page_token is not None:
|
|
292
|
-
|
|
882
|
+
if self.next_page_token is not None:
|
|
883
|
+
body["next_page_token"] = self.next_page_token
|
|
884
|
+
if self.shares:
|
|
885
|
+
body["shares"] = self.shares
|
|
293
886
|
return body
|
|
294
887
|
|
|
295
888
|
@classmethod
|
|
296
|
-
def from_dict(cls, d: Dict[str,
|
|
889
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListProviderSharesResponse:
|
|
297
890
|
"""Deserializes the ListProviderSharesResponse from a dictionary."""
|
|
298
|
-
return cls(next_page_token=d.get(
|
|
299
|
-
shares=_repeated_dict(d, 'shares', ProviderShare))
|
|
891
|
+
return cls(next_page_token=d.get("next_page_token", None), shares=_repeated_dict(d, "shares", ProviderShare))
|
|
300
892
|
|
|
301
893
|
|
|
302
894
|
@dataclass
|
|
@@ -311,22 +903,27 @@ class ListProvidersResponse:
|
|
|
311
903
|
def as_dict(self) -> dict:
|
|
312
904
|
"""Serializes the ListProvidersResponse into a dictionary suitable for use as a JSON request body."""
|
|
313
905
|
body = {}
|
|
314
|
-
if self.next_page_token is not None:
|
|
315
|
-
|
|
906
|
+
if self.next_page_token is not None:
|
|
907
|
+
body["next_page_token"] = self.next_page_token
|
|
908
|
+
if self.providers:
|
|
909
|
+
body["providers"] = [v.as_dict() for v in self.providers]
|
|
316
910
|
return body
|
|
317
911
|
|
|
318
912
|
def as_shallow_dict(self) -> dict:
|
|
319
913
|
"""Serializes the ListProvidersResponse into a shallow dictionary of its immediate attributes."""
|
|
320
914
|
body = {}
|
|
321
|
-
if self.next_page_token is not None:
|
|
322
|
-
|
|
915
|
+
if self.next_page_token is not None:
|
|
916
|
+
body["next_page_token"] = self.next_page_token
|
|
917
|
+
if self.providers:
|
|
918
|
+
body["providers"] = self.providers
|
|
323
919
|
return body
|
|
324
920
|
|
|
325
921
|
@classmethod
|
|
326
|
-
def from_dict(cls, d: Dict[str,
|
|
922
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListProvidersResponse:
|
|
327
923
|
"""Deserializes the ListProvidersResponse from a dictionary."""
|
|
328
|
-
return cls(
|
|
329
|
-
|
|
924
|
+
return cls(
|
|
925
|
+
next_page_token=d.get("next_page_token", None), providers=_repeated_dict(d, "providers", ProviderInfo)
|
|
926
|
+
)
|
|
330
927
|
|
|
331
928
|
|
|
332
929
|
@dataclass
|
|
@@ -341,22 +938,27 @@ class ListRecipientsResponse:
|
|
|
341
938
|
def as_dict(self) -> dict:
|
|
342
939
|
"""Serializes the ListRecipientsResponse into a dictionary suitable for use as a JSON request body."""
|
|
343
940
|
body = {}
|
|
344
|
-
if self.next_page_token is not None:
|
|
345
|
-
|
|
941
|
+
if self.next_page_token is not None:
|
|
942
|
+
body["next_page_token"] = self.next_page_token
|
|
943
|
+
if self.recipients:
|
|
944
|
+
body["recipients"] = [v.as_dict() for v in self.recipients]
|
|
346
945
|
return body
|
|
347
946
|
|
|
348
947
|
def as_shallow_dict(self) -> dict:
|
|
349
948
|
"""Serializes the ListRecipientsResponse into a shallow dictionary of its immediate attributes."""
|
|
350
949
|
body = {}
|
|
351
|
-
if self.next_page_token is not None:
|
|
352
|
-
|
|
950
|
+
if self.next_page_token is not None:
|
|
951
|
+
body["next_page_token"] = self.next_page_token
|
|
952
|
+
if self.recipients:
|
|
953
|
+
body["recipients"] = self.recipients
|
|
353
954
|
return body
|
|
354
955
|
|
|
355
956
|
@classmethod
|
|
356
|
-
def from_dict(cls, d: Dict[str,
|
|
957
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListRecipientsResponse:
|
|
357
958
|
"""Deserializes the ListRecipientsResponse from a dictionary."""
|
|
358
|
-
return cls(
|
|
359
|
-
|
|
959
|
+
return cls(
|
|
960
|
+
next_page_token=d.get("next_page_token", None), recipients=_repeated_dict(d, "recipients", RecipientInfo)
|
|
961
|
+
)
|
|
360
962
|
|
|
361
963
|
|
|
362
964
|
@dataclass
|
|
@@ -371,68 +973,117 @@ class ListSharesResponse:
|
|
|
371
973
|
def as_dict(self) -> dict:
|
|
372
974
|
"""Serializes the ListSharesResponse into a dictionary suitable for use as a JSON request body."""
|
|
373
975
|
body = {}
|
|
374
|
-
if self.next_page_token is not None:
|
|
375
|
-
|
|
976
|
+
if self.next_page_token is not None:
|
|
977
|
+
body["next_page_token"] = self.next_page_token
|
|
978
|
+
if self.shares:
|
|
979
|
+
body["shares"] = [v.as_dict() for v in self.shares]
|
|
376
980
|
return body
|
|
377
981
|
|
|
378
982
|
def as_shallow_dict(self) -> dict:
|
|
379
983
|
"""Serializes the ListSharesResponse into a shallow dictionary of its immediate attributes."""
|
|
380
984
|
body = {}
|
|
381
|
-
if self.next_page_token is not None:
|
|
382
|
-
|
|
985
|
+
if self.next_page_token is not None:
|
|
986
|
+
body["next_page_token"] = self.next_page_token
|
|
987
|
+
if self.shares:
|
|
988
|
+
body["shares"] = self.shares
|
|
383
989
|
return body
|
|
384
990
|
|
|
385
991
|
@classmethod
|
|
386
|
-
def from_dict(cls, d: Dict[str,
|
|
992
|
+
def from_dict(cls, d: Dict[str, Any]) -> ListSharesResponse:
|
|
387
993
|
"""Deserializes the ListSharesResponse from a dictionary."""
|
|
388
|
-
return cls(next_page_token=d.get(
|
|
389
|
-
shares=_repeated_dict(d, 'shares', ShareInfo))
|
|
994
|
+
return cls(next_page_token=d.get("next_page_token", None), shares=_repeated_dict(d, "shares", ShareInfo))
|
|
390
995
|
|
|
391
996
|
|
|
392
997
|
@dataclass
|
|
393
|
-
class
|
|
394
|
-
|
|
395
|
-
"""
|
|
998
|
+
class NotebookFile:
|
|
999
|
+
comment: Optional[str] = None
|
|
1000
|
+
"""The comment of the notebook file."""
|
|
1001
|
+
|
|
1002
|
+
id: Optional[str] = None
|
|
1003
|
+
"""The id of the notebook file."""
|
|
1004
|
+
|
|
1005
|
+
name: Optional[str] = None
|
|
1006
|
+
"""Name of the notebook file."""
|
|
1007
|
+
|
|
1008
|
+
share: Optional[str] = None
|
|
1009
|
+
"""The name of the share that the notebook file belongs to."""
|
|
1010
|
+
|
|
1011
|
+
share_id: Optional[str] = None
|
|
1012
|
+
"""The id of the share that the notebook file belongs to."""
|
|
1013
|
+
|
|
1014
|
+
tags: Optional[List[catalog.TagKeyValue]] = None
|
|
1015
|
+
"""The tags of the notebook file."""
|
|
396
1016
|
|
|
397
1017
|
def as_dict(self) -> dict:
|
|
398
|
-
"""Serializes the
|
|
399
|
-
body = {}
|
|
400
|
-
if self.
|
|
1018
|
+
"""Serializes the NotebookFile into a dictionary suitable for use as a JSON request body."""
|
|
1019
|
+
body = {}
|
|
1020
|
+
if self.comment is not None:
|
|
1021
|
+
body["comment"] = self.comment
|
|
1022
|
+
if self.id is not None:
|
|
1023
|
+
body["id"] = self.id
|
|
1024
|
+
if self.name is not None:
|
|
1025
|
+
body["name"] = self.name
|
|
1026
|
+
if self.share is not None:
|
|
1027
|
+
body["share"] = self.share
|
|
1028
|
+
if self.share_id is not None:
|
|
1029
|
+
body["share_id"] = self.share_id
|
|
1030
|
+
if self.tags:
|
|
1031
|
+
body["tags"] = [v.as_dict() for v in self.tags]
|
|
401
1032
|
return body
|
|
402
1033
|
|
|
403
1034
|
def as_shallow_dict(self) -> dict:
|
|
404
|
-
"""Serializes the
|
|
405
|
-
body = {}
|
|
406
|
-
if self.
|
|
1035
|
+
"""Serializes the NotebookFile into a shallow dictionary of its immediate attributes."""
|
|
1036
|
+
body = {}
|
|
1037
|
+
if self.comment is not None:
|
|
1038
|
+
body["comment"] = self.comment
|
|
1039
|
+
if self.id is not None:
|
|
1040
|
+
body["id"] = self.id
|
|
1041
|
+
if self.name is not None:
|
|
1042
|
+
body["name"] = self.name
|
|
1043
|
+
if self.share is not None:
|
|
1044
|
+
body["share"] = self.share
|
|
1045
|
+
if self.share_id is not None:
|
|
1046
|
+
body["share_id"] = self.share_id
|
|
1047
|
+
if self.tags:
|
|
1048
|
+
body["tags"] = self.tags
|
|
407
1049
|
return body
|
|
408
1050
|
|
|
409
1051
|
@classmethod
|
|
410
|
-
def from_dict(cls, d: Dict[str,
|
|
411
|
-
"""Deserializes the
|
|
412
|
-
return cls(
|
|
1052
|
+
def from_dict(cls, d: Dict[str, Any]) -> NotebookFile:
|
|
1053
|
+
"""Deserializes the NotebookFile from a dictionary."""
|
|
1054
|
+
return cls(
|
|
1055
|
+
comment=d.get("comment", None),
|
|
1056
|
+
id=d.get("id", None),
|
|
1057
|
+
name=d.get("name", None),
|
|
1058
|
+
share=d.get("share", None),
|
|
1059
|
+
share_id=d.get("share_id", None),
|
|
1060
|
+
tags=_repeated_dict(d, "tags", catalog.TagKeyValue),
|
|
1061
|
+
)
|
|
413
1062
|
|
|
414
1063
|
|
|
415
1064
|
@dataclass
|
|
416
|
-
class
|
|
1065
|
+
class Partition:
|
|
417
1066
|
values: Optional[List[PartitionValue]] = None
|
|
418
1067
|
"""An array of partition values."""
|
|
419
1068
|
|
|
420
1069
|
def as_dict(self) -> dict:
|
|
421
|
-
"""Serializes the
|
|
1070
|
+
"""Serializes the Partition into a dictionary suitable for use as a JSON request body."""
|
|
422
1071
|
body = {}
|
|
423
|
-
if self.values:
|
|
1072
|
+
if self.values:
|
|
1073
|
+
body["values"] = [v.as_dict() for v in self.values]
|
|
424
1074
|
return body
|
|
425
1075
|
|
|
426
1076
|
def as_shallow_dict(self) -> dict:
|
|
427
|
-
"""Serializes the
|
|
1077
|
+
"""Serializes the Partition into a shallow dictionary of its immediate attributes."""
|
|
428
1078
|
body = {}
|
|
429
|
-
if self.values:
|
|
1079
|
+
if self.values:
|
|
1080
|
+
body["values"] = self.values
|
|
430
1081
|
return body
|
|
431
1082
|
|
|
432
1083
|
@classmethod
|
|
433
|
-
def from_dict(cls, d: Dict[str,
|
|
434
|
-
"""Deserializes the
|
|
435
|
-
return cls(values=_repeated_dict(d,
|
|
1084
|
+
def from_dict(cls, d: Dict[str, Any]) -> Partition:
|
|
1085
|
+
"""Deserializes the Partition from a dictionary."""
|
|
1086
|
+
return cls(values=_repeated_dict(d, "values", PartitionValue))
|
|
436
1087
|
|
|
437
1088
|
|
|
438
1089
|
@dataclass
|
|
@@ -454,85 +1105,132 @@ class PartitionValue:
|
|
|
454
1105
|
def as_dict(self) -> dict:
|
|
455
1106
|
"""Serializes the PartitionValue into a dictionary suitable for use as a JSON request body."""
|
|
456
1107
|
body = {}
|
|
457
|
-
if self.name is not None:
|
|
458
|
-
|
|
1108
|
+
if self.name is not None:
|
|
1109
|
+
body["name"] = self.name
|
|
1110
|
+
if self.op is not None:
|
|
1111
|
+
body["op"] = self.op.value
|
|
459
1112
|
if self.recipient_property_key is not None:
|
|
460
|
-
body[
|
|
461
|
-
if self.value is not None:
|
|
1113
|
+
body["recipient_property_key"] = self.recipient_property_key
|
|
1114
|
+
if self.value is not None:
|
|
1115
|
+
body["value"] = self.value
|
|
462
1116
|
return body
|
|
463
1117
|
|
|
464
1118
|
def as_shallow_dict(self) -> dict:
|
|
465
1119
|
"""Serializes the PartitionValue into a shallow dictionary of its immediate attributes."""
|
|
466
1120
|
body = {}
|
|
467
|
-
if self.name is not None:
|
|
468
|
-
|
|
1121
|
+
if self.name is not None:
|
|
1122
|
+
body["name"] = self.name
|
|
1123
|
+
if self.op is not None:
|
|
1124
|
+
body["op"] = self.op
|
|
469
1125
|
if self.recipient_property_key is not None:
|
|
470
|
-
body[
|
|
471
|
-
if self.value is not None:
|
|
1126
|
+
body["recipient_property_key"] = self.recipient_property_key
|
|
1127
|
+
if self.value is not None:
|
|
1128
|
+
body["value"] = self.value
|
|
472
1129
|
return body
|
|
473
1130
|
|
|
474
1131
|
@classmethod
|
|
475
|
-
def from_dict(cls, d: Dict[str,
|
|
1132
|
+
def from_dict(cls, d: Dict[str, Any]) -> PartitionValue:
|
|
476
1133
|
"""Deserializes the PartitionValue from a dictionary."""
|
|
477
|
-
return cls(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
1134
|
+
return cls(
|
|
1135
|
+
name=d.get("name", None),
|
|
1136
|
+
op=_enum(d, "op", PartitionValueOp),
|
|
1137
|
+
recipient_property_key=d.get("recipient_property_key", None),
|
|
1138
|
+
value=d.get("value", None),
|
|
1139
|
+
)
|
|
481
1140
|
|
|
482
1141
|
|
|
483
1142
|
class PartitionValueOp(Enum):
|
|
484
1143
|
|
|
485
|
-
EQUAL =
|
|
486
|
-
LIKE =
|
|
1144
|
+
EQUAL = "EQUAL"
|
|
1145
|
+
LIKE = "LIKE"
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
@dataclass
|
|
1149
|
+
class PermissionsChange:
|
|
1150
|
+
add: Optional[List[str]] = None
|
|
1151
|
+
"""The set of privileges to add."""
|
|
1152
|
+
|
|
1153
|
+
principal: Optional[str] = None
|
|
1154
|
+
"""The principal whose privileges we are changing."""
|
|
1155
|
+
|
|
1156
|
+
remove: Optional[List[str]] = None
|
|
1157
|
+
"""The set of privileges to remove."""
|
|
1158
|
+
|
|
1159
|
+
def as_dict(self) -> dict:
|
|
1160
|
+
"""Serializes the PermissionsChange into a dictionary suitable for use as a JSON request body."""
|
|
1161
|
+
body = {}
|
|
1162
|
+
if self.add:
|
|
1163
|
+
body["add"] = [v for v in self.add]
|
|
1164
|
+
if self.principal is not None:
|
|
1165
|
+
body["principal"] = self.principal
|
|
1166
|
+
if self.remove:
|
|
1167
|
+
body["remove"] = [v for v in self.remove]
|
|
1168
|
+
return body
|
|
1169
|
+
|
|
1170
|
+
def as_shallow_dict(self) -> dict:
|
|
1171
|
+
"""Serializes the PermissionsChange into a shallow dictionary of its immediate attributes."""
|
|
1172
|
+
body = {}
|
|
1173
|
+
if self.add:
|
|
1174
|
+
body["add"] = self.add
|
|
1175
|
+
if self.principal is not None:
|
|
1176
|
+
body["principal"] = self.principal
|
|
1177
|
+
if self.remove:
|
|
1178
|
+
body["remove"] = self.remove
|
|
1179
|
+
return body
|
|
1180
|
+
|
|
1181
|
+
@classmethod
|
|
1182
|
+
def from_dict(cls, d: Dict[str, Any]) -> PermissionsChange:
|
|
1183
|
+
"""Deserializes the PermissionsChange from a dictionary."""
|
|
1184
|
+
return cls(add=d.get("add", None), principal=d.get("principal", None), remove=d.get("remove", None))
|
|
487
1185
|
|
|
488
1186
|
|
|
489
1187
|
class Privilege(Enum):
|
|
490
1188
|
|
|
491
|
-
ACCESS =
|
|
492
|
-
ALL_PRIVILEGES =
|
|
493
|
-
APPLY_TAG =
|
|
494
|
-
CREATE =
|
|
495
|
-
CREATE_CATALOG =
|
|
496
|
-
CREATE_CONNECTION =
|
|
497
|
-
CREATE_EXTERNAL_LOCATION =
|
|
498
|
-
CREATE_EXTERNAL_TABLE =
|
|
499
|
-
CREATE_EXTERNAL_VOLUME =
|
|
500
|
-
CREATE_FOREIGN_CATALOG =
|
|
501
|
-
CREATE_FOREIGN_SECURABLE =
|
|
502
|
-
CREATE_FUNCTION =
|
|
503
|
-
CREATE_MANAGED_STORAGE =
|
|
504
|
-
CREATE_MATERIALIZED_VIEW =
|
|
505
|
-
CREATE_MODEL =
|
|
506
|
-
CREATE_PROVIDER =
|
|
507
|
-
CREATE_RECIPIENT =
|
|
508
|
-
CREATE_SCHEMA =
|
|
509
|
-
CREATE_SERVICE_CREDENTIAL =
|
|
510
|
-
CREATE_SHARE =
|
|
511
|
-
CREATE_STORAGE_CREDENTIAL =
|
|
512
|
-
CREATE_TABLE =
|
|
513
|
-
CREATE_VIEW =
|
|
514
|
-
CREATE_VOLUME =
|
|
515
|
-
EXECUTE =
|
|
516
|
-
MANAGE =
|
|
517
|
-
MANAGE_ALLOWLIST =
|
|
518
|
-
MODIFY =
|
|
519
|
-
READ_FILES =
|
|
520
|
-
READ_PRIVATE_FILES =
|
|
521
|
-
READ_VOLUME =
|
|
522
|
-
REFRESH =
|
|
523
|
-
SELECT =
|
|
524
|
-
SET_SHARE_PERMISSION =
|
|
525
|
-
USAGE =
|
|
526
|
-
USE_CATALOG =
|
|
527
|
-
USE_CONNECTION =
|
|
528
|
-
USE_MARKETPLACE_ASSETS =
|
|
529
|
-
USE_PROVIDER =
|
|
530
|
-
USE_RECIPIENT =
|
|
531
|
-
USE_SCHEMA =
|
|
532
|
-
USE_SHARE =
|
|
533
|
-
WRITE_FILES =
|
|
534
|
-
WRITE_PRIVATE_FILES =
|
|
535
|
-
WRITE_VOLUME =
|
|
1189
|
+
ACCESS = "ACCESS"
|
|
1190
|
+
ALL_PRIVILEGES = "ALL_PRIVILEGES"
|
|
1191
|
+
APPLY_TAG = "APPLY_TAG"
|
|
1192
|
+
CREATE = "CREATE"
|
|
1193
|
+
CREATE_CATALOG = "CREATE_CATALOG"
|
|
1194
|
+
CREATE_CONNECTION = "CREATE_CONNECTION"
|
|
1195
|
+
CREATE_EXTERNAL_LOCATION = "CREATE_EXTERNAL_LOCATION"
|
|
1196
|
+
CREATE_EXTERNAL_TABLE = "CREATE_EXTERNAL_TABLE"
|
|
1197
|
+
CREATE_EXTERNAL_VOLUME = "CREATE_EXTERNAL_VOLUME"
|
|
1198
|
+
CREATE_FOREIGN_CATALOG = "CREATE_FOREIGN_CATALOG"
|
|
1199
|
+
CREATE_FOREIGN_SECURABLE = "CREATE_FOREIGN_SECURABLE"
|
|
1200
|
+
CREATE_FUNCTION = "CREATE_FUNCTION"
|
|
1201
|
+
CREATE_MANAGED_STORAGE = "CREATE_MANAGED_STORAGE"
|
|
1202
|
+
CREATE_MATERIALIZED_VIEW = "CREATE_MATERIALIZED_VIEW"
|
|
1203
|
+
CREATE_MODEL = "CREATE_MODEL"
|
|
1204
|
+
CREATE_PROVIDER = "CREATE_PROVIDER"
|
|
1205
|
+
CREATE_RECIPIENT = "CREATE_RECIPIENT"
|
|
1206
|
+
CREATE_SCHEMA = "CREATE_SCHEMA"
|
|
1207
|
+
CREATE_SERVICE_CREDENTIAL = "CREATE_SERVICE_CREDENTIAL"
|
|
1208
|
+
CREATE_SHARE = "CREATE_SHARE"
|
|
1209
|
+
CREATE_STORAGE_CREDENTIAL = "CREATE_STORAGE_CREDENTIAL"
|
|
1210
|
+
CREATE_TABLE = "CREATE_TABLE"
|
|
1211
|
+
CREATE_VIEW = "CREATE_VIEW"
|
|
1212
|
+
CREATE_VOLUME = "CREATE_VOLUME"
|
|
1213
|
+
EXECUTE = "EXECUTE"
|
|
1214
|
+
MANAGE = "MANAGE"
|
|
1215
|
+
MANAGE_ALLOWLIST = "MANAGE_ALLOWLIST"
|
|
1216
|
+
MODIFY = "MODIFY"
|
|
1217
|
+
READ_FILES = "READ_FILES"
|
|
1218
|
+
READ_PRIVATE_FILES = "READ_PRIVATE_FILES"
|
|
1219
|
+
READ_VOLUME = "READ_VOLUME"
|
|
1220
|
+
REFRESH = "REFRESH"
|
|
1221
|
+
SELECT = "SELECT"
|
|
1222
|
+
SET_SHARE_PERMISSION = "SET_SHARE_PERMISSION"
|
|
1223
|
+
USAGE = "USAGE"
|
|
1224
|
+
USE_CATALOG = "USE_CATALOG"
|
|
1225
|
+
USE_CONNECTION = "USE_CONNECTION"
|
|
1226
|
+
USE_MARKETPLACE_ASSETS = "USE_MARKETPLACE_ASSETS"
|
|
1227
|
+
USE_PROVIDER = "USE_PROVIDER"
|
|
1228
|
+
USE_RECIPIENT = "USE_RECIPIENT"
|
|
1229
|
+
USE_SCHEMA = "USE_SCHEMA"
|
|
1230
|
+
USE_SHARE = "USE_SHARE"
|
|
1231
|
+
WRITE_FILES = "WRITE_FILES"
|
|
1232
|
+
WRITE_PRIVATE_FILES = "WRITE_PRIVATE_FILES"
|
|
1233
|
+
WRITE_VOLUME = "WRITE_VOLUME"
|
|
536
1234
|
|
|
537
1235
|
|
|
538
1236
|
@dataclass
|
|
@@ -546,21 +1244,25 @@ class PrivilegeAssignment:
|
|
|
546
1244
|
def as_dict(self) -> dict:
|
|
547
1245
|
"""Serializes the PrivilegeAssignment into a dictionary suitable for use as a JSON request body."""
|
|
548
1246
|
body = {}
|
|
549
|
-
if self.principal is not None:
|
|
550
|
-
|
|
1247
|
+
if self.principal is not None:
|
|
1248
|
+
body["principal"] = self.principal
|
|
1249
|
+
if self.privileges:
|
|
1250
|
+
body["privileges"] = [v.value for v in self.privileges]
|
|
551
1251
|
return body
|
|
552
1252
|
|
|
553
1253
|
def as_shallow_dict(self) -> dict:
|
|
554
1254
|
"""Serializes the PrivilegeAssignment into a shallow dictionary of its immediate attributes."""
|
|
555
1255
|
body = {}
|
|
556
|
-
if self.principal is not None:
|
|
557
|
-
|
|
1256
|
+
if self.principal is not None:
|
|
1257
|
+
body["principal"] = self.principal
|
|
1258
|
+
if self.privileges:
|
|
1259
|
+
body["privileges"] = self.privileges
|
|
558
1260
|
return body
|
|
559
1261
|
|
|
560
1262
|
@classmethod
|
|
561
|
-
def from_dict(cls, d: Dict[str,
|
|
1263
|
+
def from_dict(cls, d: Dict[str, Any]) -> PrivilegeAssignment:
|
|
562
1264
|
"""Deserializes the PrivilegeAssignment from a dictionary."""
|
|
563
|
-
return cls(principal=d.get(
|
|
1265
|
+
return cls(principal=d.get("principal", None), privileges=_repeated_enum(d, "privileges", Privilege))
|
|
564
1266
|
|
|
565
1267
|
|
|
566
1268
|
@dataclass
|
|
@@ -617,60 +1319,88 @@ class ProviderInfo:
|
|
|
617
1319
|
def as_dict(self) -> dict:
|
|
618
1320
|
"""Serializes the ProviderInfo into a dictionary suitable for use as a JSON request body."""
|
|
619
1321
|
body = {}
|
|
620
|
-
if self.authentication_type is not None:
|
|
621
|
-
|
|
622
|
-
if self.
|
|
623
|
-
|
|
624
|
-
if self.
|
|
1322
|
+
if self.authentication_type is not None:
|
|
1323
|
+
body["authentication_type"] = self.authentication_type.value
|
|
1324
|
+
if self.cloud is not None:
|
|
1325
|
+
body["cloud"] = self.cloud
|
|
1326
|
+
if self.comment is not None:
|
|
1327
|
+
body["comment"] = self.comment
|
|
1328
|
+
if self.created_at is not None:
|
|
1329
|
+
body["created_at"] = self.created_at
|
|
1330
|
+
if self.created_by is not None:
|
|
1331
|
+
body["created_by"] = self.created_by
|
|
625
1332
|
if self.data_provider_global_metastore_id is not None:
|
|
626
|
-
body[
|
|
627
|
-
if self.metastore_id is not None:
|
|
628
|
-
|
|
629
|
-
if self.
|
|
630
|
-
|
|
631
|
-
if self.
|
|
632
|
-
|
|
633
|
-
if self.
|
|
634
|
-
|
|
1333
|
+
body["data_provider_global_metastore_id"] = self.data_provider_global_metastore_id
|
|
1334
|
+
if self.metastore_id is not None:
|
|
1335
|
+
body["metastore_id"] = self.metastore_id
|
|
1336
|
+
if self.name is not None:
|
|
1337
|
+
body["name"] = self.name
|
|
1338
|
+
if self.owner is not None:
|
|
1339
|
+
body["owner"] = self.owner
|
|
1340
|
+
if self.recipient_profile:
|
|
1341
|
+
body["recipient_profile"] = self.recipient_profile.as_dict()
|
|
1342
|
+
if self.recipient_profile_str is not None:
|
|
1343
|
+
body["recipient_profile_str"] = self.recipient_profile_str
|
|
1344
|
+
if self.region is not None:
|
|
1345
|
+
body["region"] = self.region
|
|
1346
|
+
if self.updated_at is not None:
|
|
1347
|
+
body["updated_at"] = self.updated_at
|
|
1348
|
+
if self.updated_by is not None:
|
|
1349
|
+
body["updated_by"] = self.updated_by
|
|
635
1350
|
return body
|
|
636
1351
|
|
|
637
1352
|
def as_shallow_dict(self) -> dict:
|
|
638
1353
|
"""Serializes the ProviderInfo into a shallow dictionary of its immediate attributes."""
|
|
639
1354
|
body = {}
|
|
640
|
-
if self.authentication_type is not None:
|
|
641
|
-
|
|
642
|
-
if self.
|
|
643
|
-
|
|
644
|
-
if self.
|
|
1355
|
+
if self.authentication_type is not None:
|
|
1356
|
+
body["authentication_type"] = self.authentication_type
|
|
1357
|
+
if self.cloud is not None:
|
|
1358
|
+
body["cloud"] = self.cloud
|
|
1359
|
+
if self.comment is not None:
|
|
1360
|
+
body["comment"] = self.comment
|
|
1361
|
+
if self.created_at is not None:
|
|
1362
|
+
body["created_at"] = self.created_at
|
|
1363
|
+
if self.created_by is not None:
|
|
1364
|
+
body["created_by"] = self.created_by
|
|
645
1365
|
if self.data_provider_global_metastore_id is not None:
|
|
646
|
-
body[
|
|
647
|
-
if self.metastore_id is not None:
|
|
648
|
-
|
|
649
|
-
if self.
|
|
650
|
-
|
|
651
|
-
if self.
|
|
652
|
-
|
|
653
|
-
if self.
|
|
654
|
-
|
|
1366
|
+
body["data_provider_global_metastore_id"] = self.data_provider_global_metastore_id
|
|
1367
|
+
if self.metastore_id is not None:
|
|
1368
|
+
body["metastore_id"] = self.metastore_id
|
|
1369
|
+
if self.name is not None:
|
|
1370
|
+
body["name"] = self.name
|
|
1371
|
+
if self.owner is not None:
|
|
1372
|
+
body["owner"] = self.owner
|
|
1373
|
+
if self.recipient_profile:
|
|
1374
|
+
body["recipient_profile"] = self.recipient_profile
|
|
1375
|
+
if self.recipient_profile_str is not None:
|
|
1376
|
+
body["recipient_profile_str"] = self.recipient_profile_str
|
|
1377
|
+
if self.region is not None:
|
|
1378
|
+
body["region"] = self.region
|
|
1379
|
+
if self.updated_at is not None:
|
|
1380
|
+
body["updated_at"] = self.updated_at
|
|
1381
|
+
if self.updated_by is not None:
|
|
1382
|
+
body["updated_by"] = self.updated_by
|
|
655
1383
|
return body
|
|
656
1384
|
|
|
657
1385
|
@classmethod
|
|
658
|
-
def from_dict(cls, d: Dict[str,
|
|
1386
|
+
def from_dict(cls, d: Dict[str, Any]) -> ProviderInfo:
|
|
659
1387
|
"""Deserializes the ProviderInfo from a dictionary."""
|
|
660
|
-
return cls(
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
1388
|
+
return cls(
|
|
1389
|
+
authentication_type=_enum(d, "authentication_type", AuthenticationType),
|
|
1390
|
+
cloud=d.get("cloud", None),
|
|
1391
|
+
comment=d.get("comment", None),
|
|
1392
|
+
created_at=d.get("created_at", None),
|
|
1393
|
+
created_by=d.get("created_by", None),
|
|
1394
|
+
data_provider_global_metastore_id=d.get("data_provider_global_metastore_id", None),
|
|
1395
|
+
metastore_id=d.get("metastore_id", None),
|
|
1396
|
+
name=d.get("name", None),
|
|
1397
|
+
owner=d.get("owner", None),
|
|
1398
|
+
recipient_profile=_from_dict(d, "recipient_profile", RecipientProfile),
|
|
1399
|
+
recipient_profile_str=d.get("recipient_profile_str", None),
|
|
1400
|
+
region=d.get("region", None),
|
|
1401
|
+
updated_at=d.get("updated_at", None),
|
|
1402
|
+
updated_by=d.get("updated_by", None),
|
|
1403
|
+
)
|
|
674
1404
|
|
|
675
1405
|
|
|
676
1406
|
@dataclass
|
|
@@ -681,19 +1411,21 @@ class ProviderShare:
|
|
|
681
1411
|
def as_dict(self) -> dict:
|
|
682
1412
|
"""Serializes the ProviderShare into a dictionary suitable for use as a JSON request body."""
|
|
683
1413
|
body = {}
|
|
684
|
-
if self.name is not None:
|
|
1414
|
+
if self.name is not None:
|
|
1415
|
+
body["name"] = self.name
|
|
685
1416
|
return body
|
|
686
1417
|
|
|
687
1418
|
def as_shallow_dict(self) -> dict:
|
|
688
1419
|
"""Serializes the ProviderShare into a shallow dictionary of its immediate attributes."""
|
|
689
1420
|
body = {}
|
|
690
|
-
if self.name is not None:
|
|
1421
|
+
if self.name is not None:
|
|
1422
|
+
body["name"] = self.name
|
|
691
1423
|
return body
|
|
692
1424
|
|
|
693
1425
|
@classmethod
|
|
694
|
-
def from_dict(cls, d: Dict[str,
|
|
1426
|
+
def from_dict(cls, d: Dict[str, Any]) -> ProviderShare:
|
|
695
1427
|
"""Deserializes the ProviderShare from a dictionary."""
|
|
696
|
-
return cls(name=d.get(
|
|
1428
|
+
return cls(name=d.get("name", None))
|
|
697
1429
|
|
|
698
1430
|
|
|
699
1431
|
@dataclass
|
|
@@ -767,75 +1499,113 @@ class RecipientInfo:
|
|
|
767
1499
|
def as_dict(self) -> dict:
|
|
768
1500
|
"""Serializes the RecipientInfo into a dictionary suitable for use as a JSON request body."""
|
|
769
1501
|
body = {}
|
|
770
|
-
if self.activated is not None:
|
|
771
|
-
|
|
772
|
-
if self.
|
|
773
|
-
|
|
774
|
-
if self.
|
|
775
|
-
|
|
776
|
-
if self.
|
|
1502
|
+
if self.activated is not None:
|
|
1503
|
+
body["activated"] = self.activated
|
|
1504
|
+
if self.activation_url is not None:
|
|
1505
|
+
body["activation_url"] = self.activation_url
|
|
1506
|
+
if self.authentication_type is not None:
|
|
1507
|
+
body["authentication_type"] = self.authentication_type.value
|
|
1508
|
+
if self.cloud is not None:
|
|
1509
|
+
body["cloud"] = self.cloud
|
|
1510
|
+
if self.comment is not None:
|
|
1511
|
+
body["comment"] = self.comment
|
|
1512
|
+
if self.created_at is not None:
|
|
1513
|
+
body["created_at"] = self.created_at
|
|
1514
|
+
if self.created_by is not None:
|
|
1515
|
+
body["created_by"] = self.created_by
|
|
777
1516
|
if self.data_recipient_global_metastore_id is not None:
|
|
778
|
-
body[
|
|
779
|
-
if self.expiration_time is not None:
|
|
780
|
-
|
|
781
|
-
if self.
|
|
782
|
-
|
|
783
|
-
if self.
|
|
784
|
-
|
|
785
|
-
if self.
|
|
786
|
-
|
|
787
|
-
if self.
|
|
788
|
-
|
|
789
|
-
if self.
|
|
1517
|
+
body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id
|
|
1518
|
+
if self.expiration_time is not None:
|
|
1519
|
+
body["expiration_time"] = self.expiration_time
|
|
1520
|
+
if self.ip_access_list:
|
|
1521
|
+
body["ip_access_list"] = self.ip_access_list.as_dict()
|
|
1522
|
+
if self.metastore_id is not None:
|
|
1523
|
+
body["metastore_id"] = self.metastore_id
|
|
1524
|
+
if self.name is not None:
|
|
1525
|
+
body["name"] = self.name
|
|
1526
|
+
if self.owner is not None:
|
|
1527
|
+
body["owner"] = self.owner
|
|
1528
|
+
if self.properties_kvpairs:
|
|
1529
|
+
body["properties_kvpairs"] = self.properties_kvpairs.as_dict()
|
|
1530
|
+
if self.region is not None:
|
|
1531
|
+
body["region"] = self.region
|
|
1532
|
+
if self.sharing_code is not None:
|
|
1533
|
+
body["sharing_code"] = self.sharing_code
|
|
1534
|
+
if self.tokens:
|
|
1535
|
+
body["tokens"] = [v.as_dict() for v in self.tokens]
|
|
1536
|
+
if self.updated_at is not None:
|
|
1537
|
+
body["updated_at"] = self.updated_at
|
|
1538
|
+
if self.updated_by is not None:
|
|
1539
|
+
body["updated_by"] = self.updated_by
|
|
790
1540
|
return body
|
|
791
1541
|
|
|
792
1542
|
def as_shallow_dict(self) -> dict:
|
|
793
1543
|
"""Serializes the RecipientInfo into a shallow dictionary of its immediate attributes."""
|
|
794
1544
|
body = {}
|
|
795
|
-
if self.activated is not None:
|
|
796
|
-
|
|
797
|
-
if self.
|
|
798
|
-
|
|
799
|
-
if self.
|
|
800
|
-
|
|
801
|
-
if self.
|
|
1545
|
+
if self.activated is not None:
|
|
1546
|
+
body["activated"] = self.activated
|
|
1547
|
+
if self.activation_url is not None:
|
|
1548
|
+
body["activation_url"] = self.activation_url
|
|
1549
|
+
if self.authentication_type is not None:
|
|
1550
|
+
body["authentication_type"] = self.authentication_type
|
|
1551
|
+
if self.cloud is not None:
|
|
1552
|
+
body["cloud"] = self.cloud
|
|
1553
|
+
if self.comment is not None:
|
|
1554
|
+
body["comment"] = self.comment
|
|
1555
|
+
if self.created_at is not None:
|
|
1556
|
+
body["created_at"] = self.created_at
|
|
1557
|
+
if self.created_by is not None:
|
|
1558
|
+
body["created_by"] = self.created_by
|
|
802
1559
|
if self.data_recipient_global_metastore_id is not None:
|
|
803
|
-
body[
|
|
804
|
-
if self.expiration_time is not None:
|
|
805
|
-
|
|
806
|
-
if self.
|
|
807
|
-
|
|
808
|
-
if self.
|
|
809
|
-
|
|
810
|
-
if self.
|
|
811
|
-
|
|
812
|
-
if self.
|
|
813
|
-
|
|
814
|
-
if self.
|
|
1560
|
+
body["data_recipient_global_metastore_id"] = self.data_recipient_global_metastore_id
|
|
1561
|
+
if self.expiration_time is not None:
|
|
1562
|
+
body["expiration_time"] = self.expiration_time
|
|
1563
|
+
if self.ip_access_list:
|
|
1564
|
+
body["ip_access_list"] = self.ip_access_list
|
|
1565
|
+
if self.metastore_id is not None:
|
|
1566
|
+
body["metastore_id"] = self.metastore_id
|
|
1567
|
+
if self.name is not None:
|
|
1568
|
+
body["name"] = self.name
|
|
1569
|
+
if self.owner is not None:
|
|
1570
|
+
body["owner"] = self.owner
|
|
1571
|
+
if self.properties_kvpairs:
|
|
1572
|
+
body["properties_kvpairs"] = self.properties_kvpairs
|
|
1573
|
+
if self.region is not None:
|
|
1574
|
+
body["region"] = self.region
|
|
1575
|
+
if self.sharing_code is not None:
|
|
1576
|
+
body["sharing_code"] = self.sharing_code
|
|
1577
|
+
if self.tokens:
|
|
1578
|
+
body["tokens"] = self.tokens
|
|
1579
|
+
if self.updated_at is not None:
|
|
1580
|
+
body["updated_at"] = self.updated_at
|
|
1581
|
+
if self.updated_by is not None:
|
|
1582
|
+
body["updated_by"] = self.updated_by
|
|
815
1583
|
return body
|
|
816
1584
|
|
|
817
1585
|
@classmethod
|
|
818
|
-
def from_dict(cls, d: Dict[str,
|
|
1586
|
+
def from_dict(cls, d: Dict[str, Any]) -> RecipientInfo:
|
|
819
1587
|
"""Deserializes the RecipientInfo from a dictionary."""
|
|
820
|
-
return cls(
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
1588
|
+
return cls(
|
|
1589
|
+
activated=d.get("activated", None),
|
|
1590
|
+
activation_url=d.get("activation_url", None),
|
|
1591
|
+
authentication_type=_enum(d, "authentication_type", AuthenticationType),
|
|
1592
|
+
cloud=d.get("cloud", None),
|
|
1593
|
+
comment=d.get("comment", None),
|
|
1594
|
+
created_at=d.get("created_at", None),
|
|
1595
|
+
created_by=d.get("created_by", None),
|
|
1596
|
+
data_recipient_global_metastore_id=d.get("data_recipient_global_metastore_id", None),
|
|
1597
|
+
expiration_time=d.get("expiration_time", None),
|
|
1598
|
+
ip_access_list=_from_dict(d, "ip_access_list", IpAccessList),
|
|
1599
|
+
metastore_id=d.get("metastore_id", None),
|
|
1600
|
+
name=d.get("name", None),
|
|
1601
|
+
owner=d.get("owner", None),
|
|
1602
|
+
properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs),
|
|
1603
|
+
region=d.get("region", None),
|
|
1604
|
+
sharing_code=d.get("sharing_code", None),
|
|
1605
|
+
tokens=_repeated_dict(d, "tokens", RecipientTokenInfo),
|
|
1606
|
+
updated_at=d.get("updated_at", None),
|
|
1607
|
+
updated_by=d.get("updated_by", None),
|
|
1608
|
+
)
|
|
839
1609
|
|
|
840
1610
|
|
|
841
1611
|
@dataclass
|
|
@@ -852,27 +1622,33 @@ class RecipientProfile:
|
|
|
852
1622
|
def as_dict(self) -> dict:
|
|
853
1623
|
"""Serializes the RecipientProfile into a dictionary suitable for use as a JSON request body."""
|
|
854
1624
|
body = {}
|
|
855
|
-
if self.bearer_token is not None:
|
|
856
|
-
|
|
1625
|
+
if self.bearer_token is not None:
|
|
1626
|
+
body["bearer_token"] = self.bearer_token
|
|
1627
|
+
if self.endpoint is not None:
|
|
1628
|
+
body["endpoint"] = self.endpoint
|
|
857
1629
|
if self.share_credentials_version is not None:
|
|
858
|
-
body[
|
|
1630
|
+
body["share_credentials_version"] = self.share_credentials_version
|
|
859
1631
|
return body
|
|
860
1632
|
|
|
861
1633
|
def as_shallow_dict(self) -> dict:
|
|
862
1634
|
"""Serializes the RecipientProfile into a shallow dictionary of its immediate attributes."""
|
|
863
1635
|
body = {}
|
|
864
|
-
if self.bearer_token is not None:
|
|
865
|
-
|
|
1636
|
+
if self.bearer_token is not None:
|
|
1637
|
+
body["bearer_token"] = self.bearer_token
|
|
1638
|
+
if self.endpoint is not None:
|
|
1639
|
+
body["endpoint"] = self.endpoint
|
|
866
1640
|
if self.share_credentials_version is not None:
|
|
867
|
-
body[
|
|
1641
|
+
body["share_credentials_version"] = self.share_credentials_version
|
|
868
1642
|
return body
|
|
869
1643
|
|
|
870
1644
|
@classmethod
|
|
871
|
-
def from_dict(cls, d: Dict[str,
|
|
1645
|
+
def from_dict(cls, d: Dict[str, Any]) -> RecipientProfile:
|
|
872
1646
|
"""Deserializes the RecipientProfile from a dictionary."""
|
|
873
|
-
return cls(
|
|
874
|
-
|
|
875
|
-
|
|
1647
|
+
return cls(
|
|
1648
|
+
bearer_token=d.get("bearer_token", None),
|
|
1649
|
+
endpoint=d.get("endpoint", None),
|
|
1650
|
+
share_credentials_version=d.get("share_credentials_version", None),
|
|
1651
|
+
)
|
|
876
1652
|
|
|
877
1653
|
|
|
878
1654
|
@dataclass
|
|
@@ -902,37 +1678,85 @@ class RecipientTokenInfo:
|
|
|
902
1678
|
def as_dict(self) -> dict:
|
|
903
1679
|
"""Serializes the RecipientTokenInfo into a dictionary suitable for use as a JSON request body."""
|
|
904
1680
|
body = {}
|
|
905
|
-
if self.activation_url is not None:
|
|
906
|
-
|
|
907
|
-
if self.
|
|
908
|
-
|
|
909
|
-
if self.
|
|
910
|
-
|
|
911
|
-
if self.
|
|
1681
|
+
if self.activation_url is not None:
|
|
1682
|
+
body["activation_url"] = self.activation_url
|
|
1683
|
+
if self.created_at is not None:
|
|
1684
|
+
body["created_at"] = self.created_at
|
|
1685
|
+
if self.created_by is not None:
|
|
1686
|
+
body["created_by"] = self.created_by
|
|
1687
|
+
if self.expiration_time is not None:
|
|
1688
|
+
body["expiration_time"] = self.expiration_time
|
|
1689
|
+
if self.id is not None:
|
|
1690
|
+
body["id"] = self.id
|
|
1691
|
+
if self.updated_at is not None:
|
|
1692
|
+
body["updated_at"] = self.updated_at
|
|
1693
|
+
if self.updated_by is not None:
|
|
1694
|
+
body["updated_by"] = self.updated_by
|
|
912
1695
|
return body
|
|
913
1696
|
|
|
914
1697
|
def as_shallow_dict(self) -> dict:
|
|
915
1698
|
"""Serializes the RecipientTokenInfo into a shallow dictionary of its immediate attributes."""
|
|
916
1699
|
body = {}
|
|
917
|
-
if self.activation_url is not None:
|
|
918
|
-
|
|
919
|
-
if self.
|
|
920
|
-
|
|
921
|
-
if self.
|
|
922
|
-
|
|
923
|
-
if self.
|
|
1700
|
+
if self.activation_url is not None:
|
|
1701
|
+
body["activation_url"] = self.activation_url
|
|
1702
|
+
if self.created_at is not None:
|
|
1703
|
+
body["created_at"] = self.created_at
|
|
1704
|
+
if self.created_by is not None:
|
|
1705
|
+
body["created_by"] = self.created_by
|
|
1706
|
+
if self.expiration_time is not None:
|
|
1707
|
+
body["expiration_time"] = self.expiration_time
|
|
1708
|
+
if self.id is not None:
|
|
1709
|
+
body["id"] = self.id
|
|
1710
|
+
if self.updated_at is not None:
|
|
1711
|
+
body["updated_at"] = self.updated_at
|
|
1712
|
+
if self.updated_by is not None:
|
|
1713
|
+
body["updated_by"] = self.updated_by
|
|
924
1714
|
return body
|
|
925
1715
|
|
|
926
1716
|
@classmethod
|
|
927
|
-
def from_dict(cls, d: Dict[str,
|
|
1717
|
+
def from_dict(cls, d: Dict[str, Any]) -> RecipientTokenInfo:
|
|
928
1718
|
"""Deserializes the RecipientTokenInfo from a dictionary."""
|
|
929
|
-
return cls(
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
1719
|
+
return cls(
|
|
1720
|
+
activation_url=d.get("activation_url", None),
|
|
1721
|
+
created_at=d.get("created_at", None),
|
|
1722
|
+
created_by=d.get("created_by", None),
|
|
1723
|
+
expiration_time=d.get("expiration_time", None),
|
|
1724
|
+
id=d.get("id", None),
|
|
1725
|
+
updated_at=d.get("updated_at", None),
|
|
1726
|
+
updated_by=d.get("updated_by", None),
|
|
1727
|
+
)
|
|
1728
|
+
|
|
1729
|
+
|
|
1730
|
+
@dataclass
|
|
1731
|
+
class RegisteredModelAlias:
|
|
1732
|
+
alias_name: Optional[str] = None
|
|
1733
|
+
"""Name of the alias."""
|
|
1734
|
+
|
|
1735
|
+
version_num: Optional[int] = None
|
|
1736
|
+
"""Numeric model version that alias will reference."""
|
|
1737
|
+
|
|
1738
|
+
def as_dict(self) -> dict:
|
|
1739
|
+
"""Serializes the RegisteredModelAlias into a dictionary suitable for use as a JSON request body."""
|
|
1740
|
+
body = {}
|
|
1741
|
+
if self.alias_name is not None:
|
|
1742
|
+
body["alias_name"] = self.alias_name
|
|
1743
|
+
if self.version_num is not None:
|
|
1744
|
+
body["version_num"] = self.version_num
|
|
1745
|
+
return body
|
|
1746
|
+
|
|
1747
|
+
def as_shallow_dict(self) -> dict:
|
|
1748
|
+
"""Serializes the RegisteredModelAlias into a shallow dictionary of its immediate attributes."""
|
|
1749
|
+
body = {}
|
|
1750
|
+
if self.alias_name is not None:
|
|
1751
|
+
body["alias_name"] = self.alias_name
|
|
1752
|
+
if self.version_num is not None:
|
|
1753
|
+
body["version_num"] = self.version_num
|
|
1754
|
+
return body
|
|
1755
|
+
|
|
1756
|
+
@classmethod
|
|
1757
|
+
def from_dict(cls, d: Dict[str, Any]) -> RegisteredModelAlias:
|
|
1758
|
+
"""Deserializes the RegisteredModelAlias from a dictionary."""
|
|
1759
|
+
return cls(alias_name=d.get("alias_name", None), version_num=d.get("version_num", None))
|
|
936
1760
|
|
|
937
1761
|
|
|
938
1762
|
@dataclass
|
|
@@ -952,30 +1776,38 @@ class RetrieveTokenResponse:
|
|
|
952
1776
|
def as_dict(self) -> dict:
|
|
953
1777
|
"""Serializes the RetrieveTokenResponse into a dictionary suitable for use as a JSON request body."""
|
|
954
1778
|
body = {}
|
|
955
|
-
if self.bearer_token is not None:
|
|
956
|
-
|
|
957
|
-
if self.
|
|
1779
|
+
if self.bearer_token is not None:
|
|
1780
|
+
body["bearerToken"] = self.bearer_token
|
|
1781
|
+
if self.endpoint is not None:
|
|
1782
|
+
body["endpoint"] = self.endpoint
|
|
1783
|
+
if self.expiration_time is not None:
|
|
1784
|
+
body["expirationTime"] = self.expiration_time
|
|
958
1785
|
if self.share_credentials_version is not None:
|
|
959
|
-
body[
|
|
1786
|
+
body["shareCredentialsVersion"] = self.share_credentials_version
|
|
960
1787
|
return body
|
|
961
1788
|
|
|
962
1789
|
def as_shallow_dict(self) -> dict:
|
|
963
1790
|
"""Serializes the RetrieveTokenResponse into a shallow dictionary of its immediate attributes."""
|
|
964
1791
|
body = {}
|
|
965
|
-
if self.bearer_token is not None:
|
|
966
|
-
|
|
967
|
-
if self.
|
|
1792
|
+
if self.bearer_token is not None:
|
|
1793
|
+
body["bearerToken"] = self.bearer_token
|
|
1794
|
+
if self.endpoint is not None:
|
|
1795
|
+
body["endpoint"] = self.endpoint
|
|
1796
|
+
if self.expiration_time is not None:
|
|
1797
|
+
body["expirationTime"] = self.expiration_time
|
|
968
1798
|
if self.share_credentials_version is not None:
|
|
969
|
-
body[
|
|
1799
|
+
body["shareCredentialsVersion"] = self.share_credentials_version
|
|
970
1800
|
return body
|
|
971
1801
|
|
|
972
1802
|
@classmethod
|
|
973
|
-
def from_dict(cls, d: Dict[str,
|
|
1803
|
+
def from_dict(cls, d: Dict[str, Any]) -> RetrieveTokenResponse:
|
|
974
1804
|
"""Deserializes the RetrieveTokenResponse from a dictionary."""
|
|
975
|
-
return cls(
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1805
|
+
return cls(
|
|
1806
|
+
bearer_token=d.get("bearerToken", None),
|
|
1807
|
+
endpoint=d.get("endpoint", None),
|
|
1808
|
+
expiration_time=d.get("expirationTime", None),
|
|
1809
|
+
share_credentials_version=d.get("shareCredentialsVersion", None),
|
|
1810
|
+
)
|
|
979
1811
|
|
|
980
1812
|
|
|
981
1813
|
@dataclass
|
|
@@ -992,23 +1824,26 @@ class RotateRecipientToken:
|
|
|
992
1824
|
"""Serializes the RotateRecipientToken into a dictionary suitable for use as a JSON request body."""
|
|
993
1825
|
body = {}
|
|
994
1826
|
if self.existing_token_expire_in_seconds is not None:
|
|
995
|
-
body[
|
|
996
|
-
if self.name is not None:
|
|
1827
|
+
body["existing_token_expire_in_seconds"] = self.existing_token_expire_in_seconds
|
|
1828
|
+
if self.name is not None:
|
|
1829
|
+
body["name"] = self.name
|
|
997
1830
|
return body
|
|
998
1831
|
|
|
999
1832
|
def as_shallow_dict(self) -> dict:
|
|
1000
1833
|
"""Serializes the RotateRecipientToken into a shallow dictionary of its immediate attributes."""
|
|
1001
1834
|
body = {}
|
|
1002
1835
|
if self.existing_token_expire_in_seconds is not None:
|
|
1003
|
-
body[
|
|
1004
|
-
if self.name is not None:
|
|
1836
|
+
body["existing_token_expire_in_seconds"] = self.existing_token_expire_in_seconds
|
|
1837
|
+
if self.name is not None:
|
|
1838
|
+
body["name"] = self.name
|
|
1005
1839
|
return body
|
|
1006
1840
|
|
|
1007
1841
|
@classmethod
|
|
1008
|
-
def from_dict(cls, d: Dict[str,
|
|
1842
|
+
def from_dict(cls, d: Dict[str, Any]) -> RotateRecipientToken:
|
|
1009
1843
|
"""Deserializes the RotateRecipientToken from a dictionary."""
|
|
1010
|
-
return cls(
|
|
1011
|
-
|
|
1844
|
+
return cls(
|
|
1845
|
+
existing_token_expire_in_seconds=d.get("existing_token_expire_in_seconds", None), name=d.get("name", None)
|
|
1846
|
+
)
|
|
1012
1847
|
|
|
1013
1848
|
|
|
1014
1849
|
@dataclass
|
|
@@ -1021,19 +1856,21 @@ class SecurablePropertiesKvPairs:
|
|
|
1021
1856
|
def as_dict(self) -> dict:
|
|
1022
1857
|
"""Serializes the SecurablePropertiesKvPairs into a dictionary suitable for use as a JSON request body."""
|
|
1023
1858
|
body = {}
|
|
1024
|
-
if self.properties:
|
|
1859
|
+
if self.properties:
|
|
1860
|
+
body["properties"] = self.properties
|
|
1025
1861
|
return body
|
|
1026
1862
|
|
|
1027
1863
|
def as_shallow_dict(self) -> dict:
|
|
1028
1864
|
"""Serializes the SecurablePropertiesKvPairs into a shallow dictionary of its immediate attributes."""
|
|
1029
1865
|
body = {}
|
|
1030
|
-
if self.properties:
|
|
1866
|
+
if self.properties:
|
|
1867
|
+
body["properties"] = self.properties
|
|
1031
1868
|
return body
|
|
1032
1869
|
|
|
1033
1870
|
@classmethod
|
|
1034
|
-
def from_dict(cls, d: Dict[str,
|
|
1871
|
+
def from_dict(cls, d: Dict[str, Any]) -> SecurablePropertiesKvPairs:
|
|
1035
1872
|
"""Deserializes the SecurablePropertiesKvPairs from a dictionary."""
|
|
1036
|
-
return cls(properties=d.get(
|
|
1873
|
+
return cls(properties=d.get("properties", None))
|
|
1037
1874
|
|
|
1038
1875
|
|
|
1039
1876
|
@dataclass
|
|
@@ -1071,46 +1908,68 @@ class ShareInfo:
|
|
|
1071
1908
|
def as_dict(self) -> dict:
|
|
1072
1909
|
"""Serializes the ShareInfo into a dictionary suitable for use as a JSON request body."""
|
|
1073
1910
|
body = {}
|
|
1074
|
-
if self.comment is not None:
|
|
1075
|
-
|
|
1076
|
-
if self.
|
|
1077
|
-
|
|
1078
|
-
if self.
|
|
1079
|
-
|
|
1080
|
-
if self.
|
|
1081
|
-
|
|
1082
|
-
if self.
|
|
1083
|
-
|
|
1911
|
+
if self.comment is not None:
|
|
1912
|
+
body["comment"] = self.comment
|
|
1913
|
+
if self.created_at is not None:
|
|
1914
|
+
body["created_at"] = self.created_at
|
|
1915
|
+
if self.created_by is not None:
|
|
1916
|
+
body["created_by"] = self.created_by
|
|
1917
|
+
if self.name is not None:
|
|
1918
|
+
body["name"] = self.name
|
|
1919
|
+
if self.objects:
|
|
1920
|
+
body["objects"] = [v.as_dict() for v in self.objects]
|
|
1921
|
+
if self.owner is not None:
|
|
1922
|
+
body["owner"] = self.owner
|
|
1923
|
+
if self.storage_location is not None:
|
|
1924
|
+
body["storage_location"] = self.storage_location
|
|
1925
|
+
if self.storage_root is not None:
|
|
1926
|
+
body["storage_root"] = self.storage_root
|
|
1927
|
+
if self.updated_at is not None:
|
|
1928
|
+
body["updated_at"] = self.updated_at
|
|
1929
|
+
if self.updated_by is not None:
|
|
1930
|
+
body["updated_by"] = self.updated_by
|
|
1084
1931
|
return body
|
|
1085
1932
|
|
|
1086
1933
|
def as_shallow_dict(self) -> dict:
|
|
1087
1934
|
"""Serializes the ShareInfo into a shallow dictionary of its immediate attributes."""
|
|
1088
1935
|
body = {}
|
|
1089
|
-
if self.comment is not None:
|
|
1090
|
-
|
|
1091
|
-
if self.
|
|
1092
|
-
|
|
1093
|
-
if self.
|
|
1094
|
-
|
|
1095
|
-
if self.
|
|
1096
|
-
|
|
1097
|
-
if self.
|
|
1098
|
-
|
|
1936
|
+
if self.comment is not None:
|
|
1937
|
+
body["comment"] = self.comment
|
|
1938
|
+
if self.created_at is not None:
|
|
1939
|
+
body["created_at"] = self.created_at
|
|
1940
|
+
if self.created_by is not None:
|
|
1941
|
+
body["created_by"] = self.created_by
|
|
1942
|
+
if self.name is not None:
|
|
1943
|
+
body["name"] = self.name
|
|
1944
|
+
if self.objects:
|
|
1945
|
+
body["objects"] = self.objects
|
|
1946
|
+
if self.owner is not None:
|
|
1947
|
+
body["owner"] = self.owner
|
|
1948
|
+
if self.storage_location is not None:
|
|
1949
|
+
body["storage_location"] = self.storage_location
|
|
1950
|
+
if self.storage_root is not None:
|
|
1951
|
+
body["storage_root"] = self.storage_root
|
|
1952
|
+
if self.updated_at is not None:
|
|
1953
|
+
body["updated_at"] = self.updated_at
|
|
1954
|
+
if self.updated_by is not None:
|
|
1955
|
+
body["updated_by"] = self.updated_by
|
|
1099
1956
|
return body
|
|
1100
1957
|
|
|
1101
1958
|
@classmethod
|
|
1102
|
-
def from_dict(cls, d: Dict[str,
|
|
1959
|
+
def from_dict(cls, d: Dict[str, Any]) -> ShareInfo:
|
|
1103
1960
|
"""Deserializes the ShareInfo from a dictionary."""
|
|
1104
|
-
return cls(
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1961
|
+
return cls(
|
|
1962
|
+
comment=d.get("comment", None),
|
|
1963
|
+
created_at=d.get("created_at", None),
|
|
1964
|
+
created_by=d.get("created_by", None),
|
|
1965
|
+
name=d.get("name", None),
|
|
1966
|
+
objects=_repeated_dict(d, "objects", SharedDataObject),
|
|
1967
|
+
owner=d.get("owner", None),
|
|
1968
|
+
storage_location=d.get("storage_location", None),
|
|
1969
|
+
storage_root=d.get("storage_root", None),
|
|
1970
|
+
updated_at=d.get("updated_at", None),
|
|
1971
|
+
updated_by=d.get("updated_by", None),
|
|
1972
|
+
)
|
|
1114
1973
|
|
|
1115
1974
|
|
|
1116
1975
|
@dataclass
|
|
@@ -1125,30 +1984,34 @@ class ShareToPrivilegeAssignment:
|
|
|
1125
1984
|
"""Serializes the ShareToPrivilegeAssignment into a dictionary suitable for use as a JSON request body."""
|
|
1126
1985
|
body = {}
|
|
1127
1986
|
if self.privilege_assignments:
|
|
1128
|
-
body[
|
|
1129
|
-
if self.share_name is not None:
|
|
1987
|
+
body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments]
|
|
1988
|
+
if self.share_name is not None:
|
|
1989
|
+
body["share_name"] = self.share_name
|
|
1130
1990
|
return body
|
|
1131
1991
|
|
|
1132
1992
|
def as_shallow_dict(self) -> dict:
|
|
1133
1993
|
"""Serializes the ShareToPrivilegeAssignment into a shallow dictionary of its immediate attributes."""
|
|
1134
1994
|
body = {}
|
|
1135
|
-
if self.privilege_assignments:
|
|
1136
|
-
|
|
1995
|
+
if self.privilege_assignments:
|
|
1996
|
+
body["privilege_assignments"] = self.privilege_assignments
|
|
1997
|
+
if self.share_name is not None:
|
|
1998
|
+
body["share_name"] = self.share_name
|
|
1137
1999
|
return body
|
|
1138
2000
|
|
|
1139
2001
|
@classmethod
|
|
1140
|
-
def from_dict(cls, d: Dict[str,
|
|
2002
|
+
def from_dict(cls, d: Dict[str, Any]) -> ShareToPrivilegeAssignment:
|
|
1141
2003
|
"""Deserializes the ShareToPrivilegeAssignment from a dictionary."""
|
|
1142
|
-
return cls(
|
|
1143
|
-
|
|
2004
|
+
return cls(
|
|
2005
|
+
privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment),
|
|
2006
|
+
share_name=d.get("share_name", None),
|
|
2007
|
+
)
|
|
1144
2008
|
|
|
1145
2009
|
|
|
1146
2010
|
@dataclass
|
|
1147
2011
|
class SharedDataObject:
|
|
1148
2012
|
name: str
|
|
1149
|
-
"""A fully qualified name that uniquely identifies a data object.
|
|
1150
|
-
|
|
1151
|
-
For example, a table's fully qualified name is in the format of `<catalog>.<schema>.<table>`."""
|
|
2013
|
+
"""A fully qualified name that uniquely identifies a data object. For example, a table's fully
|
|
2014
|
+
qualified name is in the format of `<catalog>.<schema>.<table>`,"""
|
|
1152
2015
|
|
|
1153
2016
|
added_at: Optional[int] = None
|
|
1154
2017
|
"""The time when this data object is added to the share, in epoch milliseconds."""
|
|
@@ -1160,7 +2023,7 @@ class SharedDataObject:
|
|
|
1160
2023
|
"""Whether to enable cdf or indicate if cdf is enabled on the shared object."""
|
|
1161
2024
|
|
|
1162
2025
|
comment: Optional[str] = None
|
|
1163
|
-
"""A user-provided comment when adding the data object to the share.
|
|
2026
|
+
"""A user-provided comment when adding the data object to the share."""
|
|
1164
2027
|
|
|
1165
2028
|
content: Optional[str] = None
|
|
1166
2029
|
"""The content of the notebook file when the data object type is NOTEBOOK_FILE. This should be
|
|
@@ -1194,95 +2057,118 @@ class SharedDataObject:
|
|
|
1194
2057
|
"""One of: **ACTIVE**, **PERMISSION_DENIED**."""
|
|
1195
2058
|
|
|
1196
2059
|
string_shared_as: Optional[str] = None
|
|
1197
|
-
"""A user-provided new name for the
|
|
1198
|
-
the object's original name will be used as the `string_shared_as` name. The
|
|
1199
|
-
name must be unique
|
|
1200
|
-
name."""
|
|
2060
|
+
"""A user-provided new name for the shared object within the share. If this new name is not not
|
|
2061
|
+
provided, the object's original name will be used as the `string_shared_as` name. The
|
|
2062
|
+
`string_shared_as` name must be unique for objects of the same type within a Share. For
|
|
2063
|
+
notebooks, the new name should be the new notebook file name."""
|
|
1201
2064
|
|
|
1202
2065
|
def as_dict(self) -> dict:
|
|
1203
2066
|
"""Serializes the SharedDataObject into a dictionary suitable for use as a JSON request body."""
|
|
1204
2067
|
body = {}
|
|
1205
|
-
if self.added_at is not None:
|
|
1206
|
-
|
|
1207
|
-
if self.
|
|
1208
|
-
|
|
1209
|
-
if self.
|
|
1210
|
-
|
|
2068
|
+
if self.added_at is not None:
|
|
2069
|
+
body["added_at"] = self.added_at
|
|
2070
|
+
if self.added_by is not None:
|
|
2071
|
+
body["added_by"] = self.added_by
|
|
2072
|
+
if self.cdf_enabled is not None:
|
|
2073
|
+
body["cdf_enabled"] = self.cdf_enabled
|
|
2074
|
+
if self.comment is not None:
|
|
2075
|
+
body["comment"] = self.comment
|
|
2076
|
+
if self.content is not None:
|
|
2077
|
+
body["content"] = self.content
|
|
2078
|
+
if self.data_object_type is not None:
|
|
2079
|
+
body["data_object_type"] = self.data_object_type.value
|
|
1211
2080
|
if self.history_data_sharing_status is not None:
|
|
1212
|
-
body[
|
|
1213
|
-
if self.name is not None:
|
|
1214
|
-
|
|
1215
|
-
if self.
|
|
1216
|
-
|
|
1217
|
-
if self.
|
|
1218
|
-
|
|
2081
|
+
body["history_data_sharing_status"] = self.history_data_sharing_status.value
|
|
2082
|
+
if self.name is not None:
|
|
2083
|
+
body["name"] = self.name
|
|
2084
|
+
if self.partitions:
|
|
2085
|
+
body["partitions"] = [v.as_dict() for v in self.partitions]
|
|
2086
|
+
if self.shared_as is not None:
|
|
2087
|
+
body["shared_as"] = self.shared_as
|
|
2088
|
+
if self.start_version is not None:
|
|
2089
|
+
body["start_version"] = self.start_version
|
|
2090
|
+
if self.status is not None:
|
|
2091
|
+
body["status"] = self.status.value
|
|
2092
|
+
if self.string_shared_as is not None:
|
|
2093
|
+
body["string_shared_as"] = self.string_shared_as
|
|
1219
2094
|
return body
|
|
1220
2095
|
|
|
1221
2096
|
def as_shallow_dict(self) -> dict:
|
|
1222
2097
|
"""Serializes the SharedDataObject into a shallow dictionary of its immediate attributes."""
|
|
1223
2098
|
body = {}
|
|
1224
|
-
if self.added_at is not None:
|
|
1225
|
-
|
|
1226
|
-
if self.
|
|
1227
|
-
|
|
1228
|
-
if self.
|
|
1229
|
-
|
|
2099
|
+
if self.added_at is not None:
|
|
2100
|
+
body["added_at"] = self.added_at
|
|
2101
|
+
if self.added_by is not None:
|
|
2102
|
+
body["added_by"] = self.added_by
|
|
2103
|
+
if self.cdf_enabled is not None:
|
|
2104
|
+
body["cdf_enabled"] = self.cdf_enabled
|
|
2105
|
+
if self.comment is not None:
|
|
2106
|
+
body["comment"] = self.comment
|
|
2107
|
+
if self.content is not None:
|
|
2108
|
+
body["content"] = self.content
|
|
2109
|
+
if self.data_object_type is not None:
|
|
2110
|
+
body["data_object_type"] = self.data_object_type
|
|
1230
2111
|
if self.history_data_sharing_status is not None:
|
|
1231
|
-
body[
|
|
1232
|
-
if self.name is not None:
|
|
1233
|
-
|
|
1234
|
-
if self.
|
|
1235
|
-
|
|
1236
|
-
if self.
|
|
1237
|
-
|
|
2112
|
+
body["history_data_sharing_status"] = self.history_data_sharing_status
|
|
2113
|
+
if self.name is not None:
|
|
2114
|
+
body["name"] = self.name
|
|
2115
|
+
if self.partitions:
|
|
2116
|
+
body["partitions"] = self.partitions
|
|
2117
|
+
if self.shared_as is not None:
|
|
2118
|
+
body["shared_as"] = self.shared_as
|
|
2119
|
+
if self.start_version is not None:
|
|
2120
|
+
body["start_version"] = self.start_version
|
|
2121
|
+
if self.status is not None:
|
|
2122
|
+
body["status"] = self.status
|
|
2123
|
+
if self.string_shared_as is not None:
|
|
2124
|
+
body["string_shared_as"] = self.string_shared_as
|
|
1238
2125
|
return body
|
|
1239
2126
|
|
|
1240
2127
|
@classmethod
|
|
1241
|
-
def from_dict(cls, d: Dict[str,
|
|
2128
|
+
def from_dict(cls, d: Dict[str, Any]) -> SharedDataObject:
|
|
1242
2129
|
"""Deserializes the SharedDataObject from a dictionary."""
|
|
1243
|
-
return cls(
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
2130
|
+
return cls(
|
|
2131
|
+
added_at=d.get("added_at", None),
|
|
2132
|
+
added_by=d.get("added_by", None),
|
|
2133
|
+
cdf_enabled=d.get("cdf_enabled", None),
|
|
2134
|
+
comment=d.get("comment", None),
|
|
2135
|
+
content=d.get("content", None),
|
|
2136
|
+
data_object_type=_enum(d, "data_object_type", SharedDataObjectDataObjectType),
|
|
2137
|
+
history_data_sharing_status=_enum(
|
|
2138
|
+
d, "history_data_sharing_status", SharedDataObjectHistoryDataSharingStatus
|
|
2139
|
+
),
|
|
2140
|
+
name=d.get("name", None),
|
|
2141
|
+
partitions=_repeated_dict(d, "partitions", Partition),
|
|
2142
|
+
shared_as=d.get("shared_as", None),
|
|
2143
|
+
start_version=d.get("start_version", None),
|
|
2144
|
+
status=_enum(d, "status", SharedDataObjectStatus),
|
|
2145
|
+
string_shared_as=d.get("string_shared_as", None),
|
|
2146
|
+
)
|
|
1257
2147
|
|
|
1258
2148
|
|
|
1259
2149
|
class SharedDataObjectDataObjectType(Enum):
|
|
1260
|
-
"""The type of the data object."""
|
|
1261
2150
|
|
|
1262
|
-
FEATURE_SPEC =
|
|
1263
|
-
FUNCTION =
|
|
1264
|
-
MATERIALIZED_VIEW =
|
|
1265
|
-
MODEL =
|
|
1266
|
-
NOTEBOOK_FILE =
|
|
1267
|
-
SCHEMA =
|
|
1268
|
-
STREAMING_TABLE =
|
|
1269
|
-
TABLE =
|
|
1270
|
-
VIEW =
|
|
2151
|
+
FEATURE_SPEC = "FEATURE_SPEC"
|
|
2152
|
+
FUNCTION = "FUNCTION"
|
|
2153
|
+
MATERIALIZED_VIEW = "MATERIALIZED_VIEW"
|
|
2154
|
+
MODEL = "MODEL"
|
|
2155
|
+
NOTEBOOK_FILE = "NOTEBOOK_FILE"
|
|
2156
|
+
SCHEMA = "SCHEMA"
|
|
2157
|
+
STREAMING_TABLE = "STREAMING_TABLE"
|
|
2158
|
+
TABLE = "TABLE"
|
|
2159
|
+
VIEW = "VIEW"
|
|
1271
2160
|
|
|
1272
2161
|
|
|
1273
2162
|
class SharedDataObjectHistoryDataSharingStatus(Enum):
|
|
1274
|
-
"""Whether to enable or disable sharing of data history. If not specified, the default is
|
|
1275
|
-
**DISABLED**."""
|
|
1276
2163
|
|
|
1277
|
-
DISABLED =
|
|
1278
|
-
ENABLED =
|
|
2164
|
+
DISABLED = "DISABLED"
|
|
2165
|
+
ENABLED = "ENABLED"
|
|
1279
2166
|
|
|
1280
2167
|
|
|
1281
2168
|
class SharedDataObjectStatus(Enum):
|
|
1282
|
-
"""One of: **ACTIVE**, **PERMISSION_DENIED**."""
|
|
1283
2169
|
|
|
1284
|
-
ACTIVE =
|
|
1285
|
-
PERMISSION_DENIED =
|
|
2170
|
+
ACTIVE = "ACTIVE"
|
|
2171
|
+
PERMISSION_DENIED = "PERMISSION_DENIED"
|
|
1286
2172
|
|
|
1287
2173
|
|
|
1288
2174
|
@dataclass
|
|
@@ -1296,49 +2182,202 @@ class SharedDataObjectUpdate:
|
|
|
1296
2182
|
def as_dict(self) -> dict:
|
|
1297
2183
|
"""Serializes the SharedDataObjectUpdate into a dictionary suitable for use as a JSON request body."""
|
|
1298
2184
|
body = {}
|
|
1299
|
-
if self.action is not None:
|
|
1300
|
-
|
|
2185
|
+
if self.action is not None:
|
|
2186
|
+
body["action"] = self.action.value
|
|
2187
|
+
if self.data_object:
|
|
2188
|
+
body["data_object"] = self.data_object.as_dict()
|
|
1301
2189
|
return body
|
|
1302
2190
|
|
|
1303
2191
|
def as_shallow_dict(self) -> dict:
|
|
1304
2192
|
"""Serializes the SharedDataObjectUpdate into a shallow dictionary of its immediate attributes."""
|
|
1305
2193
|
body = {}
|
|
1306
|
-
if self.action is not None:
|
|
1307
|
-
|
|
2194
|
+
if self.action is not None:
|
|
2195
|
+
body["action"] = self.action
|
|
2196
|
+
if self.data_object:
|
|
2197
|
+
body["data_object"] = self.data_object
|
|
1308
2198
|
return body
|
|
1309
2199
|
|
|
1310
2200
|
@classmethod
|
|
1311
|
-
def from_dict(cls, d: Dict[str,
|
|
2201
|
+
def from_dict(cls, d: Dict[str, Any]) -> SharedDataObjectUpdate:
|
|
1312
2202
|
"""Deserializes the SharedDataObjectUpdate from a dictionary."""
|
|
1313
|
-
return cls(
|
|
1314
|
-
|
|
2203
|
+
return cls(
|
|
2204
|
+
action=_enum(d, "action", SharedDataObjectUpdateAction),
|
|
2205
|
+
data_object=_from_dict(d, "data_object", SharedDataObject),
|
|
2206
|
+
)
|
|
1315
2207
|
|
|
1316
2208
|
|
|
1317
2209
|
class SharedDataObjectUpdateAction(Enum):
|
|
1318
|
-
"""One of: **ADD**, **REMOVE**, **UPDATE**."""
|
|
1319
2210
|
|
|
1320
|
-
ADD =
|
|
1321
|
-
REMOVE =
|
|
1322
|
-
UPDATE =
|
|
2211
|
+
ADD = "ADD"
|
|
2212
|
+
REMOVE = "REMOVE"
|
|
2213
|
+
UPDATE = "UPDATE"
|
|
2214
|
+
|
|
2215
|
+
|
|
2216
|
+
class SharedSecurableKind(Enum):
|
|
2217
|
+
"""The SecurableKind of a delta-shared object."""
|
|
2218
|
+
|
|
2219
|
+
FUNCTION_FEATURE_SPEC = "FUNCTION_FEATURE_SPEC"
|
|
2220
|
+
FUNCTION_REGISTERED_MODEL = "FUNCTION_REGISTERED_MODEL"
|
|
2221
|
+
FUNCTION_STANDARD = "FUNCTION_STANDARD"
|
|
2222
|
+
|
|
2223
|
+
|
|
2224
|
+
@dataclass
|
|
2225
|
+
class Table:
|
|
2226
|
+
comment: Optional[str] = None
|
|
2227
|
+
"""The comment of the table."""
|
|
2228
|
+
|
|
2229
|
+
id: Optional[str] = None
|
|
2230
|
+
"""The id of the table."""
|
|
2231
|
+
|
|
2232
|
+
internal_attributes: Optional[TableInternalAttributes] = None
|
|
2233
|
+
"""Internal information for D2D sharing that should not be disclosed to external users."""
|
|
2234
|
+
|
|
2235
|
+
materialized_table_name: Optional[str] = None
|
|
2236
|
+
"""The name of a materialized table."""
|
|
2237
|
+
|
|
2238
|
+
name: Optional[str] = None
|
|
2239
|
+
"""The name of the table."""
|
|
2240
|
+
|
|
2241
|
+
schema: Optional[str] = None
|
|
2242
|
+
"""The name of the schema that the table belongs to."""
|
|
2243
|
+
|
|
2244
|
+
share: Optional[str] = None
|
|
2245
|
+
"""The name of the share that the table belongs to."""
|
|
2246
|
+
|
|
2247
|
+
share_id: Optional[str] = None
|
|
2248
|
+
"""The id of the share that the table belongs to."""
|
|
2249
|
+
|
|
2250
|
+
tags: Optional[List[catalog.TagKeyValue]] = None
|
|
2251
|
+
"""The Tags of the table."""
|
|
2252
|
+
|
|
2253
|
+
def as_dict(self) -> dict:
|
|
2254
|
+
"""Serializes the Table into a dictionary suitable for use as a JSON request body."""
|
|
2255
|
+
body = {}
|
|
2256
|
+
if self.comment is not None:
|
|
2257
|
+
body["comment"] = self.comment
|
|
2258
|
+
if self.id is not None:
|
|
2259
|
+
body["id"] = self.id
|
|
2260
|
+
if self.internal_attributes:
|
|
2261
|
+
body["internal_attributes"] = self.internal_attributes.as_dict()
|
|
2262
|
+
if self.materialized_table_name is not None:
|
|
2263
|
+
body["materialized_table_name"] = self.materialized_table_name
|
|
2264
|
+
if self.name is not None:
|
|
2265
|
+
body["name"] = self.name
|
|
2266
|
+
if self.schema is not None:
|
|
2267
|
+
body["schema"] = self.schema
|
|
2268
|
+
if self.share is not None:
|
|
2269
|
+
body["share"] = self.share
|
|
2270
|
+
if self.share_id is not None:
|
|
2271
|
+
body["share_id"] = self.share_id
|
|
2272
|
+
if self.tags:
|
|
2273
|
+
body["tags"] = [v.as_dict() for v in self.tags]
|
|
2274
|
+
return body
|
|
2275
|
+
|
|
2276
|
+
def as_shallow_dict(self) -> dict:
|
|
2277
|
+
"""Serializes the Table into a shallow dictionary of its immediate attributes."""
|
|
2278
|
+
body = {}
|
|
2279
|
+
if self.comment is not None:
|
|
2280
|
+
body["comment"] = self.comment
|
|
2281
|
+
if self.id is not None:
|
|
2282
|
+
body["id"] = self.id
|
|
2283
|
+
if self.internal_attributes:
|
|
2284
|
+
body["internal_attributes"] = self.internal_attributes
|
|
2285
|
+
if self.materialized_table_name is not None:
|
|
2286
|
+
body["materialized_table_name"] = self.materialized_table_name
|
|
2287
|
+
if self.name is not None:
|
|
2288
|
+
body["name"] = self.name
|
|
2289
|
+
if self.schema is not None:
|
|
2290
|
+
body["schema"] = self.schema
|
|
2291
|
+
if self.share is not None:
|
|
2292
|
+
body["share"] = self.share
|
|
2293
|
+
if self.share_id is not None:
|
|
2294
|
+
body["share_id"] = self.share_id
|
|
2295
|
+
if self.tags:
|
|
2296
|
+
body["tags"] = self.tags
|
|
2297
|
+
return body
|
|
2298
|
+
|
|
2299
|
+
@classmethod
|
|
2300
|
+
def from_dict(cls, d: Dict[str, Any]) -> Table:
|
|
2301
|
+
"""Deserializes the Table from a dictionary."""
|
|
2302
|
+
return cls(
|
|
2303
|
+
comment=d.get("comment", None),
|
|
2304
|
+
id=d.get("id", None),
|
|
2305
|
+
internal_attributes=_from_dict(d, "internal_attributes", TableInternalAttributes),
|
|
2306
|
+
materialized_table_name=d.get("materialized_table_name", None),
|
|
2307
|
+
name=d.get("name", None),
|
|
2308
|
+
schema=d.get("schema", None),
|
|
2309
|
+
share=d.get("share", None),
|
|
2310
|
+
share_id=d.get("share_id", None),
|
|
2311
|
+
tags=_repeated_dict(d, "tags", catalog.TagKeyValue),
|
|
2312
|
+
)
|
|
1323
2313
|
|
|
1324
2314
|
|
|
1325
2315
|
@dataclass
|
|
1326
|
-
class
|
|
2316
|
+
class TableInternalAttributes:
|
|
2317
|
+
"""Internal information for D2D sharing that should not be disclosed to external users."""
|
|
2318
|
+
|
|
2319
|
+
parent_storage_location: Optional[str] = None
|
|
2320
|
+
"""Will be populated in the reconciliation response for VIEW and FOREIGN_TABLE, with the value of
|
|
2321
|
+
the parent UC entity's storage_location, following the same logic as getManagedEntityPath in
|
|
2322
|
+
CreateStagingTableHandler, which is used to store the materialized table for a shared
|
|
2323
|
+
VIEW/FOREIGN_TABLE for D2O queries. The value will be used on the recipient side to be
|
|
2324
|
+
whitelisted when SEG is enabled on the workspace of the recipient, to allow the recipient users
|
|
2325
|
+
to query this shared VIEW/FOREIGN_TABLE."""
|
|
2326
|
+
|
|
2327
|
+
storage_location: Optional[str] = None
|
|
2328
|
+
"""The cloud storage location of a shard table with DIRECTORY_BASED_TABLE type."""
|
|
2329
|
+
|
|
2330
|
+
type: Optional[TableInternalAttributesSharedTableType] = None
|
|
2331
|
+
"""The type of the shared table."""
|
|
2332
|
+
|
|
2333
|
+
view_definition: Optional[str] = None
|
|
2334
|
+
"""The view definition of a shared view. DEPRECATED."""
|
|
1327
2335
|
|
|
1328
2336
|
def as_dict(self) -> dict:
|
|
1329
|
-
"""Serializes the
|
|
2337
|
+
"""Serializes the TableInternalAttributes into a dictionary suitable for use as a JSON request body."""
|
|
1330
2338
|
body = {}
|
|
2339
|
+
if self.parent_storage_location is not None:
|
|
2340
|
+
body["parent_storage_location"] = self.parent_storage_location
|
|
2341
|
+
if self.storage_location is not None:
|
|
2342
|
+
body["storage_location"] = self.storage_location
|
|
2343
|
+
if self.type is not None:
|
|
2344
|
+
body["type"] = self.type.value
|
|
2345
|
+
if self.view_definition is not None:
|
|
2346
|
+
body["view_definition"] = self.view_definition
|
|
1331
2347
|
return body
|
|
1332
2348
|
|
|
1333
2349
|
def as_shallow_dict(self) -> dict:
|
|
1334
|
-
"""Serializes the
|
|
2350
|
+
"""Serializes the TableInternalAttributes into a shallow dictionary of its immediate attributes."""
|
|
1335
2351
|
body = {}
|
|
2352
|
+
if self.parent_storage_location is not None:
|
|
2353
|
+
body["parent_storage_location"] = self.parent_storage_location
|
|
2354
|
+
if self.storage_location is not None:
|
|
2355
|
+
body["storage_location"] = self.storage_location
|
|
2356
|
+
if self.type is not None:
|
|
2357
|
+
body["type"] = self.type
|
|
2358
|
+
if self.view_definition is not None:
|
|
2359
|
+
body["view_definition"] = self.view_definition
|
|
1336
2360
|
return body
|
|
1337
2361
|
|
|
1338
2362
|
@classmethod
|
|
1339
|
-
def from_dict(cls, d: Dict[str,
|
|
1340
|
-
"""Deserializes the
|
|
1341
|
-
return cls(
|
|
2363
|
+
def from_dict(cls, d: Dict[str, Any]) -> TableInternalAttributes:
|
|
2364
|
+
"""Deserializes the TableInternalAttributes from a dictionary."""
|
|
2365
|
+
return cls(
|
|
2366
|
+
parent_storage_location=d.get("parent_storage_location", None),
|
|
2367
|
+
storage_location=d.get("storage_location", None),
|
|
2368
|
+
type=_enum(d, "type", TableInternalAttributesSharedTableType),
|
|
2369
|
+
view_definition=d.get("view_definition", None),
|
|
2370
|
+
)
|
|
2371
|
+
|
|
2372
|
+
|
|
2373
|
+
class TableInternalAttributesSharedTableType(Enum):
|
|
2374
|
+
|
|
2375
|
+
DIRECTORY_BASED_TABLE = "DIRECTORY_BASED_TABLE"
|
|
2376
|
+
FILE_BASED_TABLE = "FILE_BASED_TABLE"
|
|
2377
|
+
FOREIGN_TABLE = "FOREIGN_TABLE"
|
|
2378
|
+
MATERIALIZED_VIEW = "MATERIALIZED_VIEW"
|
|
2379
|
+
STREAMING_TABLE = "STREAMING_TABLE"
|
|
2380
|
+
VIEW = "VIEW"
|
|
1342
2381
|
|
|
1343
2382
|
|
|
1344
2383
|
@dataclass
|
|
@@ -1362,31 +2401,43 @@ class UpdateProvider:
|
|
|
1362
2401
|
def as_dict(self) -> dict:
|
|
1363
2402
|
"""Serializes the UpdateProvider into a dictionary suitable for use as a JSON request body."""
|
|
1364
2403
|
body = {}
|
|
1365
|
-
if self.comment is not None:
|
|
1366
|
-
|
|
1367
|
-
if self.
|
|
1368
|
-
|
|
1369
|
-
if self.
|
|
2404
|
+
if self.comment is not None:
|
|
2405
|
+
body["comment"] = self.comment
|
|
2406
|
+
if self.name is not None:
|
|
2407
|
+
body["name"] = self.name
|
|
2408
|
+
if self.new_name is not None:
|
|
2409
|
+
body["new_name"] = self.new_name
|
|
2410
|
+
if self.owner is not None:
|
|
2411
|
+
body["owner"] = self.owner
|
|
2412
|
+
if self.recipient_profile_str is not None:
|
|
2413
|
+
body["recipient_profile_str"] = self.recipient_profile_str
|
|
1370
2414
|
return body
|
|
1371
2415
|
|
|
1372
2416
|
def as_shallow_dict(self) -> dict:
|
|
1373
2417
|
"""Serializes the UpdateProvider into a shallow dictionary of its immediate attributes."""
|
|
1374
2418
|
body = {}
|
|
1375
|
-
if self.comment is not None:
|
|
1376
|
-
|
|
1377
|
-
if self.
|
|
1378
|
-
|
|
1379
|
-
if self.
|
|
2419
|
+
if self.comment is not None:
|
|
2420
|
+
body["comment"] = self.comment
|
|
2421
|
+
if self.name is not None:
|
|
2422
|
+
body["name"] = self.name
|
|
2423
|
+
if self.new_name is not None:
|
|
2424
|
+
body["new_name"] = self.new_name
|
|
2425
|
+
if self.owner is not None:
|
|
2426
|
+
body["owner"] = self.owner
|
|
2427
|
+
if self.recipient_profile_str is not None:
|
|
2428
|
+
body["recipient_profile_str"] = self.recipient_profile_str
|
|
1380
2429
|
return body
|
|
1381
2430
|
|
|
1382
2431
|
@classmethod
|
|
1383
|
-
def from_dict(cls, d: Dict[str,
|
|
2432
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateProvider:
|
|
1384
2433
|
"""Deserializes the UpdateProvider from a dictionary."""
|
|
1385
|
-
return cls(
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
2434
|
+
return cls(
|
|
2435
|
+
comment=d.get("comment", None),
|
|
2436
|
+
name=d.get("name", None),
|
|
2437
|
+
new_name=d.get("new_name", None),
|
|
2438
|
+
owner=d.get("owner", None),
|
|
2439
|
+
recipient_profile_str=d.get("recipient_profile_str", None),
|
|
2440
|
+
)
|
|
1390
2441
|
|
|
1391
2442
|
|
|
1392
2443
|
@dataclass
|
|
@@ -1417,37 +2468,53 @@ class UpdateRecipient:
|
|
|
1417
2468
|
def as_dict(self) -> dict:
|
|
1418
2469
|
"""Serializes the UpdateRecipient into a dictionary suitable for use as a JSON request body."""
|
|
1419
2470
|
body = {}
|
|
1420
|
-
if self.comment is not None:
|
|
1421
|
-
|
|
1422
|
-
if self.
|
|
1423
|
-
|
|
1424
|
-
if self.
|
|
1425
|
-
|
|
1426
|
-
if self.
|
|
2471
|
+
if self.comment is not None:
|
|
2472
|
+
body["comment"] = self.comment
|
|
2473
|
+
if self.expiration_time is not None:
|
|
2474
|
+
body["expiration_time"] = self.expiration_time
|
|
2475
|
+
if self.ip_access_list:
|
|
2476
|
+
body["ip_access_list"] = self.ip_access_list.as_dict()
|
|
2477
|
+
if self.name is not None:
|
|
2478
|
+
body["name"] = self.name
|
|
2479
|
+
if self.new_name is not None:
|
|
2480
|
+
body["new_name"] = self.new_name
|
|
2481
|
+
if self.owner is not None:
|
|
2482
|
+
body["owner"] = self.owner
|
|
2483
|
+
if self.properties_kvpairs:
|
|
2484
|
+
body["properties_kvpairs"] = self.properties_kvpairs.as_dict()
|
|
1427
2485
|
return body
|
|
1428
2486
|
|
|
1429
2487
|
def as_shallow_dict(self) -> dict:
|
|
1430
2488
|
"""Serializes the UpdateRecipient into a shallow dictionary of its immediate attributes."""
|
|
1431
2489
|
body = {}
|
|
1432
|
-
if self.comment is not None:
|
|
1433
|
-
|
|
1434
|
-
if self.
|
|
1435
|
-
|
|
1436
|
-
if self.
|
|
1437
|
-
|
|
1438
|
-
if self.
|
|
2490
|
+
if self.comment is not None:
|
|
2491
|
+
body["comment"] = self.comment
|
|
2492
|
+
if self.expiration_time is not None:
|
|
2493
|
+
body["expiration_time"] = self.expiration_time
|
|
2494
|
+
if self.ip_access_list:
|
|
2495
|
+
body["ip_access_list"] = self.ip_access_list
|
|
2496
|
+
if self.name is not None:
|
|
2497
|
+
body["name"] = self.name
|
|
2498
|
+
if self.new_name is not None:
|
|
2499
|
+
body["new_name"] = self.new_name
|
|
2500
|
+
if self.owner is not None:
|
|
2501
|
+
body["owner"] = self.owner
|
|
2502
|
+
if self.properties_kvpairs:
|
|
2503
|
+
body["properties_kvpairs"] = self.properties_kvpairs
|
|
1439
2504
|
return body
|
|
1440
2505
|
|
|
1441
2506
|
@classmethod
|
|
1442
|
-
def from_dict(cls, d: Dict[str,
|
|
2507
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateRecipient:
|
|
1443
2508
|
"""Deserializes the UpdateRecipient from a dictionary."""
|
|
1444
|
-
return cls(
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
2509
|
+
return cls(
|
|
2510
|
+
comment=d.get("comment", None),
|
|
2511
|
+
expiration_time=d.get("expiration_time", None),
|
|
2512
|
+
ip_access_list=_from_dict(d, "ip_access_list", IpAccessList),
|
|
2513
|
+
name=d.get("name", None),
|
|
2514
|
+
new_name=d.get("new_name", None),
|
|
2515
|
+
owner=d.get("owner", None),
|
|
2516
|
+
properties_kvpairs=_from_dict(d, "properties_kvpairs", SecurablePropertiesKvPairs),
|
|
2517
|
+
)
|
|
1451
2518
|
|
|
1452
2519
|
|
|
1453
2520
|
@dataclass
|
|
@@ -1473,81 +2540,223 @@ class UpdateShare:
|
|
|
1473
2540
|
def as_dict(self) -> dict:
|
|
1474
2541
|
"""Serializes the UpdateShare into a dictionary suitable for use as a JSON request body."""
|
|
1475
2542
|
body = {}
|
|
1476
|
-
if self.comment is not None:
|
|
1477
|
-
|
|
1478
|
-
if self.
|
|
1479
|
-
|
|
1480
|
-
if self.
|
|
1481
|
-
|
|
2543
|
+
if self.comment is not None:
|
|
2544
|
+
body["comment"] = self.comment
|
|
2545
|
+
if self.name is not None:
|
|
2546
|
+
body["name"] = self.name
|
|
2547
|
+
if self.new_name is not None:
|
|
2548
|
+
body["new_name"] = self.new_name
|
|
2549
|
+
if self.owner is not None:
|
|
2550
|
+
body["owner"] = self.owner
|
|
2551
|
+
if self.storage_root is not None:
|
|
2552
|
+
body["storage_root"] = self.storage_root
|
|
2553
|
+
if self.updates:
|
|
2554
|
+
body["updates"] = [v.as_dict() for v in self.updates]
|
|
1482
2555
|
return body
|
|
1483
2556
|
|
|
1484
2557
|
def as_shallow_dict(self) -> dict:
|
|
1485
2558
|
"""Serializes the UpdateShare into a shallow dictionary of its immediate attributes."""
|
|
1486
2559
|
body = {}
|
|
1487
|
-
if self.comment is not None:
|
|
1488
|
-
|
|
1489
|
-
if self.
|
|
1490
|
-
|
|
1491
|
-
if self.
|
|
1492
|
-
|
|
2560
|
+
if self.comment is not None:
|
|
2561
|
+
body["comment"] = self.comment
|
|
2562
|
+
if self.name is not None:
|
|
2563
|
+
body["name"] = self.name
|
|
2564
|
+
if self.new_name is not None:
|
|
2565
|
+
body["new_name"] = self.new_name
|
|
2566
|
+
if self.owner is not None:
|
|
2567
|
+
body["owner"] = self.owner
|
|
2568
|
+
if self.storage_root is not None:
|
|
2569
|
+
body["storage_root"] = self.storage_root
|
|
2570
|
+
if self.updates:
|
|
2571
|
+
body["updates"] = self.updates
|
|
1493
2572
|
return body
|
|
1494
2573
|
|
|
1495
2574
|
@classmethod
|
|
1496
|
-
def from_dict(cls, d: Dict[str,
|
|
2575
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateShare:
|
|
1497
2576
|
"""Deserializes the UpdateShare from a dictionary."""
|
|
1498
|
-
return cls(
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
2577
|
+
return cls(
|
|
2578
|
+
comment=d.get("comment", None),
|
|
2579
|
+
name=d.get("name", None),
|
|
2580
|
+
new_name=d.get("new_name", None),
|
|
2581
|
+
owner=d.get("owner", None),
|
|
2582
|
+
storage_root=d.get("storage_root", None),
|
|
2583
|
+
updates=_repeated_dict(d, "updates", SharedDataObjectUpdate),
|
|
2584
|
+
)
|
|
1504
2585
|
|
|
1505
2586
|
|
|
1506
2587
|
@dataclass
|
|
1507
2588
|
class UpdateSharePermissions:
|
|
1508
|
-
changes: Optional[List[
|
|
2589
|
+
changes: Optional[List[PermissionsChange]] = None
|
|
1509
2590
|
"""Array of permission changes."""
|
|
1510
2591
|
|
|
1511
|
-
max_results: Optional[int] = None
|
|
1512
|
-
"""Maximum number of permissions to return. - when set to 0, the page length is set to a server
|
|
1513
|
-
configured value (recommended); - when set to a value greater than 0, the page length is the
|
|
1514
|
-
minimum of this value and a server configured value; - when set to a value less than 0, an
|
|
1515
|
-
invalid parameter error is returned; - If not set, all valid permissions are returned (not
|
|
1516
|
-
recommended). - Note: The number of returned permissions might be less than the specified
|
|
1517
|
-
max_results size, even zero. The only definitive indication that no further permissions can be
|
|
1518
|
-
fetched is when the next_page_token is unset from the response."""
|
|
1519
|
-
|
|
1520
2592
|
name: Optional[str] = None
|
|
1521
2593
|
"""The name of the share."""
|
|
1522
2594
|
|
|
1523
|
-
page_token: Optional[str] = None
|
|
1524
|
-
"""Opaque pagination token to go to next page based on previous query."""
|
|
1525
|
-
|
|
1526
2595
|
def as_dict(self) -> dict:
|
|
1527
2596
|
"""Serializes the UpdateSharePermissions into a dictionary suitable for use as a JSON request body."""
|
|
1528
2597
|
body = {}
|
|
1529
|
-
if self.changes:
|
|
1530
|
-
|
|
1531
|
-
if self.name is not None:
|
|
1532
|
-
|
|
2598
|
+
if self.changes:
|
|
2599
|
+
body["changes"] = [v.as_dict() for v in self.changes]
|
|
2600
|
+
if self.name is not None:
|
|
2601
|
+
body["name"] = self.name
|
|
1533
2602
|
return body
|
|
1534
2603
|
|
|
1535
2604
|
def as_shallow_dict(self) -> dict:
|
|
1536
2605
|
"""Serializes the UpdateSharePermissions into a shallow dictionary of its immediate attributes."""
|
|
1537
2606
|
body = {}
|
|
1538
|
-
if self.changes:
|
|
1539
|
-
|
|
1540
|
-
if self.name is not None:
|
|
1541
|
-
|
|
2607
|
+
if self.changes:
|
|
2608
|
+
body["changes"] = self.changes
|
|
2609
|
+
if self.name is not None:
|
|
2610
|
+
body["name"] = self.name
|
|
1542
2611
|
return body
|
|
1543
2612
|
|
|
1544
2613
|
@classmethod
|
|
1545
|
-
def from_dict(cls, d: Dict[str,
|
|
2614
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateSharePermissions:
|
|
1546
2615
|
"""Deserializes the UpdateSharePermissions from a dictionary."""
|
|
1547
|
-
return cls(changes=_repeated_dict(d,
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
2616
|
+
return cls(changes=_repeated_dict(d, "changes", PermissionsChange), name=d.get("name", None))
|
|
2617
|
+
|
|
2618
|
+
|
|
2619
|
+
@dataclass
|
|
2620
|
+
class UpdateSharePermissionsResponse:
|
|
2621
|
+
privilege_assignments: Optional[List[PrivilegeAssignment]] = None
|
|
2622
|
+
"""The privileges assigned to each principal"""
|
|
2623
|
+
|
|
2624
|
+
def as_dict(self) -> dict:
|
|
2625
|
+
"""Serializes the UpdateSharePermissionsResponse into a dictionary suitable for use as a JSON request body."""
|
|
2626
|
+
body = {}
|
|
2627
|
+
if self.privilege_assignments:
|
|
2628
|
+
body["privilege_assignments"] = [v.as_dict() for v in self.privilege_assignments]
|
|
2629
|
+
return body
|
|
2630
|
+
|
|
2631
|
+
def as_shallow_dict(self) -> dict:
|
|
2632
|
+
"""Serializes the UpdateSharePermissionsResponse into a shallow dictionary of its immediate attributes."""
|
|
2633
|
+
body = {}
|
|
2634
|
+
if self.privilege_assignments:
|
|
2635
|
+
body["privilege_assignments"] = self.privilege_assignments
|
|
2636
|
+
return body
|
|
2637
|
+
|
|
2638
|
+
@classmethod
|
|
2639
|
+
def from_dict(cls, d: Dict[str, Any]) -> UpdateSharePermissionsResponse:
|
|
2640
|
+
"""Deserializes the UpdateSharePermissionsResponse from a dictionary."""
|
|
2641
|
+
return cls(privilege_assignments=_repeated_dict(d, "privilege_assignments", PrivilegeAssignment))
|
|
2642
|
+
|
|
2643
|
+
|
|
2644
|
+
@dataclass
|
|
2645
|
+
class Volume:
|
|
2646
|
+
comment: Optional[str] = None
|
|
2647
|
+
"""The comment of the volume."""
|
|
2648
|
+
|
|
2649
|
+
id: Optional[str] = None
|
|
2650
|
+
"""This id maps to the shared_volume_id in database Recipient needs shared_volume_id for recon to
|
|
2651
|
+
check if this volume is already in recipient's DB or not."""
|
|
2652
|
+
|
|
2653
|
+
internal_attributes: Optional[VolumeInternalAttributes] = None
|
|
2654
|
+
"""Internal attributes for D2D sharing that should not be disclosed to external users."""
|
|
2655
|
+
|
|
2656
|
+
name: Optional[str] = None
|
|
2657
|
+
"""The name of the volume."""
|
|
2658
|
+
|
|
2659
|
+
schema: Optional[str] = None
|
|
2660
|
+
"""The name of the schema that the volume belongs to."""
|
|
2661
|
+
|
|
2662
|
+
share: Optional[str] = None
|
|
2663
|
+
"""The name of the share that the volume belongs to."""
|
|
2664
|
+
|
|
2665
|
+
share_id: Optional[str] = None
|
|
2666
|
+
"""/ The id of the share that the volume belongs to."""
|
|
2667
|
+
|
|
2668
|
+
tags: Optional[List[catalog.TagKeyValue]] = None
|
|
2669
|
+
"""The tags of the volume."""
|
|
2670
|
+
|
|
2671
|
+
def as_dict(self) -> dict:
|
|
2672
|
+
"""Serializes the Volume into a dictionary suitable for use as a JSON request body."""
|
|
2673
|
+
body = {}
|
|
2674
|
+
if self.comment is not None:
|
|
2675
|
+
body["comment"] = self.comment
|
|
2676
|
+
if self.id is not None:
|
|
2677
|
+
body["id"] = self.id
|
|
2678
|
+
if self.internal_attributes:
|
|
2679
|
+
body["internal_attributes"] = self.internal_attributes.as_dict()
|
|
2680
|
+
if self.name is not None:
|
|
2681
|
+
body["name"] = self.name
|
|
2682
|
+
if self.schema is not None:
|
|
2683
|
+
body["schema"] = self.schema
|
|
2684
|
+
if self.share is not None:
|
|
2685
|
+
body["share"] = self.share
|
|
2686
|
+
if self.share_id is not None:
|
|
2687
|
+
body["share_id"] = self.share_id
|
|
2688
|
+
if self.tags:
|
|
2689
|
+
body["tags"] = [v.as_dict() for v in self.tags]
|
|
2690
|
+
return body
|
|
2691
|
+
|
|
2692
|
+
def as_shallow_dict(self) -> dict:
|
|
2693
|
+
"""Serializes the Volume into a shallow dictionary of its immediate attributes."""
|
|
2694
|
+
body = {}
|
|
2695
|
+
if self.comment is not None:
|
|
2696
|
+
body["comment"] = self.comment
|
|
2697
|
+
if self.id is not None:
|
|
2698
|
+
body["id"] = self.id
|
|
2699
|
+
if self.internal_attributes:
|
|
2700
|
+
body["internal_attributes"] = self.internal_attributes
|
|
2701
|
+
if self.name is not None:
|
|
2702
|
+
body["name"] = self.name
|
|
2703
|
+
if self.schema is not None:
|
|
2704
|
+
body["schema"] = self.schema
|
|
2705
|
+
if self.share is not None:
|
|
2706
|
+
body["share"] = self.share
|
|
2707
|
+
if self.share_id is not None:
|
|
2708
|
+
body["share_id"] = self.share_id
|
|
2709
|
+
if self.tags:
|
|
2710
|
+
body["tags"] = self.tags
|
|
2711
|
+
return body
|
|
2712
|
+
|
|
2713
|
+
@classmethod
|
|
2714
|
+
def from_dict(cls, d: Dict[str, Any]) -> Volume:
|
|
2715
|
+
"""Deserializes the Volume from a dictionary."""
|
|
2716
|
+
return cls(
|
|
2717
|
+
comment=d.get("comment", None),
|
|
2718
|
+
id=d.get("id", None),
|
|
2719
|
+
internal_attributes=_from_dict(d, "internal_attributes", VolumeInternalAttributes),
|
|
2720
|
+
name=d.get("name", None),
|
|
2721
|
+
schema=d.get("schema", None),
|
|
2722
|
+
share=d.get("share", None),
|
|
2723
|
+
share_id=d.get("share_id", None),
|
|
2724
|
+
tags=_repeated_dict(d, "tags", catalog.TagKeyValue),
|
|
2725
|
+
)
|
|
2726
|
+
|
|
2727
|
+
|
|
2728
|
+
@dataclass
|
|
2729
|
+
class VolumeInternalAttributes:
|
|
2730
|
+
"""Internal information for D2D sharing that should not be disclosed to external users."""
|
|
2731
|
+
|
|
2732
|
+
storage_location: Optional[str] = None
|
|
2733
|
+
"""The cloud storage location of the volume"""
|
|
2734
|
+
|
|
2735
|
+
type: Optional[str] = None
|
|
2736
|
+
"""The type of the shared volume."""
|
|
2737
|
+
|
|
2738
|
+
def as_dict(self) -> dict:
|
|
2739
|
+
"""Serializes the VolumeInternalAttributes into a dictionary suitable for use as a JSON request body."""
|
|
2740
|
+
body = {}
|
|
2741
|
+
if self.storage_location is not None:
|
|
2742
|
+
body["storage_location"] = self.storage_location
|
|
2743
|
+
if self.type is not None:
|
|
2744
|
+
body["type"] = self.type
|
|
2745
|
+
return body
|
|
2746
|
+
|
|
2747
|
+
def as_shallow_dict(self) -> dict:
|
|
2748
|
+
"""Serializes the VolumeInternalAttributes into a shallow dictionary of its immediate attributes."""
|
|
2749
|
+
body = {}
|
|
2750
|
+
if self.storage_location is not None:
|
|
2751
|
+
body["storage_location"] = self.storage_location
|
|
2752
|
+
if self.type is not None:
|
|
2753
|
+
body["type"] = self.type
|
|
2754
|
+
return body
|
|
2755
|
+
|
|
2756
|
+
@classmethod
|
|
2757
|
+
def from_dict(cls, d: Dict[str, Any]) -> VolumeInternalAttributes:
|
|
2758
|
+
"""Deserializes the VolumeInternalAttributes from a dictionary."""
|
|
2759
|
+
return cls(storage_location=d.get("storage_location", None), type=d.get("type", None))
|
|
1551
2760
|
|
|
1552
2761
|
|
|
1553
2762
|
class ProvidersAPI:
|
|
@@ -1557,17 +2766,19 @@ class ProvidersAPI:
|
|
|
1557
2766
|
def __init__(self, api_client):
|
|
1558
2767
|
self._api = api_client
|
|
1559
2768
|
|
|
1560
|
-
def create(
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
2769
|
+
def create(
|
|
2770
|
+
self,
|
|
2771
|
+
name: str,
|
|
2772
|
+
authentication_type: AuthenticationType,
|
|
2773
|
+
*,
|
|
2774
|
+
comment: Optional[str] = None,
|
|
2775
|
+
recipient_profile_str: Optional[str] = None,
|
|
2776
|
+
) -> ProviderInfo:
|
|
1566
2777
|
"""Create an auth provider.
|
|
1567
|
-
|
|
2778
|
+
|
|
1568
2779
|
Creates a new authentication provider minimally based on a name and authentication type. The caller
|
|
1569
2780
|
must be an admin on the metastore.
|
|
1570
|
-
|
|
2781
|
+
|
|
1571
2782
|
:param name: str
|
|
1572
2783
|
The name of the Provider.
|
|
1573
2784
|
:param authentication_type: :class:`AuthenticationType`
|
|
@@ -1577,63 +2788,74 @@ class ProvidersAPI:
|
|
|
1577
2788
|
:param recipient_profile_str: str (optional)
|
|
1578
2789
|
This field is required when the __authentication_type__ is **TOKEN**, **OAUTH_CLIENT_CREDENTIALS**
|
|
1579
2790
|
or not provided.
|
|
1580
|
-
|
|
2791
|
+
|
|
1581
2792
|
:returns: :class:`ProviderInfo`
|
|
1582
2793
|
"""
|
|
1583
2794
|
body = {}
|
|
1584
|
-
if authentication_type is not None:
|
|
1585
|
-
|
|
1586
|
-
if
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
2795
|
+
if authentication_type is not None:
|
|
2796
|
+
body["authentication_type"] = authentication_type.value
|
|
2797
|
+
if comment is not None:
|
|
2798
|
+
body["comment"] = comment
|
|
2799
|
+
if name is not None:
|
|
2800
|
+
body["name"] = name
|
|
2801
|
+
if recipient_profile_str is not None:
|
|
2802
|
+
body["recipient_profile_str"] = recipient_profile_str
|
|
2803
|
+
headers = {
|
|
2804
|
+
"Accept": "application/json",
|
|
2805
|
+
"Content-Type": "application/json",
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2808
|
+
res = self._api.do("POST", "/api/2.1/unity-catalog/providers", body=body, headers=headers)
|
|
1591
2809
|
return ProviderInfo.from_dict(res)
|
|
1592
2810
|
|
|
1593
2811
|
def delete(self, name: str):
|
|
1594
2812
|
"""Delete a provider.
|
|
1595
|
-
|
|
2813
|
+
|
|
1596
2814
|
Deletes an authentication provider, if the caller is a metastore admin or is the owner of the
|
|
1597
2815
|
provider.
|
|
1598
|
-
|
|
2816
|
+
|
|
1599
2817
|
:param name: str
|
|
1600
2818
|
Name of the provider.
|
|
1601
|
-
|
|
1602
|
-
|
|
2819
|
+
|
|
2820
|
+
|
|
1603
2821
|
"""
|
|
1604
2822
|
|
|
1605
|
-
headers = {
|
|
2823
|
+
headers = {}
|
|
1606
2824
|
|
|
1607
|
-
self._api.do(
|
|
2825
|
+
self._api.do("DELETE", f"/api/2.1/unity-catalog/providers/{name}", headers=headers)
|
|
1608
2826
|
|
|
1609
2827
|
def get(self, name: str) -> ProviderInfo:
|
|
1610
2828
|
"""Get a provider.
|
|
1611
|
-
|
|
2829
|
+
|
|
1612
2830
|
Gets a specific authentication provider. The caller must supply the name of the provider, and must
|
|
1613
2831
|
either be a metastore admin or the owner of the provider.
|
|
1614
|
-
|
|
2832
|
+
|
|
1615
2833
|
:param name: str
|
|
1616
2834
|
Name of the provider.
|
|
1617
|
-
|
|
2835
|
+
|
|
1618
2836
|
:returns: :class:`ProviderInfo`
|
|
1619
2837
|
"""
|
|
1620
2838
|
|
|
1621
|
-
headers = {
|
|
2839
|
+
headers = {
|
|
2840
|
+
"Accept": "application/json",
|
|
2841
|
+
}
|
|
1622
2842
|
|
|
1623
|
-
res = self._api.do(
|
|
2843
|
+
res = self._api.do("GET", f"/api/2.1/unity-catalog/providers/{name}", headers=headers)
|
|
1624
2844
|
return ProviderInfo.from_dict(res)
|
|
1625
2845
|
|
|
1626
|
-
def list(
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
2846
|
+
def list(
|
|
2847
|
+
self,
|
|
2848
|
+
*,
|
|
2849
|
+
data_provider_global_metastore_id: Optional[str] = None,
|
|
2850
|
+
max_results: Optional[int] = None,
|
|
2851
|
+
page_token: Optional[str] = None,
|
|
2852
|
+
) -> Iterator[ProviderInfo]:
|
|
1631
2853
|
"""List providers.
|
|
1632
|
-
|
|
2854
|
+
|
|
1633
2855
|
Gets an array of available authentication providers. The caller must either be a metastore admin or
|
|
1634
2856
|
the owner of the providers. Providers not owned by the caller are not included in the response. There
|
|
1635
2857
|
is no guarantee of a specific ordering of the elements in the array.
|
|
1636
|
-
|
|
2858
|
+
|
|
1637
2859
|
:param data_provider_global_metastore_id: str (optional)
|
|
1638
2860
|
If not provided, all providers will be returned. If no providers exist with this ID, no results will
|
|
1639
2861
|
be returned.
|
|
@@ -1647,38 +2869,90 @@ class ProvidersAPI:
|
|
|
1647
2869
|
from the response.
|
|
1648
2870
|
:param page_token: str (optional)
|
|
1649
2871
|
Opaque pagination token to go to next page based on previous query.
|
|
1650
|
-
|
|
2872
|
+
|
|
1651
2873
|
:returns: Iterator over :class:`ProviderInfo`
|
|
1652
2874
|
"""
|
|
1653
2875
|
|
|
1654
2876
|
query = {}
|
|
1655
2877
|
if data_provider_global_metastore_id is not None:
|
|
1656
|
-
query[
|
|
1657
|
-
if max_results is not None:
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
2878
|
+
query["data_provider_global_metastore_id"] = data_provider_global_metastore_id
|
|
2879
|
+
if max_results is not None:
|
|
2880
|
+
query["max_results"] = max_results
|
|
2881
|
+
if page_token is not None:
|
|
2882
|
+
query["page_token"] = page_token
|
|
2883
|
+
headers = {
|
|
2884
|
+
"Accept": "application/json",
|
|
2885
|
+
}
|
|
2886
|
+
|
|
2887
|
+
if "max_results" not in query:
|
|
2888
|
+
query["max_results"] = 0
|
|
1662
2889
|
while True:
|
|
1663
|
-
json = self._api.do(
|
|
1664
|
-
if
|
|
1665
|
-
for v in json[
|
|
2890
|
+
json = self._api.do("GET", "/api/2.1/unity-catalog/providers", query=query, headers=headers)
|
|
2891
|
+
if "providers" in json:
|
|
2892
|
+
for v in json["providers"]:
|
|
1666
2893
|
yield ProviderInfo.from_dict(v)
|
|
1667
|
-
if
|
|
2894
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
1668
2895
|
return
|
|
1669
|
-
query[
|
|
2896
|
+
query["page_token"] = json["next_page_token"]
|
|
2897
|
+
|
|
2898
|
+
def list_provider_share_assets(
|
|
2899
|
+
self,
|
|
2900
|
+
provider_name: str,
|
|
2901
|
+
share_name: str,
|
|
2902
|
+
*,
|
|
2903
|
+
function_max_results: Optional[int] = None,
|
|
2904
|
+
notebook_max_results: Optional[int] = None,
|
|
2905
|
+
table_max_results: Optional[int] = None,
|
|
2906
|
+
volume_max_results: Optional[int] = None,
|
|
2907
|
+
) -> ListProviderShareAssetsResponse:
|
|
2908
|
+
"""List assets by provider share.
|
|
2909
|
+
|
|
2910
|
+
Get arrays of assets associated with a specified provider's share. The caller is the recipient of the
|
|
2911
|
+
share.
|
|
1670
2912
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
2913
|
+
:param provider_name: str
|
|
2914
|
+
The name of the provider who owns the share.
|
|
2915
|
+
:param share_name: str
|
|
2916
|
+
The name of the share.
|
|
2917
|
+
:param function_max_results: int (optional)
|
|
2918
|
+
Maximum number of functions to return.
|
|
2919
|
+
:param notebook_max_results: int (optional)
|
|
2920
|
+
Maximum number of notebooks to return.
|
|
2921
|
+
:param table_max_results: int (optional)
|
|
2922
|
+
Maximum number of tables to return.
|
|
2923
|
+
:param volume_max_results: int (optional)
|
|
2924
|
+
Maximum number of volumes to return.
|
|
2925
|
+
|
|
2926
|
+
:returns: :class:`ListProviderShareAssetsResponse`
|
|
2927
|
+
"""
|
|
2928
|
+
|
|
2929
|
+
query = {}
|
|
2930
|
+
if function_max_results is not None:
|
|
2931
|
+
query["function_max_results"] = function_max_results
|
|
2932
|
+
if notebook_max_results is not None:
|
|
2933
|
+
query["notebook_max_results"] = notebook_max_results
|
|
2934
|
+
if table_max_results is not None:
|
|
2935
|
+
query["table_max_results"] = table_max_results
|
|
2936
|
+
if volume_max_results is not None:
|
|
2937
|
+
query["volume_max_results"] = volume_max_results
|
|
2938
|
+
headers = {
|
|
2939
|
+
"Accept": "application/json",
|
|
2940
|
+
}
|
|
2941
|
+
|
|
2942
|
+
res = self._api.do(
|
|
2943
|
+
"GET", f"/api/2.1/data-sharing/providers/{provider_name}/shares/{share_name}", query=query, headers=headers
|
|
2944
|
+
)
|
|
2945
|
+
return ListProviderShareAssetsResponse.from_dict(res)
|
|
2946
|
+
|
|
2947
|
+
def list_shares(
|
|
2948
|
+
self, name: str, *, max_results: Optional[int] = None, page_token: Optional[str] = None
|
|
2949
|
+
) -> Iterator[ProviderShare]:
|
|
1676
2950
|
"""List shares by Provider.
|
|
1677
|
-
|
|
2951
|
+
|
|
1678
2952
|
Gets an array of a specified provider's shares within the metastore where:
|
|
1679
|
-
|
|
2953
|
+
|
|
1680
2954
|
* the caller is a metastore admin, or * the caller is the owner.
|
|
1681
|
-
|
|
2955
|
+
|
|
1682
2956
|
:param name: str
|
|
1683
2957
|
Name of the provider in which to list shares.
|
|
1684
2958
|
:param max_results: int (optional)
|
|
@@ -1691,41 +2965,45 @@ class ProvidersAPI:
|
|
|
1691
2965
|
response.
|
|
1692
2966
|
:param page_token: str (optional)
|
|
1693
2967
|
Opaque pagination token to go to next page based on previous query.
|
|
1694
|
-
|
|
2968
|
+
|
|
1695
2969
|
:returns: Iterator over :class:`ProviderShare`
|
|
1696
2970
|
"""
|
|
1697
2971
|
|
|
1698
2972
|
query = {}
|
|
1699
|
-
if max_results is not None:
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
2973
|
+
if max_results is not None:
|
|
2974
|
+
query["max_results"] = max_results
|
|
2975
|
+
if page_token is not None:
|
|
2976
|
+
query["page_token"] = page_token
|
|
2977
|
+
headers = {
|
|
2978
|
+
"Accept": "application/json",
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
if "max_results" not in query:
|
|
2982
|
+
query["max_results"] = 0
|
|
1704
2983
|
while True:
|
|
1705
|
-
json = self._api.do(
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
headers=headers)
|
|
1709
|
-
if 'shares' in json:
|
|
1710
|
-
for v in json['shares']:
|
|
2984
|
+
json = self._api.do("GET", f"/api/2.1/unity-catalog/providers/{name}/shares", query=query, headers=headers)
|
|
2985
|
+
if "shares" in json:
|
|
2986
|
+
for v in json["shares"]:
|
|
1711
2987
|
yield ProviderShare.from_dict(v)
|
|
1712
|
-
if
|
|
2988
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
1713
2989
|
return
|
|
1714
|
-
query[
|
|
1715
|
-
|
|
1716
|
-
def update(
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
2990
|
+
query["page_token"] = json["next_page_token"]
|
|
2991
|
+
|
|
2992
|
+
def update(
|
|
2993
|
+
self,
|
|
2994
|
+
name: str,
|
|
2995
|
+
*,
|
|
2996
|
+
comment: Optional[str] = None,
|
|
2997
|
+
new_name: Optional[str] = None,
|
|
2998
|
+
owner: Optional[str] = None,
|
|
2999
|
+
recipient_profile_str: Optional[str] = None,
|
|
3000
|
+
) -> ProviderInfo:
|
|
1723
3001
|
"""Update a provider.
|
|
1724
|
-
|
|
3002
|
+
|
|
1725
3003
|
Updates the information for an authentication provider, if the caller is a metastore admin or is the
|
|
1726
3004
|
owner of the provider. If the update changes the provider name, the caller must be both a metastore
|
|
1727
3005
|
admin and the owner of the provider.
|
|
1728
|
-
|
|
3006
|
+
|
|
1729
3007
|
:param name: str
|
|
1730
3008
|
Name of the provider.
|
|
1731
3009
|
:param comment: str (optional)
|
|
@@ -1737,17 +3015,24 @@ class ProvidersAPI:
|
|
|
1737
3015
|
:param recipient_profile_str: str (optional)
|
|
1738
3016
|
This field is required when the __authentication_type__ is **TOKEN**, **OAUTH_CLIENT_CREDENTIALS**
|
|
1739
3017
|
or not provided.
|
|
1740
|
-
|
|
3018
|
+
|
|
1741
3019
|
:returns: :class:`ProviderInfo`
|
|
1742
3020
|
"""
|
|
1743
3021
|
body = {}
|
|
1744
|
-
if comment is not None:
|
|
1745
|
-
|
|
1746
|
-
if
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
3022
|
+
if comment is not None:
|
|
3023
|
+
body["comment"] = comment
|
|
3024
|
+
if new_name is not None:
|
|
3025
|
+
body["new_name"] = new_name
|
|
3026
|
+
if owner is not None:
|
|
3027
|
+
body["owner"] = owner
|
|
3028
|
+
if recipient_profile_str is not None:
|
|
3029
|
+
body["recipient_profile_str"] = recipient_profile_str
|
|
3030
|
+
headers = {
|
|
3031
|
+
"Accept": "application/json",
|
|
3032
|
+
"Content-Type": "application/json",
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
res = self._api.do("PATCH", f"/api/2.1/unity-catalog/providers/{name}", body=body, headers=headers)
|
|
1751
3036
|
return ProviderInfo.from_dict(res)
|
|
1752
3037
|
|
|
1753
3038
|
|
|
@@ -1756,7 +3041,7 @@ class RecipientActivationAPI:
|
|
|
1756
3041
|
the authentication type of `TOKEN`. The data recipient follows the activation link shared by the data
|
|
1757
3042
|
provider to download the credential file that includes the access token. The recipient will then use the
|
|
1758
3043
|
credential file to establish a secure connection with the provider to receive the shared data.
|
|
1759
|
-
|
|
3044
|
+
|
|
1760
3045
|
Note that you can download the credential file only once. Recipients should treat the downloaded
|
|
1761
3046
|
credential as a secret and must not share it outside of their organization."""
|
|
1762
3047
|
|
|
@@ -1765,37 +3050,41 @@ class RecipientActivationAPI:
|
|
|
1765
3050
|
|
|
1766
3051
|
def get_activation_url_info(self, activation_url: str):
|
|
1767
3052
|
"""Get a share activation URL.
|
|
1768
|
-
|
|
3053
|
+
|
|
1769
3054
|
Gets an activation URL for a share.
|
|
1770
|
-
|
|
3055
|
+
|
|
1771
3056
|
:param activation_url: str
|
|
1772
3057
|
The one time activation url. It also accepts activation token.
|
|
1773
|
-
|
|
1774
|
-
|
|
3058
|
+
|
|
3059
|
+
|
|
1775
3060
|
"""
|
|
1776
3061
|
|
|
1777
|
-
headers = {
|
|
3062
|
+
headers = {
|
|
3063
|
+
"Accept": "application/json",
|
|
3064
|
+
}
|
|
1778
3065
|
|
|
1779
|
-
self._api.do(
|
|
1780
|
-
|
|
1781
|
-
|
|
3066
|
+
self._api.do(
|
|
3067
|
+
"GET", f"/api/2.1/unity-catalog/public/data_sharing_activation_info/{activation_url}", headers=headers
|
|
3068
|
+
)
|
|
1782
3069
|
|
|
1783
3070
|
def retrieve_token(self, activation_url: str) -> RetrieveTokenResponse:
|
|
1784
3071
|
"""Get an access token.
|
|
1785
|
-
|
|
3072
|
+
|
|
1786
3073
|
Retrieve access token with an activation url. This is a public API without any authentication.
|
|
1787
|
-
|
|
3074
|
+
|
|
1788
3075
|
:param activation_url: str
|
|
1789
3076
|
The one time activation url. It also accepts activation token.
|
|
1790
|
-
|
|
3077
|
+
|
|
1791
3078
|
:returns: :class:`RetrieveTokenResponse`
|
|
1792
3079
|
"""
|
|
1793
3080
|
|
|
1794
|
-
headers = {
|
|
3081
|
+
headers = {
|
|
3082
|
+
"Accept": "application/json",
|
|
3083
|
+
}
|
|
1795
3084
|
|
|
1796
|
-
res = self._api.do(
|
|
1797
|
-
|
|
1798
|
-
|
|
3085
|
+
res = self._api.do(
|
|
3086
|
+
"GET", f"/api/2.1/unity-catalog/public/data_sharing_activation/{activation_url}", headers=headers
|
|
3087
|
+
)
|
|
1799
3088
|
return RetrieveTokenResponse.from_dict(res)
|
|
1800
3089
|
|
|
1801
3090
|
|
|
@@ -1803,12 +3092,12 @@ class RecipientsAPI:
|
|
|
1803
3092
|
"""A recipient is an object you create using :method:recipients/create to represent an organization which you
|
|
1804
3093
|
want to allow access shares. The way how sharing works differs depending on whether or not your recipient
|
|
1805
3094
|
has access to a Databricks workspace that is enabled for Unity Catalog:
|
|
1806
|
-
|
|
3095
|
+
|
|
1807
3096
|
- For recipients with access to a Databricks workspace that is enabled for Unity Catalog, you can create a
|
|
1808
3097
|
recipient object along with a unique sharing identifier you get from the recipient. The sharing identifier
|
|
1809
3098
|
is the key identifier that enables the secure connection. This sharing mode is called
|
|
1810
3099
|
**Databricks-to-Databricks sharing**.
|
|
1811
|
-
|
|
3100
|
+
|
|
1812
3101
|
- For recipients without access to a Databricks workspace that is enabled for Unity Catalog, when you
|
|
1813
3102
|
create a recipient object, Databricks generates an activation link you can send to the recipient. The
|
|
1814
3103
|
recipient follows the activation link to download the credential file, and then uses the credential file
|
|
@@ -1817,22 +3106,24 @@ class RecipientsAPI:
|
|
|
1817
3106
|
def __init__(self, api_client):
|
|
1818
3107
|
self._api = api_client
|
|
1819
3108
|
|
|
1820
|
-
def create(
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
3109
|
+
def create(
|
|
3110
|
+
self,
|
|
3111
|
+
name: str,
|
|
3112
|
+
authentication_type: AuthenticationType,
|
|
3113
|
+
*,
|
|
3114
|
+
comment: Optional[str] = None,
|
|
3115
|
+
data_recipient_global_metastore_id: Optional[str] = None,
|
|
3116
|
+
expiration_time: Optional[int] = None,
|
|
3117
|
+
ip_access_list: Optional[IpAccessList] = None,
|
|
3118
|
+
owner: Optional[str] = None,
|
|
3119
|
+
properties_kvpairs: Optional[SecurablePropertiesKvPairs] = None,
|
|
3120
|
+
sharing_code: Optional[str] = None,
|
|
3121
|
+
) -> RecipientInfo:
|
|
1831
3122
|
"""Create a share recipient.
|
|
1832
|
-
|
|
3123
|
+
|
|
1833
3124
|
Creates a new recipient with the delta sharing authentication type in the metastore. The caller must
|
|
1834
3125
|
be a metastore admin or have the **CREATE_RECIPIENT** privilege on the metastore.
|
|
1835
|
-
|
|
3126
|
+
|
|
1836
3127
|
:param name: str
|
|
1837
3128
|
Name of Recipient.
|
|
1838
3129
|
:param authentication_type: :class:`AuthenticationType`
|
|
@@ -1856,70 +3147,85 @@ class RecipientsAPI:
|
|
|
1856
3147
|
:param sharing_code: str (optional)
|
|
1857
3148
|
The one-time sharing code provided by the data recipient. This field is only present when the
|
|
1858
3149
|
__authentication_type__ is **DATABRICKS**.
|
|
1859
|
-
|
|
3150
|
+
|
|
1860
3151
|
:returns: :class:`RecipientInfo`
|
|
1861
3152
|
"""
|
|
1862
3153
|
body = {}
|
|
1863
|
-
if authentication_type is not None:
|
|
1864
|
-
|
|
3154
|
+
if authentication_type is not None:
|
|
3155
|
+
body["authentication_type"] = authentication_type.value
|
|
3156
|
+
if comment is not None:
|
|
3157
|
+
body["comment"] = comment
|
|
1865
3158
|
if data_recipient_global_metastore_id is not None:
|
|
1866
|
-
body[
|
|
1867
|
-
if expiration_time is not None:
|
|
1868
|
-
|
|
1869
|
-
if
|
|
1870
|
-
|
|
1871
|
-
if
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
3159
|
+
body["data_recipient_global_metastore_id"] = data_recipient_global_metastore_id
|
|
3160
|
+
if expiration_time is not None:
|
|
3161
|
+
body["expiration_time"] = expiration_time
|
|
3162
|
+
if ip_access_list is not None:
|
|
3163
|
+
body["ip_access_list"] = ip_access_list.as_dict()
|
|
3164
|
+
if name is not None:
|
|
3165
|
+
body["name"] = name
|
|
3166
|
+
if owner is not None:
|
|
3167
|
+
body["owner"] = owner
|
|
3168
|
+
if properties_kvpairs is not None:
|
|
3169
|
+
body["properties_kvpairs"] = properties_kvpairs.as_dict()
|
|
3170
|
+
if sharing_code is not None:
|
|
3171
|
+
body["sharing_code"] = sharing_code
|
|
3172
|
+
headers = {
|
|
3173
|
+
"Accept": "application/json",
|
|
3174
|
+
"Content-Type": "application/json",
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
res = self._api.do("POST", "/api/2.1/unity-catalog/recipients", body=body, headers=headers)
|
|
1876
3178
|
return RecipientInfo.from_dict(res)
|
|
1877
3179
|
|
|
1878
3180
|
def delete(self, name: str):
|
|
1879
3181
|
"""Delete a share recipient.
|
|
1880
|
-
|
|
3182
|
+
|
|
1881
3183
|
Deletes the specified recipient from the metastore. The caller must be the owner of the recipient.
|
|
1882
|
-
|
|
3184
|
+
|
|
1883
3185
|
:param name: str
|
|
1884
3186
|
Name of the recipient.
|
|
1885
|
-
|
|
1886
|
-
|
|
3187
|
+
|
|
3188
|
+
|
|
1887
3189
|
"""
|
|
1888
3190
|
|
|
1889
|
-
headers = {
|
|
3191
|
+
headers = {}
|
|
1890
3192
|
|
|
1891
|
-
self._api.do(
|
|
3193
|
+
self._api.do("DELETE", f"/api/2.1/unity-catalog/recipients/{name}", headers=headers)
|
|
1892
3194
|
|
|
1893
3195
|
def get(self, name: str) -> RecipientInfo:
|
|
1894
3196
|
"""Get a share recipient.
|
|
1895
|
-
|
|
3197
|
+
|
|
1896
3198
|
Gets a share recipient from the metastore if:
|
|
1897
|
-
|
|
3199
|
+
|
|
1898
3200
|
* the caller is the owner of the share recipient, or: * is a metastore admin
|
|
1899
|
-
|
|
3201
|
+
|
|
1900
3202
|
:param name: str
|
|
1901
3203
|
Name of the recipient.
|
|
1902
|
-
|
|
3204
|
+
|
|
1903
3205
|
:returns: :class:`RecipientInfo`
|
|
1904
3206
|
"""
|
|
1905
3207
|
|
|
1906
|
-
headers = {
|
|
3208
|
+
headers = {
|
|
3209
|
+
"Accept": "application/json",
|
|
3210
|
+
}
|
|
1907
3211
|
|
|
1908
|
-
res = self._api.do(
|
|
3212
|
+
res = self._api.do("GET", f"/api/2.1/unity-catalog/recipients/{name}", headers=headers)
|
|
1909
3213
|
return RecipientInfo.from_dict(res)
|
|
1910
3214
|
|
|
1911
|
-
def list(
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
3215
|
+
def list(
|
|
3216
|
+
self,
|
|
3217
|
+
*,
|
|
3218
|
+
data_recipient_global_metastore_id: Optional[str] = None,
|
|
3219
|
+
max_results: Optional[int] = None,
|
|
3220
|
+
page_token: Optional[str] = None,
|
|
3221
|
+
) -> Iterator[RecipientInfo]:
|
|
1916
3222
|
"""List share recipients.
|
|
1917
|
-
|
|
3223
|
+
|
|
1918
3224
|
Gets an array of all share recipients within the current metastore where:
|
|
1919
|
-
|
|
3225
|
+
|
|
1920
3226
|
* the caller is a metastore admin, or * the caller is the owner. There is no guarantee of a specific
|
|
1921
3227
|
ordering of the elements in the array.
|
|
1922
|
-
|
|
3228
|
+
|
|
1923
3229
|
:param data_recipient_global_metastore_id: str (optional)
|
|
1924
3230
|
If not provided, all recipients will be returned. If no recipients exist with this ID, no results
|
|
1925
3231
|
will be returned.
|
|
@@ -1933,63 +3239,66 @@ class RecipientsAPI:
|
|
|
1933
3239
|
from the response.
|
|
1934
3240
|
:param page_token: str (optional)
|
|
1935
3241
|
Opaque pagination token to go to next page based on previous query.
|
|
1936
|
-
|
|
3242
|
+
|
|
1937
3243
|
:returns: Iterator over :class:`RecipientInfo`
|
|
1938
3244
|
"""
|
|
1939
3245
|
|
|
1940
3246
|
query = {}
|
|
1941
3247
|
if data_recipient_global_metastore_id is not None:
|
|
1942
|
-
query[
|
|
1943
|
-
if max_results is not None:
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
3248
|
+
query["data_recipient_global_metastore_id"] = data_recipient_global_metastore_id
|
|
3249
|
+
if max_results is not None:
|
|
3250
|
+
query["max_results"] = max_results
|
|
3251
|
+
if page_token is not None:
|
|
3252
|
+
query["page_token"] = page_token
|
|
3253
|
+
headers = {
|
|
3254
|
+
"Accept": "application/json",
|
|
3255
|
+
}
|
|
3256
|
+
|
|
3257
|
+
if "max_results" not in query:
|
|
3258
|
+
query["max_results"] = 0
|
|
1948
3259
|
while True:
|
|
1949
|
-
json = self._api.do(
|
|
1950
|
-
if
|
|
1951
|
-
for v in json[
|
|
3260
|
+
json = self._api.do("GET", "/api/2.1/unity-catalog/recipients", query=query, headers=headers)
|
|
3261
|
+
if "recipients" in json:
|
|
3262
|
+
for v in json["recipients"]:
|
|
1952
3263
|
yield RecipientInfo.from_dict(v)
|
|
1953
|
-
if
|
|
3264
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
1954
3265
|
return
|
|
1955
|
-
query[
|
|
3266
|
+
query["page_token"] = json["next_page_token"]
|
|
1956
3267
|
|
|
1957
3268
|
def rotate_token(self, name: str, existing_token_expire_in_seconds: int) -> RecipientInfo:
|
|
1958
3269
|
"""Rotate a token.
|
|
1959
|
-
|
|
3270
|
+
|
|
1960
3271
|
Refreshes the specified recipient's delta sharing authentication token with the provided token info.
|
|
1961
3272
|
The caller must be the owner of the recipient.
|
|
1962
|
-
|
|
3273
|
+
|
|
1963
3274
|
:param name: str
|
|
1964
3275
|
The name of the Recipient.
|
|
1965
3276
|
:param existing_token_expire_in_seconds: int
|
|
1966
3277
|
The expiration time of the bearer token in ISO 8601 format. This will set the expiration_time of
|
|
1967
3278
|
existing token only to a smaller timestamp, it cannot extend the expiration_time. Use 0 to expire
|
|
1968
3279
|
the existing token immediately, negative number will return an error.
|
|
1969
|
-
|
|
3280
|
+
|
|
1970
3281
|
:returns: :class:`RecipientInfo`
|
|
1971
3282
|
"""
|
|
1972
3283
|
body = {}
|
|
1973
3284
|
if existing_token_expire_in_seconds is not None:
|
|
1974
|
-
body[
|
|
1975
|
-
headers = {
|
|
3285
|
+
body["existing_token_expire_in_seconds"] = existing_token_expire_in_seconds
|
|
3286
|
+
headers = {
|
|
3287
|
+
"Accept": "application/json",
|
|
3288
|
+
"Content-Type": "application/json",
|
|
3289
|
+
}
|
|
1976
3290
|
|
|
1977
|
-
res = self._api.do(
|
|
1978
|
-
f'/api/2.1/unity-catalog/recipients/{name}/rotate-token',
|
|
1979
|
-
body=body,
|
|
1980
|
-
headers=headers)
|
|
3291
|
+
res = self._api.do("POST", f"/api/2.1/unity-catalog/recipients/{name}/rotate-token", body=body, headers=headers)
|
|
1981
3292
|
return RecipientInfo.from_dict(res)
|
|
1982
3293
|
|
|
1983
|
-
def share_permissions(
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
max_results: Optional[int] = None,
|
|
1987
|
-
page_token: Optional[str] = None) -> GetRecipientSharePermissionsResponse:
|
|
3294
|
+
def share_permissions(
|
|
3295
|
+
self, name: str, *, max_results: Optional[int] = None, page_token: Optional[str] = None
|
|
3296
|
+
) -> GetRecipientSharePermissionsResponse:
|
|
1988
3297
|
"""Get recipient share permissions.
|
|
1989
|
-
|
|
3298
|
+
|
|
1990
3299
|
Gets the share permissions for the specified Recipient. The caller must be a metastore admin or the
|
|
1991
3300
|
owner of the Recipient.
|
|
1992
|
-
|
|
3301
|
+
|
|
1993
3302
|
:param name: str
|
|
1994
3303
|
The name of the Recipient.
|
|
1995
3304
|
:param max_results: int (optional)
|
|
@@ -2002,36 +3311,41 @@ class RecipientsAPI:
|
|
|
2002
3311
|
unset from the response.
|
|
2003
3312
|
:param page_token: str (optional)
|
|
2004
3313
|
Opaque pagination token to go to next page based on previous query.
|
|
2005
|
-
|
|
3314
|
+
|
|
2006
3315
|
:returns: :class:`GetRecipientSharePermissionsResponse`
|
|
2007
3316
|
"""
|
|
2008
3317
|
|
|
2009
3318
|
query = {}
|
|
2010
|
-
if max_results is not None:
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
3319
|
+
if max_results is not None:
|
|
3320
|
+
query["max_results"] = max_results
|
|
3321
|
+
if page_token is not None:
|
|
3322
|
+
query["page_token"] = page_token
|
|
3323
|
+
headers = {
|
|
3324
|
+
"Accept": "application/json",
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
res = self._api.do(
|
|
3328
|
+
"GET", f"/api/2.1/unity-catalog/recipients/{name}/share-permissions", query=query, headers=headers
|
|
3329
|
+
)
|
|
2018
3330
|
return GetRecipientSharePermissionsResponse.from_dict(res)
|
|
2019
3331
|
|
|
2020
|
-
def update(
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
3332
|
+
def update(
|
|
3333
|
+
self,
|
|
3334
|
+
name: str,
|
|
3335
|
+
*,
|
|
3336
|
+
comment: Optional[str] = None,
|
|
3337
|
+
expiration_time: Optional[int] = None,
|
|
3338
|
+
ip_access_list: Optional[IpAccessList] = None,
|
|
3339
|
+
new_name: Optional[str] = None,
|
|
3340
|
+
owner: Optional[str] = None,
|
|
3341
|
+
properties_kvpairs: Optional[SecurablePropertiesKvPairs] = None,
|
|
3342
|
+
) -> RecipientInfo:
|
|
2029
3343
|
"""Update a share recipient.
|
|
2030
|
-
|
|
3344
|
+
|
|
2031
3345
|
Updates an existing recipient in the metastore. The caller must be a metastore admin or the owner of
|
|
2032
3346
|
the recipient. If the recipient name will be updated, the user must be both a metastore admin and the
|
|
2033
3347
|
owner of the recipient.
|
|
2034
|
-
|
|
3348
|
+
|
|
2035
3349
|
:param name: str
|
|
2036
3350
|
Name of the recipient.
|
|
2037
3351
|
:param comment: str (optional)
|
|
@@ -2048,19 +3362,28 @@ class RecipientsAPI:
|
|
|
2048
3362
|
Recipient properties as map of string key-value pairs. When provided in update request, the
|
|
2049
3363
|
specified properties will override the existing properties. To add and remove properties, one would
|
|
2050
3364
|
need to perform a read-modify-write.
|
|
2051
|
-
|
|
3365
|
+
|
|
2052
3366
|
:returns: :class:`RecipientInfo`
|
|
2053
3367
|
"""
|
|
2054
3368
|
body = {}
|
|
2055
|
-
if comment is not None:
|
|
2056
|
-
|
|
2057
|
-
if
|
|
2058
|
-
|
|
2059
|
-
if
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
3369
|
+
if comment is not None:
|
|
3370
|
+
body["comment"] = comment
|
|
3371
|
+
if expiration_time is not None:
|
|
3372
|
+
body["expiration_time"] = expiration_time
|
|
3373
|
+
if ip_access_list is not None:
|
|
3374
|
+
body["ip_access_list"] = ip_access_list.as_dict()
|
|
3375
|
+
if new_name is not None:
|
|
3376
|
+
body["new_name"] = new_name
|
|
3377
|
+
if owner is not None:
|
|
3378
|
+
body["owner"] = owner
|
|
3379
|
+
if properties_kvpairs is not None:
|
|
3380
|
+
body["properties_kvpairs"] = properties_kvpairs.as_dict()
|
|
3381
|
+
headers = {
|
|
3382
|
+
"Accept": "application/json",
|
|
3383
|
+
"Content-Type": "application/json",
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3386
|
+
res = self._api.do("PATCH", f"/api/2.1/unity-catalog/recipients/{name}", body=body, headers=headers)
|
|
2064
3387
|
return RecipientInfo.from_dict(res)
|
|
2065
3388
|
|
|
2066
3389
|
|
|
@@ -2073,79 +3396,81 @@ class SharesAPI:
|
|
|
2073
3396
|
def __init__(self, api_client):
|
|
2074
3397
|
self._api = api_client
|
|
2075
3398
|
|
|
2076
|
-
def create(self,
|
|
2077
|
-
name: str,
|
|
2078
|
-
*,
|
|
2079
|
-
comment: Optional[str] = None,
|
|
2080
|
-
storage_root: Optional[str] = None) -> ShareInfo:
|
|
3399
|
+
def create(self, name: str, *, comment: Optional[str] = None, storage_root: Optional[str] = None) -> ShareInfo:
|
|
2081
3400
|
"""Create a share.
|
|
2082
|
-
|
|
3401
|
+
|
|
2083
3402
|
Creates a new share for data objects. Data objects can be added after creation with **update**. The
|
|
2084
3403
|
caller must be a metastore admin or have the **CREATE_SHARE** privilege on the metastore.
|
|
2085
|
-
|
|
3404
|
+
|
|
2086
3405
|
:param name: str
|
|
2087
3406
|
Name of the share.
|
|
2088
3407
|
:param comment: str (optional)
|
|
2089
3408
|
User-provided free-form text description.
|
|
2090
3409
|
:param storage_root: str (optional)
|
|
2091
3410
|
Storage root URL for the share.
|
|
2092
|
-
|
|
3411
|
+
|
|
2093
3412
|
:returns: :class:`ShareInfo`
|
|
2094
3413
|
"""
|
|
2095
3414
|
body = {}
|
|
2096
|
-
if comment is not None:
|
|
2097
|
-
|
|
2098
|
-
if
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
3415
|
+
if comment is not None:
|
|
3416
|
+
body["comment"] = comment
|
|
3417
|
+
if name is not None:
|
|
3418
|
+
body["name"] = name
|
|
3419
|
+
if storage_root is not None:
|
|
3420
|
+
body["storage_root"] = storage_root
|
|
3421
|
+
headers = {
|
|
3422
|
+
"Accept": "application/json",
|
|
3423
|
+
"Content-Type": "application/json",
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
res = self._api.do("POST", "/api/2.1/unity-catalog/shares", body=body, headers=headers)
|
|
2102
3427
|
return ShareInfo.from_dict(res)
|
|
2103
3428
|
|
|
2104
3429
|
def delete(self, name: str):
|
|
2105
3430
|
"""Delete a share.
|
|
2106
|
-
|
|
3431
|
+
|
|
2107
3432
|
Deletes a data object share from the metastore. The caller must be an owner of the share.
|
|
2108
|
-
|
|
3433
|
+
|
|
2109
3434
|
:param name: str
|
|
2110
3435
|
The name of the share.
|
|
2111
|
-
|
|
2112
|
-
|
|
3436
|
+
|
|
3437
|
+
|
|
2113
3438
|
"""
|
|
2114
3439
|
|
|
2115
|
-
headers = {
|
|
3440
|
+
headers = {}
|
|
2116
3441
|
|
|
2117
|
-
self._api.do(
|
|
3442
|
+
self._api.do("DELETE", f"/api/2.1/unity-catalog/shares/{name}", headers=headers)
|
|
2118
3443
|
|
|
2119
3444
|
def get(self, name: str, *, include_shared_data: Optional[bool] = None) -> ShareInfo:
|
|
2120
3445
|
"""Get a share.
|
|
2121
|
-
|
|
3446
|
+
|
|
2122
3447
|
Gets a data object share from the metastore. The caller must be a metastore admin or the owner of the
|
|
2123
3448
|
share.
|
|
2124
|
-
|
|
3449
|
+
|
|
2125
3450
|
:param name: str
|
|
2126
3451
|
The name of the share.
|
|
2127
3452
|
:param include_shared_data: bool (optional)
|
|
2128
3453
|
Query for data to include in the share.
|
|
2129
|
-
|
|
3454
|
+
|
|
2130
3455
|
:returns: :class:`ShareInfo`
|
|
2131
3456
|
"""
|
|
2132
3457
|
|
|
2133
3458
|
query = {}
|
|
2134
|
-
if include_shared_data is not None:
|
|
2135
|
-
|
|
3459
|
+
if include_shared_data is not None:
|
|
3460
|
+
query["include_shared_data"] = include_shared_data
|
|
3461
|
+
headers = {
|
|
3462
|
+
"Accept": "application/json",
|
|
3463
|
+
}
|
|
2136
3464
|
|
|
2137
|
-
res = self._api.do(
|
|
3465
|
+
res = self._api.do("GET", f"/api/2.1/unity-catalog/shares/{name}", query=query, headers=headers)
|
|
2138
3466
|
return ShareInfo.from_dict(res)
|
|
2139
3467
|
|
|
2140
|
-
def list(self,
|
|
2141
|
-
*,
|
|
2142
|
-
max_results: Optional[int] = None,
|
|
2143
|
-
page_token: Optional[str] = None) -> Iterator[ShareInfo]:
|
|
3468
|
+
def list(self, *, max_results: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[ShareInfo]:
|
|
2144
3469
|
"""List shares.
|
|
2145
|
-
|
|
3470
|
+
|
|
2146
3471
|
Gets an array of data object shares from the metastore. The caller must be a metastore admin or the
|
|
2147
3472
|
owner of the share. There is no guarantee of a specific ordering of the elements in the array.
|
|
2148
|
-
|
|
3473
|
+
|
|
2149
3474
|
:param max_results: int (optional)
|
|
2150
3475
|
Maximum number of shares to return. - when set to 0, the page length is set to a server configured
|
|
2151
3476
|
value (recommended); - when set to a value greater than 0, the page length is the minimum of this
|
|
@@ -2156,35 +3481,38 @@ class SharesAPI:
|
|
|
2156
3481
|
response.
|
|
2157
3482
|
:param page_token: str (optional)
|
|
2158
3483
|
Opaque pagination token to go to next page based on previous query.
|
|
2159
|
-
|
|
3484
|
+
|
|
2160
3485
|
:returns: Iterator over :class:`ShareInfo`
|
|
2161
3486
|
"""
|
|
2162
3487
|
|
|
2163
3488
|
query = {}
|
|
2164
|
-
if max_results is not None:
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
3489
|
+
if max_results is not None:
|
|
3490
|
+
query["max_results"] = max_results
|
|
3491
|
+
if page_token is not None:
|
|
3492
|
+
query["page_token"] = page_token
|
|
3493
|
+
headers = {
|
|
3494
|
+
"Accept": "application/json",
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3497
|
+
if "max_results" not in query:
|
|
3498
|
+
query["max_results"] = 0
|
|
2169
3499
|
while True:
|
|
2170
|
-
json = self._api.do(
|
|
2171
|
-
if
|
|
2172
|
-
for v in json[
|
|
3500
|
+
json = self._api.do("GET", "/api/2.1/unity-catalog/shares", query=query, headers=headers)
|
|
3501
|
+
if "shares" in json:
|
|
3502
|
+
for v in json["shares"]:
|
|
2173
3503
|
yield ShareInfo.from_dict(v)
|
|
2174
|
-
if
|
|
3504
|
+
if "next_page_token" not in json or not json["next_page_token"]:
|
|
2175
3505
|
return
|
|
2176
|
-
query[
|
|
3506
|
+
query["page_token"] = json["next_page_token"]
|
|
2177
3507
|
|
|
2178
|
-
def share_permissions(
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
max_results: Optional[int] = None,
|
|
2182
|
-
page_token: Optional[str] = None) -> catalog.PermissionsList:
|
|
3508
|
+
def share_permissions(
|
|
3509
|
+
self, name: str, *, max_results: Optional[int] = None, page_token: Optional[str] = None
|
|
3510
|
+
) -> GetSharePermissionsResponse:
|
|
2183
3511
|
"""Get permissions.
|
|
2184
|
-
|
|
3512
|
+
|
|
2185
3513
|
Gets the permissions for a data share from the metastore. The caller must be a metastore admin or the
|
|
2186
3514
|
owner of the share.
|
|
2187
|
-
|
|
3515
|
+
|
|
2188
3516
|
:param name: str
|
|
2189
3517
|
The name of the share.
|
|
2190
3518
|
:param max_results: int (optional)
|
|
@@ -2197,47 +3525,50 @@ class SharesAPI:
|
|
|
2197
3525
|
unset from the response.
|
|
2198
3526
|
:param page_token: str (optional)
|
|
2199
3527
|
Opaque pagination token to go to next page based on previous query.
|
|
2200
|
-
|
|
2201
|
-
:returns: :class:`
|
|
3528
|
+
|
|
3529
|
+
:returns: :class:`GetSharePermissionsResponse`
|
|
2202
3530
|
"""
|
|
2203
3531
|
|
|
2204
3532
|
query = {}
|
|
2205
|
-
if max_results is not None:
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
3533
|
+
if max_results is not None:
|
|
3534
|
+
query["max_results"] = max_results
|
|
3535
|
+
if page_token is not None:
|
|
3536
|
+
query["page_token"] = page_token
|
|
3537
|
+
headers = {
|
|
3538
|
+
"Accept": "application/json",
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
res = self._api.do("GET", f"/api/2.1/unity-catalog/shares/{name}/permissions", query=query, headers=headers)
|
|
3542
|
+
return GetSharePermissionsResponse.from_dict(res)
|
|
3543
|
+
|
|
3544
|
+
def update(
|
|
3545
|
+
self,
|
|
3546
|
+
name: str,
|
|
3547
|
+
*,
|
|
3548
|
+
comment: Optional[str] = None,
|
|
3549
|
+
new_name: Optional[str] = None,
|
|
3550
|
+
owner: Optional[str] = None,
|
|
3551
|
+
storage_root: Optional[str] = None,
|
|
3552
|
+
updates: Optional[List[SharedDataObjectUpdate]] = None,
|
|
3553
|
+
) -> ShareInfo:
|
|
2223
3554
|
"""Update a share.
|
|
2224
|
-
|
|
3555
|
+
|
|
2225
3556
|
Updates the share with the changes and data objects in the request. The caller must be the owner of
|
|
2226
3557
|
the share or a metastore admin.
|
|
2227
|
-
|
|
3558
|
+
|
|
2228
3559
|
When the caller is a metastore admin, only the __owner__ field can be updated.
|
|
2229
|
-
|
|
3560
|
+
|
|
2230
3561
|
In the case that the share name is changed, **updateShare** requires that the caller is both the share
|
|
2231
3562
|
owner and a metastore admin.
|
|
2232
|
-
|
|
3563
|
+
|
|
2233
3564
|
If there are notebook files in the share, the __storage_root__ field cannot be updated.
|
|
2234
|
-
|
|
3565
|
+
|
|
2235
3566
|
For each table that is added through this method, the share owner must also have **SELECT** privilege
|
|
2236
3567
|
on the table. This privilege must be maintained indefinitely for recipients to be able to access the
|
|
2237
3568
|
table. Typically, you should use a group as the share owner.
|
|
2238
|
-
|
|
3569
|
+
|
|
2239
3570
|
Table removals through **update** do not require additional privileges.
|
|
2240
|
-
|
|
3571
|
+
|
|
2241
3572
|
:param name: str
|
|
2242
3573
|
The name of the share.
|
|
2243
3574
|
:param comment: str (optional)
|
|
@@ -2250,60 +3581,53 @@ class SharesAPI:
|
|
|
2250
3581
|
Storage root URL for the share.
|
|
2251
3582
|
:param updates: List[:class:`SharedDataObjectUpdate`] (optional)
|
|
2252
3583
|
Array of shared data object updates.
|
|
2253
|
-
|
|
3584
|
+
|
|
2254
3585
|
:returns: :class:`ShareInfo`
|
|
2255
3586
|
"""
|
|
2256
3587
|
body = {}
|
|
2257
|
-
if comment is not None:
|
|
2258
|
-
|
|
2259
|
-
if
|
|
2260
|
-
|
|
2261
|
-
if
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
3588
|
+
if comment is not None:
|
|
3589
|
+
body["comment"] = comment
|
|
3590
|
+
if new_name is not None:
|
|
3591
|
+
body["new_name"] = new_name
|
|
3592
|
+
if owner is not None:
|
|
3593
|
+
body["owner"] = owner
|
|
3594
|
+
if storage_root is not None:
|
|
3595
|
+
body["storage_root"] = storage_root
|
|
3596
|
+
if updates is not None:
|
|
3597
|
+
body["updates"] = [v.as_dict() for v in updates]
|
|
3598
|
+
headers = {
|
|
3599
|
+
"Accept": "application/json",
|
|
3600
|
+
"Content-Type": "application/json",
|
|
3601
|
+
}
|
|
3602
|
+
|
|
3603
|
+
res = self._api.do("PATCH", f"/api/2.1/unity-catalog/shares/{name}", body=body, headers=headers)
|
|
2265
3604
|
return ShareInfo.from_dict(res)
|
|
2266
3605
|
|
|
2267
|
-
def update_permissions(
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
changes: Optional[List[catalog.PermissionsChange]] = None,
|
|
2271
|
-
max_results: Optional[int] = None,
|
|
2272
|
-
page_token: Optional[str] = None):
|
|
3606
|
+
def update_permissions(
|
|
3607
|
+
self, name: str, *, changes: Optional[List[PermissionsChange]] = None
|
|
3608
|
+
) -> UpdateSharePermissionsResponse:
|
|
2273
3609
|
"""Update permissions.
|
|
2274
|
-
|
|
3610
|
+
|
|
2275
3611
|
Updates the permissions for a data share in the metastore. The caller must be a metastore admin or an
|
|
2276
3612
|
owner of the share.
|
|
2277
|
-
|
|
2278
|
-
For new recipient grants, the user must also be the owner
|
|
2279
|
-
not require additional privileges.
|
|
2280
|
-
|
|
3613
|
+
|
|
3614
|
+
For new recipient grants, the user must also be the recipient owner or metastore admin. recipient
|
|
3615
|
+
revocations do not require additional privileges.
|
|
3616
|
+
|
|
2281
3617
|
:param name: str
|
|
2282
3618
|
The name of the share.
|
|
2283
3619
|
:param changes: List[:class:`PermissionsChange`] (optional)
|
|
2284
3620
|
Array of permission changes.
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
configured value (recommended); - when set to a value greater than 0, the page length is the minimum
|
|
2288
|
-
of this value and a server configured value; - when set to a value less than 0, an invalid parameter
|
|
2289
|
-
error is returned; - If not set, all valid permissions are returned (not recommended). - Note: The
|
|
2290
|
-
number of returned permissions might be less than the specified max_results size, even zero. The
|
|
2291
|
-
only definitive indication that no further permissions can be fetched is when the next_page_token is
|
|
2292
|
-
unset from the response.
|
|
2293
|
-
:param page_token: str (optional)
|
|
2294
|
-
Opaque pagination token to go to next page based on previous query.
|
|
2295
|
-
|
|
2296
|
-
|
|
3621
|
+
|
|
3622
|
+
:returns: :class:`UpdateSharePermissionsResponse`
|
|
2297
3623
|
"""
|
|
2298
3624
|
body = {}
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
body=body,
|
|
2309
|
-
headers=headers)
|
|
3625
|
+
if changes is not None:
|
|
3626
|
+
body["changes"] = [v.as_dict() for v in changes]
|
|
3627
|
+
headers = {
|
|
3628
|
+
"Accept": "application/json",
|
|
3629
|
+
"Content-Type": "application/json",
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
res = self._api.do("PATCH", f"/api/2.1/unity-catalog/shares/{name}/permissions", body=body, headers=headers)
|
|
3633
|
+
return UpdateSharePermissionsResponse.from_dict(res)
|