databricks-sdk 0.55.0__py3-none-any.whl → 0.57.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of databricks-sdk might be problematic. Click here for more details.

Files changed (31) hide show
  1. databricks/sdk/__init__.py +41 -24
  2. databricks/sdk/service/aibuilder.py +505 -0
  3. databricks/sdk/service/apps.py +14 -42
  4. databricks/sdk/service/billing.py +167 -220
  5. databricks/sdk/service/catalog.py +462 -1235
  6. databricks/sdk/service/cleanrooms.py +26 -43
  7. databricks/sdk/service/compute.py +75 -211
  8. databricks/sdk/service/dashboards.py +77 -511
  9. databricks/sdk/service/database.py +1271 -0
  10. databricks/sdk/service/files.py +20 -54
  11. databricks/sdk/service/iam.py +61 -171
  12. databricks/sdk/service/jobs.py +453 -68
  13. databricks/sdk/service/marketplace.py +46 -146
  14. databricks/sdk/service/ml.py +453 -477
  15. databricks/sdk/service/oauth2.py +17 -45
  16. databricks/sdk/service/pipelines.py +125 -40
  17. databricks/sdk/service/provisioning.py +30 -93
  18. databricks/sdk/service/qualitymonitorv2.py +265 -0
  19. databricks/sdk/service/serving.py +106 -46
  20. databricks/sdk/service/settings.py +1062 -390
  21. databricks/sdk/service/sharing.py +33 -88
  22. databricks/sdk/service/sql.py +292 -185
  23. databricks/sdk/service/vectorsearch.py +13 -43
  24. databricks/sdk/service/workspace.py +35 -105
  25. databricks/sdk/version.py +1 -1
  26. {databricks_sdk-0.55.0.dist-info → databricks_sdk-0.57.0.dist-info}/METADATA +1 -1
  27. {databricks_sdk-0.55.0.dist-info → databricks_sdk-0.57.0.dist-info}/RECORD +31 -28
  28. {databricks_sdk-0.55.0.dist-info → databricks_sdk-0.57.0.dist-info}/WHEEL +0 -0
  29. {databricks_sdk-0.55.0.dist-info → databricks_sdk-0.57.0.dist-info}/licenses/LICENSE +0 -0
  30. {databricks_sdk-0.55.0.dist-info → databricks_sdk-0.57.0.dist-info}/licenses/NOTICE +0 -0
  31. {databricks_sdk-0.55.0.dist-info → databricks_sdk-0.57.0.dist-info}/top_level.txt +0 -0
@@ -102,76 +102,6 @@ class AuthorizationDetailsGrantRule:
102
102
  return cls(permission_set=d.get("permission_set", None))
103
103
 
104
104
 
105
- @dataclass
106
- class CancelQueryExecutionResponse:
107
- status: Optional[List[CancelQueryExecutionResponseStatus]] = None
108
-
109
- def as_dict(self) -> dict:
110
- """Serializes the CancelQueryExecutionResponse into a dictionary suitable for use as a JSON request body."""
111
- body = {}
112
- if self.status:
113
- body["status"] = [v.as_dict() for v in self.status]
114
- return body
115
-
116
- def as_shallow_dict(self) -> dict:
117
- """Serializes the CancelQueryExecutionResponse into a shallow dictionary of its immediate attributes."""
118
- body = {}
119
- if self.status:
120
- body["status"] = self.status
121
- return body
122
-
123
- @classmethod
124
- def from_dict(cls, d: Dict[str, Any]) -> CancelQueryExecutionResponse:
125
- """Deserializes the CancelQueryExecutionResponse from a dictionary."""
126
- return cls(status=_repeated_dict(d, "status", CancelQueryExecutionResponseStatus))
127
-
128
-
129
- @dataclass
130
- class CancelQueryExecutionResponseStatus:
131
- data_token: str
132
- """The token to poll for result asynchronously Example:
133
- EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ"""
134
-
135
- pending: Optional[Empty] = None
136
- """Represents an empty message, similar to google.protobuf.Empty, which is not available in the
137
- firm right now."""
138
-
139
- success: Optional[Empty] = None
140
- """Represents an empty message, similar to google.protobuf.Empty, which is not available in the
141
- firm right now."""
142
-
143
- def as_dict(self) -> dict:
144
- """Serializes the CancelQueryExecutionResponseStatus into a dictionary suitable for use as a JSON request body."""
145
- body = {}
146
- if self.data_token is not None:
147
- body["data_token"] = self.data_token
148
- if self.pending:
149
- body["pending"] = self.pending.as_dict()
150
- if self.success:
151
- body["success"] = self.success.as_dict()
152
- return body
153
-
154
- def as_shallow_dict(self) -> dict:
155
- """Serializes the CancelQueryExecutionResponseStatus into a shallow dictionary of its immediate attributes."""
156
- body = {}
157
- if self.data_token is not None:
158
- body["data_token"] = self.data_token
159
- if self.pending:
160
- body["pending"] = self.pending
161
- if self.success:
162
- body["success"] = self.success
163
- return body
164
-
165
- @classmethod
166
- def from_dict(cls, d: Dict[str, Any]) -> CancelQueryExecutionResponseStatus:
167
- """Deserializes the CancelQueryExecutionResponseStatus from a dictionary."""
168
- return cls(
169
- data_token=d.get("data_token", None),
170
- pending=_from_dict(d, "pending", Empty),
171
- success=_from_dict(d, "success", Empty),
172
- )
173
-
174
-
175
105
  @dataclass
