databricks-sdk 0.24.0__py3-none-any.whl → 0.25.1__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 +79 -0
- databricks/sdk/core.py +1 -1
- databricks/sdk/errors/base.py +45 -1
- databricks/sdk/errors/mapper.py +9 -1
- databricks/sdk/errors/overrides.py +25 -0
- databricks/sdk/mixins/compute.py +5 -2
- databricks/sdk/service/catalog.py +367 -244
- databricks/sdk/service/compute.py +78 -23
- databricks/sdk/service/iam.py +16 -24
- databricks/sdk/service/jobs.py +55 -65
- databricks/sdk/service/marketplace.py +3571 -0
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.24.0.dist-info → databricks_sdk-0.25.1.dist-info}/METADATA +19 -1
- {databricks_sdk-0.24.0.dist-info → databricks_sdk-0.25.1.dist-info}/RECORD +18 -16
- {databricks_sdk-0.24.0.dist-info → databricks_sdk-0.25.1.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.24.0.dist-info → databricks_sdk-0.25.1.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.24.0.dist-info → databricks_sdk-0.25.1.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.24.0.dist-info → databricks_sdk-0.25.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,3571 @@
|
|
|
1
|
+
# Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from enum import Enum
|
|
8
|
+
from typing import Dict, Iterator, List, Optional
|
|
9
|
+
|
|
10
|
+
from ._internal import _enum, _from_dict, _repeated_dict, _repeated_enum
|
|
11
|
+
|
|
12
|
+
_LOG = logging.getLogger('databricks.sdk')
|
|
13
|
+
|
|
14
|
+
# all definitions in this file are in alphabetical order
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass
|
|
18
|
+
class AddExchangeForListingRequest:
|
|
19
|
+
listing_id: str
|
|
20
|
+
|
|
21
|
+
exchange_id: str
|
|
22
|
+
|
|
23
|
+
def as_dict(self) -> dict:
|
|
24
|
+
"""Serializes the AddExchangeForListingRequest into a dictionary suitable for use as a JSON request body."""
|
|
25
|
+
body = {}
|
|
26
|
+
if self.exchange_id is not None: body['exchange_id'] = self.exchange_id
|
|
27
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
28
|
+
return body
|
|
29
|
+
|
|
30
|
+
@classmethod
|
|
31
|
+
def from_dict(cls, d: Dict[str, any]) -> AddExchangeForListingRequest:
|
|
32
|
+
"""Deserializes the AddExchangeForListingRequest from a dictionary."""
|
|
33
|
+
return cls(exchange_id=d.get('exchange_id', None), listing_id=d.get('listing_id', None))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@dataclass
|
|
37
|
+
class AddExchangeForListingResponse:
|
|
38
|
+
exchange_for_listing: Optional[ExchangeListing] = None
|
|
39
|
+
|
|
40
|
+
def as_dict(self) -> dict:
|
|
41
|
+
"""Serializes the AddExchangeForListingResponse into a dictionary suitable for use as a JSON request body."""
|
|
42
|
+
body = {}
|
|
43
|
+
if self.exchange_for_listing: body['exchange_for_listing'] = self.exchange_for_listing.as_dict()
|
|
44
|
+
return body
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_dict(cls, d: Dict[str, any]) -> AddExchangeForListingResponse:
|
|
48
|
+
"""Deserializes the AddExchangeForListingResponse from a dictionary."""
|
|
49
|
+
return cls(exchange_for_listing=_from_dict(d, 'exchange_for_listing', ExchangeListing))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AssetType(Enum):
|
|
53
|
+
|
|
54
|
+
ASSET_TYPE_DATA_TABLE = 'ASSET_TYPE_DATA_TABLE'
|
|
55
|
+
ASSET_TYPE_GIT_REPO = 'ASSET_TYPE_GIT_REPO'
|
|
56
|
+
ASSET_TYPE_MEDIA = 'ASSET_TYPE_MEDIA'
|
|
57
|
+
ASSET_TYPE_MODEL = 'ASSET_TYPE_MODEL'
|
|
58
|
+
ASSET_TYPE_NOTEBOOK = 'ASSET_TYPE_NOTEBOOK'
|
|
59
|
+
ASSET_TYPE_UNSPECIFIED = 'ASSET_TYPE_UNSPECIFIED'
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class Category(Enum):
|
|
63
|
+
|
|
64
|
+
ADVERTISING_AND_MARKETING = 'ADVERTISING_AND_MARKETING'
|
|
65
|
+
CLIMATE_AND_ENVIRONMENT = 'CLIMATE_AND_ENVIRONMENT'
|
|
66
|
+
COMMERCE = 'COMMERCE'
|
|
67
|
+
DEMOGRAPHICS = 'DEMOGRAPHICS'
|
|
68
|
+
ECONOMICS = 'ECONOMICS'
|
|
69
|
+
EDUCATION = 'EDUCATION'
|
|
70
|
+
ENERGY = 'ENERGY'
|
|
71
|
+
FINANCIAL = 'FINANCIAL'
|
|
72
|
+
GAMING = 'GAMING'
|
|
73
|
+
GEOSPATIAL = 'GEOSPATIAL'
|
|
74
|
+
HEALTH = 'HEALTH'
|
|
75
|
+
LOOKUP_TABLES = 'LOOKUP_TABLES'
|
|
76
|
+
MANUFACTURING = 'MANUFACTURING'
|
|
77
|
+
MEDIA = 'MEDIA'
|
|
78
|
+
OTHER = 'OTHER'
|
|
79
|
+
PUBLIC_SECTOR = 'PUBLIC_SECTOR'
|
|
80
|
+
RETAIL = 'RETAIL'
|
|
81
|
+
SCIENCE_AND_RESEARCH = 'SCIENCE_AND_RESEARCH'
|
|
82
|
+
SECURITY = 'SECURITY'
|
|
83
|
+
SPORTS = 'SPORTS'
|
|
84
|
+
TRANSPORTATION_AND_LOGISTICS = 'TRANSPORTATION_AND_LOGISTICS'
|
|
85
|
+
TRAVEL_AND_TOURISM = 'TRAVEL_AND_TOURISM'
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@dataclass
|
|
89
|
+
class ConsumerTerms:
|
|
90
|
+
version: str
|
|
91
|
+
|
|
92
|
+
def as_dict(self) -> dict:
|
|
93
|
+
"""Serializes the ConsumerTerms into a dictionary suitable for use as a JSON request body."""
|
|
94
|
+
body = {}
|
|
95
|
+
if self.version is not None: body['version'] = self.version
|
|
96
|
+
return body
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_dict(cls, d: Dict[str, any]) -> ConsumerTerms:
|
|
100
|
+
"""Deserializes the ConsumerTerms from a dictionary."""
|
|
101
|
+
return cls(version=d.get('version', None))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@dataclass
|
|
105
|
+
class ContactInfo:
|
|
106
|
+
"""contact info for the consumer requesting data or performing a listing installation"""
|
|
107
|
+
|
|
108
|
+
company: Optional[str] = None
|
|
109
|
+
|
|
110
|
+
email: Optional[str] = None
|
|
111
|
+
|
|
112
|
+
first_name: Optional[str] = None
|
|
113
|
+
|
|
114
|
+
last_name: Optional[str] = None
|
|
115
|
+
|
|
116
|
+
def as_dict(self) -> dict:
|
|
117
|
+
"""Serializes the ContactInfo into a dictionary suitable for use as a JSON request body."""
|
|
118
|
+
body = {}
|
|
119
|
+
if self.company is not None: body['company'] = self.company
|
|
120
|
+
if self.email is not None: body['email'] = self.email
|
|
121
|
+
if self.first_name is not None: body['first_name'] = self.first_name
|
|
122
|
+
if self.last_name is not None: body['last_name'] = self.last_name
|
|
123
|
+
return body
|
|
124
|
+
|
|
125
|
+
@classmethod
|
|
126
|
+
def from_dict(cls, d: Dict[str, any]) -> ContactInfo:
|
|
127
|
+
"""Deserializes the ContactInfo from a dictionary."""
|
|
128
|
+
return cls(company=d.get('company', None),
|
|
129
|
+
email=d.get('email', None),
|
|
130
|
+
first_name=d.get('first_name', None),
|
|
131
|
+
last_name=d.get('last_name', None))
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
class Cost(Enum):
|
|
135
|
+
|
|
136
|
+
FREE = 'FREE'
|
|
137
|
+
PAID = 'PAID'
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
@dataclass
|
|
141
|
+
class CreateExchangeFilterRequest:
|
|
142
|
+
filter: ExchangeFilter
|
|
143
|
+
|
|
144
|
+
def as_dict(self) -> dict:
|
|
145
|
+
"""Serializes the CreateExchangeFilterRequest into a dictionary suitable for use as a JSON request body."""
|
|
146
|
+
body = {}
|
|
147
|
+
if self.filter: body['filter'] = self.filter.as_dict()
|
|
148
|
+
return body
|
|
149
|
+
|
|
150
|
+
@classmethod
|
|
151
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateExchangeFilterRequest:
|
|
152
|
+
"""Deserializes the CreateExchangeFilterRequest from a dictionary."""
|
|
153
|
+
return cls(filter=_from_dict(d, 'filter', ExchangeFilter))
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
@dataclass
|
|
157
|
+
class CreateExchangeFilterResponse:
|
|
158
|
+
filter_id: Optional[str] = None
|
|
159
|
+
|
|
160
|
+
def as_dict(self) -> dict:
|
|
161
|
+
"""Serializes the CreateExchangeFilterResponse into a dictionary suitable for use as a JSON request body."""
|
|
162
|
+
body = {}
|
|
163
|
+
if self.filter_id is not None: body['filter_id'] = self.filter_id
|
|
164
|
+
return body
|
|
165
|
+
|
|
166
|
+
@classmethod
|
|
167
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateExchangeFilterResponse:
|
|
168
|
+
"""Deserializes the CreateExchangeFilterResponse from a dictionary."""
|
|
169
|
+
return cls(filter_id=d.get('filter_id', None))
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
@dataclass
|
|
173
|
+
class CreateExchangeRequest:
|
|
174
|
+
exchange: Exchange
|
|
175
|
+
|
|
176
|
+
def as_dict(self) -> dict:
|
|
177
|
+
"""Serializes the CreateExchangeRequest into a dictionary suitable for use as a JSON request body."""
|
|
178
|
+
body = {}
|
|
179
|
+
if self.exchange: body['exchange'] = self.exchange.as_dict()
|
|
180
|
+
return body
|
|
181
|
+
|
|
182
|
+
@classmethod
|
|
183
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateExchangeRequest:
|
|
184
|
+
"""Deserializes the CreateExchangeRequest from a dictionary."""
|
|
185
|
+
return cls(exchange=_from_dict(d, 'exchange', Exchange))
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
@dataclass
|
|
189
|
+
class CreateExchangeResponse:
|
|
190
|
+
exchange_id: Optional[str] = None
|
|
191
|
+
|
|
192
|
+
def as_dict(self) -> dict:
|
|
193
|
+
"""Serializes the CreateExchangeResponse into a dictionary suitable for use as a JSON request body."""
|
|
194
|
+
body = {}
|
|
195
|
+
if self.exchange_id is not None: body['exchange_id'] = self.exchange_id
|
|
196
|
+
return body
|
|
197
|
+
|
|
198
|
+
@classmethod
|
|
199
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateExchangeResponse:
|
|
200
|
+
"""Deserializes the CreateExchangeResponse from a dictionary."""
|
|
201
|
+
return cls(exchange_id=d.get('exchange_id', None))
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
@dataclass
|
|
205
|
+
class CreateFileRequest:
|
|
206
|
+
file_parent: FileParent
|
|
207
|
+
|
|
208
|
+
marketplace_file_type: MarketplaceFileType
|
|
209
|
+
|
|
210
|
+
mime_type: str
|
|
211
|
+
|
|
212
|
+
display_name: Optional[str] = None
|
|
213
|
+
|
|
214
|
+
def as_dict(self) -> dict:
|
|
215
|
+
"""Serializes the CreateFileRequest into a dictionary suitable for use as a JSON request body."""
|
|
216
|
+
body = {}
|
|
217
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
218
|
+
if self.file_parent: body['file_parent'] = self.file_parent.as_dict()
|
|
219
|
+
if self.marketplace_file_type is not None:
|
|
220
|
+
body['marketplace_file_type'] = self.marketplace_file_type.value
|
|
221
|
+
if self.mime_type is not None: body['mime_type'] = self.mime_type
|
|
222
|
+
return body
|
|
223
|
+
|
|
224
|
+
@classmethod
|
|
225
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateFileRequest:
|
|
226
|
+
"""Deserializes the CreateFileRequest from a dictionary."""
|
|
227
|
+
return cls(display_name=d.get('display_name', None),
|
|
228
|
+
file_parent=_from_dict(d, 'file_parent', FileParent),
|
|
229
|
+
marketplace_file_type=_enum(d, 'marketplace_file_type', MarketplaceFileType),
|
|
230
|
+
mime_type=d.get('mime_type', None))
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
@dataclass
|
|
234
|
+
class CreateFileResponse:
|
|
235
|
+
file_info: Optional[FileInfo] = None
|
|
236
|
+
|
|
237
|
+
upload_url: Optional[str] = None
|
|
238
|
+
"""Pre-signed POST URL to blob storage"""
|
|
239
|
+
|
|
240
|
+
def as_dict(self) -> dict:
|
|
241
|
+
"""Serializes the CreateFileResponse into a dictionary suitable for use as a JSON request body."""
|
|
242
|
+
body = {}
|
|
243
|
+
if self.file_info: body['file_info'] = self.file_info.as_dict()
|
|
244
|
+
if self.upload_url is not None: body['upload_url'] = self.upload_url
|
|
245
|
+
return body
|
|
246
|
+
|
|
247
|
+
@classmethod
|
|
248
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateFileResponse:
|
|
249
|
+
"""Deserializes the CreateFileResponse from a dictionary."""
|
|
250
|
+
return cls(file_info=_from_dict(d, 'file_info', FileInfo), upload_url=d.get('upload_url', None))
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
@dataclass
|
|
254
|
+
class CreateInstallationRequest:
|
|
255
|
+
accepted_consumer_terms: Optional[ConsumerTerms] = None
|
|
256
|
+
|
|
257
|
+
catalog_name: Optional[str] = None
|
|
258
|
+
|
|
259
|
+
listing_id: Optional[str] = None
|
|
260
|
+
|
|
261
|
+
recipient_type: Optional[DeltaSharingRecipientType] = None
|
|
262
|
+
|
|
263
|
+
repo_detail: Optional[RepoInstallation] = None
|
|
264
|
+
"""for git repo installations"""
|
|
265
|
+
|
|
266
|
+
share_name: Optional[str] = None
|
|
267
|
+
|
|
268
|
+
def as_dict(self) -> dict:
|
|
269
|
+
"""Serializes the CreateInstallationRequest into a dictionary suitable for use as a JSON request body."""
|
|
270
|
+
body = {}
|
|
271
|
+
if self.accepted_consumer_terms:
|
|
272
|
+
body['accepted_consumer_terms'] = self.accepted_consumer_terms.as_dict()
|
|
273
|
+
if self.catalog_name is not None: body['catalog_name'] = self.catalog_name
|
|
274
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
275
|
+
if self.recipient_type is not None: body['recipient_type'] = self.recipient_type.value
|
|
276
|
+
if self.repo_detail: body['repo_detail'] = self.repo_detail.as_dict()
|
|
277
|
+
if self.share_name is not None: body['share_name'] = self.share_name
|
|
278
|
+
return body
|
|
279
|
+
|
|
280
|
+
@classmethod
|
|
281
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateInstallationRequest:
|
|
282
|
+
"""Deserializes the CreateInstallationRequest from a dictionary."""
|
|
283
|
+
return cls(accepted_consumer_terms=_from_dict(d, 'accepted_consumer_terms', ConsumerTerms),
|
|
284
|
+
catalog_name=d.get('catalog_name', None),
|
|
285
|
+
listing_id=d.get('listing_id', None),
|
|
286
|
+
recipient_type=_enum(d, 'recipient_type', DeltaSharingRecipientType),
|
|
287
|
+
repo_detail=_from_dict(d, 'repo_detail', RepoInstallation),
|
|
288
|
+
share_name=d.get('share_name', None))
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
@dataclass
|
|
292
|
+
class CreateListingRequest:
|
|
293
|
+
listing: Listing
|
|
294
|
+
|
|
295
|
+
def as_dict(self) -> dict:
|
|
296
|
+
"""Serializes the CreateListingRequest into a dictionary suitable for use as a JSON request body."""
|
|
297
|
+
body = {}
|
|
298
|
+
if self.listing: body['listing'] = self.listing.as_dict()
|
|
299
|
+
return body
|
|
300
|
+
|
|
301
|
+
@classmethod
|
|
302
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateListingRequest:
|
|
303
|
+
"""Deserializes the CreateListingRequest from a dictionary."""
|
|
304
|
+
return cls(listing=_from_dict(d, 'listing', Listing))
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
@dataclass
|
|
308
|
+
class CreateListingResponse:
|
|
309
|
+
listing_id: Optional[str] = None
|
|
310
|
+
|
|
311
|
+
def as_dict(self) -> dict:
|
|
312
|
+
"""Serializes the CreateListingResponse into a dictionary suitable for use as a JSON request body."""
|
|
313
|
+
body = {}
|
|
314
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
315
|
+
return body
|
|
316
|
+
|
|
317
|
+
@classmethod
|
|
318
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateListingResponse:
|
|
319
|
+
"""Deserializes the CreateListingResponse from a dictionary."""
|
|
320
|
+
return cls(listing_id=d.get('listing_id', None))
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
@dataclass
|
|
324
|
+
class CreatePersonalizationRequest:
|
|
325
|
+
"""Data request messages also creates a lead (maybe)"""
|
|
326
|
+
|
|
327
|
+
intended_use: str
|
|
328
|
+
|
|
329
|
+
accepted_consumer_terms: ConsumerTerms
|
|
330
|
+
|
|
331
|
+
comment: Optional[str] = None
|
|
332
|
+
|
|
333
|
+
company: Optional[str] = None
|
|
334
|
+
|
|
335
|
+
first_name: Optional[str] = None
|
|
336
|
+
|
|
337
|
+
is_from_lighthouse: Optional[bool] = None
|
|
338
|
+
|
|
339
|
+
last_name: Optional[str] = None
|
|
340
|
+
|
|
341
|
+
listing_id: Optional[str] = None
|
|
342
|
+
|
|
343
|
+
recipient_type: Optional[DeltaSharingRecipientType] = None
|
|
344
|
+
|
|
345
|
+
def as_dict(self) -> dict:
|
|
346
|
+
"""Serializes the CreatePersonalizationRequest into a dictionary suitable for use as a JSON request body."""
|
|
347
|
+
body = {}
|
|
348
|
+
if self.accepted_consumer_terms:
|
|
349
|
+
body['accepted_consumer_terms'] = self.accepted_consumer_terms.as_dict()
|
|
350
|
+
if self.comment is not None: body['comment'] = self.comment
|
|
351
|
+
if self.company is not None: body['company'] = self.company
|
|
352
|
+
if self.first_name is not None: body['first_name'] = self.first_name
|
|
353
|
+
if self.intended_use is not None: body['intended_use'] = self.intended_use
|
|
354
|
+
if self.is_from_lighthouse is not None: body['is_from_lighthouse'] = self.is_from_lighthouse
|
|
355
|
+
if self.last_name is not None: body['last_name'] = self.last_name
|
|
356
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
357
|
+
if self.recipient_type is not None: body['recipient_type'] = self.recipient_type.value
|
|
358
|
+
return body
|
|
359
|
+
|
|
360
|
+
@classmethod
|
|
361
|
+
def from_dict(cls, d: Dict[str, any]) -> CreatePersonalizationRequest:
|
|
362
|
+
"""Deserializes the CreatePersonalizationRequest from a dictionary."""
|
|
363
|
+
return cls(accepted_consumer_terms=_from_dict(d, 'accepted_consumer_terms', ConsumerTerms),
|
|
364
|
+
comment=d.get('comment', None),
|
|
365
|
+
company=d.get('company', None),
|
|
366
|
+
first_name=d.get('first_name', None),
|
|
367
|
+
intended_use=d.get('intended_use', None),
|
|
368
|
+
is_from_lighthouse=d.get('is_from_lighthouse', None),
|
|
369
|
+
last_name=d.get('last_name', None),
|
|
370
|
+
listing_id=d.get('listing_id', None),
|
|
371
|
+
recipient_type=_enum(d, 'recipient_type', DeltaSharingRecipientType))
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
@dataclass
|
|
375
|
+
class CreatePersonalizationRequestResponse:
|
|
376
|
+
id: Optional[str] = None
|
|
377
|
+
|
|
378
|
+
def as_dict(self) -> dict:
|
|
379
|
+
"""Serializes the CreatePersonalizationRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
380
|
+
body = {}
|
|
381
|
+
if self.id is not None: body['id'] = self.id
|
|
382
|
+
return body
|
|
383
|
+
|
|
384
|
+
@classmethod
|
|
385
|
+
def from_dict(cls, d: Dict[str, any]) -> CreatePersonalizationRequestResponse:
|
|
386
|
+
"""Deserializes the CreatePersonalizationRequestResponse from a dictionary."""
|
|
387
|
+
return cls(id=d.get('id', None))
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
@dataclass
|
|
391
|
+
class CreateProviderRequest:
|
|
392
|
+
provider: ProviderInfo
|
|
393
|
+
|
|
394
|
+
def as_dict(self) -> dict:
|
|
395
|
+
"""Serializes the CreateProviderRequest into a dictionary suitable for use as a JSON request body."""
|
|
396
|
+
body = {}
|
|
397
|
+
if self.provider: body['provider'] = self.provider.as_dict()
|
|
398
|
+
return body
|
|
399
|
+
|
|
400
|
+
@classmethod
|
|
401
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateProviderRequest:
|
|
402
|
+
"""Deserializes the CreateProviderRequest from a dictionary."""
|
|
403
|
+
return cls(provider=_from_dict(d, 'provider', ProviderInfo))
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
@dataclass
|
|
407
|
+
class CreateProviderResponse:
|
|
408
|
+
id: Optional[str] = None
|
|
409
|
+
|
|
410
|
+
def as_dict(self) -> dict:
|
|
411
|
+
"""Serializes the CreateProviderResponse into a dictionary suitable for use as a JSON request body."""
|
|
412
|
+
body = {}
|
|
413
|
+
if self.id is not None: body['id'] = self.id
|
|
414
|
+
return body
|
|
415
|
+
|
|
416
|
+
@classmethod
|
|
417
|
+
def from_dict(cls, d: Dict[str, any]) -> CreateProviderResponse:
|
|
418
|
+
"""Deserializes the CreateProviderResponse from a dictionary."""
|
|
419
|
+
return cls(id=d.get('id', None))
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
class DataRefresh(Enum):
|
|
423
|
+
|
|
424
|
+
DAILY = 'DAILY'
|
|
425
|
+
HOURLY = 'HOURLY'
|
|
426
|
+
MINUTE = 'MINUTE'
|
|
427
|
+
MONTHLY = 'MONTHLY'
|
|
428
|
+
NONE = 'NONE'
|
|
429
|
+
QUARTERLY = 'QUARTERLY'
|
|
430
|
+
SECOND = 'SECOND'
|
|
431
|
+
WEEKLY = 'WEEKLY'
|
|
432
|
+
YEARLY = 'YEARLY'
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
@dataclass
|
|
436
|
+
class DataRefreshInfo:
|
|
437
|
+
interval: int
|
|
438
|
+
|
|
439
|
+
unit: DataRefresh
|
|
440
|
+
|
|
441
|
+
def as_dict(self) -> dict:
|
|
442
|
+
"""Serializes the DataRefreshInfo into a dictionary suitable for use as a JSON request body."""
|
|
443
|
+
body = {}
|
|
444
|
+
if self.interval is not None: body['interval'] = self.interval
|
|
445
|
+
if self.unit is not None: body['unit'] = self.unit.value
|
|
446
|
+
return body
|
|
447
|
+
|
|
448
|
+
@classmethod
|
|
449
|
+
def from_dict(cls, d: Dict[str, any]) -> DataRefreshInfo:
|
|
450
|
+
"""Deserializes the DataRefreshInfo from a dictionary."""
|
|
451
|
+
return cls(interval=d.get('interval', None), unit=_enum(d, 'unit', DataRefresh))
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
@dataclass
|
|
455
|
+
class DeleteExchangeFilterResponse:
|
|
456
|
+
|
|
457
|
+
def as_dict(self) -> dict:
|
|
458
|
+
"""Serializes the DeleteExchangeFilterResponse into a dictionary suitable for use as a JSON request body."""
|
|
459
|
+
body = {}
|
|
460
|
+
return body
|
|
461
|
+
|
|
462
|
+
@classmethod
|
|
463
|
+
def from_dict(cls, d: Dict[str, any]) -> DeleteExchangeFilterResponse:
|
|
464
|
+
"""Deserializes the DeleteExchangeFilterResponse from a dictionary."""
|
|
465
|
+
return cls()
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
@dataclass
|
|
469
|
+
class DeleteExchangeResponse:
|
|
470
|
+
|
|
471
|
+
def as_dict(self) -> dict:
|
|
472
|
+
"""Serializes the DeleteExchangeResponse into a dictionary suitable for use as a JSON request body."""
|
|
473
|
+
body = {}
|
|
474
|
+
return body
|
|
475
|
+
|
|
476
|
+
@classmethod
|
|
477
|
+
def from_dict(cls, d: Dict[str, any]) -> DeleteExchangeResponse:
|
|
478
|
+
"""Deserializes the DeleteExchangeResponse from a dictionary."""
|
|
479
|
+
return cls()
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
@dataclass
|
|
483
|
+
class DeleteFileResponse:
|
|
484
|
+
|
|
485
|
+
def as_dict(self) -> dict:
|
|
486
|
+
"""Serializes the DeleteFileResponse into a dictionary suitable for use as a JSON request body."""
|
|
487
|
+
body = {}
|
|
488
|
+
return body
|
|
489
|
+
|
|
490
|
+
@classmethod
|
|
491
|
+
def from_dict(cls, d: Dict[str, any]) -> DeleteFileResponse:
|
|
492
|
+
"""Deserializes the DeleteFileResponse from a dictionary."""
|
|
493
|
+
return cls()
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
@dataclass
|
|
497
|
+
class DeleteInstallationResponse:
|
|
498
|
+
|
|
499
|
+
def as_dict(self) -> dict:
|
|
500
|
+
"""Serializes the DeleteInstallationResponse into a dictionary suitable for use as a JSON request body."""
|
|
501
|
+
body = {}
|
|
502
|
+
return body
|
|
503
|
+
|
|
504
|
+
@classmethod
|
|
505
|
+
def from_dict(cls, d: Dict[str, any]) -> DeleteInstallationResponse:
|
|
506
|
+
"""Deserializes the DeleteInstallationResponse from a dictionary."""
|
|
507
|
+
return cls()
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
@dataclass
|
|
511
|
+
class DeleteListingResponse:
|
|
512
|
+
|
|
513
|
+
def as_dict(self) -> dict:
|
|
514
|
+
"""Serializes the DeleteListingResponse into a dictionary suitable for use as a JSON request body."""
|
|
515
|
+
body = {}
|
|
516
|
+
return body
|
|
517
|
+
|
|
518
|
+
@classmethod
|
|
519
|
+
def from_dict(cls, d: Dict[str, any]) -> DeleteListingResponse:
|
|
520
|
+
"""Deserializes the DeleteListingResponse from a dictionary."""
|
|
521
|
+
return cls()
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
@dataclass
|
|
525
|
+
class DeleteProviderResponse:
|
|
526
|
+
|
|
527
|
+
def as_dict(self) -> dict:
|
|
528
|
+
"""Serializes the DeleteProviderResponse into a dictionary suitable for use as a JSON request body."""
|
|
529
|
+
body = {}
|
|
530
|
+
return body
|
|
531
|
+
|
|
532
|
+
@classmethod
|
|
533
|
+
def from_dict(cls, d: Dict[str, any]) -> DeleteProviderResponse:
|
|
534
|
+
"""Deserializes the DeleteProviderResponse from a dictionary."""
|
|
535
|
+
return cls()
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
class DeltaSharingRecipientType(Enum):
|
|
539
|
+
|
|
540
|
+
DELTA_SHARING_RECIPIENT_TYPE_DATABRICKS = 'DELTA_SHARING_RECIPIENT_TYPE_DATABRICKS'
|
|
541
|
+
DELTA_SHARING_RECIPIENT_TYPE_OPEN = 'DELTA_SHARING_RECIPIENT_TYPE_OPEN'
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
@dataclass
|
|
545
|
+
class Exchange:
|
|
546
|
+
name: str
|
|
547
|
+
|
|
548
|
+
comment: Optional[str] = None
|
|
549
|
+
|
|
550
|
+
created_at: Optional[int] = None
|
|
551
|
+
|
|
552
|
+
created_by: Optional[str] = None
|
|
553
|
+
|
|
554
|
+
filters: Optional[List[ExchangeFilter]] = None
|
|
555
|
+
|
|
556
|
+
id: Optional[str] = None
|
|
557
|
+
|
|
558
|
+
linked_listings: Optional[List[ExchangeListing]] = None
|
|
559
|
+
|
|
560
|
+
updated_at: Optional[int] = None
|
|
561
|
+
|
|
562
|
+
updated_by: Optional[str] = None
|
|
563
|
+
|
|
564
|
+
def as_dict(self) -> dict:
|
|
565
|
+
"""Serializes the Exchange into a dictionary suitable for use as a JSON request body."""
|
|
566
|
+
body = {}
|
|
567
|
+
if self.comment is not None: body['comment'] = self.comment
|
|
568
|
+
if self.created_at is not None: body['created_at'] = self.created_at
|
|
569
|
+
if self.created_by is not None: body['created_by'] = self.created_by
|
|
570
|
+
if self.filters: body['filters'] = [v.as_dict() for v in self.filters]
|
|
571
|
+
if self.id is not None: body['id'] = self.id
|
|
572
|
+
if self.linked_listings: body['linked_listings'] = [v.as_dict() for v in self.linked_listings]
|
|
573
|
+
if self.name is not None: body['name'] = self.name
|
|
574
|
+
if self.updated_at is not None: body['updated_at'] = self.updated_at
|
|
575
|
+
if self.updated_by is not None: body['updated_by'] = self.updated_by
|
|
576
|
+
return body
|
|
577
|
+
|
|
578
|
+
@classmethod
|
|
579
|
+
def from_dict(cls, d: Dict[str, any]) -> Exchange:
|
|
580
|
+
"""Deserializes the Exchange from a dictionary."""
|
|
581
|
+
return cls(comment=d.get('comment', None),
|
|
582
|
+
created_at=d.get('created_at', None),
|
|
583
|
+
created_by=d.get('created_by', None),
|
|
584
|
+
filters=_repeated_dict(d, 'filters', ExchangeFilter),
|
|
585
|
+
id=d.get('id', None),
|
|
586
|
+
linked_listings=_repeated_dict(d, 'linked_listings', ExchangeListing),
|
|
587
|
+
name=d.get('name', None),
|
|
588
|
+
updated_at=d.get('updated_at', None),
|
|
589
|
+
updated_by=d.get('updated_by', None))
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
@dataclass
|
|
593
|
+
class ExchangeFilter:
|
|
594
|
+
exchange_id: str
|
|
595
|
+
|
|
596
|
+
filter_value: str
|
|
597
|
+
|
|
598
|
+
filter_type: ExchangeFilterType
|
|
599
|
+
|
|
600
|
+
created_at: Optional[int] = None
|
|
601
|
+
|
|
602
|
+
created_by: Optional[str] = None
|
|
603
|
+
|
|
604
|
+
id: Optional[str] = None
|
|
605
|
+
|
|
606
|
+
name: Optional[str] = None
|
|
607
|
+
|
|
608
|
+
updated_at: Optional[int] = None
|
|
609
|
+
|
|
610
|
+
updated_by: Optional[str] = None
|
|
611
|
+
|
|
612
|
+
def as_dict(self) -> dict:
|
|
613
|
+
"""Serializes the ExchangeFilter into a dictionary suitable for use as a JSON request body."""
|
|
614
|
+
body = {}
|
|
615
|
+
if self.created_at is not None: body['created_at'] = self.created_at
|
|
616
|
+
if self.created_by is not None: body['created_by'] = self.created_by
|
|
617
|
+
if self.exchange_id is not None: body['exchange_id'] = self.exchange_id
|
|
618
|
+
if self.filter_type is not None: body['filter_type'] = self.filter_type.value
|
|
619
|
+
if self.filter_value is not None: body['filter_value'] = self.filter_value
|
|
620
|
+
if self.id is not None: body['id'] = self.id
|
|
621
|
+
if self.name is not None: body['name'] = self.name
|
|
622
|
+
if self.updated_at is not None: body['updated_at'] = self.updated_at
|
|
623
|
+
if self.updated_by is not None: body['updated_by'] = self.updated_by
|
|
624
|
+
return body
|
|
625
|
+
|
|
626
|
+
@classmethod
|
|
627
|
+
def from_dict(cls, d: Dict[str, any]) -> ExchangeFilter:
|
|
628
|
+
"""Deserializes the ExchangeFilter from a dictionary."""
|
|
629
|
+
return cls(created_at=d.get('created_at', None),
|
|
630
|
+
created_by=d.get('created_by', None),
|
|
631
|
+
exchange_id=d.get('exchange_id', None),
|
|
632
|
+
filter_type=_enum(d, 'filter_type', ExchangeFilterType),
|
|
633
|
+
filter_value=d.get('filter_value', None),
|
|
634
|
+
id=d.get('id', None),
|
|
635
|
+
name=d.get('name', None),
|
|
636
|
+
updated_at=d.get('updated_at', None),
|
|
637
|
+
updated_by=d.get('updated_by', None))
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
class ExchangeFilterType(Enum):
|
|
641
|
+
|
|
642
|
+
GLOBAL_METASTORE_ID = 'GLOBAL_METASTORE_ID'
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
@dataclass
|
|
646
|
+
class ExchangeListing:
|
|
647
|
+
created_at: Optional[int] = None
|
|
648
|
+
|
|
649
|
+
created_by: Optional[str] = None
|
|
650
|
+
|
|
651
|
+
exchange_id: Optional[str] = None
|
|
652
|
+
|
|
653
|
+
exchange_name: Optional[str] = None
|
|
654
|
+
|
|
655
|
+
id: Optional[str] = None
|
|
656
|
+
|
|
657
|
+
listing_id: Optional[str] = None
|
|
658
|
+
|
|
659
|
+
listing_name: Optional[str] = None
|
|
660
|
+
|
|
661
|
+
def as_dict(self) -> dict:
|
|
662
|
+
"""Serializes the ExchangeListing into a dictionary suitable for use as a JSON request body."""
|
|
663
|
+
body = {}
|
|
664
|
+
if self.created_at is not None: body['created_at'] = self.created_at
|
|
665
|
+
if self.created_by is not None: body['created_by'] = self.created_by
|
|
666
|
+
if self.exchange_id is not None: body['exchange_id'] = self.exchange_id
|
|
667
|
+
if self.exchange_name is not None: body['exchange_name'] = self.exchange_name
|
|
668
|
+
if self.id is not None: body['id'] = self.id
|
|
669
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
670
|
+
if self.listing_name is not None: body['listing_name'] = self.listing_name
|
|
671
|
+
return body
|
|
672
|
+
|
|
673
|
+
@classmethod
|
|
674
|
+
def from_dict(cls, d: Dict[str, any]) -> ExchangeListing:
|
|
675
|
+
"""Deserializes the ExchangeListing from a dictionary."""
|
|
676
|
+
return cls(created_at=d.get('created_at', None),
|
|
677
|
+
created_by=d.get('created_by', None),
|
|
678
|
+
exchange_id=d.get('exchange_id', None),
|
|
679
|
+
exchange_name=d.get('exchange_name', None),
|
|
680
|
+
id=d.get('id', None),
|
|
681
|
+
listing_id=d.get('listing_id', None),
|
|
682
|
+
listing_name=d.get('listing_name', None))
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
@dataclass
|
|
686
|
+
class FileInfo:
|
|
687
|
+
created_at: Optional[int] = None
|
|
688
|
+
|
|
689
|
+
display_name: Optional[str] = None
|
|
690
|
+
"""Name displayed to users for applicable files, e.g. embedded notebooks"""
|
|
691
|
+
|
|
692
|
+
download_link: Optional[str] = None
|
|
693
|
+
|
|
694
|
+
file_parent: Optional[FileParent] = None
|
|
695
|
+
|
|
696
|
+
id: Optional[str] = None
|
|
697
|
+
|
|
698
|
+
marketplace_file_type: Optional[MarketplaceFileType] = None
|
|
699
|
+
|
|
700
|
+
mime_type: Optional[str] = None
|
|
701
|
+
|
|
702
|
+
status: Optional[FileStatus] = None
|
|
703
|
+
|
|
704
|
+
status_message: Optional[str] = None
|
|
705
|
+
"""Populated if status is in a failed state with more information on reason for the failure."""
|
|
706
|
+
|
|
707
|
+
updated_at: Optional[int] = None
|
|
708
|
+
|
|
709
|
+
def as_dict(self) -> dict:
|
|
710
|
+
"""Serializes the FileInfo into a dictionary suitable for use as a JSON request body."""
|
|
711
|
+
body = {}
|
|
712
|
+
if self.created_at is not None: body['created_at'] = self.created_at
|
|
713
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
714
|
+
if self.download_link is not None: body['download_link'] = self.download_link
|
|
715
|
+
if self.file_parent: body['file_parent'] = self.file_parent.as_dict()
|
|
716
|
+
if self.id is not None: body['id'] = self.id
|
|
717
|
+
if self.marketplace_file_type is not None:
|
|
718
|
+
body['marketplace_file_type'] = self.marketplace_file_type.value
|
|
719
|
+
if self.mime_type is not None: body['mime_type'] = self.mime_type
|
|
720
|
+
if self.status is not None: body['status'] = self.status.value
|
|
721
|
+
if self.status_message is not None: body['status_message'] = self.status_message
|
|
722
|
+
if self.updated_at is not None: body['updated_at'] = self.updated_at
|
|
723
|
+
return body
|
|
724
|
+
|
|
725
|
+
@classmethod
|
|
726
|
+
def from_dict(cls, d: Dict[str, any]) -> FileInfo:
|
|
727
|
+
"""Deserializes the FileInfo from a dictionary."""
|
|
728
|
+
return cls(created_at=d.get('created_at', None),
|
|
729
|
+
display_name=d.get('display_name', None),
|
|
730
|
+
download_link=d.get('download_link', None),
|
|
731
|
+
file_parent=_from_dict(d, 'file_parent', FileParent),
|
|
732
|
+
id=d.get('id', None),
|
|
733
|
+
marketplace_file_type=_enum(d, 'marketplace_file_type', MarketplaceFileType),
|
|
734
|
+
mime_type=d.get('mime_type', None),
|
|
735
|
+
status=_enum(d, 'status', FileStatus),
|
|
736
|
+
status_message=d.get('status_message', None),
|
|
737
|
+
updated_at=d.get('updated_at', None))
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
@dataclass
|
|
741
|
+
class FileParent:
|
|
742
|
+
file_parent_type: Optional[FileParentType] = None
|
|
743
|
+
|
|
744
|
+
parent_id: Optional[str] = None
|
|
745
|
+
"""TODO make the following fields required"""
|
|
746
|
+
|
|
747
|
+
def as_dict(self) -> dict:
|
|
748
|
+
"""Serializes the FileParent into a dictionary suitable for use as a JSON request body."""
|
|
749
|
+
body = {}
|
|
750
|
+
if self.file_parent_type is not None: body['file_parent_type'] = self.file_parent_type.value
|
|
751
|
+
if self.parent_id is not None: body['parent_id'] = self.parent_id
|
|
752
|
+
return body
|
|
753
|
+
|
|
754
|
+
@classmethod
|
|
755
|
+
def from_dict(cls, d: Dict[str, any]) -> FileParent:
|
|
756
|
+
"""Deserializes the FileParent from a dictionary."""
|
|
757
|
+
return cls(file_parent_type=_enum(d, 'file_parent_type', FileParentType),
|
|
758
|
+
parent_id=d.get('parent_id', None))
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
class FileParentType(Enum):
|
|
762
|
+
|
|
763
|
+
LISTING = 'LISTING'
|
|
764
|
+
PROVIDER = 'PROVIDER'
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
class FileStatus(Enum):
|
|
768
|
+
|
|
769
|
+
FILE_STATUS_PUBLISHED = 'FILE_STATUS_PUBLISHED'
|
|
770
|
+
FILE_STATUS_SANITIZATION_FAILED = 'FILE_STATUS_SANITIZATION_FAILED'
|
|
771
|
+
FILE_STATUS_SANITIZING = 'FILE_STATUS_SANITIZING'
|
|
772
|
+
FILE_STATUS_STAGING = 'FILE_STATUS_STAGING'
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
class FilterType(Enum):
|
|
776
|
+
|
|
777
|
+
METASTORE = 'METASTORE'
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
class FulfillmentType(Enum):
|
|
781
|
+
|
|
782
|
+
INSTALL = 'INSTALL'
|
|
783
|
+
REQUEST_ACCESS = 'REQUEST_ACCESS'
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
@dataclass
|
|
787
|
+
class GetExchangeResponse:
|
|
788
|
+
exchange: Optional[Exchange] = None
|
|
789
|
+
|
|
790
|
+
def as_dict(self) -> dict:
|
|
791
|
+
"""Serializes the GetExchangeResponse into a dictionary suitable for use as a JSON request body."""
|
|
792
|
+
body = {}
|
|
793
|
+
if self.exchange: body['exchange'] = self.exchange.as_dict()
|
|
794
|
+
return body
|
|
795
|
+
|
|
796
|
+
@classmethod
|
|
797
|
+
def from_dict(cls, d: Dict[str, any]) -> GetExchangeResponse:
|
|
798
|
+
"""Deserializes the GetExchangeResponse from a dictionary."""
|
|
799
|
+
return cls(exchange=_from_dict(d, 'exchange', Exchange))
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
@dataclass
|
|
803
|
+
class GetFileResponse:
|
|
804
|
+
file_info: Optional[FileInfo] = None
|
|
805
|
+
|
|
806
|
+
def as_dict(self) -> dict:
|
|
807
|
+
"""Serializes the GetFileResponse into a dictionary suitable for use as a JSON request body."""
|
|
808
|
+
body = {}
|
|
809
|
+
if self.file_info: body['file_info'] = self.file_info.as_dict()
|
|
810
|
+
return body
|
|
811
|
+
|
|
812
|
+
@classmethod
|
|
813
|
+
def from_dict(cls, d: Dict[str, any]) -> GetFileResponse:
|
|
814
|
+
"""Deserializes the GetFileResponse from a dictionary."""
|
|
815
|
+
return cls(file_info=_from_dict(d, 'file_info', FileInfo))
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
@dataclass
|
|
819
|
+
class GetLatestVersionProviderAnalyticsDashboardResponse:
|
|
820
|
+
version: Optional[int] = None
|
|
821
|
+
"""version here is latest logical version of the dashboard template"""
|
|
822
|
+
|
|
823
|
+
def as_dict(self) -> dict:
|
|
824
|
+
"""Serializes the GetLatestVersionProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body."""
|
|
825
|
+
body = {}
|
|
826
|
+
if self.version is not None: body['version'] = self.version
|
|
827
|
+
return body
|
|
828
|
+
|
|
829
|
+
@classmethod
|
|
830
|
+
def from_dict(cls, d: Dict[str, any]) -> GetLatestVersionProviderAnalyticsDashboardResponse:
|
|
831
|
+
"""Deserializes the GetLatestVersionProviderAnalyticsDashboardResponse from a dictionary."""
|
|
832
|
+
return cls(version=d.get('version', None))
|
|
833
|
+
|
|
834
|
+
|
|
835
|
+
@dataclass
|
|
836
|
+
class GetListingContentMetadataResponse:
|
|
837
|
+
next_page_token: Optional[str] = None
|
|
838
|
+
|
|
839
|
+
shared_data_objects: Optional[List[SharedDataObject]] = None
|
|
840
|
+
|
|
841
|
+
def as_dict(self) -> dict:
|
|
842
|
+
"""Serializes the GetListingContentMetadataResponse into a dictionary suitable for use as a JSON request body."""
|
|
843
|
+
body = {}
|
|
844
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
845
|
+
if self.shared_data_objects:
|
|
846
|
+
body['shared_data_objects'] = [v.as_dict() for v in self.shared_data_objects]
|
|
847
|
+
return body
|
|
848
|
+
|
|
849
|
+
@classmethod
|
|
850
|
+
def from_dict(cls, d: Dict[str, any]) -> GetListingContentMetadataResponse:
|
|
851
|
+
"""Deserializes the GetListingContentMetadataResponse from a dictionary."""
|
|
852
|
+
return cls(next_page_token=d.get('next_page_token', None),
|
|
853
|
+
shared_data_objects=_repeated_dict(d, 'shared_data_objects', SharedDataObject))
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
@dataclass
|
|
857
|
+
class GetListingResponse:
|
|
858
|
+
listing: Optional[Listing] = None
|
|
859
|
+
|
|
860
|
+
def as_dict(self) -> dict:
|
|
861
|
+
"""Serializes the GetListingResponse into a dictionary suitable for use as a JSON request body."""
|
|
862
|
+
body = {}
|
|
863
|
+
if self.listing: body['listing'] = self.listing.as_dict()
|
|
864
|
+
return body
|
|
865
|
+
|
|
866
|
+
@classmethod
|
|
867
|
+
def from_dict(cls, d: Dict[str, any]) -> GetListingResponse:
|
|
868
|
+
"""Deserializes the GetListingResponse from a dictionary."""
|
|
869
|
+
return cls(listing=_from_dict(d, 'listing', Listing))
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
@dataclass
|
|
873
|
+
class GetListingsResponse:
|
|
874
|
+
listings: Optional[List[Listing]] = None
|
|
875
|
+
|
|
876
|
+
next_page_token: Optional[str] = None
|
|
877
|
+
|
|
878
|
+
def as_dict(self) -> dict:
|
|
879
|
+
"""Serializes the GetListingsResponse into a dictionary suitable for use as a JSON request body."""
|
|
880
|
+
body = {}
|
|
881
|
+
if self.listings: body['listings'] = [v.as_dict() for v in self.listings]
|
|
882
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
883
|
+
return body
|
|
884
|
+
|
|
885
|
+
@classmethod
|
|
886
|
+
def from_dict(cls, d: Dict[str, any]) -> GetListingsResponse:
|
|
887
|
+
"""Deserializes the GetListingsResponse from a dictionary."""
|
|
888
|
+
return cls(listings=_repeated_dict(d, 'listings', Listing),
|
|
889
|
+
next_page_token=d.get('next_page_token', None))
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
@dataclass
|
|
893
|
+
class GetPersonalizationRequestResponse:
|
|
894
|
+
personalization_requests: Optional[List[PersonalizationRequest]] = None
|
|
895
|
+
|
|
896
|
+
def as_dict(self) -> dict:
|
|
897
|
+
"""Serializes the GetPersonalizationRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
898
|
+
body = {}
|
|
899
|
+
if self.personalization_requests:
|
|
900
|
+
body['personalization_requests'] = [v.as_dict() for v in self.personalization_requests]
|
|
901
|
+
return body
|
|
902
|
+
|
|
903
|
+
@classmethod
|
|
904
|
+
def from_dict(cls, d: Dict[str, any]) -> GetPersonalizationRequestResponse:
|
|
905
|
+
"""Deserializes the GetPersonalizationRequestResponse from a dictionary."""
|
|
906
|
+
return cls(
|
|
907
|
+
personalization_requests=_repeated_dict(d, 'personalization_requests', PersonalizationRequest))
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
@dataclass
|
|
911
|
+
class GetProviderResponse:
|
|
912
|
+
provider: Optional[ProviderInfo] = None
|
|
913
|
+
|
|
914
|
+
def as_dict(self) -> dict:
|
|
915
|
+
"""Serializes the GetProviderResponse into a dictionary suitable for use as a JSON request body."""
|
|
916
|
+
body = {}
|
|
917
|
+
if self.provider: body['provider'] = self.provider.as_dict()
|
|
918
|
+
return body
|
|
919
|
+
|
|
920
|
+
@classmethod
|
|
921
|
+
def from_dict(cls, d: Dict[str, any]) -> GetProviderResponse:
|
|
922
|
+
"""Deserializes the GetProviderResponse from a dictionary."""
|
|
923
|
+
return cls(provider=_from_dict(d, 'provider', ProviderInfo))
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
@dataclass
|
|
927
|
+
class Installation:
|
|
928
|
+
installation: Optional[InstallationDetail] = None
|
|
929
|
+
|
|
930
|
+
def as_dict(self) -> dict:
|
|
931
|
+
"""Serializes the Installation into a dictionary suitable for use as a JSON request body."""
|
|
932
|
+
body = {}
|
|
933
|
+
if self.installation: body['installation'] = self.installation.as_dict()
|
|
934
|
+
return body
|
|
935
|
+
|
|
936
|
+
@classmethod
|
|
937
|
+
def from_dict(cls, d: Dict[str, any]) -> Installation:
|
|
938
|
+
"""Deserializes the Installation from a dictionary."""
|
|
939
|
+
return cls(installation=_from_dict(d, 'installation', InstallationDetail))
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
@dataclass
|
|
943
|
+
class InstallationDetail:
|
|
944
|
+
catalog_name: Optional[str] = None
|
|
945
|
+
|
|
946
|
+
error_message: Optional[str] = None
|
|
947
|
+
|
|
948
|
+
id: Optional[str] = None
|
|
949
|
+
|
|
950
|
+
installed_on: Optional[int] = None
|
|
951
|
+
|
|
952
|
+
listing_id: Optional[str] = None
|
|
953
|
+
|
|
954
|
+
listing_name: Optional[str] = None
|
|
955
|
+
|
|
956
|
+
recipient_type: Optional[DeltaSharingRecipientType] = None
|
|
957
|
+
|
|
958
|
+
repo_name: Optional[str] = None
|
|
959
|
+
|
|
960
|
+
repo_path: Optional[str] = None
|
|
961
|
+
|
|
962
|
+
share_name: Optional[str] = None
|
|
963
|
+
|
|
964
|
+
status: Optional[InstallationStatus] = None
|
|
965
|
+
|
|
966
|
+
token_detail: Optional[TokenDetail] = None
|
|
967
|
+
|
|
968
|
+
tokens: Optional[List[TokenInfo]] = None
|
|
969
|
+
|
|
970
|
+
def as_dict(self) -> dict:
|
|
971
|
+
"""Serializes the InstallationDetail into a dictionary suitable for use as a JSON request body."""
|
|
972
|
+
body = {}
|
|
973
|
+
if self.catalog_name is not None: body['catalog_name'] = self.catalog_name
|
|
974
|
+
if self.error_message is not None: body['error_message'] = self.error_message
|
|
975
|
+
if self.id is not None: body['id'] = self.id
|
|
976
|
+
if self.installed_on is not None: body['installed_on'] = self.installed_on
|
|
977
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
978
|
+
if self.listing_name is not None: body['listing_name'] = self.listing_name
|
|
979
|
+
if self.recipient_type is not None: body['recipient_type'] = self.recipient_type.value
|
|
980
|
+
if self.repo_name is not None: body['repo_name'] = self.repo_name
|
|
981
|
+
if self.repo_path is not None: body['repo_path'] = self.repo_path
|
|
982
|
+
if self.share_name is not None: body['share_name'] = self.share_name
|
|
983
|
+
if self.status is not None: body['status'] = self.status.value
|
|
984
|
+
if self.token_detail: body['token_detail'] = self.token_detail.as_dict()
|
|
985
|
+
if self.tokens: body['tokens'] = [v.as_dict() for v in self.tokens]
|
|
986
|
+
return body
|
|
987
|
+
|
|
988
|
+
@classmethod
|
|
989
|
+
def from_dict(cls, d: Dict[str, any]) -> InstallationDetail:
|
|
990
|
+
"""Deserializes the InstallationDetail from a dictionary."""
|
|
991
|
+
return cls(catalog_name=d.get('catalog_name', None),
|
|
992
|
+
error_message=d.get('error_message', None),
|
|
993
|
+
id=d.get('id', None),
|
|
994
|
+
installed_on=d.get('installed_on', None),
|
|
995
|
+
listing_id=d.get('listing_id', None),
|
|
996
|
+
listing_name=d.get('listing_name', None),
|
|
997
|
+
recipient_type=_enum(d, 'recipient_type', DeltaSharingRecipientType),
|
|
998
|
+
repo_name=d.get('repo_name', None),
|
|
999
|
+
repo_path=d.get('repo_path', None),
|
|
1000
|
+
share_name=d.get('share_name', None),
|
|
1001
|
+
status=_enum(d, 'status', InstallationStatus),
|
|
1002
|
+
token_detail=_from_dict(d, 'token_detail', TokenDetail),
|
|
1003
|
+
tokens=_repeated_dict(d, 'tokens', TokenInfo))
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
class InstallationStatus(Enum):
|
|
1007
|
+
|
|
1008
|
+
FAILED = 'FAILED'
|
|
1009
|
+
INSTALLED = 'INSTALLED'
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
@dataclass
|
|
1013
|
+
class ListAllInstallationsResponse:
|
|
1014
|
+
installations: Optional[List[InstallationDetail]] = None
|
|
1015
|
+
|
|
1016
|
+
next_page_token: Optional[str] = None
|
|
1017
|
+
|
|
1018
|
+
def as_dict(self) -> dict:
|
|
1019
|
+
"""Serializes the ListAllInstallationsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1020
|
+
body = {}
|
|
1021
|
+
if self.installations: body['installations'] = [v.as_dict() for v in self.installations]
|
|
1022
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1023
|
+
return body
|
|
1024
|
+
|
|
1025
|
+
@classmethod
|
|
1026
|
+
def from_dict(cls, d: Dict[str, any]) -> ListAllInstallationsResponse:
|
|
1027
|
+
"""Deserializes the ListAllInstallationsResponse from a dictionary."""
|
|
1028
|
+
return cls(installations=_repeated_dict(d, 'installations', InstallationDetail),
|
|
1029
|
+
next_page_token=d.get('next_page_token', None))
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
@dataclass
|
|
1033
|
+
class ListAllPersonalizationRequestsResponse:
|
|
1034
|
+
next_page_token: Optional[str] = None
|
|
1035
|
+
|
|
1036
|
+
personalization_requests: Optional[List[PersonalizationRequest]] = None
|
|
1037
|
+
|
|
1038
|
+
def as_dict(self) -> dict:
|
|
1039
|
+
"""Serializes the ListAllPersonalizationRequestsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1040
|
+
body = {}
|
|
1041
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1042
|
+
if self.personalization_requests:
|
|
1043
|
+
body['personalization_requests'] = [v.as_dict() for v in self.personalization_requests]
|
|
1044
|
+
return body
|
|
1045
|
+
|
|
1046
|
+
@classmethod
|
|
1047
|
+
def from_dict(cls, d: Dict[str, any]) -> ListAllPersonalizationRequestsResponse:
|
|
1048
|
+
"""Deserializes the ListAllPersonalizationRequestsResponse from a dictionary."""
|
|
1049
|
+
return cls(next_page_token=d.get('next_page_token', None),
|
|
1050
|
+
personalization_requests=_repeated_dict(d, 'personalization_requests',
|
|
1051
|
+
PersonalizationRequest))
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
@dataclass
|
|
1055
|
+
class ListExchangeFiltersResponse:
|
|
1056
|
+
filters: Optional[List[ExchangeFilter]] = None
|
|
1057
|
+
|
|
1058
|
+
next_page_token: Optional[str] = None
|
|
1059
|
+
|
|
1060
|
+
def as_dict(self) -> dict:
|
|
1061
|
+
"""Serializes the ListExchangeFiltersResponse into a dictionary suitable for use as a JSON request body."""
|
|
1062
|
+
body = {}
|
|
1063
|
+
if self.filters: body['filters'] = [v.as_dict() for v in self.filters]
|
|
1064
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1065
|
+
return body
|
|
1066
|
+
|
|
1067
|
+
@classmethod
|
|
1068
|
+
def from_dict(cls, d: Dict[str, any]) -> ListExchangeFiltersResponse:
|
|
1069
|
+
"""Deserializes the ListExchangeFiltersResponse from a dictionary."""
|
|
1070
|
+
return cls(filters=_repeated_dict(d, 'filters', ExchangeFilter),
|
|
1071
|
+
next_page_token=d.get('next_page_token', None))
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
@dataclass
|
|
1075
|
+
class ListExchangesForListingResponse:
|
|
1076
|
+
exchange_listing: Optional[List[ExchangeListing]] = None
|
|
1077
|
+
|
|
1078
|
+
next_page_token: Optional[str] = None
|
|
1079
|
+
|
|
1080
|
+
def as_dict(self) -> dict:
|
|
1081
|
+
"""Serializes the ListExchangesForListingResponse into a dictionary suitable for use as a JSON request body."""
|
|
1082
|
+
body = {}
|
|
1083
|
+
if self.exchange_listing: body['exchange_listing'] = [v.as_dict() for v in self.exchange_listing]
|
|
1084
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1085
|
+
return body
|
|
1086
|
+
|
|
1087
|
+
@classmethod
|
|
1088
|
+
def from_dict(cls, d: Dict[str, any]) -> ListExchangesForListingResponse:
|
|
1089
|
+
"""Deserializes the ListExchangesForListingResponse from a dictionary."""
|
|
1090
|
+
return cls(exchange_listing=_repeated_dict(d, 'exchange_listing', ExchangeListing),
|
|
1091
|
+
next_page_token=d.get('next_page_token', None))
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
@dataclass
|
|
1095
|
+
class ListExchangesResponse:
|
|
1096
|
+
exchanges: Optional[List[Exchange]] = None
|
|
1097
|
+
|
|
1098
|
+
next_page_token: Optional[str] = None
|
|
1099
|
+
|
|
1100
|
+
def as_dict(self) -> dict:
|
|
1101
|
+
"""Serializes the ListExchangesResponse into a dictionary suitable for use as a JSON request body."""
|
|
1102
|
+
body = {}
|
|
1103
|
+
if self.exchanges: body['exchanges'] = [v.as_dict() for v in self.exchanges]
|
|
1104
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1105
|
+
return body
|
|
1106
|
+
|
|
1107
|
+
@classmethod
|
|
1108
|
+
def from_dict(cls, d: Dict[str, any]) -> ListExchangesResponse:
|
|
1109
|
+
"""Deserializes the ListExchangesResponse from a dictionary."""
|
|
1110
|
+
return cls(exchanges=_repeated_dict(d, 'exchanges', Exchange),
|
|
1111
|
+
next_page_token=d.get('next_page_token', None))
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
@dataclass
|
|
1115
|
+
class ListFilesResponse:
|
|
1116
|
+
file_infos: Optional[List[FileInfo]] = None
|
|
1117
|
+
|
|
1118
|
+
next_page_token: Optional[str] = None
|
|
1119
|
+
|
|
1120
|
+
def as_dict(self) -> dict:
|
|
1121
|
+
"""Serializes the ListFilesResponse into a dictionary suitable for use as a JSON request body."""
|
|
1122
|
+
body = {}
|
|
1123
|
+
if self.file_infos: body['file_infos'] = [v.as_dict() for v in self.file_infos]
|
|
1124
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1125
|
+
return body
|
|
1126
|
+
|
|
1127
|
+
@classmethod
|
|
1128
|
+
def from_dict(cls, d: Dict[str, any]) -> ListFilesResponse:
|
|
1129
|
+
"""Deserializes the ListFilesResponse from a dictionary."""
|
|
1130
|
+
return cls(file_infos=_repeated_dict(d, 'file_infos', FileInfo),
|
|
1131
|
+
next_page_token=d.get('next_page_token', None))
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
@dataclass
|
|
1135
|
+
class ListFulfillmentsResponse:
|
|
1136
|
+
fulfillments: Optional[List[ListingFulfillment]] = None
|
|
1137
|
+
|
|
1138
|
+
next_page_token: Optional[str] = None
|
|
1139
|
+
|
|
1140
|
+
def as_dict(self) -> dict:
|
|
1141
|
+
"""Serializes the ListFulfillmentsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1142
|
+
body = {}
|
|
1143
|
+
if self.fulfillments: body['fulfillments'] = [v.as_dict() for v in self.fulfillments]
|
|
1144
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1145
|
+
return body
|
|
1146
|
+
|
|
1147
|
+
@classmethod
|
|
1148
|
+
def from_dict(cls, d: Dict[str, any]) -> ListFulfillmentsResponse:
|
|
1149
|
+
"""Deserializes the ListFulfillmentsResponse from a dictionary."""
|
|
1150
|
+
return cls(fulfillments=_repeated_dict(d, 'fulfillments', ListingFulfillment),
|
|
1151
|
+
next_page_token=d.get('next_page_token', None))
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
@dataclass
|
|
1155
|
+
class ListInstallationsResponse:
|
|
1156
|
+
installations: Optional[List[InstallationDetail]] = None
|
|
1157
|
+
|
|
1158
|
+
next_page_token: Optional[str] = None
|
|
1159
|
+
|
|
1160
|
+
def as_dict(self) -> dict:
|
|
1161
|
+
"""Serializes the ListInstallationsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1162
|
+
body = {}
|
|
1163
|
+
if self.installations: body['installations'] = [v.as_dict() for v in self.installations]
|
|
1164
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1165
|
+
return body
|
|
1166
|
+
|
|
1167
|
+
@classmethod
|
|
1168
|
+
def from_dict(cls, d: Dict[str, any]) -> ListInstallationsResponse:
|
|
1169
|
+
"""Deserializes the ListInstallationsResponse from a dictionary."""
|
|
1170
|
+
return cls(installations=_repeated_dict(d, 'installations', InstallationDetail),
|
|
1171
|
+
next_page_token=d.get('next_page_token', None))
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
@dataclass
|
|
1175
|
+
class ListListingsForExchangeResponse:
|
|
1176
|
+
exchange_listings: Optional[List[ExchangeListing]] = None
|
|
1177
|
+
|
|
1178
|
+
next_page_token: Optional[str] = None
|
|
1179
|
+
|
|
1180
|
+
def as_dict(self) -> dict:
|
|
1181
|
+
"""Serializes the ListListingsForExchangeResponse into a dictionary suitable for use as a JSON request body."""
|
|
1182
|
+
body = {}
|
|
1183
|
+
if self.exchange_listings: body['exchange_listings'] = [v.as_dict() for v in self.exchange_listings]
|
|
1184
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1185
|
+
return body
|
|
1186
|
+
|
|
1187
|
+
@classmethod
|
|
1188
|
+
def from_dict(cls, d: Dict[str, any]) -> ListListingsForExchangeResponse:
|
|
1189
|
+
"""Deserializes the ListListingsForExchangeResponse from a dictionary."""
|
|
1190
|
+
return cls(exchange_listings=_repeated_dict(d, 'exchange_listings', ExchangeListing),
|
|
1191
|
+
next_page_token=d.get('next_page_token', None))
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
@dataclass
|
|
1195
|
+
class ListListingsResponse:
|
|
1196
|
+
listings: Optional[List[Listing]] = None
|
|
1197
|
+
|
|
1198
|
+
next_page_token: Optional[str] = None
|
|
1199
|
+
|
|
1200
|
+
def as_dict(self) -> dict:
|
|
1201
|
+
"""Serializes the ListListingsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1202
|
+
body = {}
|
|
1203
|
+
if self.listings: body['listings'] = [v.as_dict() for v in self.listings]
|
|
1204
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1205
|
+
return body
|
|
1206
|
+
|
|
1207
|
+
@classmethod
|
|
1208
|
+
def from_dict(cls, d: Dict[str, any]) -> ListListingsResponse:
|
|
1209
|
+
"""Deserializes the ListListingsResponse from a dictionary."""
|
|
1210
|
+
return cls(listings=_repeated_dict(d, 'listings', Listing),
|
|
1211
|
+
next_page_token=d.get('next_page_token', None))
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
@dataclass
|
|
1215
|
+
class ListProviderAnalyticsDashboardResponse:
|
|
1216
|
+
id: str
|
|
1217
|
+
|
|
1218
|
+
dashboard_id: str
|
|
1219
|
+
"""dashboard_id will be used to open Lakeview dashboard."""
|
|
1220
|
+
|
|
1221
|
+
version: Optional[int] = None
|
|
1222
|
+
|
|
1223
|
+
def as_dict(self) -> dict:
|
|
1224
|
+
"""Serializes the ListProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body."""
|
|
1225
|
+
body = {}
|
|
1226
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
1227
|
+
if self.id is not None: body['id'] = self.id
|
|
1228
|
+
if self.version is not None: body['version'] = self.version
|
|
1229
|
+
return body
|
|
1230
|
+
|
|
1231
|
+
@classmethod
|
|
1232
|
+
def from_dict(cls, d: Dict[str, any]) -> ListProviderAnalyticsDashboardResponse:
|
|
1233
|
+
"""Deserializes the ListProviderAnalyticsDashboardResponse from a dictionary."""
|
|
1234
|
+
return cls(dashboard_id=d.get('dashboard_id', None),
|
|
1235
|
+
id=d.get('id', None),
|
|
1236
|
+
version=d.get('version', None))
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
@dataclass
|
|
1240
|
+
class ListProvidersResponse:
|
|
1241
|
+
next_page_token: Optional[str] = None
|
|
1242
|
+
|
|
1243
|
+
providers: Optional[List[ProviderInfo]] = None
|
|
1244
|
+
|
|
1245
|
+
def as_dict(self) -> dict:
|
|
1246
|
+
"""Serializes the ListProvidersResponse into a dictionary suitable for use as a JSON request body."""
|
|
1247
|
+
body = {}
|
|
1248
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1249
|
+
if self.providers: body['providers'] = [v.as_dict() for v in self.providers]
|
|
1250
|
+
return body
|
|
1251
|
+
|
|
1252
|
+
@classmethod
|
|
1253
|
+
def from_dict(cls, d: Dict[str, any]) -> ListProvidersResponse:
|
|
1254
|
+
"""Deserializes the ListProvidersResponse from a dictionary."""
|
|
1255
|
+
return cls(next_page_token=d.get('next_page_token', None),
|
|
1256
|
+
providers=_repeated_dict(d, 'providers', ProviderInfo))
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
@dataclass
|
|
1260
|
+
class Listing:
|
|
1261
|
+
summary: ListingSummary
|
|
1262
|
+
"""Next Number: 26"""
|
|
1263
|
+
|
|
1264
|
+
detail: Optional[ListingDetail] = None
|
|
1265
|
+
|
|
1266
|
+
id: Optional[str] = None
|
|
1267
|
+
|
|
1268
|
+
def as_dict(self) -> dict:
|
|
1269
|
+
"""Serializes the Listing into a dictionary suitable for use as a JSON request body."""
|
|
1270
|
+
body = {}
|
|
1271
|
+
if self.detail: body['detail'] = self.detail.as_dict()
|
|
1272
|
+
if self.id is not None: body['id'] = self.id
|
|
1273
|
+
if self.summary: body['summary'] = self.summary.as_dict()
|
|
1274
|
+
return body
|
|
1275
|
+
|
|
1276
|
+
@classmethod
|
|
1277
|
+
def from_dict(cls, d: Dict[str, any]) -> Listing:
|
|
1278
|
+
"""Deserializes the Listing from a dictionary."""
|
|
1279
|
+
return cls(detail=_from_dict(d, 'detail', ListingDetail),
|
|
1280
|
+
id=d.get('id', None),
|
|
1281
|
+
summary=_from_dict(d, 'summary', ListingSummary))
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
@dataclass
|
|
1285
|
+
class ListingDetail:
|
|
1286
|
+
assets: Optional[List[AssetType]] = None
|
|
1287
|
+
"""Type of assets included in the listing. eg. GIT_REPO, DATA_TABLE, MODEL, NOTEBOOK"""
|
|
1288
|
+
|
|
1289
|
+
collection_date_end: Optional[int] = None
|
|
1290
|
+
"""The ending date timestamp for when the data spans"""
|
|
1291
|
+
|
|
1292
|
+
collection_date_start: Optional[int] = None
|
|
1293
|
+
"""The starting date timestamp for when the data spans"""
|
|
1294
|
+
|
|
1295
|
+
collection_granularity: Optional[DataRefreshInfo] = None
|
|
1296
|
+
"""Smallest unit of time in the dataset"""
|
|
1297
|
+
|
|
1298
|
+
cost: Optional[Cost] = None
|
|
1299
|
+
"""Whether the dataset is free or paid"""
|
|
1300
|
+
|
|
1301
|
+
data_source: Optional[str] = None
|
|
1302
|
+
"""Where/how the data is sourced"""
|
|
1303
|
+
|
|
1304
|
+
description: Optional[str] = None
|
|
1305
|
+
|
|
1306
|
+
documentation_link: Optional[str] = None
|
|
1307
|
+
|
|
1308
|
+
embedded_notebook_file_infos: Optional[List[FileInfo]] = None
|
|
1309
|
+
|
|
1310
|
+
file_ids: Optional[List[str]] = None
|
|
1311
|
+
|
|
1312
|
+
geographical_coverage: Optional[str] = None
|
|
1313
|
+
"""Which geo region the listing data is collected from"""
|
|
1314
|
+
|
|
1315
|
+
license: Optional[str] = None
|
|
1316
|
+
"""ID 20, 21 removed don't use License of the data asset - Required for listings with model based
|
|
1317
|
+
assets"""
|
|
1318
|
+
|
|
1319
|
+
pricing_model: Optional[str] = None
|
|
1320
|
+
"""What the pricing model is (e.g. paid, subscription, paid upfront); should only be present if
|
|
1321
|
+
cost is paid TODO: Not used yet, should deprecate if we will never use it"""
|
|
1322
|
+
|
|
1323
|
+
privacy_policy_link: Optional[str] = None
|
|
1324
|
+
|
|
1325
|
+
size: Optional[float] = None
|
|
1326
|
+
"""size of the dataset in GB"""
|
|
1327
|
+
|
|
1328
|
+
support_link: Optional[str] = None
|
|
1329
|
+
|
|
1330
|
+
tags: Optional[List[ListingTag]] = None
|
|
1331
|
+
"""Listing tags - Simple key value pair to annotate listings. When should I use tags vs dedicated
|
|
1332
|
+
fields? Using tags avoids the need to add new columns in the database for new annotations.
|
|
1333
|
+
However, this should be used sparingly since tags are stored as key value pair. Use tags only:
|
|
1334
|
+
1. If the field is optional and won't need to have NOT NULL integrity check 2. The value is
|
|
1335
|
+
fairly fixed, static and low cardinality (eg. enums). 3. The value won't be used in filters or
|
|
1336
|
+
joins with other tables."""
|
|
1337
|
+
|
|
1338
|
+
terms_of_service: Optional[str] = None
|
|
1339
|
+
|
|
1340
|
+
update_frequency: Optional[DataRefreshInfo] = None
|
|
1341
|
+
"""How often data is updated"""
|
|
1342
|
+
|
|
1343
|
+
def as_dict(self) -> dict:
|
|
1344
|
+
"""Serializes the ListingDetail into a dictionary suitable for use as a JSON request body."""
|
|
1345
|
+
body = {}
|
|
1346
|
+
if self.assets: body['assets'] = [v.value for v in self.assets]
|
|
1347
|
+
if self.collection_date_end is not None: body['collection_date_end'] = self.collection_date_end
|
|
1348
|
+
if self.collection_date_start is not None: body['collection_date_start'] = self.collection_date_start
|
|
1349
|
+
if self.collection_granularity: body['collection_granularity'] = self.collection_granularity.as_dict()
|
|
1350
|
+
if self.cost is not None: body['cost'] = self.cost.value
|
|
1351
|
+
if self.data_source is not None: body['data_source'] = self.data_source
|
|
1352
|
+
if self.description is not None: body['description'] = self.description
|
|
1353
|
+
if self.documentation_link is not None: body['documentation_link'] = self.documentation_link
|
|
1354
|
+
if self.embedded_notebook_file_infos:
|
|
1355
|
+
body['embedded_notebook_file_infos'] = [v.as_dict() for v in self.embedded_notebook_file_infos]
|
|
1356
|
+
if self.file_ids: body['file_ids'] = [v for v in self.file_ids]
|
|
1357
|
+
if self.geographical_coverage is not None: body['geographical_coverage'] = self.geographical_coverage
|
|
1358
|
+
if self.license is not None: body['license'] = self.license
|
|
1359
|
+
if self.pricing_model is not None: body['pricing_model'] = self.pricing_model
|
|
1360
|
+
if self.privacy_policy_link is not None: body['privacy_policy_link'] = self.privacy_policy_link
|
|
1361
|
+
if self.size is not None: body['size'] = self.size
|
|
1362
|
+
if self.support_link is not None: body['support_link'] = self.support_link
|
|
1363
|
+
if self.tags: body['tags'] = [v.as_dict() for v in self.tags]
|
|
1364
|
+
if self.terms_of_service is not None: body['terms_of_service'] = self.terms_of_service
|
|
1365
|
+
if self.update_frequency: body['update_frequency'] = self.update_frequency.as_dict()
|
|
1366
|
+
return body
|
|
1367
|
+
|
|
1368
|
+
@classmethod
|
|
1369
|
+
def from_dict(cls, d: Dict[str, any]) -> ListingDetail:
|
|
1370
|
+
"""Deserializes the ListingDetail from a dictionary."""
|
|
1371
|
+
return cls(assets=_repeated_enum(d, 'assets', AssetType),
|
|
1372
|
+
collection_date_end=d.get('collection_date_end', None),
|
|
1373
|
+
collection_date_start=d.get('collection_date_start', None),
|
|
1374
|
+
collection_granularity=_from_dict(d, 'collection_granularity', DataRefreshInfo),
|
|
1375
|
+
cost=_enum(d, 'cost', Cost),
|
|
1376
|
+
data_source=d.get('data_source', None),
|
|
1377
|
+
description=d.get('description', None),
|
|
1378
|
+
documentation_link=d.get('documentation_link', None),
|
|
1379
|
+
embedded_notebook_file_infos=_repeated_dict(d, 'embedded_notebook_file_infos', FileInfo),
|
|
1380
|
+
file_ids=d.get('file_ids', None),
|
|
1381
|
+
geographical_coverage=d.get('geographical_coverage', None),
|
|
1382
|
+
license=d.get('license', None),
|
|
1383
|
+
pricing_model=d.get('pricing_model', None),
|
|
1384
|
+
privacy_policy_link=d.get('privacy_policy_link', None),
|
|
1385
|
+
size=d.get('size', None),
|
|
1386
|
+
support_link=d.get('support_link', None),
|
|
1387
|
+
tags=_repeated_dict(d, 'tags', ListingTag),
|
|
1388
|
+
terms_of_service=d.get('terms_of_service', None),
|
|
1389
|
+
update_frequency=_from_dict(d, 'update_frequency', DataRefreshInfo))
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
@dataclass
|
|
1393
|
+
class ListingFulfillment:
|
|
1394
|
+
listing_id: str
|
|
1395
|
+
|
|
1396
|
+
fulfillment_type: Optional[FulfillmentType] = None
|
|
1397
|
+
|
|
1398
|
+
recipient_type: Optional[DeltaSharingRecipientType] = None
|
|
1399
|
+
|
|
1400
|
+
repo_info: Optional[RepoInfo] = None
|
|
1401
|
+
|
|
1402
|
+
share_info: Optional[ShareInfo] = None
|
|
1403
|
+
|
|
1404
|
+
def as_dict(self) -> dict:
|
|
1405
|
+
"""Serializes the ListingFulfillment into a dictionary suitable for use as a JSON request body."""
|
|
1406
|
+
body = {}
|
|
1407
|
+
if self.fulfillment_type is not None: body['fulfillment_type'] = self.fulfillment_type.value
|
|
1408
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
1409
|
+
if self.recipient_type is not None: body['recipient_type'] = self.recipient_type.value
|
|
1410
|
+
if self.repo_info: body['repo_info'] = self.repo_info.as_dict()
|
|
1411
|
+
if self.share_info: body['share_info'] = self.share_info.as_dict()
|
|
1412
|
+
return body
|
|
1413
|
+
|
|
1414
|
+
@classmethod
|
|
1415
|
+
def from_dict(cls, d: Dict[str, any]) -> ListingFulfillment:
|
|
1416
|
+
"""Deserializes the ListingFulfillment from a dictionary."""
|
|
1417
|
+
return cls(fulfillment_type=_enum(d, 'fulfillment_type', FulfillmentType),
|
|
1418
|
+
listing_id=d.get('listing_id', None),
|
|
1419
|
+
recipient_type=_enum(d, 'recipient_type', DeltaSharingRecipientType),
|
|
1420
|
+
repo_info=_from_dict(d, 'repo_info', RepoInfo),
|
|
1421
|
+
share_info=_from_dict(d, 'share_info', ShareInfo))
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
@dataclass
|
|
1425
|
+
class ListingSetting:
|
|
1426
|
+
filters: Optional[List[VisibilityFilter]] = None
|
|
1427
|
+
"""filters are joined with `or` conjunction."""
|
|
1428
|
+
|
|
1429
|
+
visibility: Optional[Visibility] = None
|
|
1430
|
+
|
|
1431
|
+
def as_dict(self) -> dict:
|
|
1432
|
+
"""Serializes the ListingSetting into a dictionary suitable for use as a JSON request body."""
|
|
1433
|
+
body = {}
|
|
1434
|
+
if self.filters: body['filters'] = [v.as_dict() for v in self.filters]
|
|
1435
|
+
if self.visibility is not None: body['visibility'] = self.visibility.value
|
|
1436
|
+
return body
|
|
1437
|
+
|
|
1438
|
+
@classmethod
|
|
1439
|
+
def from_dict(cls, d: Dict[str, any]) -> ListingSetting:
|
|
1440
|
+
"""Deserializes the ListingSetting from a dictionary."""
|
|
1441
|
+
return cls(filters=_repeated_dict(d, 'filters', VisibilityFilter),
|
|
1442
|
+
visibility=_enum(d, 'visibility', Visibility))
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
class ListingShareType(Enum):
|
|
1446
|
+
|
|
1447
|
+
FULL = 'FULL'
|
|
1448
|
+
SAMPLE = 'SAMPLE'
|
|
1449
|
+
|
|
1450
|
+
|
|
1451
|
+
class ListingStatus(Enum):
|
|
1452
|
+
"""Enums"""
|
|
1453
|
+
|
|
1454
|
+
DRAFT = 'DRAFT'
|
|
1455
|
+
PENDING = 'PENDING'
|
|
1456
|
+
PUBLISHED = 'PUBLISHED'
|
|
1457
|
+
SUSPENDED = 'SUSPENDED'
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
@dataclass
|
|
1461
|
+
class ListingSummary:
|
|
1462
|
+
"""Next Number: 26"""
|
|
1463
|
+
|
|
1464
|
+
name: str
|
|
1465
|
+
|
|
1466
|
+
listing_type: ListingType
|
|
1467
|
+
|
|
1468
|
+
categories: Optional[List[Category]] = None
|
|
1469
|
+
|
|
1470
|
+
created_at: Optional[int] = None
|
|
1471
|
+
|
|
1472
|
+
created_by: Optional[str] = None
|
|
1473
|
+
|
|
1474
|
+
created_by_id: Optional[int] = None
|
|
1475
|
+
|
|
1476
|
+
exchange_ids: Optional[List[str]] = None
|
|
1477
|
+
|
|
1478
|
+
git_repo: Optional[RepoInfo] = None
|
|
1479
|
+
"""if a git repo is being created, a listing will be initialized with this field as opposed to a
|
|
1480
|
+
share"""
|
|
1481
|
+
|
|
1482
|
+
metastore_id: Optional[str] = None
|
|
1483
|
+
|
|
1484
|
+
provider_id: Optional[str] = None
|
|
1485
|
+
|
|
1486
|
+
provider_region: Optional[RegionInfo] = None
|
|
1487
|
+
|
|
1488
|
+
published_at: Optional[int] = None
|
|
1489
|
+
|
|
1490
|
+
published_by: Optional[str] = None
|
|
1491
|
+
|
|
1492
|
+
setting: Optional[ListingSetting] = None
|
|
1493
|
+
|
|
1494
|
+
share: Optional[ShareInfo] = None
|
|
1495
|
+
|
|
1496
|
+
status: Optional[ListingStatus] = None
|
|
1497
|
+
"""Enums"""
|
|
1498
|
+
|
|
1499
|
+
subtitle: Optional[str] = None
|
|
1500
|
+
|
|
1501
|
+
updated_at: Optional[int] = None
|
|
1502
|
+
|
|
1503
|
+
updated_by: Optional[str] = None
|
|
1504
|
+
|
|
1505
|
+
updated_by_id: Optional[int] = None
|
|
1506
|
+
|
|
1507
|
+
def as_dict(self) -> dict:
|
|
1508
|
+
"""Serializes the ListingSummary into a dictionary suitable for use as a JSON request body."""
|
|
1509
|
+
body = {}
|
|
1510
|
+
if self.categories: body['categories'] = [v.value for v in self.categories]
|
|
1511
|
+
if self.created_at is not None: body['created_at'] = self.created_at
|
|
1512
|
+
if self.created_by is not None: body['created_by'] = self.created_by
|
|
1513
|
+
if self.created_by_id is not None: body['created_by_id'] = self.created_by_id
|
|
1514
|
+
if self.exchange_ids: body['exchange_ids'] = [v for v in self.exchange_ids]
|
|
1515
|
+
if self.git_repo: body['git_repo'] = self.git_repo.as_dict()
|
|
1516
|
+
if self.listing_type is not None: body['listingType'] = self.listing_type.value
|
|
1517
|
+
if self.metastore_id is not None: body['metastore_id'] = self.metastore_id
|
|
1518
|
+
if self.name is not None: body['name'] = self.name
|
|
1519
|
+
if self.provider_id is not None: body['provider_id'] = self.provider_id
|
|
1520
|
+
if self.provider_region: body['provider_region'] = self.provider_region.as_dict()
|
|
1521
|
+
if self.published_at is not None: body['published_at'] = self.published_at
|
|
1522
|
+
if self.published_by is not None: body['published_by'] = self.published_by
|
|
1523
|
+
if self.setting: body['setting'] = self.setting.as_dict()
|
|
1524
|
+
if self.share: body['share'] = self.share.as_dict()
|
|
1525
|
+
if self.status is not None: body['status'] = self.status.value
|
|
1526
|
+
if self.subtitle is not None: body['subtitle'] = self.subtitle
|
|
1527
|
+
if self.updated_at is not None: body['updated_at'] = self.updated_at
|
|
1528
|
+
if self.updated_by is not None: body['updated_by'] = self.updated_by
|
|
1529
|
+
if self.updated_by_id is not None: body['updated_by_id'] = self.updated_by_id
|
|
1530
|
+
return body
|
|
1531
|
+
|
|
1532
|
+
@classmethod
|
|
1533
|
+
def from_dict(cls, d: Dict[str, any]) -> ListingSummary:
|
|
1534
|
+
"""Deserializes the ListingSummary from a dictionary."""
|
|
1535
|
+
return cls(categories=_repeated_enum(d, 'categories', Category),
|
|
1536
|
+
created_at=d.get('created_at', None),
|
|
1537
|
+
created_by=d.get('created_by', None),
|
|
1538
|
+
created_by_id=d.get('created_by_id', None),
|
|
1539
|
+
exchange_ids=d.get('exchange_ids', None),
|
|
1540
|
+
git_repo=_from_dict(d, 'git_repo', RepoInfo),
|
|
1541
|
+
listing_type=_enum(d, 'listingType', ListingType),
|
|
1542
|
+
metastore_id=d.get('metastore_id', None),
|
|
1543
|
+
name=d.get('name', None),
|
|
1544
|
+
provider_id=d.get('provider_id', None),
|
|
1545
|
+
provider_region=_from_dict(d, 'provider_region', RegionInfo),
|
|
1546
|
+
published_at=d.get('published_at', None),
|
|
1547
|
+
published_by=d.get('published_by', None),
|
|
1548
|
+
setting=_from_dict(d, 'setting', ListingSetting),
|
|
1549
|
+
share=_from_dict(d, 'share', ShareInfo),
|
|
1550
|
+
status=_enum(d, 'status', ListingStatus),
|
|
1551
|
+
subtitle=d.get('subtitle', None),
|
|
1552
|
+
updated_at=d.get('updated_at', None),
|
|
1553
|
+
updated_by=d.get('updated_by', None),
|
|
1554
|
+
updated_by_id=d.get('updated_by_id', None))
|
|
1555
|
+
|
|
1556
|
+
|
|
1557
|
+
@dataclass
|
|
1558
|
+
class ListingTag:
|
|
1559
|
+
tag_name: Optional[ListingTagType] = None
|
|
1560
|
+
"""Tag name (enum)"""
|
|
1561
|
+
|
|
1562
|
+
tag_values: Optional[List[str]] = None
|
|
1563
|
+
"""String representation of the tag value. Values should be string literals (no complex types)"""
|
|
1564
|
+
|
|
1565
|
+
def as_dict(self) -> dict:
|
|
1566
|
+
"""Serializes the ListingTag into a dictionary suitable for use as a JSON request body."""
|
|
1567
|
+
body = {}
|
|
1568
|
+
if self.tag_name is not None: body['tag_name'] = self.tag_name.value
|
|
1569
|
+
if self.tag_values: body['tag_values'] = [v for v in self.tag_values]
|
|
1570
|
+
return body
|
|
1571
|
+
|
|
1572
|
+
@classmethod
|
|
1573
|
+
def from_dict(cls, d: Dict[str, any]) -> ListingTag:
|
|
1574
|
+
"""Deserializes the ListingTag from a dictionary."""
|
|
1575
|
+
return cls(tag_name=_enum(d, 'tag_name', ListingTagType), tag_values=d.get('tag_values', None))
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
class ListingTagType(Enum):
|
|
1579
|
+
|
|
1580
|
+
LISTING_TAG_TYPE_LANGUAGE = 'LISTING_TAG_TYPE_LANGUAGE'
|
|
1581
|
+
LISTING_TAG_TYPE_TASK = 'LISTING_TAG_TYPE_TASK'
|
|
1582
|
+
LISTING_TAG_TYPE_UNSPECIFIED = 'LISTING_TAG_TYPE_UNSPECIFIED'
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
class ListingType(Enum):
|
|
1586
|
+
|
|
1587
|
+
PERSONALIZED = 'PERSONALIZED'
|
|
1588
|
+
STANDARD = 'STANDARD'
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
class MarketplaceFileType(Enum):
|
|
1592
|
+
|
|
1593
|
+
EMBEDDED_NOTEBOOK = 'EMBEDDED_NOTEBOOK'
|
|
1594
|
+
PROVIDER_ICON = 'PROVIDER_ICON'
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
@dataclass
|
|
1598
|
+
class PersonalizationRequest:
|
|
1599
|
+
consumer_region: RegionInfo
|
|
1600
|
+
|
|
1601
|
+
comment: Optional[str] = None
|
|
1602
|
+
|
|
1603
|
+
contact_info: Optional[ContactInfo] = None
|
|
1604
|
+
"""contact info for the consumer requesting data or performing a listing installation"""
|
|
1605
|
+
|
|
1606
|
+
created_at: Optional[int] = None
|
|
1607
|
+
|
|
1608
|
+
id: Optional[str] = None
|
|
1609
|
+
|
|
1610
|
+
intended_use: Optional[str] = None
|
|
1611
|
+
|
|
1612
|
+
is_from_lighthouse: Optional[bool] = None
|
|
1613
|
+
|
|
1614
|
+
listing_id: Optional[str] = None
|
|
1615
|
+
|
|
1616
|
+
listing_name: Optional[str] = None
|
|
1617
|
+
|
|
1618
|
+
metastore_id: Optional[str] = None
|
|
1619
|
+
|
|
1620
|
+
provider_id: Optional[str] = None
|
|
1621
|
+
|
|
1622
|
+
recipient_type: Optional[DeltaSharingRecipientType] = None
|
|
1623
|
+
|
|
1624
|
+
share: Optional[ShareInfo] = None
|
|
1625
|
+
|
|
1626
|
+
status: Optional[PersonalizationRequestStatus] = None
|
|
1627
|
+
|
|
1628
|
+
status_message: Optional[str] = None
|
|
1629
|
+
|
|
1630
|
+
updated_at: Optional[int] = None
|
|
1631
|
+
|
|
1632
|
+
def as_dict(self) -> dict:
|
|
1633
|
+
"""Serializes the PersonalizationRequest into a dictionary suitable for use as a JSON request body."""
|
|
1634
|
+
body = {}
|
|
1635
|
+
if self.comment is not None: body['comment'] = self.comment
|
|
1636
|
+
if self.consumer_region: body['consumer_region'] = self.consumer_region.as_dict()
|
|
1637
|
+
if self.contact_info: body['contact_info'] = self.contact_info.as_dict()
|
|
1638
|
+
if self.created_at is not None: body['created_at'] = self.created_at
|
|
1639
|
+
if self.id is not None: body['id'] = self.id
|
|
1640
|
+
if self.intended_use is not None: body['intended_use'] = self.intended_use
|
|
1641
|
+
if self.is_from_lighthouse is not None: body['is_from_lighthouse'] = self.is_from_lighthouse
|
|
1642
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
1643
|
+
if self.listing_name is not None: body['listing_name'] = self.listing_name
|
|
1644
|
+
if self.metastore_id is not None: body['metastore_id'] = self.metastore_id
|
|
1645
|
+
if self.provider_id is not None: body['provider_id'] = self.provider_id
|
|
1646
|
+
if self.recipient_type is not None: body['recipient_type'] = self.recipient_type.value
|
|
1647
|
+
if self.share: body['share'] = self.share.as_dict()
|
|
1648
|
+
if self.status is not None: body['status'] = self.status.value
|
|
1649
|
+
if self.status_message is not None: body['status_message'] = self.status_message
|
|
1650
|
+
if self.updated_at is not None: body['updated_at'] = self.updated_at
|
|
1651
|
+
return body
|
|
1652
|
+
|
|
1653
|
+
@classmethod
|
|
1654
|
+
def from_dict(cls, d: Dict[str, any]) -> PersonalizationRequest:
|
|
1655
|
+
"""Deserializes the PersonalizationRequest from a dictionary."""
|
|
1656
|
+
return cls(comment=d.get('comment', None),
|
|
1657
|
+
consumer_region=_from_dict(d, 'consumer_region', RegionInfo),
|
|
1658
|
+
contact_info=_from_dict(d, 'contact_info', ContactInfo),
|
|
1659
|
+
created_at=d.get('created_at', None),
|
|
1660
|
+
id=d.get('id', None),
|
|
1661
|
+
intended_use=d.get('intended_use', None),
|
|
1662
|
+
is_from_lighthouse=d.get('is_from_lighthouse', None),
|
|
1663
|
+
listing_id=d.get('listing_id', None),
|
|
1664
|
+
listing_name=d.get('listing_name', None),
|
|
1665
|
+
metastore_id=d.get('metastore_id', None),
|
|
1666
|
+
provider_id=d.get('provider_id', None),
|
|
1667
|
+
recipient_type=_enum(d, 'recipient_type', DeltaSharingRecipientType),
|
|
1668
|
+
share=_from_dict(d, 'share', ShareInfo),
|
|
1669
|
+
status=_enum(d, 'status', PersonalizationRequestStatus),
|
|
1670
|
+
status_message=d.get('status_message', None),
|
|
1671
|
+
updated_at=d.get('updated_at', None))
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
class PersonalizationRequestStatus(Enum):
|
|
1675
|
+
|
|
1676
|
+
DENIED = 'DENIED'
|
|
1677
|
+
FULFILLED = 'FULFILLED'
|
|
1678
|
+
NEW = 'NEW'
|
|
1679
|
+
REQUEST_PENDING = 'REQUEST_PENDING'
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
@dataclass
|
|
1683
|
+
class ProviderAnalyticsDashboard:
|
|
1684
|
+
id: str
|
|
1685
|
+
|
|
1686
|
+
def as_dict(self) -> dict:
|
|
1687
|
+
"""Serializes the ProviderAnalyticsDashboard into a dictionary suitable for use as a JSON request body."""
|
|
1688
|
+
body = {}
|
|
1689
|
+
if self.id is not None: body['id'] = self.id
|
|
1690
|
+
return body
|
|
1691
|
+
|
|
1692
|
+
@classmethod
|
|
1693
|
+
def from_dict(cls, d: Dict[str, any]) -> ProviderAnalyticsDashboard:
|
|
1694
|
+
"""Deserializes the ProviderAnalyticsDashboard from a dictionary."""
|
|
1695
|
+
return cls(id=d.get('id', None))
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
@dataclass
|
|
1699
|
+
class ProviderInfo:
|
|
1700
|
+
name: str
|
|
1701
|
+
|
|
1702
|
+
business_contact_email: str
|
|
1703
|
+
|
|
1704
|
+
term_of_service_link: str
|
|
1705
|
+
|
|
1706
|
+
privacy_policy_link: str
|
|
1707
|
+
|
|
1708
|
+
company_website_link: Optional[str] = None
|
|
1709
|
+
|
|
1710
|
+
dark_mode_icon_file_id: Optional[str] = None
|
|
1711
|
+
|
|
1712
|
+
dark_mode_icon_file_path: Optional[str] = None
|
|
1713
|
+
|
|
1714
|
+
description: Optional[str] = None
|
|
1715
|
+
|
|
1716
|
+
icon_file_id: Optional[str] = None
|
|
1717
|
+
|
|
1718
|
+
icon_file_path: Optional[str] = None
|
|
1719
|
+
|
|
1720
|
+
id: Optional[str] = None
|
|
1721
|
+
|
|
1722
|
+
is_featured: Optional[bool] = None
|
|
1723
|
+
"""is_featured is accessible by consumers only"""
|
|
1724
|
+
|
|
1725
|
+
published_by: Optional[str] = None
|
|
1726
|
+
"""published_by is only applicable to data aggregators (e.g. Crux)"""
|
|
1727
|
+
|
|
1728
|
+
support_contact_email: Optional[str] = None
|
|
1729
|
+
|
|
1730
|
+
def as_dict(self) -> dict:
|
|
1731
|
+
"""Serializes the ProviderInfo into a dictionary suitable for use as a JSON request body."""
|
|
1732
|
+
body = {}
|
|
1733
|
+
if self.business_contact_email is not None:
|
|
1734
|
+
body['business_contact_email'] = self.business_contact_email
|
|
1735
|
+
if self.company_website_link is not None: body['company_website_link'] = self.company_website_link
|
|
1736
|
+
if self.dark_mode_icon_file_id is not None:
|
|
1737
|
+
body['dark_mode_icon_file_id'] = self.dark_mode_icon_file_id
|
|
1738
|
+
if self.dark_mode_icon_file_path is not None:
|
|
1739
|
+
body['dark_mode_icon_file_path'] = self.dark_mode_icon_file_path
|
|
1740
|
+
if self.description is not None: body['description'] = self.description
|
|
1741
|
+
if self.icon_file_id is not None: body['icon_file_id'] = self.icon_file_id
|
|
1742
|
+
if self.icon_file_path is not None: body['icon_file_path'] = self.icon_file_path
|
|
1743
|
+
if self.id is not None: body['id'] = self.id
|
|
1744
|
+
if self.is_featured is not None: body['is_featured'] = self.is_featured
|
|
1745
|
+
if self.name is not None: body['name'] = self.name
|
|
1746
|
+
if self.privacy_policy_link is not None: body['privacy_policy_link'] = self.privacy_policy_link
|
|
1747
|
+
if self.published_by is not None: body['published_by'] = self.published_by
|
|
1748
|
+
if self.support_contact_email is not None: body['support_contact_email'] = self.support_contact_email
|
|
1749
|
+
if self.term_of_service_link is not None: body['term_of_service_link'] = self.term_of_service_link
|
|
1750
|
+
return body
|
|
1751
|
+
|
|
1752
|
+
@classmethod
|
|
1753
|
+
def from_dict(cls, d: Dict[str, any]) -> ProviderInfo:
|
|
1754
|
+
"""Deserializes the ProviderInfo from a dictionary."""
|
|
1755
|
+
return cls(business_contact_email=d.get('business_contact_email', None),
|
|
1756
|
+
company_website_link=d.get('company_website_link', None),
|
|
1757
|
+
dark_mode_icon_file_id=d.get('dark_mode_icon_file_id', None),
|
|
1758
|
+
dark_mode_icon_file_path=d.get('dark_mode_icon_file_path', None),
|
|
1759
|
+
description=d.get('description', None),
|
|
1760
|
+
icon_file_id=d.get('icon_file_id', None),
|
|
1761
|
+
icon_file_path=d.get('icon_file_path', None),
|
|
1762
|
+
id=d.get('id', None),
|
|
1763
|
+
is_featured=d.get('is_featured', None),
|
|
1764
|
+
name=d.get('name', None),
|
|
1765
|
+
privacy_policy_link=d.get('privacy_policy_link', None),
|
|
1766
|
+
published_by=d.get('published_by', None),
|
|
1767
|
+
support_contact_email=d.get('support_contact_email', None),
|
|
1768
|
+
term_of_service_link=d.get('term_of_service_link', None))
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
@dataclass
|
|
1772
|
+
class RegionInfo:
|
|
1773
|
+
cloud: Optional[str] = None
|
|
1774
|
+
|
|
1775
|
+
region: Optional[str] = None
|
|
1776
|
+
|
|
1777
|
+
def as_dict(self) -> dict:
|
|
1778
|
+
"""Serializes the RegionInfo into a dictionary suitable for use as a JSON request body."""
|
|
1779
|
+
body = {}
|
|
1780
|
+
if self.cloud is not None: body['cloud'] = self.cloud
|
|
1781
|
+
if self.region is not None: body['region'] = self.region
|
|
1782
|
+
return body
|
|
1783
|
+
|
|
1784
|
+
@classmethod
|
|
1785
|
+
def from_dict(cls, d: Dict[str, any]) -> RegionInfo:
|
|
1786
|
+
"""Deserializes the RegionInfo from a dictionary."""
|
|
1787
|
+
return cls(cloud=d.get('cloud', None), region=d.get('region', None))
|
|
1788
|
+
|
|
1789
|
+
|
|
1790
|
+
@dataclass
|
|
1791
|
+
class RemoveExchangeForListingResponse:
|
|
1792
|
+
|
|
1793
|
+
def as_dict(self) -> dict:
|
|
1794
|
+
"""Serializes the RemoveExchangeForListingResponse into a dictionary suitable for use as a JSON request body."""
|
|
1795
|
+
body = {}
|
|
1796
|
+
return body
|
|
1797
|
+
|
|
1798
|
+
@classmethod
|
|
1799
|
+
def from_dict(cls, d: Dict[str, any]) -> RemoveExchangeForListingResponse:
|
|
1800
|
+
"""Deserializes the RemoveExchangeForListingResponse from a dictionary."""
|
|
1801
|
+
return cls()
|
|
1802
|
+
|
|
1803
|
+
|
|
1804
|
+
@dataclass
|
|
1805
|
+
class RepoInfo:
|
|
1806
|
+
git_repo_url: str
|
|
1807
|
+
"""the git repo url e.g. https://github.com/databrickslabs/dolly.git"""
|
|
1808
|
+
|
|
1809
|
+
def as_dict(self) -> dict:
|
|
1810
|
+
"""Serializes the RepoInfo into a dictionary suitable for use as a JSON request body."""
|
|
1811
|
+
body = {}
|
|
1812
|
+
if self.git_repo_url is not None: body['git_repo_url'] = self.git_repo_url
|
|
1813
|
+
return body
|
|
1814
|
+
|
|
1815
|
+
@classmethod
|
|
1816
|
+
def from_dict(cls, d: Dict[str, any]) -> RepoInfo:
|
|
1817
|
+
"""Deserializes the RepoInfo from a dictionary."""
|
|
1818
|
+
return cls(git_repo_url=d.get('git_repo_url', None))
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
@dataclass
|
|
1822
|
+
class RepoInstallation:
|
|
1823
|
+
repo_name: str
|
|
1824
|
+
"""the user-specified repo name for their installed git repo listing"""
|
|
1825
|
+
|
|
1826
|
+
repo_path: str
|
|
1827
|
+
"""refers to the full url file path that navigates the user to the repo's entrypoint (e.g. a
|
|
1828
|
+
README.md file, or the repo file view in the unified UI) should just be a relative path"""
|
|
1829
|
+
|
|
1830
|
+
def as_dict(self) -> dict:
|
|
1831
|
+
"""Serializes the RepoInstallation into a dictionary suitable for use as a JSON request body."""
|
|
1832
|
+
body = {}
|
|
1833
|
+
if self.repo_name is not None: body['repo_name'] = self.repo_name
|
|
1834
|
+
if self.repo_path is not None: body['repo_path'] = self.repo_path
|
|
1835
|
+
return body
|
|
1836
|
+
|
|
1837
|
+
@classmethod
|
|
1838
|
+
def from_dict(cls, d: Dict[str, any]) -> RepoInstallation:
|
|
1839
|
+
"""Deserializes the RepoInstallation from a dictionary."""
|
|
1840
|
+
return cls(repo_name=d.get('repo_name', None), repo_path=d.get('repo_path', None))
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
@dataclass
|
|
1844
|
+
class SearchListingsResponse:
|
|
1845
|
+
listings: Optional[List[Listing]] = None
|
|
1846
|
+
|
|
1847
|
+
next_page_token: Optional[str] = None
|
|
1848
|
+
|
|
1849
|
+
def as_dict(self) -> dict:
|
|
1850
|
+
"""Serializes the SearchListingsResponse into a dictionary suitable for use as a JSON request body."""
|
|
1851
|
+
body = {}
|
|
1852
|
+
if self.listings: body['listings'] = [v.as_dict() for v in self.listings]
|
|
1853
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
1854
|
+
return body
|
|
1855
|
+
|
|
1856
|
+
@classmethod
|
|
1857
|
+
def from_dict(cls, d: Dict[str, any]) -> SearchListingsResponse:
|
|
1858
|
+
"""Deserializes the SearchListingsResponse from a dictionary."""
|
|
1859
|
+
return cls(listings=_repeated_dict(d, 'listings', Listing),
|
|
1860
|
+
next_page_token=d.get('next_page_token', None))
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
@dataclass
|
|
1864
|
+
class ShareInfo:
|
|
1865
|
+
name: str
|
|
1866
|
+
|
|
1867
|
+
type: ListingShareType
|
|
1868
|
+
|
|
1869
|
+
def as_dict(self) -> dict:
|
|
1870
|
+
"""Serializes the ShareInfo into a dictionary suitable for use as a JSON request body."""
|
|
1871
|
+
body = {}
|
|
1872
|
+
if self.name is not None: body['name'] = self.name
|
|
1873
|
+
if self.type is not None: body['type'] = self.type.value
|
|
1874
|
+
return body
|
|
1875
|
+
|
|
1876
|
+
@classmethod
|
|
1877
|
+
def from_dict(cls, d: Dict[str, any]) -> ShareInfo:
|
|
1878
|
+
"""Deserializes the ShareInfo from a dictionary."""
|
|
1879
|
+
return cls(name=d.get('name', None), type=_enum(d, 'type', ListingShareType))
|
|
1880
|
+
|
|
1881
|
+
|
|
1882
|
+
@dataclass
|
|
1883
|
+
class SharedDataObject:
|
|
1884
|
+
data_object_type: Optional[str] = None
|
|
1885
|
+
"""The type of the data object. Could be one of: TABLE, SCHEMA, NOTEBOOK_FILE, MODEL, VOLUME"""
|
|
1886
|
+
|
|
1887
|
+
name: Optional[str] = None
|
|
1888
|
+
"""Name of the shared object"""
|
|
1889
|
+
|
|
1890
|
+
def as_dict(self) -> dict:
|
|
1891
|
+
"""Serializes the SharedDataObject into a dictionary suitable for use as a JSON request body."""
|
|
1892
|
+
body = {}
|
|
1893
|
+
if self.data_object_type is not None: body['data_object_type'] = self.data_object_type
|
|
1894
|
+
if self.name is not None: body['name'] = self.name
|
|
1895
|
+
return body
|
|
1896
|
+
|
|
1897
|
+
@classmethod
|
|
1898
|
+
def from_dict(cls, d: Dict[str, any]) -> SharedDataObject:
|
|
1899
|
+
"""Deserializes the SharedDataObject from a dictionary."""
|
|
1900
|
+
return cls(data_object_type=d.get('data_object_type', None), name=d.get('name', None))
|
|
1901
|
+
|
|
1902
|
+
|
|
1903
|
+
class SortBy(Enum):
|
|
1904
|
+
|
|
1905
|
+
SORT_BY_DATE = 'SORT_BY_DATE'
|
|
1906
|
+
SORT_BY_RELEVANCE = 'SORT_BY_RELEVANCE'
|
|
1907
|
+
SORT_BY_TITLE = 'SORT_BY_TITLE'
|
|
1908
|
+
SORT_BY_UNSPECIFIED = 'SORT_BY_UNSPECIFIED'
|
|
1909
|
+
|
|
1910
|
+
|
|
1911
|
+
@dataclass
|
|
1912
|
+
class SortBySpec:
|
|
1913
|
+
sort_by: SortBy
|
|
1914
|
+
"""The field on which to sort the listing."""
|
|
1915
|
+
|
|
1916
|
+
sort_order: SortOrder
|
|
1917
|
+
"""The order in which to sort the listing."""
|
|
1918
|
+
|
|
1919
|
+
def as_dict(self) -> dict:
|
|
1920
|
+
"""Serializes the SortBySpec into a dictionary suitable for use as a JSON request body."""
|
|
1921
|
+
body = {}
|
|
1922
|
+
if self.sort_by is not None: body['sort_by'] = self.sort_by.value
|
|
1923
|
+
if self.sort_order is not None: body['sort_order'] = self.sort_order.value
|
|
1924
|
+
return body
|
|
1925
|
+
|
|
1926
|
+
@classmethod
|
|
1927
|
+
def from_dict(cls, d: Dict[str, any]) -> SortBySpec:
|
|
1928
|
+
"""Deserializes the SortBySpec from a dictionary."""
|
|
1929
|
+
return cls(sort_by=_enum(d, 'sort_by', SortBy), sort_order=_enum(d, 'sort_order', SortOrder))
|
|
1930
|
+
|
|
1931
|
+
|
|
1932
|
+
class SortOrder(Enum):
|
|
1933
|
+
|
|
1934
|
+
SORT_ORDER_ASCENDING = 'SORT_ORDER_ASCENDING'
|
|
1935
|
+
SORT_ORDER_DESCENDING = 'SORT_ORDER_DESCENDING'
|
|
1936
|
+
SORT_ORDER_UNSPECIFIED = 'SORT_ORDER_UNSPECIFIED'
|
|
1937
|
+
|
|
1938
|
+
|
|
1939
|
+
@dataclass
|
|
1940
|
+
class TokenDetail:
|
|
1941
|
+
bearer_token: Optional[str] = None
|
|
1942
|
+
|
|
1943
|
+
endpoint: Optional[str] = None
|
|
1944
|
+
|
|
1945
|
+
expiration_time: Optional[str] = None
|
|
1946
|
+
|
|
1947
|
+
share_credentials_version: Optional[int] = None
|
|
1948
|
+
"""These field names must follow the delta sharing protocol. Original message:
|
|
1949
|
+
RetrieveToken.Response in managed-catalog/api/messages/recipient.proto"""
|
|
1950
|
+
|
|
1951
|
+
def as_dict(self) -> dict:
|
|
1952
|
+
"""Serializes the TokenDetail into a dictionary suitable for use as a JSON request body."""
|
|
1953
|
+
body = {}
|
|
1954
|
+
if self.bearer_token is not None: body['bearerToken'] = self.bearer_token
|
|
1955
|
+
if self.endpoint is not None: body['endpoint'] = self.endpoint
|
|
1956
|
+
if self.expiration_time is not None: body['expirationTime'] = self.expiration_time
|
|
1957
|
+
if self.share_credentials_version is not None:
|
|
1958
|
+
body['shareCredentialsVersion'] = self.share_credentials_version
|
|
1959
|
+
return body
|
|
1960
|
+
|
|
1961
|
+
@classmethod
|
|
1962
|
+
def from_dict(cls, d: Dict[str, any]) -> TokenDetail:
|
|
1963
|
+
"""Deserializes the TokenDetail from a dictionary."""
|
|
1964
|
+
return cls(bearer_token=d.get('bearerToken', None),
|
|
1965
|
+
endpoint=d.get('endpoint', None),
|
|
1966
|
+
expiration_time=d.get('expirationTime', None),
|
|
1967
|
+
share_credentials_version=d.get('shareCredentialsVersion', None))
|
|
1968
|
+
|
|
1969
|
+
|
|
1970
|
+
@dataclass
|
|
1971
|
+
class TokenInfo:
|
|
1972
|
+
activation_url: Optional[str] = None
|
|
1973
|
+
"""Full activation url to retrieve the access token. It will be empty if the token is already
|
|
1974
|
+
retrieved."""
|
|
1975
|
+
|
|
1976
|
+
created_at: Optional[int] = None
|
|
1977
|
+
"""Time at which this Recipient Token was created, in epoch milliseconds."""
|
|
1978
|
+
|
|
1979
|
+
created_by: Optional[str] = None
|
|
1980
|
+
"""Username of Recipient Token creator."""
|
|
1981
|
+
|
|
1982
|
+
expiration_time: Optional[int] = None
|
|
1983
|
+
"""Expiration timestamp of the token in epoch milliseconds."""
|
|
1984
|
+
|
|
1985
|
+
id: Optional[str] = None
|
|
1986
|
+
"""Unique id of the Recipient Token."""
|
|
1987
|
+
|
|
1988
|
+
updated_at: Optional[int] = None
|
|
1989
|
+
"""Time at which this Recipient Token was updated, in epoch milliseconds."""
|
|
1990
|
+
|
|
1991
|
+
updated_by: Optional[str] = None
|
|
1992
|
+
"""Username of Recipient Token updater."""
|
|
1993
|
+
|
|
1994
|
+
def as_dict(self) -> dict:
|
|
1995
|
+
"""Serializes the TokenInfo into a dictionary suitable for use as a JSON request body."""
|
|
1996
|
+
body = {}
|
|
1997
|
+
if self.activation_url is not None: body['activation_url'] = self.activation_url
|
|
1998
|
+
if self.created_at is not None: body['created_at'] = self.created_at
|
|
1999
|
+
if self.created_by is not None: body['created_by'] = self.created_by
|
|
2000
|
+
if self.expiration_time is not None: body['expiration_time'] = self.expiration_time
|
|
2001
|
+
if self.id is not None: body['id'] = self.id
|
|
2002
|
+
if self.updated_at is not None: body['updated_at'] = self.updated_at
|
|
2003
|
+
if self.updated_by is not None: body['updated_by'] = self.updated_by
|
|
2004
|
+
return body
|
|
2005
|
+
|
|
2006
|
+
@classmethod
|
|
2007
|
+
def from_dict(cls, d: Dict[str, any]) -> TokenInfo:
|
|
2008
|
+
"""Deserializes the TokenInfo from a dictionary."""
|
|
2009
|
+
return cls(activation_url=d.get('activation_url', None),
|
|
2010
|
+
created_at=d.get('created_at', None),
|
|
2011
|
+
created_by=d.get('created_by', None),
|
|
2012
|
+
expiration_time=d.get('expiration_time', None),
|
|
2013
|
+
id=d.get('id', None),
|
|
2014
|
+
updated_at=d.get('updated_at', None),
|
|
2015
|
+
updated_by=d.get('updated_by', None))
|
|
2016
|
+
|
|
2017
|
+
|
|
2018
|
+
@dataclass
|
|
2019
|
+
class UpdateExchangeFilterRequest:
|
|
2020
|
+
filter: ExchangeFilter
|
|
2021
|
+
|
|
2022
|
+
id: Optional[str] = None
|
|
2023
|
+
|
|
2024
|
+
def as_dict(self) -> dict:
|
|
2025
|
+
"""Serializes the UpdateExchangeFilterRequest into a dictionary suitable for use as a JSON request body."""
|
|
2026
|
+
body = {}
|
|
2027
|
+
if self.filter: body['filter'] = self.filter.as_dict()
|
|
2028
|
+
if self.id is not None: body['id'] = self.id
|
|
2029
|
+
return body
|
|
2030
|
+
|
|
2031
|
+
@classmethod
|
|
2032
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateExchangeFilterRequest:
|
|
2033
|
+
"""Deserializes the UpdateExchangeFilterRequest from a dictionary."""
|
|
2034
|
+
return cls(filter=_from_dict(d, 'filter', ExchangeFilter), id=d.get('id', None))
|
|
2035
|
+
|
|
2036
|
+
|
|
2037
|
+
@dataclass
|
|
2038
|
+
class UpdateExchangeFilterResponse:
|
|
2039
|
+
filter: Optional[ExchangeFilter] = None
|
|
2040
|
+
|
|
2041
|
+
def as_dict(self) -> dict:
|
|
2042
|
+
"""Serializes the UpdateExchangeFilterResponse into a dictionary suitable for use as a JSON request body."""
|
|
2043
|
+
body = {}
|
|
2044
|
+
if self.filter: body['filter'] = self.filter.as_dict()
|
|
2045
|
+
return body
|
|
2046
|
+
|
|
2047
|
+
@classmethod
|
|
2048
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateExchangeFilterResponse:
|
|
2049
|
+
"""Deserializes the UpdateExchangeFilterResponse from a dictionary."""
|
|
2050
|
+
return cls(filter=_from_dict(d, 'filter', ExchangeFilter))
|
|
2051
|
+
|
|
2052
|
+
|
|
2053
|
+
@dataclass
|
|
2054
|
+
class UpdateExchangeRequest:
|
|
2055
|
+
exchange: Exchange
|
|
2056
|
+
|
|
2057
|
+
id: Optional[str] = None
|
|
2058
|
+
|
|
2059
|
+
def as_dict(self) -> dict:
|
|
2060
|
+
"""Serializes the UpdateExchangeRequest into a dictionary suitable for use as a JSON request body."""
|
|
2061
|
+
body = {}
|
|
2062
|
+
if self.exchange: body['exchange'] = self.exchange.as_dict()
|
|
2063
|
+
if self.id is not None: body['id'] = self.id
|
|
2064
|
+
return body
|
|
2065
|
+
|
|
2066
|
+
@classmethod
|
|
2067
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateExchangeRequest:
|
|
2068
|
+
"""Deserializes the UpdateExchangeRequest from a dictionary."""
|
|
2069
|
+
return cls(exchange=_from_dict(d, 'exchange', Exchange), id=d.get('id', None))
|
|
2070
|
+
|
|
2071
|
+
|
|
2072
|
+
@dataclass
|
|
2073
|
+
class UpdateExchangeResponse:
|
|
2074
|
+
exchange: Optional[Exchange] = None
|
|
2075
|
+
|
|
2076
|
+
def as_dict(self) -> dict:
|
|
2077
|
+
"""Serializes the UpdateExchangeResponse into a dictionary suitable for use as a JSON request body."""
|
|
2078
|
+
body = {}
|
|
2079
|
+
if self.exchange: body['exchange'] = self.exchange.as_dict()
|
|
2080
|
+
return body
|
|
2081
|
+
|
|
2082
|
+
@classmethod
|
|
2083
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateExchangeResponse:
|
|
2084
|
+
"""Deserializes the UpdateExchangeResponse from a dictionary."""
|
|
2085
|
+
return cls(exchange=_from_dict(d, 'exchange', Exchange))
|
|
2086
|
+
|
|
2087
|
+
|
|
2088
|
+
@dataclass
|
|
2089
|
+
class UpdateInstallationRequest:
|
|
2090
|
+
installation: InstallationDetail
|
|
2091
|
+
|
|
2092
|
+
installation_id: Optional[str] = None
|
|
2093
|
+
|
|
2094
|
+
listing_id: Optional[str] = None
|
|
2095
|
+
|
|
2096
|
+
rotate_token: Optional[bool] = None
|
|
2097
|
+
|
|
2098
|
+
def as_dict(self) -> dict:
|
|
2099
|
+
"""Serializes the UpdateInstallationRequest into a dictionary suitable for use as a JSON request body."""
|
|
2100
|
+
body = {}
|
|
2101
|
+
if self.installation: body['installation'] = self.installation.as_dict()
|
|
2102
|
+
if self.installation_id is not None: body['installation_id'] = self.installation_id
|
|
2103
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
2104
|
+
if self.rotate_token is not None: body['rotate_token'] = self.rotate_token
|
|
2105
|
+
return body
|
|
2106
|
+
|
|
2107
|
+
@classmethod
|
|
2108
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateInstallationRequest:
|
|
2109
|
+
"""Deserializes the UpdateInstallationRequest from a dictionary."""
|
|
2110
|
+
return cls(installation=_from_dict(d, 'installation', InstallationDetail),
|
|
2111
|
+
installation_id=d.get('installation_id', None),
|
|
2112
|
+
listing_id=d.get('listing_id', None),
|
|
2113
|
+
rotate_token=d.get('rotate_token', None))
|
|
2114
|
+
|
|
2115
|
+
|
|
2116
|
+
@dataclass
|
|
2117
|
+
class UpdateInstallationResponse:
|
|
2118
|
+
installation: Optional[InstallationDetail] = None
|
|
2119
|
+
|
|
2120
|
+
def as_dict(self) -> dict:
|
|
2121
|
+
"""Serializes the UpdateInstallationResponse into a dictionary suitable for use as a JSON request body."""
|
|
2122
|
+
body = {}
|
|
2123
|
+
if self.installation: body['installation'] = self.installation.as_dict()
|
|
2124
|
+
return body
|
|
2125
|
+
|
|
2126
|
+
@classmethod
|
|
2127
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateInstallationResponse:
|
|
2128
|
+
"""Deserializes the UpdateInstallationResponse from a dictionary."""
|
|
2129
|
+
return cls(installation=_from_dict(d, 'installation', InstallationDetail))
|
|
2130
|
+
|
|
2131
|
+
|
|
2132
|
+
@dataclass
|
|
2133
|
+
class UpdateListingRequest:
|
|
2134
|
+
listing: Listing
|
|
2135
|
+
|
|
2136
|
+
id: Optional[str] = None
|
|
2137
|
+
|
|
2138
|
+
def as_dict(self) -> dict:
|
|
2139
|
+
"""Serializes the UpdateListingRequest into a dictionary suitable for use as a JSON request body."""
|
|
2140
|
+
body = {}
|
|
2141
|
+
if self.id is not None: body['id'] = self.id
|
|
2142
|
+
if self.listing: body['listing'] = self.listing.as_dict()
|
|
2143
|
+
return body
|
|
2144
|
+
|
|
2145
|
+
@classmethod
|
|
2146
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateListingRequest:
|
|
2147
|
+
"""Deserializes the UpdateListingRequest from a dictionary."""
|
|
2148
|
+
return cls(id=d.get('id', None), listing=_from_dict(d, 'listing', Listing))
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
@dataclass
|
|
2152
|
+
class UpdateListingResponse:
|
|
2153
|
+
listing: Optional[Listing] = None
|
|
2154
|
+
|
|
2155
|
+
def as_dict(self) -> dict:
|
|
2156
|
+
"""Serializes the UpdateListingResponse into a dictionary suitable for use as a JSON request body."""
|
|
2157
|
+
body = {}
|
|
2158
|
+
if self.listing: body['listing'] = self.listing.as_dict()
|
|
2159
|
+
return body
|
|
2160
|
+
|
|
2161
|
+
@classmethod
|
|
2162
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateListingResponse:
|
|
2163
|
+
"""Deserializes the UpdateListingResponse from a dictionary."""
|
|
2164
|
+
return cls(listing=_from_dict(d, 'listing', Listing))
|
|
2165
|
+
|
|
2166
|
+
|
|
2167
|
+
@dataclass
|
|
2168
|
+
class UpdatePersonalizationRequestRequest:
|
|
2169
|
+
status: PersonalizationRequestStatus
|
|
2170
|
+
|
|
2171
|
+
listing_id: Optional[str] = None
|
|
2172
|
+
|
|
2173
|
+
reason: Optional[str] = None
|
|
2174
|
+
|
|
2175
|
+
request_id: Optional[str] = None
|
|
2176
|
+
|
|
2177
|
+
share: Optional[ShareInfo] = None
|
|
2178
|
+
|
|
2179
|
+
def as_dict(self) -> dict:
|
|
2180
|
+
"""Serializes the UpdatePersonalizationRequestRequest into a dictionary suitable for use as a JSON request body."""
|
|
2181
|
+
body = {}
|
|
2182
|
+
if self.listing_id is not None: body['listing_id'] = self.listing_id
|
|
2183
|
+
if self.reason is not None: body['reason'] = self.reason
|
|
2184
|
+
if self.request_id is not None: body['request_id'] = self.request_id
|
|
2185
|
+
if self.share: body['share'] = self.share.as_dict()
|
|
2186
|
+
if self.status is not None: body['status'] = self.status.value
|
|
2187
|
+
return body
|
|
2188
|
+
|
|
2189
|
+
@classmethod
|
|
2190
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdatePersonalizationRequestRequest:
|
|
2191
|
+
"""Deserializes the UpdatePersonalizationRequestRequest from a dictionary."""
|
|
2192
|
+
return cls(listing_id=d.get('listing_id', None),
|
|
2193
|
+
reason=d.get('reason', None),
|
|
2194
|
+
request_id=d.get('request_id', None),
|
|
2195
|
+
share=_from_dict(d, 'share', ShareInfo),
|
|
2196
|
+
status=_enum(d, 'status', PersonalizationRequestStatus))
|
|
2197
|
+
|
|
2198
|
+
|
|
2199
|
+
@dataclass
|
|
2200
|
+
class UpdatePersonalizationRequestResponse:
|
|
2201
|
+
request: Optional[PersonalizationRequest] = None
|
|
2202
|
+
|
|
2203
|
+
def as_dict(self) -> dict:
|
|
2204
|
+
"""Serializes the UpdatePersonalizationRequestResponse into a dictionary suitable for use as a JSON request body."""
|
|
2205
|
+
body = {}
|
|
2206
|
+
if self.request: body['request'] = self.request.as_dict()
|
|
2207
|
+
return body
|
|
2208
|
+
|
|
2209
|
+
@classmethod
|
|
2210
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdatePersonalizationRequestResponse:
|
|
2211
|
+
"""Deserializes the UpdatePersonalizationRequestResponse from a dictionary."""
|
|
2212
|
+
return cls(request=_from_dict(d, 'request', PersonalizationRequest))
|
|
2213
|
+
|
|
2214
|
+
|
|
2215
|
+
@dataclass
|
|
2216
|
+
class UpdateProviderAnalyticsDashboardRequest:
|
|
2217
|
+
id: Optional[str] = None
|
|
2218
|
+
"""id is immutable property and can't be updated."""
|
|
2219
|
+
|
|
2220
|
+
version: Optional[int] = None
|
|
2221
|
+
"""this is the version of the dashboard template we want to update our user to current expectation
|
|
2222
|
+
is that it should be equal to latest version of the dashboard template"""
|
|
2223
|
+
|
|
2224
|
+
def as_dict(self) -> dict:
|
|
2225
|
+
"""Serializes the UpdateProviderAnalyticsDashboardRequest into a dictionary suitable for use as a JSON request body."""
|
|
2226
|
+
body = {}
|
|
2227
|
+
if self.id is not None: body['id'] = self.id
|
|
2228
|
+
if self.version is not None: body['version'] = self.version
|
|
2229
|
+
return body
|
|
2230
|
+
|
|
2231
|
+
@classmethod
|
|
2232
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateProviderAnalyticsDashboardRequest:
|
|
2233
|
+
"""Deserializes the UpdateProviderAnalyticsDashboardRequest from a dictionary."""
|
|
2234
|
+
return cls(id=d.get('id', None), version=d.get('version', None))
|
|
2235
|
+
|
|
2236
|
+
|
|
2237
|
+
@dataclass
|
|
2238
|
+
class UpdateProviderAnalyticsDashboardResponse:
|
|
2239
|
+
id: str
|
|
2240
|
+
"""id & version should be the same as the request"""
|
|
2241
|
+
|
|
2242
|
+
dashboard_id: str
|
|
2243
|
+
"""this is newly created Lakeview dashboard for the user"""
|
|
2244
|
+
|
|
2245
|
+
version: Optional[int] = None
|
|
2246
|
+
|
|
2247
|
+
def as_dict(self) -> dict:
|
|
2248
|
+
"""Serializes the UpdateProviderAnalyticsDashboardResponse into a dictionary suitable for use as a JSON request body."""
|
|
2249
|
+
body = {}
|
|
2250
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
2251
|
+
if self.id is not None: body['id'] = self.id
|
|
2252
|
+
if self.version is not None: body['version'] = self.version
|
|
2253
|
+
return body
|
|
2254
|
+
|
|
2255
|
+
@classmethod
|
|
2256
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateProviderAnalyticsDashboardResponse:
|
|
2257
|
+
"""Deserializes the UpdateProviderAnalyticsDashboardResponse from a dictionary."""
|
|
2258
|
+
return cls(dashboard_id=d.get('dashboard_id', None),
|
|
2259
|
+
id=d.get('id', None),
|
|
2260
|
+
version=d.get('version', None))
|
|
2261
|
+
|
|
2262
|
+
|
|
2263
|
+
@dataclass
|
|
2264
|
+
class UpdateProviderRequest:
|
|
2265
|
+
provider: ProviderInfo
|
|
2266
|
+
|
|
2267
|
+
id: Optional[str] = None
|
|
2268
|
+
|
|
2269
|
+
def as_dict(self) -> dict:
|
|
2270
|
+
"""Serializes the UpdateProviderRequest into a dictionary suitable for use as a JSON request body."""
|
|
2271
|
+
body = {}
|
|
2272
|
+
if self.id is not None: body['id'] = self.id
|
|
2273
|
+
if self.provider: body['provider'] = self.provider.as_dict()
|
|
2274
|
+
return body
|
|
2275
|
+
|
|
2276
|
+
@classmethod
|
|
2277
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateProviderRequest:
|
|
2278
|
+
"""Deserializes the UpdateProviderRequest from a dictionary."""
|
|
2279
|
+
return cls(id=d.get('id', None), provider=_from_dict(d, 'provider', ProviderInfo))
|
|
2280
|
+
|
|
2281
|
+
|
|
2282
|
+
@dataclass
|
|
2283
|
+
class UpdateProviderResponse:
|
|
2284
|
+
provider: Optional[ProviderInfo] = None
|
|
2285
|
+
|
|
2286
|
+
def as_dict(self) -> dict:
|
|
2287
|
+
"""Serializes the UpdateProviderResponse into a dictionary suitable for use as a JSON request body."""
|
|
2288
|
+
body = {}
|
|
2289
|
+
if self.provider: body['provider'] = self.provider.as_dict()
|
|
2290
|
+
return body
|
|
2291
|
+
|
|
2292
|
+
@classmethod
|
|
2293
|
+
def from_dict(cls, d: Dict[str, any]) -> UpdateProviderResponse:
|
|
2294
|
+
"""Deserializes the UpdateProviderResponse from a dictionary."""
|
|
2295
|
+
return cls(provider=_from_dict(d, 'provider', ProviderInfo))
|
|
2296
|
+
|
|
2297
|
+
|
|
2298
|
+
class Visibility(Enum):
|
|
2299
|
+
|
|
2300
|
+
PRIVATE = 'PRIVATE'
|
|
2301
|
+
PUBLIC = 'PUBLIC'
|
|
2302
|
+
|
|
2303
|
+
|
|
2304
|
+
@dataclass
|
|
2305
|
+
class VisibilityFilter:
|
|
2306
|
+
filter_type: Optional[FilterType] = None
|
|
2307
|
+
|
|
2308
|
+
filter_value: Optional[str] = None
|
|
2309
|
+
|
|
2310
|
+
def as_dict(self) -> dict:
|
|
2311
|
+
"""Serializes the VisibilityFilter into a dictionary suitable for use as a JSON request body."""
|
|
2312
|
+
body = {}
|
|
2313
|
+
if self.filter_type is not None: body['filterType'] = self.filter_type.value
|
|
2314
|
+
if self.filter_value is not None: body['filterValue'] = self.filter_value
|
|
2315
|
+
return body
|
|
2316
|
+
|
|
2317
|
+
@classmethod
|
|
2318
|
+
def from_dict(cls, d: Dict[str, any]) -> VisibilityFilter:
|
|
2319
|
+
"""Deserializes the VisibilityFilter from a dictionary."""
|
|
2320
|
+
return cls(filter_type=_enum(d, 'filterType', FilterType), filter_value=d.get('filterValue', None))
|
|
2321
|
+
|
|
2322
|
+
|
|
2323
|
+
class ConsumerFulfillmentsAPI:
|
|
2324
|
+
"""Fulfillments are entities that allow consumers to preview installations."""
|
|
2325
|
+
|
|
2326
|
+
def __init__(self, api_client):
|
|
2327
|
+
self._api = api_client
|
|
2328
|
+
|
|
2329
|
+
def get(self,
|
|
2330
|
+
listing_id: str,
|
|
2331
|
+
*,
|
|
2332
|
+
page_size: Optional[int] = None,
|
|
2333
|
+
page_token: Optional[str] = None) -> Iterator[SharedDataObject]:
|
|
2334
|
+
"""Get listing content metadata.
|
|
2335
|
+
|
|
2336
|
+
Get a high level preview of the metadata of listing installable content.
|
|
2337
|
+
|
|
2338
|
+
:param listing_id: str
|
|
2339
|
+
:param page_size: int (optional)
|
|
2340
|
+
:param page_token: str (optional)
|
|
2341
|
+
|
|
2342
|
+
:returns: Iterator over :class:`SharedDataObject`
|
|
2343
|
+
"""
|
|
2344
|
+
|
|
2345
|
+
query = {}
|
|
2346
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2347
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2348
|
+
headers = {'Accept': 'application/json', }
|
|
2349
|
+
|
|
2350
|
+
while True:
|
|
2351
|
+
json = self._api.do('GET',
|
|
2352
|
+
f'/api/2.1/marketplace-consumer/listings/{listing_id}/content',
|
|
2353
|
+
query=query,
|
|
2354
|
+
headers=headers)
|
|
2355
|
+
if 'shared_data_objects' in json:
|
|
2356
|
+
for v in json['shared_data_objects']:
|
|
2357
|
+
yield SharedDataObject.from_dict(v)
|
|
2358
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2359
|
+
return
|
|
2360
|
+
query['page_token'] = json['next_page_token']
|
|
2361
|
+
|
|
2362
|
+
def list(self,
|
|
2363
|
+
listing_id: str,
|
|
2364
|
+
*,
|
|
2365
|
+
page_size: Optional[int] = None,
|
|
2366
|
+
page_token: Optional[str] = None) -> Iterator[ListingFulfillment]:
|
|
2367
|
+
"""List all listing fulfillments.
|
|
2368
|
+
|
|
2369
|
+
Get all listings fulfillments associated with a listing. A _fulfillment_ is a potential installation.
|
|
2370
|
+
Standard installations contain metadata about the attached share or git repo. Only one of these fields
|
|
2371
|
+
will be present. Personalized installations contain metadata about the attached share or git repo, as
|
|
2372
|
+
well as the Delta Sharing recipient type.
|
|
2373
|
+
|
|
2374
|
+
:param listing_id: str
|
|
2375
|
+
:param page_size: int (optional)
|
|
2376
|
+
:param page_token: str (optional)
|
|
2377
|
+
|
|
2378
|
+
:returns: Iterator over :class:`ListingFulfillment`
|
|
2379
|
+
"""
|
|
2380
|
+
|
|
2381
|
+
query = {}
|
|
2382
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2383
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2384
|
+
headers = {'Accept': 'application/json', }
|
|
2385
|
+
|
|
2386
|
+
while True:
|
|
2387
|
+
json = self._api.do('GET',
|
|
2388
|
+
f'/api/2.1/marketplace-consumer/listings/{listing_id}/fulfillments',
|
|
2389
|
+
query=query,
|
|
2390
|
+
headers=headers)
|
|
2391
|
+
if 'fulfillments' in json:
|
|
2392
|
+
for v in json['fulfillments']:
|
|
2393
|
+
yield ListingFulfillment.from_dict(v)
|
|
2394
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2395
|
+
return
|
|
2396
|
+
query['page_token'] = json['next_page_token']
|
|
2397
|
+
|
|
2398
|
+
|
|
2399
|
+
class ConsumerInstallationsAPI:
|
|
2400
|
+
"""Installations are entities that allow consumers to interact with Databricks Marketplace listings."""
|
|
2401
|
+
|
|
2402
|
+
def __init__(self, api_client):
|
|
2403
|
+
self._api = api_client
|
|
2404
|
+
|
|
2405
|
+
def create(self,
|
|
2406
|
+
listing_id: str,
|
|
2407
|
+
*,
|
|
2408
|
+
accepted_consumer_terms: Optional[ConsumerTerms] = None,
|
|
2409
|
+
catalog_name: Optional[str] = None,
|
|
2410
|
+
recipient_type: Optional[DeltaSharingRecipientType] = None,
|
|
2411
|
+
repo_detail: Optional[RepoInstallation] = None,
|
|
2412
|
+
share_name: Optional[str] = None) -> Installation:
|
|
2413
|
+
"""Install from a listing.
|
|
2414
|
+
|
|
2415
|
+
Install payload associated with a Databricks Marketplace listing.
|
|
2416
|
+
|
|
2417
|
+
:param listing_id: str
|
|
2418
|
+
:param accepted_consumer_terms: :class:`ConsumerTerms` (optional)
|
|
2419
|
+
:param catalog_name: str (optional)
|
|
2420
|
+
:param recipient_type: :class:`DeltaSharingRecipientType` (optional)
|
|
2421
|
+
:param repo_detail: :class:`RepoInstallation` (optional)
|
|
2422
|
+
for git repo installations
|
|
2423
|
+
:param share_name: str (optional)
|
|
2424
|
+
|
|
2425
|
+
:returns: :class:`Installation`
|
|
2426
|
+
"""
|
|
2427
|
+
body = {}
|
|
2428
|
+
if accepted_consumer_terms is not None:
|
|
2429
|
+
body['accepted_consumer_terms'] = accepted_consumer_terms.as_dict()
|
|
2430
|
+
if catalog_name is not None: body['catalog_name'] = catalog_name
|
|
2431
|
+
if recipient_type is not None: body['recipient_type'] = recipient_type.value
|
|
2432
|
+
if repo_detail is not None: body['repo_detail'] = repo_detail.as_dict()
|
|
2433
|
+
if share_name is not None: body['share_name'] = share_name
|
|
2434
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
2435
|
+
|
|
2436
|
+
res = self._api.do('POST',
|
|
2437
|
+
f'/api/2.1/marketplace-consumer/listings/{listing_id}/installations',
|
|
2438
|
+
body=body,
|
|
2439
|
+
headers=headers)
|
|
2440
|
+
return Installation.from_dict(res)
|
|
2441
|
+
|
|
2442
|
+
def delete(self, listing_id: str, installation_id: str):
|
|
2443
|
+
"""Uninstall from a listing.
|
|
2444
|
+
|
|
2445
|
+
Uninstall an installation associated with a Databricks Marketplace listing.
|
|
2446
|
+
|
|
2447
|
+
:param listing_id: str
|
|
2448
|
+
:param installation_id: str
|
|
2449
|
+
|
|
2450
|
+
|
|
2451
|
+
"""
|
|
2452
|
+
|
|
2453
|
+
headers = {'Accept': 'application/json', }
|
|
2454
|
+
|
|
2455
|
+
self._api.do('DELETE',
|
|
2456
|
+
f'/api/2.1/marketplace-consumer/listings/{listing_id}/installations/{installation_id}',
|
|
2457
|
+
headers=headers)
|
|
2458
|
+
|
|
2459
|
+
def list(self,
|
|
2460
|
+
*,
|
|
2461
|
+
page_size: Optional[int] = None,
|
|
2462
|
+
page_token: Optional[str] = None) -> Iterator[InstallationDetail]:
|
|
2463
|
+
"""List all installations.
|
|
2464
|
+
|
|
2465
|
+
List all installations across all listings.
|
|
2466
|
+
|
|
2467
|
+
:param page_size: int (optional)
|
|
2468
|
+
:param page_token: str (optional)
|
|
2469
|
+
|
|
2470
|
+
:returns: Iterator over :class:`InstallationDetail`
|
|
2471
|
+
"""
|
|
2472
|
+
|
|
2473
|
+
query = {}
|
|
2474
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2475
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2476
|
+
headers = {'Accept': 'application/json', }
|
|
2477
|
+
|
|
2478
|
+
while True:
|
|
2479
|
+
json = self._api.do('GET',
|
|
2480
|
+
'/api/2.1/marketplace-consumer/installations',
|
|
2481
|
+
query=query,
|
|
2482
|
+
headers=headers)
|
|
2483
|
+
if 'installations' in json:
|
|
2484
|
+
for v in json['installations']:
|
|
2485
|
+
yield InstallationDetail.from_dict(v)
|
|
2486
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2487
|
+
return
|
|
2488
|
+
query['page_token'] = json['next_page_token']
|
|
2489
|
+
|
|
2490
|
+
def list_listing_installations(self,
|
|
2491
|
+
listing_id: str,
|
|
2492
|
+
*,
|
|
2493
|
+
page_size: Optional[int] = None,
|
|
2494
|
+
page_token: Optional[str] = None) -> Iterator[InstallationDetail]:
|
|
2495
|
+
"""List installations for a listing.
|
|
2496
|
+
|
|
2497
|
+
List all installations for a particular listing.
|
|
2498
|
+
|
|
2499
|
+
:param listing_id: str
|
|
2500
|
+
:param page_size: int (optional)
|
|
2501
|
+
:param page_token: str (optional)
|
|
2502
|
+
|
|
2503
|
+
:returns: Iterator over :class:`InstallationDetail`
|
|
2504
|
+
"""
|
|
2505
|
+
|
|
2506
|
+
query = {}
|
|
2507
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2508
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2509
|
+
headers = {'Accept': 'application/json', }
|
|
2510
|
+
|
|
2511
|
+
while True:
|
|
2512
|
+
json = self._api.do('GET',
|
|
2513
|
+
f'/api/2.1/marketplace-consumer/listings/{listing_id}/installations',
|
|
2514
|
+
query=query,
|
|
2515
|
+
headers=headers)
|
|
2516
|
+
if 'installations' in json:
|
|
2517
|
+
for v in json['installations']:
|
|
2518
|
+
yield InstallationDetail.from_dict(v)
|
|
2519
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2520
|
+
return
|
|
2521
|
+
query['page_token'] = json['next_page_token']
|
|
2522
|
+
|
|
2523
|
+
def update(self,
|
|
2524
|
+
listing_id: str,
|
|
2525
|
+
installation_id: str,
|
|
2526
|
+
installation: InstallationDetail,
|
|
2527
|
+
*,
|
|
2528
|
+
rotate_token: Optional[bool] = None) -> UpdateInstallationResponse:
|
|
2529
|
+
"""Update an installation.
|
|
2530
|
+
|
|
2531
|
+
This is a update API that will update the part of the fields defined in the installation table as well
|
|
2532
|
+
as interact with external services according to the fields not included in the installation table 1.
|
|
2533
|
+
the token will be rotate if the rotateToken flag is true 2. the token will be forcibly rotate if the
|
|
2534
|
+
rotateToken flag is true and the tokenInfo field is empty
|
|
2535
|
+
|
|
2536
|
+
:param listing_id: str
|
|
2537
|
+
:param installation_id: str
|
|
2538
|
+
:param installation: :class:`InstallationDetail`
|
|
2539
|
+
:param rotate_token: bool (optional)
|
|
2540
|
+
|
|
2541
|
+
:returns: :class:`UpdateInstallationResponse`
|
|
2542
|
+
"""
|
|
2543
|
+
body = {}
|
|
2544
|
+
if installation is not None: body['installation'] = installation.as_dict()
|
|
2545
|
+
if rotate_token is not None: body['rotate_token'] = rotate_token
|
|
2546
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
2547
|
+
|
|
2548
|
+
res = self._api.do(
|
|
2549
|
+
'PUT',
|
|
2550
|
+
f'/api/2.1/marketplace-consumer/listings/{listing_id}/installations/{installation_id}',
|
|
2551
|
+
body=body,
|
|
2552
|
+
headers=headers)
|
|
2553
|
+
return UpdateInstallationResponse.from_dict(res)
|
|
2554
|
+
|
|
2555
|
+
|
|
2556
|
+
class ConsumerListingsAPI:
|
|
2557
|
+
"""Listings are the core entities in the Marketplace. They represent the products that are available for
|
|
2558
|
+
consumption."""
|
|
2559
|
+
|
|
2560
|
+
def __init__(self, api_client):
|
|
2561
|
+
self._api = api_client
|
|
2562
|
+
|
|
2563
|
+
def get(self, id: str) -> GetListingResponse:
|
|
2564
|
+
"""Get listing.
|
|
2565
|
+
|
|
2566
|
+
Get a published listing in the Databricks Marketplace that the consumer has access to.
|
|
2567
|
+
|
|
2568
|
+
:param id: str
|
|
2569
|
+
|
|
2570
|
+
:returns: :class:`GetListingResponse`
|
|
2571
|
+
"""
|
|
2572
|
+
|
|
2573
|
+
headers = {'Accept': 'application/json', }
|
|
2574
|
+
|
|
2575
|
+
res = self._api.do('GET', f'/api/2.1/marketplace-consumer/listings/{id}', headers=headers)
|
|
2576
|
+
return GetListingResponse.from_dict(res)
|
|
2577
|
+
|
|
2578
|
+
def list(self,
|
|
2579
|
+
*,
|
|
2580
|
+
assets: Optional[List[AssetType]] = None,
|
|
2581
|
+
categories: Optional[List[Category]] = None,
|
|
2582
|
+
is_free: Optional[bool] = None,
|
|
2583
|
+
is_private_exchange: Optional[bool] = None,
|
|
2584
|
+
is_staff_pick: Optional[bool] = None,
|
|
2585
|
+
page_size: Optional[int] = None,
|
|
2586
|
+
page_token: Optional[str] = None,
|
|
2587
|
+
provider_ids: Optional[List[str]] = None,
|
|
2588
|
+
sort_by_spec: Optional[SortBySpec] = None,
|
|
2589
|
+
tags: Optional[List[ListingTag]] = None) -> Iterator[Listing]:
|
|
2590
|
+
"""List listings.
|
|
2591
|
+
|
|
2592
|
+
List all published listings in the Databricks Marketplace that the consumer has access to.
|
|
2593
|
+
|
|
2594
|
+
:param assets: List[:class:`AssetType`] (optional)
|
|
2595
|
+
Matches any of the following asset types
|
|
2596
|
+
:param categories: List[:class:`Category`] (optional)
|
|
2597
|
+
Matches any of the following categories
|
|
2598
|
+
:param is_free: bool (optional)
|
|
2599
|
+
Filters each listing based on if it is free.
|
|
2600
|
+
:param is_private_exchange: bool (optional)
|
|
2601
|
+
Filters each listing based on if it is a private exchange.
|
|
2602
|
+
:param is_staff_pick: bool (optional)
|
|
2603
|
+
Filters each listing based on whether it is a staff pick.
|
|
2604
|
+
:param page_size: int (optional)
|
|
2605
|
+
:param page_token: str (optional)
|
|
2606
|
+
:param provider_ids: List[str] (optional)
|
|
2607
|
+
Matches any of the following provider ids
|
|
2608
|
+
:param sort_by_spec: :class:`SortBySpec` (optional)
|
|
2609
|
+
Criteria for sorting the resulting set of listings.
|
|
2610
|
+
:param tags: List[:class:`ListingTag`] (optional)
|
|
2611
|
+
Matches any of the following tags
|
|
2612
|
+
|
|
2613
|
+
:returns: Iterator over :class:`Listing`
|
|
2614
|
+
"""
|
|
2615
|
+
|
|
2616
|
+
query = {}
|
|
2617
|
+
if assets is not None: query['assets'] = [v.value for v in assets]
|
|
2618
|
+
if categories is not None: query['categories'] = [v.value for v in categories]
|
|
2619
|
+
if is_free is not None: query['is_free'] = is_free
|
|
2620
|
+
if is_private_exchange is not None: query['is_private_exchange'] = is_private_exchange
|
|
2621
|
+
if is_staff_pick is not None: query['is_staff_pick'] = is_staff_pick
|
|
2622
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2623
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2624
|
+
if provider_ids is not None: query['provider_ids'] = [v for v in provider_ids]
|
|
2625
|
+
if sort_by_spec is not None: query['sort_by_spec'] = sort_by_spec.as_dict()
|
|
2626
|
+
if tags is not None: query['tags'] = [v.as_dict() for v in tags]
|
|
2627
|
+
headers = {'Accept': 'application/json', }
|
|
2628
|
+
|
|
2629
|
+
while True:
|
|
2630
|
+
json = self._api.do('GET', '/api/2.1/marketplace-consumer/listings', query=query, headers=headers)
|
|
2631
|
+
if 'listings' in json:
|
|
2632
|
+
for v in json['listings']:
|
|
2633
|
+
yield Listing.from_dict(v)
|
|
2634
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2635
|
+
return
|
|
2636
|
+
query['page_token'] = json['next_page_token']
|
|
2637
|
+
|
|
2638
|
+
def search(self,
|
|
2639
|
+
query: str,
|
|
2640
|
+
*,
|
|
2641
|
+
assets: Optional[List[AssetType]] = None,
|
|
2642
|
+
categories: Optional[List[Category]] = None,
|
|
2643
|
+
is_free: Optional[bool] = None,
|
|
2644
|
+
is_private_exchange: Optional[bool] = None,
|
|
2645
|
+
page_size: Optional[int] = None,
|
|
2646
|
+
page_token: Optional[str] = None,
|
|
2647
|
+
provider_ids: Optional[List[str]] = None,
|
|
2648
|
+
sort_by: Optional[SortBy] = None) -> Iterator[Listing]:
|
|
2649
|
+
"""Search listings.
|
|
2650
|
+
|
|
2651
|
+
Search published listings in the Databricks Marketplace that the consumer has access to. This query
|
|
2652
|
+
supports a variety of different search parameters and performs fuzzy matching.
|
|
2653
|
+
|
|
2654
|
+
:param query: str
|
|
2655
|
+
Fuzzy matches query
|
|
2656
|
+
:param assets: List[:class:`AssetType`] (optional)
|
|
2657
|
+
Matches any of the following asset types
|
|
2658
|
+
:param categories: List[:class:`Category`] (optional)
|
|
2659
|
+
Matches any of the following categories
|
|
2660
|
+
:param is_free: bool (optional)
|
|
2661
|
+
:param is_private_exchange: bool (optional)
|
|
2662
|
+
:param page_size: int (optional)
|
|
2663
|
+
:param page_token: str (optional)
|
|
2664
|
+
:param provider_ids: List[str] (optional)
|
|
2665
|
+
Matches any of the following provider ids
|
|
2666
|
+
:param sort_by: :class:`SortBy` (optional)
|
|
2667
|
+
|
|
2668
|
+
:returns: Iterator over :class:`Listing`
|
|
2669
|
+
"""
|
|
2670
|
+
|
|
2671
|
+
query = {}
|
|
2672
|
+
if assets is not None: query['assets'] = [v.value for v in assets]
|
|
2673
|
+
if categories is not None: query['categories'] = [v.value for v in categories]
|
|
2674
|
+
if is_free is not None: query['is_free'] = is_free
|
|
2675
|
+
if is_private_exchange is not None: query['is_private_exchange'] = is_private_exchange
|
|
2676
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2677
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2678
|
+
if provider_ids is not None: query['provider_ids'] = [v for v in provider_ids]
|
|
2679
|
+
if query is not None: query['query'] = query
|
|
2680
|
+
if sort_by is not None: query['sort_by'] = sort_by.value
|
|
2681
|
+
headers = {'Accept': 'application/json', }
|
|
2682
|
+
|
|
2683
|
+
while True:
|
|
2684
|
+
json = self._api.do('GET',
|
|
2685
|
+
'/api/2.1/marketplace-consumer/search-listings',
|
|
2686
|
+
query=query,
|
|
2687
|
+
headers=headers)
|
|
2688
|
+
if 'listings' in json:
|
|
2689
|
+
for v in json['listings']:
|
|
2690
|
+
yield Listing.from_dict(v)
|
|
2691
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2692
|
+
return
|
|
2693
|
+
query['page_token'] = json['next_page_token']
|
|
2694
|
+
|
|
2695
|
+
|
|
2696
|
+
class ConsumerPersonalizationRequestsAPI:
|
|
2697
|
+
"""Personalization Requests allow customers to interact with the individualized Marketplace listing flow."""
|
|
2698
|
+
|
|
2699
|
+
def __init__(self, api_client):
|
|
2700
|
+
self._api = api_client
|
|
2701
|
+
|
|
2702
|
+
def create(
|
|
2703
|
+
self,
|
|
2704
|
+
listing_id: str,
|
|
2705
|
+
intended_use: str,
|
|
2706
|
+
accepted_consumer_terms: ConsumerTerms,
|
|
2707
|
+
*,
|
|
2708
|
+
comment: Optional[str] = None,
|
|
2709
|
+
company: Optional[str] = None,
|
|
2710
|
+
first_name: Optional[str] = None,
|
|
2711
|
+
is_from_lighthouse: Optional[bool] = None,
|
|
2712
|
+
last_name: Optional[str] = None,
|
|
2713
|
+
recipient_type: Optional[DeltaSharingRecipientType] = None
|
|
2714
|
+
) -> CreatePersonalizationRequestResponse:
|
|
2715
|
+
"""Create a personalization request.
|
|
2716
|
+
|
|
2717
|
+
Create a personalization request for a listing.
|
|
2718
|
+
|
|
2719
|
+
:param listing_id: str
|
|
2720
|
+
:param intended_use: str
|
|
2721
|
+
:param accepted_consumer_terms: :class:`ConsumerTerms`
|
|
2722
|
+
:param comment: str (optional)
|
|
2723
|
+
:param company: str (optional)
|
|
2724
|
+
:param first_name: str (optional)
|
|
2725
|
+
:param is_from_lighthouse: bool (optional)
|
|
2726
|
+
:param last_name: str (optional)
|
|
2727
|
+
:param recipient_type: :class:`DeltaSharingRecipientType` (optional)
|
|
2728
|
+
|
|
2729
|
+
:returns: :class:`CreatePersonalizationRequestResponse`
|
|
2730
|
+
"""
|
|
2731
|
+
body = {}
|
|
2732
|
+
if accepted_consumer_terms is not None:
|
|
2733
|
+
body['accepted_consumer_terms'] = accepted_consumer_terms.as_dict()
|
|
2734
|
+
if comment is not None: body['comment'] = comment
|
|
2735
|
+
if company is not None: body['company'] = company
|
|
2736
|
+
if first_name is not None: body['first_name'] = first_name
|
|
2737
|
+
if intended_use is not None: body['intended_use'] = intended_use
|
|
2738
|
+
if is_from_lighthouse is not None: body['is_from_lighthouse'] = is_from_lighthouse
|
|
2739
|
+
if last_name is not None: body['last_name'] = last_name
|
|
2740
|
+
if recipient_type is not None: body['recipient_type'] = recipient_type.value
|
|
2741
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
2742
|
+
|
|
2743
|
+
res = self._api.do('POST',
|
|
2744
|
+
f'/api/2.1/marketplace-consumer/listings/{listing_id}/personalization-requests',
|
|
2745
|
+
body=body,
|
|
2746
|
+
headers=headers)
|
|
2747
|
+
return CreatePersonalizationRequestResponse.from_dict(res)
|
|
2748
|
+
|
|
2749
|
+
def get(self, listing_id: str) -> GetPersonalizationRequestResponse:
|
|
2750
|
+
"""Get the personalization request for a listing.
|
|
2751
|
+
|
|
2752
|
+
Get the personalization request for a listing. Each consumer can make at *most* one personalization
|
|
2753
|
+
request for a listing.
|
|
2754
|
+
|
|
2755
|
+
:param listing_id: str
|
|
2756
|
+
|
|
2757
|
+
:returns: :class:`GetPersonalizationRequestResponse`
|
|
2758
|
+
"""
|
|
2759
|
+
|
|
2760
|
+
headers = {'Accept': 'application/json', }
|
|
2761
|
+
|
|
2762
|
+
res = self._api.do('GET',
|
|
2763
|
+
f'/api/2.1/marketplace-consumer/listings/{listing_id}/personalization-requests',
|
|
2764
|
+
headers=headers)
|
|
2765
|
+
return GetPersonalizationRequestResponse.from_dict(res)
|
|
2766
|
+
|
|
2767
|
+
def list(self,
|
|
2768
|
+
*,
|
|
2769
|
+
page_size: Optional[int] = None,
|
|
2770
|
+
page_token: Optional[str] = None) -> Iterator[PersonalizationRequest]:
|
|
2771
|
+
"""List all personalization requests.
|
|
2772
|
+
|
|
2773
|
+
List personalization requests for a consumer across all listings.
|
|
2774
|
+
|
|
2775
|
+
:param page_size: int (optional)
|
|
2776
|
+
:param page_token: str (optional)
|
|
2777
|
+
|
|
2778
|
+
:returns: Iterator over :class:`PersonalizationRequest`
|
|
2779
|
+
"""
|
|
2780
|
+
|
|
2781
|
+
query = {}
|
|
2782
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2783
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2784
|
+
headers = {'Accept': 'application/json', }
|
|
2785
|
+
|
|
2786
|
+
while True:
|
|
2787
|
+
json = self._api.do('GET',
|
|
2788
|
+
'/api/2.1/marketplace-consumer/personalization-requests',
|
|
2789
|
+
query=query,
|
|
2790
|
+
headers=headers)
|
|
2791
|
+
if 'personalization_requests' in json:
|
|
2792
|
+
for v in json['personalization_requests']:
|
|
2793
|
+
yield PersonalizationRequest.from_dict(v)
|
|
2794
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2795
|
+
return
|
|
2796
|
+
query['page_token'] = json['next_page_token']
|
|
2797
|
+
|
|
2798
|
+
|
|
2799
|
+
class ConsumerProvidersAPI:
|
|
2800
|
+
"""Providers are the entities that publish listings to the Marketplace."""
|
|
2801
|
+
|
|
2802
|
+
def __init__(self, api_client):
|
|
2803
|
+
self._api = api_client
|
|
2804
|
+
|
|
2805
|
+
def get(self, id: str) -> GetProviderResponse:
|
|
2806
|
+
"""Get a provider.
|
|
2807
|
+
|
|
2808
|
+
Get a provider in the Databricks Marketplace with at least one visible listing.
|
|
2809
|
+
|
|
2810
|
+
:param id: str
|
|
2811
|
+
|
|
2812
|
+
:returns: :class:`GetProviderResponse`
|
|
2813
|
+
"""
|
|
2814
|
+
|
|
2815
|
+
headers = {'Accept': 'application/json', }
|
|
2816
|
+
|
|
2817
|
+
res = self._api.do('GET', f'/api/2.1/marketplace-consumer/providers/{id}', headers=headers)
|
|
2818
|
+
return GetProviderResponse.from_dict(res)
|
|
2819
|
+
|
|
2820
|
+
def list(self,
|
|
2821
|
+
*,
|
|
2822
|
+
is_featured: Optional[bool] = None,
|
|
2823
|
+
page_size: Optional[int] = None,
|
|
2824
|
+
page_token: Optional[str] = None) -> Iterator[ProviderInfo]:
|
|
2825
|
+
"""List providers.
|
|
2826
|
+
|
|
2827
|
+
List all providers in the Databricks Marketplace with at least one visible listing.
|
|
2828
|
+
|
|
2829
|
+
:param is_featured: bool (optional)
|
|
2830
|
+
:param page_size: int (optional)
|
|
2831
|
+
:param page_token: str (optional)
|
|
2832
|
+
|
|
2833
|
+
:returns: Iterator over :class:`ProviderInfo`
|
|
2834
|
+
"""
|
|
2835
|
+
|
|
2836
|
+
query = {}
|
|
2837
|
+
if is_featured is not None: query['is_featured'] = is_featured
|
|
2838
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2839
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2840
|
+
headers = {'Accept': 'application/json', }
|
|
2841
|
+
|
|
2842
|
+
while True:
|
|
2843
|
+
json = self._api.do('GET',
|
|
2844
|
+
'/api/2.1/marketplace-consumer/providers',
|
|
2845
|
+
query=query,
|
|
2846
|
+
headers=headers)
|
|
2847
|
+
if 'providers' in json:
|
|
2848
|
+
for v in json['providers']:
|
|
2849
|
+
yield ProviderInfo.from_dict(v)
|
|
2850
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2851
|
+
return
|
|
2852
|
+
query['page_token'] = json['next_page_token']
|
|
2853
|
+
|
|
2854
|
+
|
|
2855
|
+
class ProviderExchangeFiltersAPI:
|
|
2856
|
+
"""Marketplace exchanges filters curate which groups can access an exchange."""
|
|
2857
|
+
|
|
2858
|
+
def __init__(self, api_client):
|
|
2859
|
+
self._api = api_client
|
|
2860
|
+
|
|
2861
|
+
def create(self, filter: ExchangeFilter) -> CreateExchangeFilterResponse:
|
|
2862
|
+
"""Create a new exchange filter.
|
|
2863
|
+
|
|
2864
|
+
Add an exchange filter.
|
|
2865
|
+
|
|
2866
|
+
:param filter: :class:`ExchangeFilter`
|
|
2867
|
+
|
|
2868
|
+
:returns: :class:`CreateExchangeFilterResponse`
|
|
2869
|
+
"""
|
|
2870
|
+
body = {}
|
|
2871
|
+
if filter is not None: body['filter'] = filter.as_dict()
|
|
2872
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
2873
|
+
|
|
2874
|
+
res = self._api.do('POST', '/api/2.0/marketplace-exchange/filters', body=body, headers=headers)
|
|
2875
|
+
return CreateExchangeFilterResponse.from_dict(res)
|
|
2876
|
+
|
|
2877
|
+
def delete(self, id: str):
|
|
2878
|
+
"""Delete an exchange filter.
|
|
2879
|
+
|
|
2880
|
+
Delete an exchange filter
|
|
2881
|
+
|
|
2882
|
+
:param id: str
|
|
2883
|
+
|
|
2884
|
+
|
|
2885
|
+
"""
|
|
2886
|
+
|
|
2887
|
+
headers = {'Accept': 'application/json', }
|
|
2888
|
+
|
|
2889
|
+
self._api.do('DELETE', f'/api/2.0/marketplace-exchange/filters/{id}', headers=headers)
|
|
2890
|
+
|
|
2891
|
+
def list(self,
|
|
2892
|
+
exchange_id: str,
|
|
2893
|
+
*,
|
|
2894
|
+
page_size: Optional[int] = None,
|
|
2895
|
+
page_token: Optional[str] = None) -> Iterator[ExchangeFilter]:
|
|
2896
|
+
"""List exchange filters.
|
|
2897
|
+
|
|
2898
|
+
List exchange filter
|
|
2899
|
+
|
|
2900
|
+
:param exchange_id: str
|
|
2901
|
+
:param page_size: int (optional)
|
|
2902
|
+
:param page_token: str (optional)
|
|
2903
|
+
|
|
2904
|
+
:returns: Iterator over :class:`ExchangeFilter`
|
|
2905
|
+
"""
|
|
2906
|
+
|
|
2907
|
+
query = {}
|
|
2908
|
+
if exchange_id is not None: query['exchange_id'] = exchange_id
|
|
2909
|
+
if page_size is not None: query['page_size'] = page_size
|
|
2910
|
+
if page_token is not None: query['page_token'] = page_token
|
|
2911
|
+
headers = {'Accept': 'application/json', }
|
|
2912
|
+
|
|
2913
|
+
while True:
|
|
2914
|
+
json = self._api.do('GET', '/api/2.0/marketplace-exchange/filters', query=query, headers=headers)
|
|
2915
|
+
if 'filters' in json:
|
|
2916
|
+
for v in json['filters']:
|
|
2917
|
+
yield ExchangeFilter.from_dict(v)
|
|
2918
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
2919
|
+
return
|
|
2920
|
+
query['page_token'] = json['next_page_token']
|
|
2921
|
+
|
|
2922
|
+
def update(self, id: str, filter: ExchangeFilter) -> UpdateExchangeFilterResponse:
|
|
2923
|
+
"""Update exchange filter.
|
|
2924
|
+
|
|
2925
|
+
Update an exchange filter.
|
|
2926
|
+
|
|
2927
|
+
:param id: str
|
|
2928
|
+
:param filter: :class:`ExchangeFilter`
|
|
2929
|
+
|
|
2930
|
+
:returns: :class:`UpdateExchangeFilterResponse`
|
|
2931
|
+
"""
|
|
2932
|
+
body = {}
|
|
2933
|
+
if filter is not None: body['filter'] = filter.as_dict()
|
|
2934
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
2935
|
+
|
|
2936
|
+
res = self._api.do('PUT', f'/api/2.0/marketplace-exchange/filters/{id}', body=body, headers=headers)
|
|
2937
|
+
return UpdateExchangeFilterResponse.from_dict(res)
|
|
2938
|
+
|
|
2939
|
+
|
|
2940
|
+
class ProviderExchangesAPI:
|
|
2941
|
+
"""Marketplace exchanges allow providers to share their listings with a curated set of customers."""
|
|
2942
|
+
|
|
2943
|
+
def __init__(self, api_client):
|
|
2944
|
+
self._api = api_client
|
|
2945
|
+
|
|
2946
|
+
def add_listing_to_exchange(self, listing_id: str, exchange_id: str) -> AddExchangeForListingResponse:
|
|
2947
|
+
"""Add an exchange for listing.
|
|
2948
|
+
|
|
2949
|
+
Associate an exchange with a listing
|
|
2950
|
+
|
|
2951
|
+
:param listing_id: str
|
|
2952
|
+
:param exchange_id: str
|
|
2953
|
+
|
|
2954
|
+
:returns: :class:`AddExchangeForListingResponse`
|
|
2955
|
+
"""
|
|
2956
|
+
body = {}
|
|
2957
|
+
if exchange_id is not None: body['exchange_id'] = exchange_id
|
|
2958
|
+
if listing_id is not None: body['listing_id'] = listing_id
|
|
2959
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
2960
|
+
|
|
2961
|
+
res = self._api.do('POST',
|
|
2962
|
+
'/api/2.0/marketplace-exchange/exchanges-for-listing',
|
|
2963
|
+
body=body,
|
|
2964
|
+
headers=headers)
|
|
2965
|
+
return AddExchangeForListingResponse.from_dict(res)
|
|
2966
|
+
|
|
2967
|
+
def create(self, exchange: Exchange) -> CreateExchangeResponse:
|
|
2968
|
+
"""Create an exchange.
|
|
2969
|
+
|
|
2970
|
+
Create an exchange
|
|
2971
|
+
|
|
2972
|
+
:param exchange: :class:`Exchange`
|
|
2973
|
+
|
|
2974
|
+
:returns: :class:`CreateExchangeResponse`
|
|
2975
|
+
"""
|
|
2976
|
+
body = {}
|
|
2977
|
+
if exchange is not None: body['exchange'] = exchange.as_dict()
|
|
2978
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
2979
|
+
|
|
2980
|
+
res = self._api.do('POST', '/api/2.0/marketplace-exchange/exchanges', body=body, headers=headers)
|
|
2981
|
+
return CreateExchangeResponse.from_dict(res)
|
|
2982
|
+
|
|
2983
|
+
def delete(self, id: str):
|
|
2984
|
+
"""Delete an exchange.
|
|
2985
|
+
|
|
2986
|
+
This removes a listing from marketplace.
|
|
2987
|
+
|
|
2988
|
+
:param id: str
|
|
2989
|
+
|
|
2990
|
+
|
|
2991
|
+
"""
|
|
2992
|
+
|
|
2993
|
+
headers = {'Accept': 'application/json', }
|
|
2994
|
+
|
|
2995
|
+
self._api.do('DELETE', f'/api/2.0/marketplace-exchange/exchanges/{id}', headers=headers)
|
|
2996
|
+
|
|
2997
|
+
def delete_listing_from_exchange(self, id: str):
|
|
2998
|
+
"""Remove an exchange for listing.
|
|
2999
|
+
|
|
3000
|
+
Disassociate an exchange with a listing
|
|
3001
|
+
|
|
3002
|
+
:param id: str
|
|
3003
|
+
|
|
3004
|
+
|
|
3005
|
+
"""
|
|
3006
|
+
|
|
3007
|
+
headers = {'Accept': 'application/json', }
|
|
3008
|
+
|
|
3009
|
+
self._api.do('DELETE', f'/api/2.0/marketplace-exchange/exchanges-for-listing/{id}', headers=headers)
|
|
3010
|
+
|
|
3011
|
+
def get(self, id: str) -> GetExchangeResponse:
|
|
3012
|
+
"""Get an exchange.
|
|
3013
|
+
|
|
3014
|
+
Get an exchange.
|
|
3015
|
+
|
|
3016
|
+
:param id: str
|
|
3017
|
+
|
|
3018
|
+
:returns: :class:`GetExchangeResponse`
|
|
3019
|
+
"""
|
|
3020
|
+
|
|
3021
|
+
headers = {'Accept': 'application/json', }
|
|
3022
|
+
|
|
3023
|
+
res = self._api.do('GET', f'/api/2.0/marketplace-exchange/exchanges/{id}', headers=headers)
|
|
3024
|
+
return GetExchangeResponse.from_dict(res)
|
|
3025
|
+
|
|
3026
|
+
def list(self,
|
|
3027
|
+
*,
|
|
3028
|
+
page_size: Optional[int] = None,
|
|
3029
|
+
page_token: Optional[str] = None) -> Iterator[Exchange]:
|
|
3030
|
+
"""List exchanges.
|
|
3031
|
+
|
|
3032
|
+
List exchanges visible to provider
|
|
3033
|
+
|
|
3034
|
+
:param page_size: int (optional)
|
|
3035
|
+
:param page_token: str (optional)
|
|
3036
|
+
|
|
3037
|
+
:returns: Iterator over :class:`Exchange`
|
|
3038
|
+
"""
|
|
3039
|
+
|
|
3040
|
+
query = {}
|
|
3041
|
+
if page_size is not None: query['page_size'] = page_size
|
|
3042
|
+
if page_token is not None: query['page_token'] = page_token
|
|
3043
|
+
headers = {'Accept': 'application/json', }
|
|
3044
|
+
|
|
3045
|
+
while True:
|
|
3046
|
+
json = self._api.do('GET',
|
|
3047
|
+
'/api/2.0/marketplace-exchange/exchanges',
|
|
3048
|
+
query=query,
|
|
3049
|
+
headers=headers)
|
|
3050
|
+
if 'exchanges' in json:
|
|
3051
|
+
for v in json['exchanges']:
|
|
3052
|
+
yield Exchange.from_dict(v)
|
|
3053
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
3054
|
+
return
|
|
3055
|
+
query['page_token'] = json['next_page_token']
|
|
3056
|
+
|
|
3057
|
+
def list_exchanges_for_listing(self,
|
|
3058
|
+
listing_id: str,
|
|
3059
|
+
*,
|
|
3060
|
+
page_size: Optional[int] = None,
|
|
3061
|
+
page_token: Optional[str] = None) -> Iterator[ExchangeListing]:
|
|
3062
|
+
"""List exchanges for listing.
|
|
3063
|
+
|
|
3064
|
+
List exchanges associated with a listing
|
|
3065
|
+
|
|
3066
|
+
:param listing_id: str
|
|
3067
|
+
:param page_size: int (optional)
|
|
3068
|
+
:param page_token: str (optional)
|
|
3069
|
+
|
|
3070
|
+
:returns: Iterator over :class:`ExchangeListing`
|
|
3071
|
+
"""
|
|
3072
|
+
|
|
3073
|
+
query = {}
|
|
3074
|
+
if listing_id is not None: query['listing_id'] = listing_id
|
|
3075
|
+
if page_size is not None: query['page_size'] = page_size
|
|
3076
|
+
if page_token is not None: query['page_token'] = page_token
|
|
3077
|
+
headers = {'Accept': 'application/json', }
|
|
3078
|
+
|
|
3079
|
+
while True:
|
|
3080
|
+
json = self._api.do('GET',
|
|
3081
|
+
'/api/2.0/marketplace-exchange/exchanges-for-listing',
|
|
3082
|
+
query=query,
|
|
3083
|
+
headers=headers)
|
|
3084
|
+
if 'exchange_listing' in json:
|
|
3085
|
+
for v in json['exchange_listing']:
|
|
3086
|
+
yield ExchangeListing.from_dict(v)
|
|
3087
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
3088
|
+
return
|
|
3089
|
+
query['page_token'] = json['next_page_token']
|
|
3090
|
+
|
|
3091
|
+
def list_listings_for_exchange(self,
|
|
3092
|
+
exchange_id: str,
|
|
3093
|
+
*,
|
|
3094
|
+
page_size: Optional[int] = None,
|
|
3095
|
+
page_token: Optional[str] = None) -> Iterator[ExchangeListing]:
|
|
3096
|
+
"""List listings for exchange.
|
|
3097
|
+
|
|
3098
|
+
List listings associated with an exchange
|
|
3099
|
+
|
|
3100
|
+
:param exchange_id: str
|
|
3101
|
+
:param page_size: int (optional)
|
|
3102
|
+
:param page_token: str (optional)
|
|
3103
|
+
|
|
3104
|
+
:returns: Iterator over :class:`ExchangeListing`
|
|
3105
|
+
"""
|
|
3106
|
+
|
|
3107
|
+
query = {}
|
|
3108
|
+
if exchange_id is not None: query['exchange_id'] = exchange_id
|
|
3109
|
+
if page_size is not None: query['page_size'] = page_size
|
|
3110
|
+
if page_token is not None: query['page_token'] = page_token
|
|
3111
|
+
headers = {'Accept': 'application/json', }
|
|
3112
|
+
|
|
3113
|
+
while True:
|
|
3114
|
+
json = self._api.do('GET',
|
|
3115
|
+
'/api/2.0/marketplace-exchange/listings-for-exchange',
|
|
3116
|
+
query=query,
|
|
3117
|
+
headers=headers)
|
|
3118
|
+
if 'exchange_listings' in json:
|
|
3119
|
+
for v in json['exchange_listings']:
|
|
3120
|
+
yield ExchangeListing.from_dict(v)
|
|
3121
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
3122
|
+
return
|
|
3123
|
+
query['page_token'] = json['next_page_token']
|
|
3124
|
+
|
|
3125
|
+
def update(self, id: str, exchange: Exchange) -> UpdateExchangeResponse:
|
|
3126
|
+
"""Update exchange.
|
|
3127
|
+
|
|
3128
|
+
Update an exchange
|
|
3129
|
+
|
|
3130
|
+
:param id: str
|
|
3131
|
+
:param exchange: :class:`Exchange`
|
|
3132
|
+
|
|
3133
|
+
:returns: :class:`UpdateExchangeResponse`
|
|
3134
|
+
"""
|
|
3135
|
+
body = {}
|
|
3136
|
+
if exchange is not None: body['exchange'] = exchange.as_dict()
|
|
3137
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3138
|
+
|
|
3139
|
+
res = self._api.do('PUT', f'/api/2.0/marketplace-exchange/exchanges/{id}', body=body, headers=headers)
|
|
3140
|
+
return UpdateExchangeResponse.from_dict(res)
|
|
3141
|
+
|
|
3142
|
+
|
|
3143
|
+
class ProviderFilesAPI:
|
|
3144
|
+
"""Marketplace offers a set of file APIs for various purposes such as preview notebooks and provider icons."""
|
|
3145
|
+
|
|
3146
|
+
def __init__(self, api_client):
|
|
3147
|
+
self._api = api_client
|
|
3148
|
+
|
|
3149
|
+
def create(self,
|
|
3150
|
+
file_parent: FileParent,
|
|
3151
|
+
marketplace_file_type: MarketplaceFileType,
|
|
3152
|
+
mime_type: str,
|
|
3153
|
+
*,
|
|
3154
|
+
display_name: Optional[str] = None) -> CreateFileResponse:
|
|
3155
|
+
"""Create a file.
|
|
3156
|
+
|
|
3157
|
+
Create a file. Currently, only provider icons and attached notebooks are supported.
|
|
3158
|
+
|
|
3159
|
+
:param file_parent: :class:`FileParent`
|
|
3160
|
+
:param marketplace_file_type: :class:`MarketplaceFileType`
|
|
3161
|
+
:param mime_type: str
|
|
3162
|
+
:param display_name: str (optional)
|
|
3163
|
+
|
|
3164
|
+
:returns: :class:`CreateFileResponse`
|
|
3165
|
+
"""
|
|
3166
|
+
body = {}
|
|
3167
|
+
if display_name is not None: body['display_name'] = display_name
|
|
3168
|
+
if file_parent is not None: body['file_parent'] = file_parent.as_dict()
|
|
3169
|
+
if marketplace_file_type is not None: body['marketplace_file_type'] = marketplace_file_type.value
|
|
3170
|
+
if mime_type is not None: body['mime_type'] = mime_type
|
|
3171
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3172
|
+
|
|
3173
|
+
res = self._api.do('POST', '/api/2.0/marketplace-provider/files', body=body, headers=headers)
|
|
3174
|
+
return CreateFileResponse.from_dict(res)
|
|
3175
|
+
|
|
3176
|
+
def delete(self, file_id: str):
|
|
3177
|
+
"""Delete a file.
|
|
3178
|
+
|
|
3179
|
+
Delete a file
|
|
3180
|
+
|
|
3181
|
+
:param file_id: str
|
|
3182
|
+
|
|
3183
|
+
|
|
3184
|
+
"""
|
|
3185
|
+
|
|
3186
|
+
headers = {'Accept': 'application/json', }
|
|
3187
|
+
|
|
3188
|
+
self._api.do('DELETE', f'/api/2.0/marketplace-provider/files/{file_id}', headers=headers)
|
|
3189
|
+
|
|
3190
|
+
def get(self, file_id: str) -> GetFileResponse:
|
|
3191
|
+
"""Get a file.
|
|
3192
|
+
|
|
3193
|
+
Get a file
|
|
3194
|
+
|
|
3195
|
+
:param file_id: str
|
|
3196
|
+
|
|
3197
|
+
:returns: :class:`GetFileResponse`
|
|
3198
|
+
"""
|
|
3199
|
+
|
|
3200
|
+
headers = {'Accept': 'application/json', }
|
|
3201
|
+
|
|
3202
|
+
res = self._api.do('GET', f'/api/2.0/marketplace-provider/files/{file_id}', headers=headers)
|
|
3203
|
+
return GetFileResponse.from_dict(res)
|
|
3204
|
+
|
|
3205
|
+
def list(self,
|
|
3206
|
+
file_parent: FileParent,
|
|
3207
|
+
*,
|
|
3208
|
+
page_size: Optional[int] = None,
|
|
3209
|
+
page_token: Optional[str] = None) -> Iterator[FileInfo]:
|
|
3210
|
+
"""List files.
|
|
3211
|
+
|
|
3212
|
+
List files attached to a parent entity.
|
|
3213
|
+
|
|
3214
|
+
:param file_parent: :class:`FileParent`
|
|
3215
|
+
:param page_size: int (optional)
|
|
3216
|
+
:param page_token: str (optional)
|
|
3217
|
+
|
|
3218
|
+
:returns: Iterator over :class:`FileInfo`
|
|
3219
|
+
"""
|
|
3220
|
+
|
|
3221
|
+
query = {}
|
|
3222
|
+
if file_parent is not None: query['file_parent'] = file_parent.as_dict()
|
|
3223
|
+
if page_size is not None: query['page_size'] = page_size
|
|
3224
|
+
if page_token is not None: query['page_token'] = page_token
|
|
3225
|
+
headers = {'Accept': 'application/json', }
|
|
3226
|
+
|
|
3227
|
+
while True:
|
|
3228
|
+
json = self._api.do('GET', '/api/2.0/marketplace-provider/files', query=query, headers=headers)
|
|
3229
|
+
if 'file_infos' in json:
|
|
3230
|
+
for v in json['file_infos']:
|
|
3231
|
+
yield FileInfo.from_dict(v)
|
|
3232
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
3233
|
+
return
|
|
3234
|
+
query['page_token'] = json['next_page_token']
|
|
3235
|
+
|
|
3236
|
+
|
|
3237
|
+
class ProviderListingsAPI:
|
|
3238
|
+
"""Listings are the core entities in the Marketplace. They represent the products that are available for
|
|
3239
|
+
consumption."""
|
|
3240
|
+
|
|
3241
|
+
def __init__(self, api_client):
|
|
3242
|
+
self._api = api_client
|
|
3243
|
+
|
|
3244
|
+
def create(self, listing: Listing) -> CreateListingResponse:
|
|
3245
|
+
"""Create a listing.
|
|
3246
|
+
|
|
3247
|
+
Create a new listing
|
|
3248
|
+
|
|
3249
|
+
:param listing: :class:`Listing`
|
|
3250
|
+
|
|
3251
|
+
:returns: :class:`CreateListingResponse`
|
|
3252
|
+
"""
|
|
3253
|
+
body = {}
|
|
3254
|
+
if listing is not None: body['listing'] = listing.as_dict()
|
|
3255
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3256
|
+
|
|
3257
|
+
res = self._api.do('POST', '/api/2.0/marketplace-provider/listing', body=body, headers=headers)
|
|
3258
|
+
return CreateListingResponse.from_dict(res)
|
|
3259
|
+
|
|
3260
|
+
def delete(self, id: str):
|
|
3261
|
+
"""Delete a listing.
|
|
3262
|
+
|
|
3263
|
+
Delete a listing
|
|
3264
|
+
|
|
3265
|
+
:param id: str
|
|
3266
|
+
|
|
3267
|
+
|
|
3268
|
+
"""
|
|
3269
|
+
|
|
3270
|
+
headers = {'Accept': 'application/json', }
|
|
3271
|
+
|
|
3272
|
+
self._api.do('DELETE', f'/api/2.0/marketplace-provider/listings/{id}', headers=headers)
|
|
3273
|
+
|
|
3274
|
+
def get(self, id: str) -> GetListingResponse:
|
|
3275
|
+
"""Get a listing.
|
|
3276
|
+
|
|
3277
|
+
Get a listing
|
|
3278
|
+
|
|
3279
|
+
:param id: str
|
|
3280
|
+
|
|
3281
|
+
:returns: :class:`GetListingResponse`
|
|
3282
|
+
"""
|
|
3283
|
+
|
|
3284
|
+
headers = {'Accept': 'application/json', }
|
|
3285
|
+
|
|
3286
|
+
res = self._api.do('GET', f'/api/2.0/marketplace-provider/listings/{id}', headers=headers)
|
|
3287
|
+
return GetListingResponse.from_dict(res)
|
|
3288
|
+
|
|
3289
|
+
def list(self, *, page_size: Optional[int] = None, page_token: Optional[str] = None) -> Iterator[Listing]:
|
|
3290
|
+
"""List listings.
|
|
3291
|
+
|
|
3292
|
+
List listings owned by this provider
|
|
3293
|
+
|
|
3294
|
+
:param page_size: int (optional)
|
|
3295
|
+
:param page_token: str (optional)
|
|
3296
|
+
|
|
3297
|
+
:returns: Iterator over :class:`Listing`
|
|
3298
|
+
"""
|
|
3299
|
+
|
|
3300
|
+
query = {}
|
|
3301
|
+
if page_size is not None: query['page_size'] = page_size
|
|
3302
|
+
if page_token is not None: query['page_token'] = page_token
|
|
3303
|
+
headers = {'Accept': 'application/json', }
|
|
3304
|
+
|
|
3305
|
+
while True:
|
|
3306
|
+
json = self._api.do('GET', '/api/2.0/marketplace-provider/listings', query=query, headers=headers)
|
|
3307
|
+
if 'listings' in json:
|
|
3308
|
+
for v in json['listings']:
|
|
3309
|
+
yield Listing.from_dict(v)
|
|
3310
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
3311
|
+
return
|
|
3312
|
+
query['page_token'] = json['next_page_token']
|
|
3313
|
+
|
|
3314
|
+
def update(self, id: str, listing: Listing) -> UpdateListingResponse:
|
|
3315
|
+
"""Update listing.
|
|
3316
|
+
|
|
3317
|
+
Update a listing
|
|
3318
|
+
|
|
3319
|
+
:param id: str
|
|
3320
|
+
:param listing: :class:`Listing`
|
|
3321
|
+
|
|
3322
|
+
:returns: :class:`UpdateListingResponse`
|
|
3323
|
+
"""
|
|
3324
|
+
body = {}
|
|
3325
|
+
if listing is not None: body['listing'] = listing.as_dict()
|
|
3326
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3327
|
+
|
|
3328
|
+
res = self._api.do('PUT', f'/api/2.0/marketplace-provider/listings/{id}', body=body, headers=headers)
|
|
3329
|
+
return UpdateListingResponse.from_dict(res)
|
|
3330
|
+
|
|
3331
|
+
|
|
3332
|
+
class ProviderPersonalizationRequestsAPI:
|
|
3333
|
+
"""Personalization requests are an alternate to instantly available listings. Control the lifecycle of
|
|
3334
|
+
personalized solutions."""
|
|
3335
|
+
|
|
3336
|
+
def __init__(self, api_client):
|
|
3337
|
+
self._api = api_client
|
|
3338
|
+
|
|
3339
|
+
def list(self,
|
|
3340
|
+
*,
|
|
3341
|
+
page_size: Optional[int] = None,
|
|
3342
|
+
page_token: Optional[str] = None) -> Iterator[PersonalizationRequest]:
|
|
3343
|
+
"""All personalization requests across all listings.
|
|
3344
|
+
|
|
3345
|
+
List personalization requests to this provider. This will return all personalization requests,
|
|
3346
|
+
regardless of which listing they are for.
|
|
3347
|
+
|
|
3348
|
+
:param page_size: int (optional)
|
|
3349
|
+
:param page_token: str (optional)
|
|
3350
|
+
|
|
3351
|
+
:returns: Iterator over :class:`PersonalizationRequest`
|
|
3352
|
+
"""
|
|
3353
|
+
|
|
3354
|
+
query = {}
|
|
3355
|
+
if page_size is not None: query['page_size'] = page_size
|
|
3356
|
+
if page_token is not None: query['page_token'] = page_token
|
|
3357
|
+
headers = {'Accept': 'application/json', }
|
|
3358
|
+
|
|
3359
|
+
while True:
|
|
3360
|
+
json = self._api.do('GET',
|
|
3361
|
+
'/api/2.0/marketplace-provider/personalization-requests',
|
|
3362
|
+
query=query,
|
|
3363
|
+
headers=headers)
|
|
3364
|
+
if 'personalization_requests' in json:
|
|
3365
|
+
for v in json['personalization_requests']:
|
|
3366
|
+
yield PersonalizationRequest.from_dict(v)
|
|
3367
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
3368
|
+
return
|
|
3369
|
+
query['page_token'] = json['next_page_token']
|
|
3370
|
+
|
|
3371
|
+
def update(self,
|
|
3372
|
+
listing_id: str,
|
|
3373
|
+
request_id: str,
|
|
3374
|
+
status: PersonalizationRequestStatus,
|
|
3375
|
+
*,
|
|
3376
|
+
reason: Optional[str] = None,
|
|
3377
|
+
share: Optional[ShareInfo] = None) -> UpdatePersonalizationRequestResponse:
|
|
3378
|
+
"""Update personalization request status.
|
|
3379
|
+
|
|
3380
|
+
Update personalization request. This method only permits updating the status of the request.
|
|
3381
|
+
|
|
3382
|
+
:param listing_id: str
|
|
3383
|
+
:param request_id: str
|
|
3384
|
+
:param status: :class:`PersonalizationRequestStatus`
|
|
3385
|
+
:param reason: str (optional)
|
|
3386
|
+
:param share: :class:`ShareInfo` (optional)
|
|
3387
|
+
|
|
3388
|
+
:returns: :class:`UpdatePersonalizationRequestResponse`
|
|
3389
|
+
"""
|
|
3390
|
+
body = {}
|
|
3391
|
+
if reason is not None: body['reason'] = reason
|
|
3392
|
+
if share is not None: body['share'] = share.as_dict()
|
|
3393
|
+
if status is not None: body['status'] = status.value
|
|
3394
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3395
|
+
|
|
3396
|
+
res = self._api.do(
|
|
3397
|
+
'PUT',
|
|
3398
|
+
f'/api/2.0/marketplace-provider/listings/{listing_id}/personalization-requests/{request_id}/request-status',
|
|
3399
|
+
body=body,
|
|
3400
|
+
headers=headers)
|
|
3401
|
+
return UpdatePersonalizationRequestResponse.from_dict(res)
|
|
3402
|
+
|
|
3403
|
+
|
|
3404
|
+
class ProviderProviderAnalyticsDashboardsAPI:
|
|
3405
|
+
"""Manage templated analytics solution for providers."""
|
|
3406
|
+
|
|
3407
|
+
def __init__(self, api_client):
|
|
3408
|
+
self._api = api_client
|
|
3409
|
+
|
|
3410
|
+
def create(self) -> ProviderAnalyticsDashboard:
|
|
3411
|
+
"""Create provider analytics dashboard.
|
|
3412
|
+
|
|
3413
|
+
Create provider analytics dashboard. Returns Marketplace specific `id`. Not to be confused with the
|
|
3414
|
+
Lakeview dashboard id.
|
|
3415
|
+
|
|
3416
|
+
:returns: :class:`ProviderAnalyticsDashboard`
|
|
3417
|
+
"""
|
|
3418
|
+
|
|
3419
|
+
headers = {'Accept': 'application/json', }
|
|
3420
|
+
|
|
3421
|
+
res = self._api.do('POST', '/api/2.0/marketplace-provider/analytics_dashboard', headers=headers)
|
|
3422
|
+
return ProviderAnalyticsDashboard.from_dict(res)
|
|
3423
|
+
|
|
3424
|
+
def get(self) -> ListProviderAnalyticsDashboardResponse:
|
|
3425
|
+
"""Get provider analytics dashboard.
|
|
3426
|
+
|
|
3427
|
+
Get provider analytics dashboard.
|
|
3428
|
+
|
|
3429
|
+
:returns: :class:`ListProviderAnalyticsDashboardResponse`
|
|
3430
|
+
"""
|
|
3431
|
+
|
|
3432
|
+
headers = {'Accept': 'application/json', }
|
|
3433
|
+
|
|
3434
|
+
res = self._api.do('GET', '/api/2.0/marketplace-provider/analytics_dashboard', headers=headers)
|
|
3435
|
+
return ListProviderAnalyticsDashboardResponse.from_dict(res)
|
|
3436
|
+
|
|
3437
|
+
def get_latest_version(self) -> GetLatestVersionProviderAnalyticsDashboardResponse:
|
|
3438
|
+
"""Get latest version of provider analytics dashboard.
|
|
3439
|
+
|
|
3440
|
+
Get latest version of provider analytics dashboard.
|
|
3441
|
+
|
|
3442
|
+
:returns: :class:`GetLatestVersionProviderAnalyticsDashboardResponse`
|
|
3443
|
+
"""
|
|
3444
|
+
|
|
3445
|
+
headers = {'Accept': 'application/json', }
|
|
3446
|
+
|
|
3447
|
+
res = self._api.do('GET', '/api/2.0/marketplace-provider/analytics_dashboard/latest', headers=headers)
|
|
3448
|
+
return GetLatestVersionProviderAnalyticsDashboardResponse.from_dict(res)
|
|
3449
|
+
|
|
3450
|
+
def update(self, id: str, *, version: Optional[int] = None) -> UpdateProviderAnalyticsDashboardResponse:
|
|
3451
|
+
"""Update provider analytics dashboard.
|
|
3452
|
+
|
|
3453
|
+
Update provider analytics dashboard.
|
|
3454
|
+
|
|
3455
|
+
:param id: str
|
|
3456
|
+
id is immutable property and can't be updated.
|
|
3457
|
+
:param version: int (optional)
|
|
3458
|
+
this is the version of the dashboard template we want to update our user to current expectation is
|
|
3459
|
+
that it should be equal to latest version of the dashboard template
|
|
3460
|
+
|
|
3461
|
+
:returns: :class:`UpdateProviderAnalyticsDashboardResponse`
|
|
3462
|
+
"""
|
|
3463
|
+
body = {}
|
|
3464
|
+
if version is not None: body['version'] = version
|
|
3465
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3466
|
+
|
|
3467
|
+
res = self._api.do('PUT',
|
|
3468
|
+
f'/api/2.0/marketplace-provider/analytics_dashboard/{id}',
|
|
3469
|
+
body=body,
|
|
3470
|
+
headers=headers)
|
|
3471
|
+
return UpdateProviderAnalyticsDashboardResponse.from_dict(res)
|
|
3472
|
+
|
|
3473
|
+
|
|
3474
|
+
class ProviderProvidersAPI:
|
|
3475
|
+
"""Providers are entities that manage assets in Marketplace."""
|
|
3476
|
+
|
|
3477
|
+
def __init__(self, api_client):
|
|
3478
|
+
self._api = api_client
|
|
3479
|
+
|
|
3480
|
+
def create(self, provider: ProviderInfo) -> CreateProviderResponse:
|
|
3481
|
+
"""Create a provider.
|
|
3482
|
+
|
|
3483
|
+
Create a provider
|
|
3484
|
+
|
|
3485
|
+
:param provider: :class:`ProviderInfo`
|
|
3486
|
+
|
|
3487
|
+
:returns: :class:`CreateProviderResponse`
|
|
3488
|
+
"""
|
|
3489
|
+
body = {}
|
|
3490
|
+
if provider is not None: body['provider'] = provider.as_dict()
|
|
3491
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3492
|
+
|
|
3493
|
+
res = self._api.do('POST', '/api/2.0/marketplace-provider/provider', body=body, headers=headers)
|
|
3494
|
+
return CreateProviderResponse.from_dict(res)
|
|
3495
|
+
|
|
3496
|
+
def delete(self, id: str):
|
|
3497
|
+
"""Delete provider.
|
|
3498
|
+
|
|
3499
|
+
Delete provider
|
|
3500
|
+
|
|
3501
|
+
:param id: str
|
|
3502
|
+
|
|
3503
|
+
|
|
3504
|
+
"""
|
|
3505
|
+
|
|
3506
|
+
headers = {'Accept': 'application/json', }
|
|
3507
|
+
|
|
3508
|
+
self._api.do('DELETE', f'/api/2.0/marketplace-provider/providers/{id}', headers=headers)
|
|
3509
|
+
|
|
3510
|
+
def get(self, id: str) -> GetProviderResponse:
|
|
3511
|
+
"""Get provider.
|
|
3512
|
+
|
|
3513
|
+
Get provider profile
|
|
3514
|
+
|
|
3515
|
+
:param id: str
|
|
3516
|
+
|
|
3517
|
+
:returns: :class:`GetProviderResponse`
|
|
3518
|
+
"""
|
|
3519
|
+
|
|
3520
|
+
headers = {'Accept': 'application/json', }
|
|
3521
|
+
|
|
3522
|
+
res = self._api.do('GET', f'/api/2.0/marketplace-provider/providers/{id}', headers=headers)
|
|
3523
|
+
return GetProviderResponse.from_dict(res)
|
|
3524
|
+
|
|
3525
|
+
def list(self,
|
|
3526
|
+
*,
|
|
3527
|
+
page_size: Optional[int] = None,
|
|
3528
|
+
page_token: Optional[str] = None) -> Iterator[ProviderInfo]:
|
|
3529
|
+
"""List providers.
|
|
3530
|
+
|
|
3531
|
+
List provider profiles for account.
|
|
3532
|
+
|
|
3533
|
+
:param page_size: int (optional)
|
|
3534
|
+
:param page_token: str (optional)
|
|
3535
|
+
|
|
3536
|
+
:returns: Iterator over :class:`ProviderInfo`
|
|
3537
|
+
"""
|
|
3538
|
+
|
|
3539
|
+
query = {}
|
|
3540
|
+
if page_size is not None: query['page_size'] = page_size
|
|
3541
|
+
if page_token is not None: query['page_token'] = page_token
|
|
3542
|
+
headers = {'Accept': 'application/json', }
|
|
3543
|
+
|
|
3544
|
+
while True:
|
|
3545
|
+
json = self._api.do('GET',
|
|
3546
|
+
'/api/2.0/marketplace-provider/providers',
|
|
3547
|
+
query=query,
|
|
3548
|
+
headers=headers)
|
|
3549
|
+
if 'providers' in json:
|
|
3550
|
+
for v in json['providers']:
|
|
3551
|
+
yield ProviderInfo.from_dict(v)
|
|
3552
|
+
if 'next_page_token' not in json or not json['next_page_token']:
|
|
3553
|
+
return
|
|
3554
|
+
query['page_token'] = json['next_page_token']
|
|
3555
|
+
|
|
3556
|
+
def update(self, id: str, provider: ProviderInfo) -> UpdateProviderResponse:
|
|
3557
|
+
"""Update provider.
|
|
3558
|
+
|
|
3559
|
+
Update provider profile
|
|
3560
|
+
|
|
3561
|
+
:param id: str
|
|
3562
|
+
:param provider: :class:`ProviderInfo`
|
|
3563
|
+
|
|
3564
|
+
:returns: :class:`UpdateProviderResponse`
|
|
3565
|
+
"""
|
|
3566
|
+
body = {}
|
|
3567
|
+
if provider is not None: body['provider'] = provider.as_dict()
|
|
3568
|
+
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
3569
|
+
|
|
3570
|
+
res = self._api.do('PUT', f'/api/2.0/marketplace-provider/providers/{id}', body=body, headers=headers)
|
|
3571
|
+
return UpdateProviderResponse.from_dict(res)
|