176
106
  class CronSchedule:
177
107
  quartz_cron_expression: str
@@ -359,94 +289,6 @@ class DeleteSubscriptionResponse:
359
289
  return cls()
360
290
 
361
291
 
362
- @dataclass
363
- class Empty:
364
- """Represents an empty message, similar to google.protobuf.Empty, which is not available in the
365
- firm right now."""
366
-
367
- def as_dict(self) -> dict:
368
- """Serializes the Empty into a dictionary suitable for use as a JSON request body."""
369
- body = {}
370
- return body
371
-
372
- def as_shallow_dict(self) -> dict:
373
- """Serializes the Empty into a shallow dictionary of its immediate attributes."""
374
- body = {}
375
- return body
376
-
377
- @classmethod
378
- def from_dict(cls, d: Dict[str, Any]) -> Empty:
379
- """Deserializes the Empty from a dictionary."""
380
- return cls()
381
-
382
-
383
- @dataclass
384
- class ExecutePublishedDashboardQueryRequest:
385
- """Execute query request for published Dashboards. Since published dashboards have the option of
386
- running as the publisher, the datasets, warehouse_id are excluded from the request and instead
387
- read from the source (lakeview-config) via the additional parameters (dashboardName and
388
- dashboardRevisionId)"""
389
-
390
- dashboard_name: str
391
- """Dashboard name and revision_id is required to retrieve PublishedDatasetDataModel which contains
392
- the list of datasets, warehouse_id, and embedded_credentials"""
393
-
394
- dashboard_revision_id: str
395
-
396
- override_warehouse_id: Optional[str] = None
397
- """A dashboard schedule can override the warehouse used as compute for processing the published
398
- dashboard queries"""
399
-
400
- def as_dict(self) -> dict:
401
- """Serializes the ExecutePublishedDashboardQueryRequest into a dictionary suitable for use as a JSON request body."""
402
- body = {}
403
- if self.dashboard_name is not None:
404
- body["dashboard_name"] = self.dashboard_name
405
- if self.dashboard_revision_id is not None:
406
- body["dashboard_revision_id"] = self.dashboard_revision_id
407
- if self.override_warehouse_id is not None:
408
- body["override_warehouse_id"] = self.override_warehouse_id
409
- return body
410
-
411
- def as_shallow_dict(self) -> dict:
412
- """Serializes the ExecutePublishedDashboardQueryRequest into a shallow dictionary of its immediate attributes."""
413
- body = {}
414
- if self.dashboard_name is not None:
415
- body["dashboard_name"] = self.dashboard_name
416
- if self.dashboard_revision_id is not None:
417
- body["dashboard_revision_id"] = self.dashboard_revision_id
418
- if self.override_warehouse_id is not None:
419
- body["override_warehouse_id"] = self.override_warehouse_id
420
- return body
421
-
422
- @classmethod
423
- def from_dict(cls, d: Dict[str, Any]) -> ExecutePublishedDashboardQueryRequest:
424
- """Deserializes the ExecutePublishedDashboardQueryRequest from a dictionary."""
425
- return cls(
426
- dashboard_name=d.get("dashboard_name", None),
427
- dashboard_revision_id=d.get("dashboard_revision_id", None),
428
- override_warehouse_id=d.get("override_warehouse_id", None),
429
- )
430
-
431
-
432
- @dataclass
433
- class ExecuteQueryResponse:
434
- def as_dict(self) -> dict:
435
- """Serializes the ExecuteQueryResponse into a dictionary suitable for use as a JSON request body."""
436
- body = {}
437
- return body
438
-
439
- def as_shallow_dict(self) -> dict:
440
- """Serializes the ExecuteQueryResponse into a shallow dictionary of its immediate attributes."""
441
- body = {}
442
- return body
443
-
444
- @classmethod
445
- def from_dict(cls, d: Dict[str, Any]) -> ExecuteQueryResponse:
446
- """Deserializes the ExecuteQueryResponse from a dictionary."""
447
- return cls()
448
-
449
-
450
292
  @dataclass
451
293
  class GenieAttachment:
452
294
  """Genie AI Response"""
@@ -687,6 +529,38 @@ class GenieGetMessageQueryResultResponse:
687
529
  return cls(statement_response=_from_dict(d, "statement_response", sql.StatementResponse))
688
530
 
689
531
 
532
+ @dataclass
533
+ class GenieListSpacesResponse:
534
+ next_page_token: Optional[str] = None
535
+ """Token to get the next page of results"""
536
+
537
+ spaces: Optional[List[GenieSpace]] = None
538
+ """List of Genie spaces"""
539
+
540
+ def as_dict(self) -> dict:
541
+ """Serializes the GenieListSpacesResponse into a dictionary suitable for use as a JSON request body."""
542
+ body = {}
543
+ if self.next_page_token is not None:
544
+ body["next_page_token"] = self.next_page_token
545
+ if self.spaces:
546
+ body["spaces"] = [v.as_dict() for v in self.spaces]
547
+ return body
548
+
549
+ def as_shallow_dict(self) -> dict:
550
+ """Serializes the GenieListSpacesResponse into a shallow dictionary of its immediate attributes."""
551
+ body = {}
552
+ if self.next_page_token is not None:
553
+ body["next_page_token"] = self.next_page_token
554
+ if self.spaces:
555
+ body["spaces"] = self.spaces
556
+ return body
557
+
558
+ @classmethod
559
+ def from_dict(cls, d: Dict[str, Any]) -> GenieListSpacesResponse:
560
+ """Deserializes the GenieListSpacesResponse from a dictionary."""
561
+ return cls(next_page_token=d.get("next_page_token", None), spaces=_repeated_dict(d, "spaces", GenieSpace))
562
+
563
+
690
564
  @dataclass
691
565
  class GenieMessage:
692
566
  id: str
@@ -1043,24 +917,6 @@ class GenieStartConversationResponse:
1043
917
  )
1044
918
 
1045
919
 
1046
- @dataclass
1047
- class GetPublishedDashboardEmbeddedResponse:
1048
- def as_dict(self) -> dict:
1049
- """Serializes the GetPublishedDashboardEmbeddedResponse into a dictionary suitable for use as a JSON request body."""
1050
- body = {}
1051
- return body
1052
-
1053
- def as_shallow_dict(self) -> dict:
1054
- """Serializes the GetPublishedDashboardEmbeddedResponse into a shallow dictionary of its immediate attributes."""
1055
- body = {}
1056
- return body
1057
-
1058
- @classmethod
1059
- def from_dict(cls, d: Dict[str, Any]) -> GetPublishedDashboardEmbeddedResponse:
1060
- """Deserializes the GetPublishedDashboardEmbeddedResponse from a dictionary."""
1061
- return cls()
1062
-
1063
-
1064
920
  @dataclass
1065
921
  class GetPublishedDashboardTokenInfoResponse:
1066
922
  authorization_details: Optional[List[AuthorizationDetails]] = None
@@ -1381,80 +1237,6 @@ class MigrateDashboardRequest:
1381
1237
  )
1382
1238
 
1383
1239
 
1384
- @dataclass
1385
- class PendingStatus:
1386
- data_token: str
1387
- """The token to poll for result asynchronously Example:
1388
- EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ"""
1389
-
1390
- def as_dict(self) -> dict:
1391
- """Serializes the PendingStatus into a dictionary suitable for use as a JSON request body."""
1392
- body = {}
1393
- if self.data_token is not None:
1394
- body["data_token"] = self.data_token
1395
- return body
1396
-
1397
- def as_shallow_dict(self) -> dict:
1398
- """Serializes the PendingStatus into a shallow dictionary of its immediate attributes."""
1399
- body = {}
1400
- if self.data_token is not None:
1401
- body["data_token"] = self.data_token
1402
- return body
1403
-
1404
- @classmethod
1405
- def from_dict(cls, d: Dict[str, Any]) -> PendingStatus:
1406
- """Deserializes the PendingStatus from a dictionary."""
1407
- return cls(data_token=d.get("data_token", None))
1408
-
1409
-
1410
- @dataclass
1411
- class PollQueryStatusResponse:
1412
- data: Optional[List[PollQueryStatusResponseData]] = None
1413
-
1414
- def as_dict(self) -> dict:
1415
- """Serializes the PollQueryStatusResponse into a dictionary suitable for use as a JSON request body."""
1416
- body = {}
1417
- if self.data:
1418
- body["data"] = [v.as_dict() for v in self.data]
1419
- return body
1420
-
1421
- def as_shallow_dict(self) -> dict:
1422
- """Serializes the PollQueryStatusResponse into a shallow dictionary of its immediate attributes."""
1423
- body = {}
1424
- if self.data:
1425
- body["data"] = self.data
1426
- return body
1427
-
1428
- @classmethod
1429
- def from_dict(cls, d: Dict[str, Any]) -> PollQueryStatusResponse:
1430
- """Deserializes the PollQueryStatusResponse from a dictionary."""
1431
- return cls(data=_repeated_dict(d, "data", PollQueryStatusResponseData))
1432
-
1433
-
1434
- @dataclass
1435
- class PollQueryStatusResponseData:
1436
- status: QueryResponseStatus
1437
-
1438
- def as_dict(self) -> dict:
1439
- """Serializes the PollQueryStatusResponseData into a dictionary suitable for use as a JSON request body."""
1440
- body = {}
1441
- if self.status:
1442
- body["status"] = self.status.as_dict()
1443
- return body
1444
-
1445
- def as_shallow_dict(self) -> dict:
1446
- """Serializes the PollQueryStatusResponseData into a shallow dictionary of its immediate attributes."""
1447
- body = {}
1448
- if self.status:
1449
- body["status"] = self.status
1450
- return body
1451
-
1452
- @classmethod
1453
- def from_dict(cls, d: Dict[str, Any]) -> PollQueryStatusResponseData:
1454
- """Deserializes the PollQueryStatusResponseData from a dictionary."""
1455
- return cls(status=_from_dict(d, "status", QueryResponseStatus))
1456
-
1457
-
1458
1240
  @dataclass
1459
1241
  class PublishRequest:
1460
1242
  dashboard_id: Optional[str] = None
@@ -1550,67 +1332,6 @@ class PublishedDashboard:
1550
1332
  )
1551
1333
 
1552
1334
 
1553
- @dataclass
1554
- class QueryResponseStatus:
1555
- canceled: Optional[Empty] = None
1556
- """Represents an empty message, similar to google.protobuf.Empty, which is not available in the
1557
- firm right now."""
1558
-
1559
- closed: Optional[Empty] = None
1560
- """Represents an empty message, similar to google.protobuf.Empty, which is not available in the
1561
- firm right now."""
1562
-
1563
- pending: Optional[PendingStatus] = None
1564
-
1565
- statement_id: Optional[str] = None
1566
- """The statement id in format(01eef5da-c56e-1f36-bafa-21906587d6ba) The statement_id should be
1567
- identical to data_token in SuccessStatus and PendingStatus. This field is created for audit
1568
- logging purpose to record the statement_id of all QueryResponseStatus."""
1569
-
1570
- success: Optional[SuccessStatus] = None
1571
-
1572
- def as_dict(self) -> dict:
1573
- """Serializes the QueryResponseStatus into a dictionary suitable for use as a JSON request body."""
1574
- body = {}
1575
- if self.canceled:
1576
- body["canceled"] = self.canceled.as_dict()
1577
- if self.closed:
1578
- body["closed"] = self.closed.as_dict()
1579
- if self.pending:
1580
- body["pending"] = self.pending.as_dict()
1581
- if self.statement_id is not None:
1582
- body["statement_id"] = self.statement_id
1583
- if self.success:
1584
- body["success"] = self.success.as_dict()
1585
- return body
1586
-
1587
- def as_shallow_dict(self) -> dict:
1588
- """Serializes the QueryResponseStatus into a shallow dictionary of its immediate attributes."""
1589
- body = {}
1590
- if self.canceled:
1591
- body["canceled"] = self.canceled
1592
- if self.closed:
1593
- body["closed"] = self.closed
1594
- if self.pending:
1595
- body["pending"] = self.pending
1596
- if self.statement_id is not None:
1597
- body["statement_id"] = self.statement_id
1598
- if self.success:
1599
- body["success"] = self.success
1600
- return body
1601
-
1602
- @classmethod
1603
- def from_dict(cls, d: Dict[str, Any]) -> QueryResponseStatus:
1604
- """Deserializes the QueryResponseStatus from a dictionary."""
1605
- return cls(
1606
- canceled=_from_dict(d, "canceled", Empty),
1607
- closed=_from_dict(d, "closed", Empty),
1608
- pending=_from_dict(d, "pending", PendingStatus),
1609
- statement_id=d.get("statement_id", None),
1610
- success=_from_dict(d, "success", SuccessStatus),
1611
- )
1612
-
1613
-
1614
1335
  @dataclass
1615
1336
  class Result:
1616
1337
  is_truncated: Optional[bool] = None
@@ -1926,39 +1647,6 @@ class SubscriptionSubscriberUser:
1926
1647
  return cls(user_id=d.get("user_id", None))
1927
1648
 
1928
1649
 
1929
- @dataclass
1930
- class SuccessStatus:
1931
- data_token: str
1932
- """The token to poll for result asynchronously Example:
1933
- EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ"""
1934
-
1935
- truncated: Optional[bool] = None
1936
- """Whether the query result is truncated (either by byte limit or row limit)"""
1937
-
1938
- def as_dict(self) -> dict:
1939
- """Serializes the SuccessStatus into a dictionary suitable for use as a JSON request body."""
1940
- body = {}
1941
- if self.data_token is not None:
1942
- body["data_token"] = self.data_token
1943
- if self.truncated is not None:
1944
- body["truncated"] = self.truncated
1945
- return body
1946
-
1947
- def as_shallow_dict(self) -> dict:
1948
- """Serializes the SuccessStatus into a shallow dictionary of its immediate attributes."""
1949
- body = {}
1950
- if self.data_token is not None:
1951
- body["data_token"] = self.data_token
1952
- if self.truncated is not None:
1953
- body["truncated"] = self.truncated
1954
- return body
1955
-
1956
- @classmethod
1957
- def from_dict(cls, d: Dict[str, Any]) -> SuccessStatus:
1958
- """Deserializes the SuccessStatus from a dictionary."""
1959
- return cls(data_token=d.get("data_token", None), truncated=d.get("truncated", None))
1960
-
1961
-
1962
1650
  @dataclass
1963
1651
  class TextAttachment:
1964
1652
  content: Optional[str] = None
@@ -2070,9 +1758,7 @@ class GenieAPI:
2070
1758
  raise TimeoutError(f"timed out after {timeout}: {status_message}")
2071
1759
 
2072
1760
  def create_message(self, space_id: str, conversation_id: str, content: str) -> Wait[GenieMessage]:
2073
- """Create conversation message.
2074
-
2075
- Create new message in a [conversation](:method:genie/startconversation). The AI response uses all
1761
+ """Create new message in a [conversation](:method:genie/startconversation). The AI response uses all
2076
1762
  previously created messages in the conversation to respond.
2077
1763
 
2078
1764
  :param space_id: str
@@ -2118,9 +1804,7 @@ class GenieAPI:
2118
1804
  def execute_message_attachment_query(
2119
1805
  self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
2120
1806
  ) -> GenieGetMessageQueryResultResponse:
2121
- """Execute message attachment SQL query.
2122
-
2123
- Execute the SQL for a message query attachment. Use this API when the query attachment has expired and
1807
+ """Execute the SQL for a message query attachment. Use this API when the query attachment has expired and
2124
1808
  needs to be re-executed.
2125
1809
 
2126
1810
  :param space_id: str
@@ -2149,9 +1833,7 @@ class GenieAPI:
2149
1833
  def execute_message_query(
2150
1834
  self, space_id: str, conversation_id: str, message_id: str
2151
1835
  ) -> GenieGetMessageQueryResultResponse:
2152
- """[Deprecated] Execute SQL query in a conversation message.
2153
-
2154
- Execute the SQL query in the message.
1836
+ """Execute the SQL query in the message.
2155
1837
 
2156
1838
  :param space_id: str
2157
1839
  Genie space ID
@@ -2177,9 +1859,7 @@ class GenieAPI:
2177
1859
  def generate_download_full_query_result(
2178
1860
  self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
2179
1861
  ) -> GenieGenerateDownloadFullQueryResultResponse:
2180
- """Generate full query result download.
2181
-
2182
- Initiates a new SQL execution and returns a `download_id` that you can use to track the progress of
1862
+ """Initiates a new SQL execution and returns a `download_id` that you can use to track the progress of
2183
1863
  the download. The query result is stored in an external link and can be retrieved using the [Get
2184
1864
  Download Full Query Result](:method:genie/getdownloadfullqueryresult) API. Warning: Databricks
2185
1865
  strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition.
@@ -2211,9 +1891,7 @@ class GenieAPI:
2211
1891
  def get_download_full_query_result(
2212
1892
  self, space_id: str, conversation_id: str, message_id: str, attachment_id: str, download_id: str
2213
1893
  ) -> GenieGetDownloadFullQueryResultResponse:
2214
- """Get download full query result.
2215
-
2216
- After [Generating a Full Query Result Download](:method:genie/getdownloadfullqueryresult) and
1894
+ """After [Generating a Full Query Result Download](:method:genie/getdownloadfullqueryresult) and
2217
1895
  successfully receiving a `download_id`, use this API to poll the download progress. When the download
2218
1896
  is complete, the API returns one or more external links to the query result files. Warning: Databricks
2219
1897
  strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition.
@@ -2248,9 +1926,7 @@ class GenieAPI:
2248
1926
  return GenieGetDownloadFullQueryResultResponse.from_dict(res)
2249
1927
 
2250
1928
  def get_message(self, space_id: str, conversation_id: str, message_id: str) -> GenieMessage:
2251
- """Get conversation message.
2252
-
2253
- Get message from conversation.
1929
+ """Get message from conversation.
2254
1930
 
2255
1931
  :param space_id: str
2256
1932
  The ID associated with the Genie space where the target conversation is located.
@@ -2276,9 +1952,7 @@ class GenieAPI:
2276
1952
  def get_message_attachment_query_result(
2277
1953
  self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
2278
1954
  ) -> GenieGetMessageQueryResultResponse:
2279
- """Get message attachment SQL query result.
2280
-
2281
- Get the result of SQL query if the message has a query attachment. This is only available if a message
1955
+ """Get the result of SQL query if the message has a query attachment. This is only available if a message
2282
1956
  has a query attachment and the message status is `EXECUTING_QUERY` OR `COMPLETED`.
2283
1957
 
2284
1958
  :param space_id: str
@@ -2307,9 +1981,7 @@ class GenieAPI:
2307
1981
  def get_message_query_result(
2308
1982
  self, space_id: str, conversation_id: str, message_id: str
2309
1983
  ) -> GenieGetMessageQueryResultResponse:
2310
- """[Deprecated] Get conversation message SQL query result.
2311
-
2312
- Get the result of SQL query if the message has a query attachment. This is only available if a message
1984
+ """Get the result of SQL query if the message has a query attachment. This is only available if a message
2313
1985
  has a query attachment and the message status is `EXECUTING_QUERY`.
2314
1986
 
2315
1987
  :param space_id: str
@@ -2336,9 +2008,7 @@ class GenieAPI:
2336
2008
  def get_message_query_result_by_attachment(
2337
2009
  self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
2338
2010
  ) -> GenieGetMessageQueryResultResponse:
2339
- """[Deprecated] Get conversation message SQL query result.
2340
-
2341
- Get the result of SQL query if the message has a query attachment. This is only available if a message
2011
+ """Get the result of SQL query if the message has a query attachment. This is only available if a message
2342
2012
  has a query attachment and the message status is `EXECUTING_QUERY` OR `COMPLETED`.
2343
2013
 
2344
2014
  :param space_id: str
@@ -2365,9 +2035,7 @@ class GenieAPI:
2365
2035
  return GenieGetMessageQueryResultResponse.from_dict(res)
2366
2036
 
2367
2037
  def get_space(self, space_id: str) -> GenieSpace:
2368
- """Get Genie Space.
2369
-
2370
- Get details of a Genie Space.
2038
+ """Get details of a Genie Space.
2371
2039
 
2372
2040
  :param space_id: str
2373
2041
  The ID associated with the Genie space
@@ -2382,10 +2050,33 @@ class GenieAPI:
2382
2050
  res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}", headers=headers)
2383
2051
  return GenieSpace.from_dict(res)
2384
2052
 
2385
- def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]:
2386
- """Start conversation.
2053
+ def list_spaces(
2054
+ self, *, page_size: Optional[int] = None, page_token: Optional[str] = None
2055
+ ) -> GenieListSpacesResponse:
2056
+ """Get list of Genie Spaces.
2387
2057
 
2388
- Start a new conversation.
2058
+ :param page_size: int (optional)
2059
+ Maximum number of spaces to return per page
2060
+ :param page_token: str (optional)
2061
+ Pagination token for getting the next page of results
2062
+
2063
+ :returns: :class:`GenieListSpacesResponse`
2064
+ """
2065
+
2066
+ query = {}
2067
+ if page_size is not None:
2068
+ query["page_size"] = page_size
2069
+ if page_token is not None:
2070
+ query["page_token"] = page_token
2071
+ headers = {
2072
+ "Accept": "application/json",
2073
+ }
2074
+
2075
+ res = self._api.do("GET", "/api/2.0/genie/spaces", query=query, headers=headers)
2076
+ return GenieListSpacesResponse.from_dict(res)
2077
+
2078
+ def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]:
2079
+ """Start a new conversation.
2389
2080
 
2390
2081
  :param space_id: str
2391
2082
  The ID associated with the Genie space where you want to start a conversation.
@@ -2427,9 +2118,7 @@ class LakeviewAPI:
2427
2118
  self._api = api_client
2428
2119
 
2429
2120
  def create(self, dashboard: Dashboard) -> Dashboard:
2430
- """Create dashboard.
2431
-
2432
- Create a draft dashboard.
2121
+ """Create a draft dashboard.
2433
2122
 
2434
2123
  :param dashboard: :class:`Dashboard`
2435
2124
 
@@ -2548,9 +2237,7 @@ class LakeviewAPI:
2548
2237
  )
2549
2238
 
2550
2239
  def get(self, dashboard_id: str) -> Dashboard:
2551
- """Get dashboard.
2552
-
2553
- Get a draft dashboard.
2240
+ """Get a draft dashboard.
2554
2241
 
2555
2242
  :param dashboard_id: str
2556
2243
  UUID identifying the dashboard.
@@ -2566,9 +2253,7 @@ class LakeviewAPI:
2566
2253
  return Dashboard.from_dict(res)
2567
2254
 
2568
2255
  def get_published(self, dashboard_id: str) -> PublishedDashboard:
2569
- """Get published dashboard.
2570
-
2571
- Get the current published dashboard.
2256
+ """Get the current published dashboard.
2572
2257
 
2573
2258
  :param dashboard_id: str
2574
2259
  UUID identifying the published dashboard.
@@ -2758,9 +2443,7 @@ class LakeviewAPI:
2758
2443
  parent_path: Optional[str] = None,
2759
2444
  update_parameter_syntax: Optional[bool] = None,
2760
2445
  ) -> Dashboard:
2761
- """Migrate dashboard.
2762
-
2763
- Migrates a classic SQL dashboard to Lakeview.
2446
+ """Migrates a classic SQL dashboard to Lakeview.
2764
2447
 
2765
2448
  :param source_dashboard_id: str
2766
2449
  UUID of the dashboard to be migrated.
@@ -2794,9 +2477,7 @@ class LakeviewAPI:
2794
2477
  def publish(
2795
2478
  self, dashboard_id: str, *, embed_credentials: Optional[bool] = None, warehouse_id: Optional[str] = None
2796
2479
  ) -> PublishedDashboard:
2797
- """Publish dashboard.
2798
-
2799
- Publish the current draft dashboard.
2480
+ """Publish the current draft dashboard.
2800
2481
 
2801
2482
  :param dashboard_id: str
2802
2483
  UUID identifying the dashboard to be published.
@@ -2822,9 +2503,7 @@ class LakeviewAPI:
2822
2503
  return PublishedDashboard.from_dict(res)
2823
2504
 
2824
2505
  def trash(self, dashboard_id: str):
2825
- """Trash dashboard.
2826
-
2827
- Trash a dashboard.
2506
+ """Trash a dashboard.
2828
2507
 
2829
2508
  :param dashboard_id: str
2830
2509
  UUID identifying the dashboard.
@@ -2839,9 +2518,7 @@ class LakeviewAPI:
2839
2518
  self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}", headers=headers)
2840
2519
 
2841
2520
  def unpublish(self, dashboard_id: str):
2842
- """Unpublish dashboard.
2843
-
2844
- Unpublish the dashboard.
2521
+ """Unpublish the dashboard.
2845
2522
 
2846
2523
  :param dashboard_id: str
2847
2524
  UUID identifying the published dashboard.
@@ -2856,9 +2533,7 @@ class LakeviewAPI:
2856
2533
  self._api.do("DELETE", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published", headers=headers)
2857
2534
 
2858
2535
  def update(self, dashboard_id: str, dashboard: Dashboard) -> Dashboard:
2859
- """Update dashboard.
2860
-
2861
- Update a draft dashboard.
2536
+ """Update a draft dashboard.
2862
2537
 
2863
2538
  :param dashboard_id: str
2864
2539
  UUID identifying the dashboard.
@@ -2904,29 +2579,10 @@ class LakeviewEmbeddedAPI:
2904
2579
  def __init__(self, api_client):
2905
2580
  self._api = api_client
2906
2581
 
2907
- def get_published_dashboard_embedded(self, dashboard_id: str):
2908
- """Read a published dashboard in an embedded ui.
2909
-
2910
- Get the current published dashboard within an embedded context.
2911
-
2912
- :param dashboard_id: str
2913
- UUID identifying the published dashboard.
2914
-
2915
-
2916
- """
2917
-
2918
- headers = {
2919
- "Accept": "application/json",
2920
- }
2921
-
2922
- self._api.do("GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published/embedded", headers=headers)
2923
-
2924
2582
  def get_published_dashboard_token_info(
2925
2583
  self, dashboard_id: str, *, external_value: Optional[str] = None, external_viewer_id: Optional[str] = None
2926
2584
  ) -> GetPublishedDashboardTokenInfoResponse:
2927
- """Read an information of a published dashboard to mint an OAuth token.
2928
-
2929
- Get a required authorization details and scopes of a published dashboard to mint an OAuth token. The
2585
+ """Get a required authorization details and scopes of a published dashboard to mint an OAuth token. The
2930
2586
  `authorization_details` can be enriched to apply additional restriction.
2931
2587
 
2932
2588
  Example: Adding the following `authorization_details` object to downscope the viewer permission to
@@ -2956,93 +2612,3 @@ class LakeviewEmbeddedAPI:
2956
2612
  "GET", f"/api/2.0/lakeview/dashboards/{dashboard_id}/published/tokeninfo", query=query, headers=headers
2957
2613
  )
2958
2614
  return GetPublishedDashboardTokenInfoResponse.from_dict(res)
2959
-
2960
-
2961
- class QueryExecutionAPI:
2962
- """Query execution APIs for AI / BI Dashboards"""
2963
-
2964
- def __init__(self, api_client):
2965
- self._api = api_client
2966
-
2967
- def cancel_published_query_execution(
2968
- self, dashboard_name: str, dashboard_revision_id: str, *, tokens: Optional[List[str]] = None
2969
- ) -> CancelQueryExecutionResponse:
2970
- """Cancel the results for the a query for a published, embedded dashboard.
2971
-
2972
- :param dashboard_name: str
2973
- :param dashboard_revision_id: str
2974
- :param tokens: List[str] (optional)
2975
- Example: EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ
2976
-
2977
- :returns: :class:`CancelQueryExecutionResponse`
2978
- """
2979
-
2980
- query = {}
2981
- if dashboard_name is not None:
2982
- query["dashboard_name"] = dashboard_name
2983
- if dashboard_revision_id is not None:
2984
- query["dashboard_revision_id"] = dashboard_revision_id
2985
- if tokens is not None:
2986
- query["tokens"] = [v for v in tokens]
2987
- headers = {
2988
- "Accept": "application/json",
2989
- }
2990
-
2991
- res = self._api.do("DELETE", "/api/2.0/lakeview-query/query/published", query=query, headers=headers)
2992
- return CancelQueryExecutionResponse.from_dict(res)
2993
-
2994
- def execute_published_dashboard_query(
2995
- self, dashboard_name: str, dashboard_revision_id: str, *, override_warehouse_id: Optional[str] = None
2996
- ):
2997
- """Execute a query for a published dashboard.
2998
-
2999
- :param dashboard_name: str
3000
- Dashboard name and revision_id is required to retrieve PublishedDatasetDataModel which contains the
3001
- list of datasets, warehouse_id, and embedded_credentials
3002
- :param dashboard_revision_id: str
3003
- :param override_warehouse_id: str (optional)
3004
- A dashboard schedule can override the warehouse used as compute for processing the published
3005
- dashboard queries
3006
-
3007
-
3008
- """
3009
- body = {}
3010
- if dashboard_name is not None:
3011
- body["dashboard_name"] = dashboard_name
3012
- if dashboard_revision_id is not None:
3013
- body["dashboard_revision_id"] = dashboard_revision_id
3014
- if override_warehouse_id is not None:
3015
- body["override_warehouse_id"] = override_warehouse_id
3016
- headers = {
3017
- "Accept": "application/json",
3018
- "Content-Type": "application/json",
3019
- }
3020
-
3021
- self._api.do("POST", "/api/2.0/lakeview-query/query/published", body=body, headers=headers)
3022
-
3023
- def poll_published_query_status(
3024
- self, dashboard_name: str, dashboard_revision_id: str, *, tokens: Optional[List[str]] = None
3025
- ) -> PollQueryStatusResponse:
3026
- """Poll the results for the a query for a published, embedded dashboard.
3027
-
3028
- :param dashboard_name: str
3029
- :param dashboard_revision_id: str
3030
- :param tokens: List[str] (optional)
3031
- Example: EC0A..ChAB7WCEn_4Qo4vkLqEbXsxxEgh3Y2pbWw45WhoQXgZSQo9aS5q2ZvFcbvbx9CgA-PAEAQ
3032
-
3033
- :returns: :class:`PollQueryStatusResponse`
3034
- """
3035
-
3036
- query = {}
3037
- if dashboard_name is not None:
3038
- query["dashboard_name"] = dashboard_name
3039
- if dashboard_revision_id is not None:
3040
- query["dashboard_revision_id"] = dashboard_revision_id
3041
- if tokens is not None:
3042
- query["tokens"] = [v for v in tokens]
3043
- headers = {
3044
- "Accept": "application/json",
3045
- }
3046
-
3047
- res = self._api.do("GET", "/api/2.0/lakeview-query/query/published", query=query, headers=headers)
3048
- return PollQueryStatusResponse.from_dict(res)