databricks-sdk 0.58.0__py3-none-any.whl → 0.60.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 (34) hide show
  1. databricks/sdk/__init__.py +18 -10
  2. databricks/sdk/credentials_provider.py +2 -2
  3. databricks/sdk/mixins/files.py +43 -15
  4. databricks/sdk/mixins/open_ai_client.py +28 -7
  5. databricks/sdk/oidc.py +6 -2
  6. databricks/sdk/service/{aibuilder.py → agentbricks.py} +5 -132
  7. databricks/sdk/service/apps.py +52 -46
  8. databricks/sdk/service/billing.py +9 -200
  9. databricks/sdk/service/catalog.py +5501 -7697
  10. databricks/sdk/service/cleanrooms.py +24 -54
  11. databricks/sdk/service/compute.py +456 -2515
  12. databricks/sdk/service/dashboards.py +1 -177
  13. databricks/sdk/service/database.py +34 -53
  14. databricks/sdk/service/files.py +2 -218
  15. databricks/sdk/service/iam.py +16 -295
  16. databricks/sdk/service/jobs.py +108 -1171
  17. databricks/sdk/service/marketplace.py +0 -573
  18. databricks/sdk/service/ml.py +76 -2445
  19. databricks/sdk/service/oauth2.py +122 -237
  20. databricks/sdk/service/pipelines.py +180 -752
  21. databricks/sdk/service/provisioning.py +0 -603
  22. databricks/sdk/service/serving.py +5 -577
  23. databricks/sdk/service/settings.py +192 -1560
  24. databricks/sdk/service/sharing.py +5 -470
  25. databricks/sdk/service/sql.py +117 -1704
  26. databricks/sdk/service/vectorsearch.py +0 -391
  27. databricks/sdk/service/workspace.py +250 -721
  28. databricks/sdk/version.py +1 -1
  29. {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/METADATA +1 -1
  30. {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/RECORD +34 -34
  31. {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/WHEEL +0 -0
  32. {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/licenses/LICENSE +0 -0
  33. {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/licenses/NOTICE +0 -0
  34. {databricks_sdk-0.58.0.dist-info → databricks_sdk-0.60.0.dist-info}/top_level.txt +0 -0
@@ -665,10 +665,9 @@ class AlertV2:
665
665
  """Text of the query to be run."""
666
666
 
667
667
  run_as_user_name: Optional[str] = None
668
- """The run as username or application ID of service principal. This field is set to "Unavailable"
669
- if the user has been deleted. On Create and Update, this field can be set to application ID of
670
- an active service principal. Setting this field requires the servicePrincipal/user role. If not
671
- specified it'll default to be request user."""
668
+ """The run as username or application ID of service principal. On Create and Update, this field can
669
+ be set to application ID of an active service principal. Setting this field requires the
670
+ servicePrincipal/user role."""
672
671
 
673
672
  schedule: Optional[CronSchedule] = None
674
673
 
@@ -1374,101 +1373,6 @@ class ComparisonOperator(Enum):
1374
1373
  NOT_EQUAL = "NOT_EQUAL"
1375
1374
 
1376
1375
 
1377
- @dataclass
1378
- class CreateAlert:
1379
- name: str
1380
- """Name of the alert."""
1381
-
1382
- options: AlertOptions
1383
- """Alert configuration options."""
1384
-
1385
- query_id: str
1386
- """Query ID."""
1387
-
1388
- parent: Optional[str] = None
1389
- """The identifier of the workspace folder containing the object."""
1390
-
1391
- rearm: Optional[int] = None
1392
- """Number of seconds after being triggered before the alert rearms itself and can be triggered
1393
- again. If `null`, alert will never be triggered again."""
1394
-
1395
- def as_dict(self) -> dict:
1396
- """Serializes the CreateAlert into a dictionary suitable for use as a JSON request body."""
1397
- body = {}
1398
- if self.name is not None:
1399
- body["name"] = self.name
1400
- if self.options:
1401
- body["options"] = self.options.as_dict()
1402
- if self.parent is not None:
1403
- body["parent"] = self.parent
1404
- if self.query_id is not None:
1405
- body["query_id"] = self.query_id
1406
- if self.rearm is not None:
1407
- body["rearm"] = self.rearm
1408
- return body
1409
-
1410
- def as_shallow_dict(self) -> dict:
1411
- """Serializes the CreateAlert into a shallow dictionary of its immediate attributes."""
1412
- body = {}
1413
- if self.name is not None:
1414
- body["name"] = self.name
1415
- if self.options:
1416
- body["options"] = self.options
1417
- if self.parent is not None:
1418
- body["parent"] = self.parent
1419
- if self.query_id is not None:
1420
- body["query_id"] = self.query_id
1421
- if self.rearm is not None:
1422
- body["rearm"] = self.rearm
1423
- return body
1424
-
1425
- @classmethod
1426
- def from_dict(cls, d: Dict[str, Any]) -> CreateAlert:
1427
- """Deserializes the CreateAlert from a dictionary."""
1428
- return cls(
1429
- name=d.get("name", None),
1430
- options=_from_dict(d, "options", AlertOptions),
1431
- parent=d.get("parent", None),
1432
- query_id=d.get("query_id", None),
1433
- rearm=d.get("rearm", None),
1434
- )
1435
-
1436
-
1437
- @dataclass
1438
- class CreateAlertRequest:
1439
- alert: Optional[CreateAlertRequestAlert] = None
1440
-
1441
- auto_resolve_display_name: Optional[bool] = None
1442
- """If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the
1443
- alert's display name conflicts with an existing alert's display name."""
1444
-
1445
- def as_dict(self) -> dict:
1446
- """Serializes the CreateAlertRequest into a dictionary suitable for use as a JSON request body."""
1447
- body = {}
1448
- if self.alert:
1449
- body["alert"] = self.alert.as_dict()
1450
- if self.auto_resolve_display_name is not None:
1451
- body["auto_resolve_display_name"] = self.auto_resolve_display_name
1452
- return body
1453
-
1454
- def as_shallow_dict(self) -> dict:
1455
- """Serializes the CreateAlertRequest into a shallow dictionary of its immediate attributes."""
1456
- body = {}
1457
- if self.alert:
1458
- body["alert"] = self.alert
1459
- if self.auto_resolve_display_name is not None:
1460
- body["auto_resolve_display_name"] = self.auto_resolve_display_name
1461
- return body
1462
-
1463
- @classmethod
1464
- def from_dict(cls, d: Dict[str, Any]) -> CreateAlertRequest:
1465
- """Deserializes the CreateAlertRequest from a dictionary."""
1466
- return cls(
1467
- alert=_from_dict(d, "alert", CreateAlertRequestAlert),
1468
- auto_resolve_display_name=d.get("auto_resolve_display_name", None),
1469
- )
1470
-
1471
-
1472
1376
  @dataclass
1473
1377
  class CreateAlertRequestAlert:
1474
1378
  condition: Optional[AlertCondition] = None
@@ -1558,41 +1462,6 @@ class CreateAlertRequestAlert:
1558
1462
  )
1559
1463
 
1560
1464
 
1561
- @dataclass
1562
- class CreateQueryRequest:
1563
- auto_resolve_display_name: Optional[bool] = None
1564
- """If true, automatically resolve query display name conflicts. Otherwise, fail the request if the
1565
- query's display name conflicts with an existing query's display name."""
1566
-
1567
- query: Optional[CreateQueryRequestQuery] = None
1568
-
1569
- def as_dict(self) -> dict:
1570
- """Serializes the CreateQueryRequest into a dictionary suitable for use as a JSON request body."""
1571
- body = {}
1572
- if self.auto_resolve_display_name is not None:
1573
- body["auto_resolve_display_name"] = self.auto_resolve_display_name
1574
- if self.query:
1575
- body["query"] = self.query.as_dict()
1576
- return body
1577
-
1578
- def as_shallow_dict(self) -> dict:
1579
- """Serializes the CreateQueryRequest into a shallow dictionary of its immediate attributes."""
1580
- body = {}
1581
- if self.auto_resolve_display_name is not None:
1582
- body["auto_resolve_display_name"] = self.auto_resolve_display_name
1583
- if self.query:
1584
- body["query"] = self.query
1585
- return body
1586
-
1587
- @classmethod
1588
- def from_dict(cls, d: Dict[str, Any]) -> CreateQueryRequest:
1589
- """Deserializes the CreateQueryRequest from a dictionary."""
1590
- return cls(
1591
- auto_resolve_display_name=d.get("auto_resolve_display_name", None),
1592
- query=_from_dict(d, "query", CreateQueryRequestQuery),
1593
- )
1594
-
1595
-
1596
1465
  @dataclass
1597
1466
  class CreateQueryRequestQuery:
1598
1467
  apply_auto_limit: Optional[bool] = None
@@ -1699,92 +1568,6 @@ class CreateQueryRequestQuery:
1699
1568
  )
1700
1569
 
1701
1570
 
1702
- @dataclass
1703
- class CreateQueryVisualizationsLegacyRequest:
1704
- """Add visualization to a query"""
1705
-
1706
- options: Any
1707
- """The options object varies widely from one visualization type to the next and is unsupported.
1708
- Databricks does not recommend modifying visualization settings in JSON."""
1709
-
1710
- query_id: str
1711
- """The identifier returned by :method:queries/create"""
1712
-
1713
- type: str
1714
- """The type of visualization: chart, table, pivot table, and so on."""
1715
-
1716
- description: Optional[str] = None
1717
- """A short description of this visualization. This is not displayed in the UI."""
1718
-
1719
- name: Optional[str] = None
1720
- """The name of the visualization that appears on dashboards and the query screen."""
1721
-
1722
- def as_dict(self) -> dict:
1723
- """Serializes the CreateQueryVisualizationsLegacyRequest into a dictionary suitable for use as a JSON request body."""
1724
- body = {}
1725
- if self.description is not None:
1726
- body["description"] = self.description
1727
- if self.name is not None:
1728
- body["name"] = self.name
1729
- if self.options:
1730
- body["options"] = self.options
1731
- if self.query_id is not None:
1732
- body["query_id"] = self.query_id
1733
- if self.type is not None:
1734
- body["type"] = self.type
1735
- return body
1736
-
1737
- def as_shallow_dict(self) -> dict:
1738
- """Serializes the CreateQueryVisualizationsLegacyRequest into a shallow dictionary of its immediate attributes."""
1739
- body = {}
1740
- if self.description is not None:
1741
- body["description"] = self.description
1742
- if self.name is not None:
1743
- body["name"] = self.name
1744
- if self.options:
1745
- body["options"] = self.options
1746
- if self.query_id is not None:
1747
- body["query_id"] = self.query_id
1748
- if self.type is not None:
1749
- body["type"] = self.type
1750
- return body
1751
-
1752
- @classmethod
1753
- def from_dict(cls, d: Dict[str, Any]) -> CreateQueryVisualizationsLegacyRequest:
1754
- """Deserializes the CreateQueryVisualizationsLegacyRequest from a dictionary."""
1755
- return cls(
1756
- description=d.get("description", None),
1757
- name=d.get("name", None),
1758
- options=d.get("options", None),
1759
- query_id=d.get("query_id", None),
1760
- type=d.get("type", None),
1761
- )
1762
-
1763
-
1764
- @dataclass
1765
- class CreateVisualizationRequest:
1766
- visualization: Optional[CreateVisualizationRequestVisualization] = None
1767
-
1768
- def as_dict(self) -> dict:
1769
- """Serializes the CreateVisualizationRequest into a dictionary suitable for use as a JSON request body."""
1770
- body = {}
1771
- if self.visualization:
1772
- body["visualization"] = self.visualization.as_dict()
1773
- return body
1774
-
1775
- def as_shallow_dict(self) -> dict:
1776
- """Serializes the CreateVisualizationRequest into a shallow dictionary of its immediate attributes."""
1777
- body = {}
1778
- if self.visualization:
1779
- body["visualization"] = self.visualization
1780
- return body
1781
-
1782
- @classmethod
1783
- def from_dict(cls, d: Dict[str, Any]) -> CreateVisualizationRequest:
1784
- """Deserializes the CreateVisualizationRequest from a dictionary."""
1785
- return cls(visualization=_from_dict(d, "visualization", CreateVisualizationRequestVisualization))
1786
-
1787
-
1788
1571
  @dataclass
1789
1572
  class CreateVisualizationRequestVisualization:
1790
1573
  display_name: Optional[str] = None
@@ -1846,156 +1629,6 @@ class CreateVisualizationRequestVisualization:
1846
1629
  )
1847
1630
 
1848
1631
 
1849
- @dataclass
1850
- class CreateWarehouseRequest:
1851
- auto_stop_mins: Optional[int] = None
1852
- """The amount of time in minutes that a SQL warehouse must be idle (i.e., no RUNNING queries)
1853
- before it is automatically stopped.
1854
-
1855
- Supported values: - Must be >= 0 mins for serverless warehouses - Must be == 0 or >= 10 mins for
1856
- non-serverless warehouses - 0 indicates no autostop.
1857
-
1858
- Defaults to 120 mins"""
1859
-
1860
- channel: Optional[Channel] = None
1861
- """Channel Details"""
1862
-
1863
- cluster_size: Optional[str] = None
1864
- """Size of the clusters allocated for this warehouse. Increasing the size of a spark cluster allows
1865
- you to run larger queries on it. If you want to increase the number of concurrent queries,
1866
- please tune max_num_clusters.
1867
-
1868
- Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large - 2X-Large - 3X-Large
1869
- - 4X-Large"""
1870
-
1871
- creator_name: Optional[str] = None
1872
- """warehouse creator name"""
1873
-
1874
- enable_photon: Optional[bool] = None
1875
- """Configures whether the warehouse should use Photon optimized clusters.
1876
-
1877
- Defaults to false."""
1878
-
1879
- enable_serverless_compute: Optional[bool] = None
1880
- """Configures whether the warehouse should use serverless compute"""
1881
-
1882
- instance_profile_arn: Optional[str] = None
1883
- """Deprecated. Instance profile used to pass IAM role to the cluster"""
1884
-
1885
- max_num_clusters: Optional[int] = None
1886
- """Maximum number of clusters that the autoscaler will create to handle concurrent queries.
1887
-
1888
- Supported values: - Must be >= min_num_clusters - Must be <= 30.
1889
-
1890
- Defaults to min_clusters if unset."""
1891
-
1892
- min_num_clusters: Optional[int] = None
1893
- """Minimum number of available clusters that will be maintained for this SQL warehouse. Increasing
1894
- this will ensure that a larger number of clusters are always running and therefore may reduce
1895
- the cold start time for new queries. This is similar to reserved vs. revocable cores in a
1896
- resource manager.
1897
-
1898
- Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30)
1899
-
1900
- Defaults to 1"""
1901
-
1902
- name: Optional[str] = None
1903
- """Logical name for the cluster.
1904
-
1905
- Supported values: - Must be unique within an org. - Must be less than 100 characters."""
1906
-
1907
- spot_instance_policy: Optional[SpotInstancePolicy] = None
1908
-
1909
- tags: Optional[EndpointTags] = None
1910
- """A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS
1911
- volumes) associated with this SQL warehouse.
1912
-
1913
- Supported values: - Number of tags < 45."""
1914
-
1915
- warehouse_type: Optional[CreateWarehouseRequestWarehouseType] = None
1916
-
1917
- def as_dict(self) -> dict:
1918
- """Serializes the CreateWarehouseRequest into a dictionary suitable for use as a JSON request body."""
1919
- body = {}
1920
- if self.auto_stop_mins is not None:
1921
- body["auto_stop_mins"] = self.auto_stop_mins
1922
- if self.channel:
1923
- body["channel"] = self.channel.as_dict()
1924
- if self.cluster_size is not None:
1925
- body["cluster_size"] = self.cluster_size
1926
- if self.creator_name is not None:
1927
- body["creator_name"] = self.creator_name
1928
- if self.enable_photon is not None:
1929
- body["enable_photon"] = self.enable_photon
1930
- if self.enable_serverless_compute is not None:
1931
- body["enable_serverless_compute"] = self.enable_serverless_compute
1932
- if self.instance_profile_arn is not None:
1933
- body["instance_profile_arn"] = self.instance_profile_arn
1934
- if self.max_num_clusters is not None:
1935
- body["max_num_clusters"] = self.max_num_clusters
1936
- if self.min_num_clusters is not None:
1937
- body["min_num_clusters"] = self.min_num_clusters
1938
- if self.name is not None:
1939
- body["name"] = self.name
1940
- if self.spot_instance_policy is not None:
1941
- body["spot_instance_policy"] = self.spot_instance_policy.value
1942
- if self.tags:
1943
- body["tags"] = self.tags.as_dict()
1944
- if self.warehouse_type is not None:
1945
- body["warehouse_type"] = self.warehouse_type.value
1946
- return body
1947
-
1948
- def as_shallow_dict(self) -> dict:
1949
- """Serializes the CreateWarehouseRequest into a shallow dictionary of its immediate attributes."""
1950
- body = {}
1951
- if self.auto_stop_mins is not None:
1952
- body["auto_stop_mins"] = self.auto_stop_mins
1953
- if self.channel:
1954
- body["channel"] = self.channel
1955
- if self.cluster_size is not None:
1956
- body["cluster_size"] = self.cluster_size
1957
- if self.creator_name is not None:
1958
- body["creator_name"] = self.creator_name
1959
- if self.enable_photon is not None:
1960
- body["enable_photon"] = self.enable_photon
1961
- if self.enable_serverless_compute is not None:
1962
- body["enable_serverless_compute"] = self.enable_serverless_compute
1963
- if self.instance_profile_arn is not None:
1964
- body["instance_profile_arn"] = self.instance_profile_arn
1965
- if self.max_num_clusters is not None:
1966
- body["max_num_clusters"] = self.max_num_clusters
1967
- if self.min_num_clusters is not None:
1968
- body["min_num_clusters"] = self.min_num_clusters
1969
- if self.name is not None:
1970
- body["name"] = self.name
1971
- if self.spot_instance_policy is not None:
1972
- body["spot_instance_policy"] = self.spot_instance_policy
1973
- if self.tags:
1974
- body["tags"] = self.tags
1975
- if self.warehouse_type is not None:
1976
- body["warehouse_type"] = self.warehouse_type
1977
- return body
1978
-
1979
- @classmethod
1980
- def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseRequest:
1981
- """Deserializes the CreateWarehouseRequest from a dictionary."""
1982
- return cls(
1983
- auto_stop_mins=d.get("auto_stop_mins", None),
1984
- channel=_from_dict(d, "channel", Channel),
1985
- cluster_size=d.get("cluster_size", None),
1986
- creator_name=d.get("creator_name", None),
1987
- enable_photon=d.get("enable_photon", None),
1988
- enable_serverless_compute=d.get("enable_serverless_compute", None),
1989
- instance_profile_arn=d.get("instance_profile_arn", None),
1990
- max_num_clusters=d.get("max_num_clusters", None),
1991
- min_num_clusters=d.get("min_num_clusters", None),
1992
- name=d.get("name", None),
1993
- spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy),
1994
- tags=_from_dict(d, "tags", EndpointTags),
1995
- warehouse_type=_enum(d, "warehouse_type", CreateWarehouseRequestWarehouseType),
1996
- )
1997
-
1998
-
1999
1632
  class CreateWarehouseRequestWarehouseType(Enum):
2000
1633
  """Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, you must set to `PRO`
2001
1634
  and also set the field `enable_serverless_compute` to `true`."""
@@ -2017,76 +1650,17 @@ class CreateWarehouseResponse:
2017
1650
  body["id"] = self.id
2018
1651
  return body
2019
1652
 
2020
- def as_shallow_dict(self) -> dict:
2021
- """Serializes the CreateWarehouseResponse into a shallow dictionary of its immediate attributes."""
2022
- body = {}
2023
- if self.id is not None:
2024
- body["id"] = self.id
2025
- return body
2026
-
2027
- @classmethod
2028
- def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseResponse:
2029
- """Deserializes the CreateWarehouseResponse from a dictionary."""
2030
- return cls(id=d.get("id", None))
2031
-
2032
-
2033
- @dataclass
2034
- class CreateWidget:
2035
- dashboard_id: str
2036
- """Dashboard ID returned by :method:dashboards/create."""
2037
-
2038
- options: WidgetOptions
2039
-
2040
- width: int
2041
- """Width of a widget"""
2042
-
2043
- text: Optional[str] = None
2044
- """If this is a textbox widget, the application displays this text. This field is ignored if the
2045
- widget contains a visualization in the `visualization` field."""
2046
-
2047
- visualization_id: Optional[str] = None
2048
- """Query Vizualization ID returned by :method:queryvisualizations/create."""
2049
-
2050
- def as_dict(self) -> dict:
2051
- """Serializes the CreateWidget into a dictionary suitable for use as a JSON request body."""
2052
- body = {}
2053
- if self.dashboard_id is not None:
2054
- body["dashboard_id"] = self.dashboard_id
2055
- if self.options:
2056
- body["options"] = self.options.as_dict()
2057
- if self.text is not None:
2058
- body["text"] = self.text
2059
- if self.visualization_id is not None:
2060
- body["visualization_id"] = self.visualization_id
2061
- if self.width is not None:
2062
- body["width"] = self.width
2063
- return body
2064
-
2065
- def as_shallow_dict(self) -> dict:
2066
- """Serializes the CreateWidget into a shallow dictionary of its immediate attributes."""
2067
- body = {}
2068
- if self.dashboard_id is not None:
2069
- body["dashboard_id"] = self.dashboard_id
2070
- if self.options:
2071
- body["options"] = self.options
2072
- if self.text is not None:
2073
- body["text"] = self.text
2074
- if self.visualization_id is not None:
2075
- body["visualization_id"] = self.visualization_id
2076
- if self.width is not None:
2077
- body["width"] = self.width
2078
- return body
2079
-
1653
+ def as_shallow_dict(self) -> dict:
1654
+ """Serializes the CreateWarehouseResponse into a shallow dictionary of its immediate attributes."""
1655
+ body = {}
1656
+ if self.id is not None:
1657
+ body["id"] = self.id
1658
+ return body
1659
+
2080
1660
  @classmethod
2081
- def from_dict(cls, d: Dict[str, Any]) -> CreateWidget:
2082
- """Deserializes the CreateWidget from a dictionary."""
2083
- return cls(
2084
- dashboard_id=d.get("dashboard_id", None),
2085
- options=_from_dict(d, "options", WidgetOptions),
2086
- text=d.get("text", None),
2087
- visualization_id=d.get("visualization_id", None),
2088
- width=d.get("width", None),
2089
- )
1661
+ def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseResponse:
1662
+ """Deserializes the CreateWarehouseResponse from a dictionary."""
1663
+ return cls(id=d.get("id", None))
2090
1664
 
2091
1665
 
2092
1666
  @dataclass
@@ -2296,56 +1870,6 @@ class Dashboard:
2296
1870
  )
2297
1871
 
2298
1872
 
2299
- @dataclass
2300
- class DashboardEditContent:
2301
- dashboard_id: Optional[str] = None
2302
-
2303
- name: Optional[str] = None
2304
- """The title of this dashboard that appears in list views and at the top of the dashboard page."""
2305
-
2306
- run_as_role: Optional[RunAsRole] = None
2307
- """Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
2308
- viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
2309
-
2310
- tags: Optional[List[str]] = None
2311
-
2312
- def as_dict(self) -> dict:
2313
- """Serializes the DashboardEditContent into a dictionary suitable for use as a JSON request body."""
2314
- body = {}
2315
- if self.dashboard_id is not None:
2316
- body["dashboard_id"] = self.dashboard_id
2317
- if self.name is not None:
2318
- body["name"] = self.name
2319
- if self.run_as_role is not None:
2320
- body["run_as_role"] = self.run_as_role.value
2321
- if self.tags:
2322
- body["tags"] = [v for v in self.tags]
2323
- return body
2324
-
2325
- def as_shallow_dict(self) -> dict:
2326
- """Serializes the DashboardEditContent into a shallow dictionary of its immediate attributes."""
2327
- body = {}
2328
- if self.dashboard_id is not None:
2329
- body["dashboard_id"] = self.dashboard_id
2330
- if self.name is not None:
2331
- body["name"] = self.name
2332
- if self.run_as_role is not None:
2333
- body["run_as_role"] = self.run_as_role
2334
- if self.tags:
2335
- body["tags"] = self.tags
2336
- return body
2337
-
2338
- @classmethod
2339
- def from_dict(cls, d: Dict[str, Any]) -> DashboardEditContent:
2340
- """Deserializes the DashboardEditContent from a dictionary."""
2341
- return cls(
2342
- dashboard_id=d.get("dashboard_id", None),
2343
- name=d.get("name", None),
2344
- run_as_role=_enum(d, "run_as_role", RunAsRole),
2345
- tags=d.get("tags", None),
2346
- )
2347
-
2348
-
2349
1873
  @dataclass
2350
1874
  class DashboardOptions:
2351
1875
  moved_to_trash_at: Optional[str] = None
@@ -2372,73 +1896,6 @@ class DashboardOptions:
2372
1896
  return cls(moved_to_trash_at=d.get("moved_to_trash_at", None))
2373
1897
 
2374
1898
 
2375
- @dataclass
2376
- class DashboardPostContent:
2377
- name: str
2378
- """The title of this dashboard that appears in list views and at the top of the dashboard page."""
2379
-
2380
- dashboard_filters_enabled: Optional[bool] = None
2381
- """Indicates whether the dashboard filters are enabled"""
2382
-
2383
- is_favorite: Optional[bool] = None
2384
- """Indicates whether this dashboard object should appear in the current user's favorites list."""
2385
-
2386
- parent: Optional[str] = None
2387
- """The identifier of the workspace folder containing the object."""
2388
-
2389
- run_as_role: Optional[RunAsRole] = None
2390
- """Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
2391
- viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
2392
-
2393
- tags: Optional[List[str]] = None
2394
-
2395
- def as_dict(self) -> dict:
2396
- """Serializes the DashboardPostContent into a dictionary suitable for use as a JSON request body."""
2397
- body = {}
2398
- if self.dashboard_filters_enabled is not None:
2399
- body["dashboard_filters_enabled"] = self.dashboard_filters_enabled
2400
- if self.is_favorite is not None:
2401
- body["is_favorite"] = self.is_favorite
2402
- if self.name is not None:
2403
- body["name"] = self.name
2404
- if self.parent is not None:
2405
- body["parent"] = self.parent
2406
- if self.run_as_role is not None:
2407
- body["run_as_role"] = self.run_as_role.value
2408
- if self.tags:
2409
- body["tags"] = [v for v in self.tags]
2410
- return body
2411
-
2412
- def as_shallow_dict(self) -> dict:
2413
- """Serializes the DashboardPostContent into a shallow dictionary of its immediate attributes."""
2414
- body = {}
2415
- if self.dashboard_filters_enabled is not None:
2416
- body["dashboard_filters_enabled"] = self.dashboard_filters_enabled
2417
- if self.is_favorite is not None:
2418
- body["is_favorite"] = self.is_favorite
2419
- if self.name is not None:
2420
- body["name"] = self.name
2421
- if self.parent is not None:
2422
- body["parent"] = self.parent
2423
- if self.run_as_role is not None:
2424
- body["run_as_role"] = self.run_as_role
2425
- if self.tags:
2426
- body["tags"] = self.tags
2427
- return body
2428
-
2429
- @classmethod
2430
- def from_dict(cls, d: Dict[str, Any]) -> DashboardPostContent:
2431
- """Deserializes the DashboardPostContent from a dictionary."""
2432
- return cls(
2433
- dashboard_filters_enabled=d.get("dashboard_filters_enabled", None),
2434
- is_favorite=d.get("is_favorite", None),
2435
- name=d.get("name", None),
2436
- parent=d.get("parent", None),
2437
- run_as_role=_enum(d, "run_as_role", RunAsRole),
2438
- tags=d.get("tags", None),
2439
- )
2440
-
2441
-
2442
1899
  @dataclass
2443
1900
  class DataSource:
2444
1901
  """A JSON object representing a DBSQL data source / SQL warehouse."""
@@ -2692,265 +2149,49 @@ class DateValue:
2692
2149
  class DateValueDynamicDate(Enum):
2693
2150
 
2694
2151
  NOW = "NOW"
2695
- YESTERDAY = "YESTERDAY"
2696
-
2697
-
2698
- @dataclass
2699
- class DeleteResponse:
2700
- def as_dict(self) -> dict:
2701
- """Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body."""
2702
- body = {}
2703
- return body
2704
-
2705
- def as_shallow_dict(self) -> dict:
2706
- """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes."""
2707
- body = {}
2708
- return body
2709
-
2710
- @classmethod
2711
- def from_dict(cls, d: Dict[str, Any]) -> DeleteResponse:
2712
- """Deserializes the DeleteResponse from a dictionary."""
2713
- return cls()
2714
-
2715
-
2716
- @dataclass
2717
- class DeleteWarehouseResponse:
2718
- def as_dict(self) -> dict:
2719
- """Serializes the DeleteWarehouseResponse into a dictionary suitable for use as a JSON request body."""
2720
- body = {}
2721
- return body
2722
-
2723
- def as_shallow_dict(self) -> dict:
2724
- """Serializes the DeleteWarehouseResponse into a shallow dictionary of its immediate attributes."""
2725
- body = {}
2726
- return body
2727
-
2728
- @classmethod
2729
- def from_dict(cls, d: Dict[str, Any]) -> DeleteWarehouseResponse:
2730
- """Deserializes the DeleteWarehouseResponse from a dictionary."""
2731
- return cls()
2732
-
2733
-
2734
- class Disposition(Enum):
2735
-
2736
- EXTERNAL_LINKS = "EXTERNAL_LINKS"
2737
- INLINE = "INLINE"
2738
-
2739
-
2740
- @dataclass
2741
- class EditAlert:
2742
- name: str
2743
- """Name of the alert."""
2744
-
2745
- options: AlertOptions
2746
- """Alert configuration options."""
2747
-
2748
- query_id: str
2749
- """Query ID."""
2750
-
2751
- alert_id: Optional[str] = None
2752
-
2753
- rearm: Optional[int] = None
2754
- """Number of seconds after being triggered before the alert rearms itself and can be triggered
2755
- again. If `null`, alert will never be triggered again."""
2756
-
2757
- def as_dict(self) -> dict:
2758
- """Serializes the EditAlert into a dictionary suitable for use as a JSON request body."""
2759
- body = {}
2760
- if self.alert_id is not None:
2761
- body["alert_id"] = self.alert_id
2762
- if self.name is not None:
2763
- body["name"] = self.name
2764
- if self.options:
2765
- body["options"] = self.options.as_dict()
2766
- if self.query_id is not None:
2767
- body["query_id"] = self.query_id
2768
- if self.rearm is not None:
2769
- body["rearm"] = self.rearm
2770
- return body
2771
-
2772
- def as_shallow_dict(self) -> dict:
2773
- """Serializes the EditAlert into a shallow dictionary of its immediate attributes."""
2774
- body = {}
2775
- if self.alert_id is not None:
2776
- body["alert_id"] = self.alert_id
2777
- if self.name is not None:
2778
- body["name"] = self.name
2779
- if self.options:
2780
- body["options"] = self.options
2781
- if self.query_id is not None:
2782
- body["query_id"] = self.query_id
2783
- if self.rearm is not None:
2784
- body["rearm"] = self.rearm
2785
- return body
2786
-
2787
- @classmethod
2788
- def from_dict(cls, d: Dict[str, Any]) -> EditAlert:
2789
- """Deserializes the EditAlert from a dictionary."""
2790
- return cls(
2791
- alert_id=d.get("alert_id", None),
2792
- name=d.get("name", None),
2793
- options=_from_dict(d, "options", AlertOptions),
2794
- query_id=d.get("query_id", None),
2795
- rearm=d.get("rearm", None),
2796
- )
2797
-
2798
-
2799
- @dataclass
2800
- class EditWarehouseRequest:
2801
- auto_stop_mins: Optional[int] = None
2802
- """The amount of time in minutes that a SQL warehouse must be idle (i.e., no RUNNING queries)
2803
- before it is automatically stopped.
2804
-
2805
- Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop.
2806
-
2807
- Defaults to 120 mins"""
2808
-
2809
- channel: Optional[Channel] = None
2810
- """Channel Details"""
2811
-
2812
- cluster_size: Optional[str] = None
2813
- """Size of the clusters allocated for this warehouse. Increasing the size of a spark cluster allows
2814
- you to run larger queries on it. If you want to increase the number of concurrent queries,
2815
- please tune max_num_clusters.
2816
-
2817
- Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large - 2X-Large - 3X-Large
2818
- - 4X-Large"""
2819
-
2820
- creator_name: Optional[str] = None
2821
- """warehouse creator name"""
2822
-
2823
- enable_photon: Optional[bool] = None
2824
- """Configures whether the warehouse should use Photon optimized clusters.
2825
-
2826
- Defaults to false."""
2827
-
2828
- enable_serverless_compute: Optional[bool] = None
2829
- """Configures whether the warehouse should use serverless compute."""
2830
-
2831
- id: Optional[str] = None
2832
- """Required. Id of the warehouse to configure."""
2833
-
2834
- instance_profile_arn: Optional[str] = None
2835
- """Deprecated. Instance profile used to pass IAM role to the cluster"""
2836
-
2837
- max_num_clusters: Optional[int] = None
2838
- """Maximum number of clusters that the autoscaler will create to handle concurrent queries.
2839
-
2840
- Supported values: - Must be >= min_num_clusters - Must be <= 30.
2841
-
2842
- Defaults to min_clusters if unset."""
2152
+ YESTERDAY = "YESTERDAY"
2843
2153
 
2844
- min_num_clusters: Optional[int] = None
2845
- """Minimum number of available clusters that will be maintained for this SQL warehouse. Increasing
2846
- this will ensure that a larger number of clusters are always running and therefore may reduce
2847
- the cold start time for new queries. This is similar to reserved vs. revocable cores in a
2848
- resource manager.
2849
-
2850
- Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30)
2851
-
2852
- Defaults to 1"""
2853
2154
 
2854
- name: Optional[str] = None
2855
- """Logical name for the cluster.
2856
-
2857
- Supported values: - Must be unique within an org. - Must be less than 100 characters."""
2155
+ @dataclass
2156
+ class DeleteResponse:
2157
+ def as_dict(self) -> dict:
2158
+ """Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body."""
2159
+ body = {}
2160
+ return body
2858
2161
 
2859
- spot_instance_policy: Optional[SpotInstancePolicy] = None
2162
+ def as_shallow_dict(self) -> dict:
2163
+ """Serializes the DeleteResponse into a shallow dictionary of its immediate attributes."""
2164
+ body = {}
2165
+ return body
2860
2166
 
2861
- tags: Optional[EndpointTags] = None
2862
- """A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS
2863
- volumes) associated with this SQL warehouse.
2864
-
2865
- Supported values: - Number of tags < 45."""
2167
+ @classmethod
2168
+ def from_dict(cls, d: Dict[str, Any]) -> DeleteResponse:
2169
+ """Deserializes the DeleteResponse from a dictionary."""
2170
+ return cls()
2866
2171
 
2867
- warehouse_type: Optional[EditWarehouseRequestWarehouseType] = None
2868
2172
 
2173
+ @dataclass
2174
+ class DeleteWarehouseResponse:
2869
2175
  def as_dict(self) -> dict:
2870
- """Serializes the EditWarehouseRequest into a dictionary suitable for use as a JSON request body."""
2176
+ """Serializes the DeleteWarehouseResponse into a dictionary suitable for use as a JSON request body."""
2871
2177
  body = {}
2872
- if self.auto_stop_mins is not None:
2873
- body["auto_stop_mins"] = self.auto_stop_mins
2874
- if self.channel:
2875
- body["channel"] = self.channel.as_dict()
2876
- if self.cluster_size is not None:
2877
- body["cluster_size"] = self.cluster_size
2878
- if self.creator_name is not None:
2879
- body["creator_name"] = self.creator_name
2880
- if self.enable_photon is not None:
2881
- body["enable_photon"] = self.enable_photon
2882
- if self.enable_serverless_compute is not None:
2883
- body["enable_serverless_compute"] = self.enable_serverless_compute
2884
- if self.id is not None:
2885
- body["id"] = self.id
2886
- if self.instance_profile_arn is not None:
2887
- body["instance_profile_arn"] = self.instance_profile_arn
2888
- if self.max_num_clusters is not None:
2889
- body["max_num_clusters"] = self.max_num_clusters
2890
- if self.min_num_clusters is not None:
2891
- body["min_num_clusters"] = self.min_num_clusters
2892
- if self.name is not None:
2893
- body["name"] = self.name
2894
- if self.spot_instance_policy is not None:
2895
- body["spot_instance_policy"] = self.spot_instance_policy.value
2896
- if self.tags:
2897
- body["tags"] = self.tags.as_dict()
2898
- if self.warehouse_type is not None:
2899
- body["warehouse_type"] = self.warehouse_type.value
2900
2178
  return body
2901
2179
 
2902
2180
  def as_shallow_dict(self) -> dict:
2903
- """Serializes the EditWarehouseRequest into a shallow dictionary of its immediate attributes."""
2181
+ """Serializes the DeleteWarehouseResponse into a shallow dictionary of its immediate attributes."""
2904
2182
  body = {}
2905
- if self.auto_stop_mins is not None:
2906
- body["auto_stop_mins"] = self.auto_stop_mins
2907
- if self.channel:
2908
- body["channel"] = self.channel
2909
- if self.cluster_size is not None:
2910
- body["cluster_size"] = self.cluster_size
2911
- if self.creator_name is not None:
2912
- body["creator_name"] = self.creator_name
2913
- if self.enable_photon is not None:
2914
- body["enable_photon"] = self.enable_photon
2915
- if self.enable_serverless_compute is not None:
2916
- body["enable_serverless_compute"] = self.enable_serverless_compute
2917
- if self.id is not None:
2918
- body["id"] = self.id
2919
- if self.instance_profile_arn is not None:
2920
- body["instance_profile_arn"] = self.instance_profile_arn
2921
- if self.max_num_clusters is not None:
2922
- body["max_num_clusters"] = self.max_num_clusters
2923
- if self.min_num_clusters is not None:
2924
- body["min_num_clusters"] = self.min_num_clusters
2925
- if self.name is not None:
2926
- body["name"] = self.name
2927
- if self.spot_instance_policy is not None:
2928
- body["spot_instance_policy"] = self.spot_instance_policy
2929
- if self.tags:
2930
- body["tags"] = self.tags
2931
- if self.warehouse_type is not None:
2932
- body["warehouse_type"] = self.warehouse_type
2933
2183
  return body
2934
2184
 
2935
2185
  @classmethod
2936
- def from_dict(cls, d: Dict[str, Any]) -> EditWarehouseRequest:
2937
- """Deserializes the EditWarehouseRequest from a dictionary."""
2938
- return cls(
2939
- auto_stop_mins=d.get("auto_stop_mins", None),
2940
- channel=_from_dict(d, "channel", Channel),
2941
- cluster_size=d.get("cluster_size", None),
2942
- creator_name=d.get("creator_name", None),
2943
- enable_photon=d.get("enable_photon", None),
2944
- enable_serverless_compute=d.get("enable_serverless_compute", None),
2945
- id=d.get("id", None),
2946
- instance_profile_arn=d.get("instance_profile_arn", None),
2947
- max_num_clusters=d.get("max_num_clusters", None),
2948
- min_num_clusters=d.get("min_num_clusters", None),
2949
- name=d.get("name", None),
2950
- spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy),
2951
- tags=_from_dict(d, "tags", EndpointTags),
2952
- warehouse_type=_enum(d, "warehouse_type", EditWarehouseRequestWarehouseType),
2953
- )
2186
+ def from_dict(cls, d: Dict[str, Any]) -> DeleteWarehouseResponse:
2187
+ """Deserializes the DeleteWarehouseResponse from a dictionary."""
2188
+ return cls()
2189
+
2190
+
2191
+ class Disposition(Enum):
2192
+
2193
+ EXTERNAL_LINKS = "EXTERNAL_LINKS"
2194
+ INLINE = "INLINE"
2954
2195
 
2955
2196
 
2956
2197
  class EditWarehouseRequestWarehouseType(Enum):
@@ -3402,196 +2643,6 @@ class EnumValue:
3402
2643
  )
3403
2644
 
3404
2645
 
3405
- @dataclass
3406
- class ExecuteStatementRequest:
3407
- statement: str
3408
- """The SQL statement to execute. The statement can optionally be parameterized, see `parameters`.
3409
- The maximum query text size is 16 MiB."""
3410
-
3411
- warehouse_id: str
3412
- """Warehouse upon which to execute a statement. See also [What are SQL warehouses?]
3413
-
3414
- [What are SQL warehouses?]: https://docs.databricks.com/sql/admin/warehouse-type.html"""
3415
-
3416
- byte_limit: Optional[int] = None
3417
- """Applies the given byte limit to the statement's result size. Byte counts are based on internal
3418
- data representations and might not match the final size in the requested `format`. If the result
3419
- was truncated due to the byte limit, then `truncated` in the response is set to `true`. When
3420
- using `EXTERNAL_LINKS` disposition, a default `byte_limit` of 100 GiB is applied if `byte_limit`
3421
- is not explcitly set."""
3422
-
3423
- catalog: Optional[str] = None
3424
- """Sets default catalog for statement execution, similar to [`USE CATALOG`] in SQL.
3425
-
3426
- [`USE CATALOG`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-catalog.html"""
3427
-
3428
- disposition: Optional[Disposition] = None
3429
-
3430
- format: Optional[Format] = None
3431
- """Statement execution supports three result formats: `JSON_ARRAY` (default), `ARROW_STREAM`, and
3432
- `CSV`.
3433
-
3434
- Important: The formats `ARROW_STREAM` and `CSV` are supported only with `EXTERNAL_LINKS`
3435
- disposition. `JSON_ARRAY` is supported in `INLINE` and `EXTERNAL_LINKS` disposition.
3436
-
3437
- When specifying `format=JSON_ARRAY`, result data will be formatted as an array of arrays of
3438
- values, where each value is either the *string representation* of a value, or `null`. For
3439
- example, the output of `SELECT concat('id-', id) AS strCol, id AS intCol, null AS nullCol FROM
3440
- range(3)` would look like this:
3441
-
3442
- ``` [ [ "id-1", "1", null ], [ "id-2", "2", null ], [ "id-3", "3", null ], ] ```
3443
-
3444
- When specifying `format=JSON_ARRAY` and `disposition=EXTERNAL_LINKS`, each chunk in the result
3445
- contains compact JSON with no indentation or extra whitespace.
3446
-
3447
- When specifying `format=ARROW_STREAM` and `disposition=EXTERNAL_LINKS`, each chunk in the result
3448
- will be formatted as Apache Arrow Stream. See the [Apache Arrow streaming format].
3449
-
3450
- When specifying `format=CSV` and `disposition=EXTERNAL_LINKS`, each chunk in the result will be
3451
- a CSV according to [RFC 4180] standard. All the columns values will have *string representation*
3452
- similar to the `JSON_ARRAY` format, and `null` values will be encoded as “null”. Only the
3453
- first chunk in the result would contain a header row with column names. For example, the output
3454
- of `SELECT concat('id-', id) AS strCol, id AS intCol, null as nullCol FROM range(3)` would look
3455
- like this:
3456
-
3457
- ``` strCol,intCol,nullCol id-1,1,null id-2,2,null id-3,3,null ```
3458
-
3459
- [Apache Arrow streaming format]: https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format
3460
- [RFC 4180]: https://www.rfc-editor.org/rfc/rfc4180"""
3461
-
3462
- on_wait_timeout: Optional[ExecuteStatementRequestOnWaitTimeout] = None
3463
- """When `wait_timeout > 0s`, the call will block up to the specified time. If the statement
3464
- execution doesn't finish within this time, `on_wait_timeout` determines whether the execution
3465
- should continue or be canceled. When set to `CONTINUE`, the statement execution continues
3466
- asynchronously and the call returns a statement ID which can be used for polling with
3467
- :method:statementexecution/getStatement. When set to `CANCEL`, the statement execution is
3468
- canceled and the call returns with a `CANCELED` state."""
3469
-
3470
- parameters: Optional[List[StatementParameterListItem]] = None
3471
- """A list of parameters to pass into a SQL statement containing parameter markers. A parameter
3472
- consists of a name, a value, and optionally a type. To represent a NULL value, the `value` field
3473
- may be omitted or set to `null` explicitly. If the `type` field is omitted, the value is
3474
- interpreted as a string.
3475
-
3476
- If the type is given, parameters will be checked for type correctness according to the given
3477
- type. A value is correct if the provided string can be converted to the requested type using the
3478
- `cast` function. The exact semantics are described in the section [`cast` function] of the SQL
3479
- language reference.
3480
-
3481
- For example, the following statement contains two parameters, `my_name` and `my_date`:
3482
-
3483
- SELECT * FROM my_table WHERE name = :my_name AND date = :my_date
3484
-
3485
- The parameters can be passed in the request body as follows:
3486
-
3487
- { ..., "statement": "SELECT * FROM my_table WHERE name = :my_name AND date = :my_date",
3488
- "parameters": [ { "name": "my_name", "value": "the name" }, { "name": "my_date", "value":
3489
- "2020-01-01", "type": "DATE" } ] }
3490
-
3491
- Currently, positional parameters denoted by a `?` marker are not supported by the Databricks SQL
3492
- Statement Execution API.
3493
-
3494
- Also see the section [Parameter markers] of the SQL language reference.
3495
-
3496
- [Parameter markers]: https://docs.databricks.com/sql/language-manual/sql-ref-parameter-marker.html
3497
- [`cast` function]: https://docs.databricks.com/sql/language-manual/functions/cast.html"""
3498
-
3499
- row_limit: Optional[int] = None
3500
- """Applies the given row limit to the statement's result set, but unlike the `LIMIT` clause in SQL,
3501
- it also sets the `truncated` field in the response to indicate whether the result was trimmed
3502
- due to the limit or not."""
3503
-
3504
- schema: Optional[str] = None
3505
- """Sets default schema for statement execution, similar to [`USE SCHEMA`] in SQL.
3506
-
3507
- [`USE SCHEMA`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-schema.html"""
3508
-
3509
- wait_timeout: Optional[str] = None
3510
- """The time in seconds the call will wait for the statement's result set as `Ns`, where `N` can be
3511
- set to 0 or to a value between 5 and 50.
3512
-
3513
- When set to `0s`, the statement will execute in asynchronous mode and the call will not wait for
3514
- the execution to finish. In this case, the call returns directly with `PENDING` state and a
3515
- statement ID which can be used for polling with :method:statementexecution/getStatement.
3516
-
3517
- When set between 5 and 50 seconds, the call will behave synchronously up to this timeout and
3518
- wait for the statement execution to finish. If the execution finishes within this time, the call
3519
- returns immediately with a manifest and result data (or a `FAILED` state in case of an execution
3520
- error). If the statement takes longer to execute, `on_wait_timeout` determines what should
3521
- happen after the timeout is reached."""
3522
-
3523
- def as_dict(self) -> dict:
3524
- """Serializes the ExecuteStatementRequest into a dictionary suitable for use as a JSON request body."""
3525
- body = {}
3526
- if self.byte_limit is not None:
3527
- body["byte_limit"] = self.byte_limit
3528
- if self.catalog is not None:
3529
- body["catalog"] = self.catalog
3530
- if self.disposition is not None:
3531
- body["disposition"] = self.disposition.value
3532
- if self.format is not None:
3533
- body["format"] = self.format.value
3534
- if self.on_wait_timeout is not None:
3535
- body["on_wait_timeout"] = self.on_wait_timeout.value
3536
- if self.parameters:
3537
- body["parameters"] = [v.as_dict() for v in self.parameters]
3538
- if self.row_limit is not None:
3539
- body["row_limit"] = self.row_limit
3540
- if self.schema is not None:
3541
- body["schema"] = self.schema
3542
- if self.statement is not None:
3543
- body["statement"] = self.statement
3544
- if self.wait_timeout is not None:
3545
- body["wait_timeout"] = self.wait_timeout
3546
- if self.warehouse_id is not None:
3547
- body["warehouse_id"] = self.warehouse_id
3548
- return body
3549
-
3550
- def as_shallow_dict(self) -> dict:
3551
- """Serializes the ExecuteStatementRequest into a shallow dictionary of its immediate attributes."""
3552
- body = {}
3553
- if self.byte_limit is not None:
3554
- body["byte_limit"] = self.byte_limit
3555
- if self.catalog is not None:
3556
- body["catalog"] = self.catalog
3557
- if self.disposition is not None:
3558
- body["disposition"] = self.disposition
3559
- if self.format is not None:
3560
- body["format"] = self.format
3561
- if self.on_wait_timeout is not None:
3562
- body["on_wait_timeout"] = self.on_wait_timeout
3563
- if self.parameters:
3564
- body["parameters"] = self.parameters
3565
- if self.row_limit is not None:
3566
- body["row_limit"] = self.row_limit
3567
- if self.schema is not None:
3568
- body["schema"] = self.schema
3569
- if self.statement is not None:
3570
- body["statement"] = self.statement
3571
- if self.wait_timeout is not None:
3572
- body["wait_timeout"] = self.wait_timeout
3573
- if self.warehouse_id is not None:
3574
- body["warehouse_id"] = self.warehouse_id
3575
- return body
3576
-
3577
- @classmethod
3578
- def from_dict(cls, d: Dict[str, Any]) -> ExecuteStatementRequest:
3579
- """Deserializes the ExecuteStatementRequest from a dictionary."""
3580
- return cls(
3581
- byte_limit=d.get("byte_limit", None),
3582
- catalog=d.get("catalog", None),
3583
- disposition=_enum(d, "disposition", Disposition),
3584
- format=_enum(d, "format", Format),
3585
- on_wait_timeout=_enum(d, "on_wait_timeout", ExecuteStatementRequestOnWaitTimeout),
3586
- parameters=_repeated_dict(d, "parameters", StatementParameterListItem),
3587
- row_limit=d.get("row_limit", None),
3588
- schema=d.get("schema", None),
3589
- statement=d.get("statement", None),
3590
- wait_timeout=d.get("wait_timeout", None),
3591
- warehouse_id=d.get("warehouse_id", None),
3592
- )
3593
-
3594
-
3595
2646
  class ExecuteStatementRequestOnWaitTimeout(Enum):
3596
2647
  """When `wait_timeout > 0s`, the call will block up to the specified time. If the statement
3597
2648
  execution doesn't finish within this time, `on_wait_timeout` determines whether the execution
@@ -5566,132 +4617,45 @@ class Query:
5566
4617
 
5567
4618
 
5568
4619
  @dataclass
5569
- class QueryBackedValue:
5570
- multi_values_options: Optional[MultiValuesOptions] = None
5571
- """If specified, allows multiple values to be selected for this parameter."""
5572
-
5573
- query_id: Optional[str] = None
5574
- """UUID of the query that provides the parameter values."""
5575
-
5576
- values: Optional[List[str]] = None
5577
- """List of selected query parameter values."""
5578
-
5579
- def as_dict(self) -> dict:
5580
- """Serializes the QueryBackedValue into a dictionary suitable for use as a JSON request body."""
5581
- body = {}
5582
- if self.multi_values_options:
5583
- body["multi_values_options"] = self.multi_values_options.as_dict()
5584
- if self.query_id is not None:
5585
- body["query_id"] = self.query_id
5586
- if self.values:
5587
- body["values"] = [v for v in self.values]
5588
- return body
5589
-
5590
- def as_shallow_dict(self) -> dict:
5591
- """Serializes the QueryBackedValue into a shallow dictionary of its immediate attributes."""
5592
- body = {}
5593
- if self.multi_values_options:
5594
- body["multi_values_options"] = self.multi_values_options
5595
- if self.query_id is not None:
5596
- body["query_id"] = self.query_id
5597
- if self.values:
5598
- body["values"] = self.values
5599
- return body
5600
-
5601
- @classmethod
5602
- def from_dict(cls, d: Dict[str, Any]) -> QueryBackedValue:
5603
- """Deserializes the QueryBackedValue from a dictionary."""
5604
- return cls(
5605
- multi_values_options=_from_dict(d, "multi_values_options", MultiValuesOptions),
5606
- query_id=d.get("query_id", None),
5607
- values=d.get("values", None),
5608
- )
5609
-
5610
-
5611
- @dataclass
5612
- class QueryEditContent:
5613
- data_source_id: Optional[str] = None
5614
- """Data source ID maps to the ID of the data source used by the resource and is distinct from the
5615
- warehouse ID. [Learn more]
5616
-
5617
- [Learn more]: https://docs.databricks.com/api/workspace/datasources/list"""
5618
-
5619
- description: Optional[str] = None
5620
- """General description that conveys additional information about this query such as usage notes."""
5621
-
5622
- name: Optional[str] = None
5623
- """The title of this query that appears in list views, widget headings, and on the query page."""
5624
-
5625
- options: Optional[Any] = None
5626
- """Exclusively used for storing a list parameter definitions. A parameter is an object with
5627
- `title`, `name`, `type`, and `value` properties. The `value` field here is the default value. It
5628
- can be overridden at runtime."""
5629
-
5630
- query: Optional[str] = None
5631
- """The text of the query to be run."""
4620
+ class QueryBackedValue:
4621
+ multi_values_options: Optional[MultiValuesOptions] = None
4622
+ """If specified, allows multiple values to be selected for this parameter."""
5632
4623
 
5633
4624
  query_id: Optional[str] = None
4625
+ """UUID of the query that provides the parameter values."""
5634
4626
 
5635
- run_as_role: Optional[RunAsRole] = None
5636
- """Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
5637
- viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
5638
-
5639
- tags: Optional[List[str]] = None
4627
+ values: Optional[List[str]] = None
4628
+ """List of selected query parameter values."""
5640
4629
 
5641
4630
  def as_dict(self) -> dict:
5642
- """Serializes the QueryEditContent into a dictionary suitable for use as a JSON request body."""
4631
+ """Serializes the QueryBackedValue into a dictionary suitable for use as a JSON request body."""
5643
4632
  body = {}
5644
- if self.data_source_id is not None:
5645
- body["data_source_id"] = self.data_source_id
5646
- if self.description is not None:
5647
- body["description"] = self.description
5648
- if self.name is not None:
5649
- body["name"] = self.name
5650
- if self.options:
5651
- body["options"] = self.options
5652
- if self.query is not None:
5653
- body["query"] = self.query
4633
+ if self.multi_values_options:
4634
+ body["multi_values_options"] = self.multi_values_options.as_dict()
5654
4635
  if self.query_id is not None:
5655
4636
  body["query_id"] = self.query_id
5656
- if self.run_as_role is not None:
5657
- body["run_as_role"] = self.run_as_role.value
5658
- if self.tags:
5659
- body["tags"] = [v for v in self.tags]
4637
+ if self.values:
4638
+ body["values"] = [v for v in self.values]
5660
4639
  return body
5661
4640
 
5662
4641
  def as_shallow_dict(self) -> dict:
5663
- """Serializes the QueryEditContent into a shallow dictionary of its immediate attributes."""
4642
+ """Serializes the QueryBackedValue into a shallow dictionary of its immediate attributes."""
5664
4643
  body = {}
5665
- if self.data_source_id is not None:
5666
- body["data_source_id"] = self.data_source_id
5667
- if self.description is not None:
5668
- body["description"] = self.description
5669
- if self.name is not None:
5670
- body["name"] = self.name
5671
- if self.options:
5672
- body["options"] = self.options
5673
- if self.query is not None:
5674
- body["query"] = self.query
4644
+ if self.multi_values_options:
4645
+ body["multi_values_options"] = self.multi_values_options
5675
4646
  if self.query_id is not None:
5676
4647
  body["query_id"] = self.query_id
5677
- if self.run_as_role is not None:
5678
- body["run_as_role"] = self.run_as_role
5679
- if self.tags:
5680
- body["tags"] = self.tags
4648
+ if self.values:
4649
+ body["values"] = self.values
5681
4650
  return body
5682
4651
 
5683
4652
  @classmethod
5684
- def from_dict(cls, d: Dict[str, Any]) -> QueryEditContent:
5685
- """Deserializes the QueryEditContent from a dictionary."""
4653
+ def from_dict(cls, d: Dict[str, Any]) -> QueryBackedValue:
4654
+ """Deserializes the QueryBackedValue from a dictionary."""
5686
4655
  return cls(
5687
- data_source_id=d.get("data_source_id", None),
5688
- description=d.get("description", None),
5689
- name=d.get("name", None),
5690
- options=d.get("options", None),
5691
- query=d.get("query", None),
4656
+ multi_values_options=_from_dict(d, "multi_values_options", MultiValuesOptions),
5692
4657
  query_id=d.get("query_id", None),
5693
- run_as_role=_enum(d, "run_as_role", RunAsRole),
5694
- tags=d.get("tags", None),
4658
+ values=d.get("values", None),
5695
4659
  )
5696
4660
 
5697
4661
 
@@ -6050,6 +5014,9 @@ class QueryMetrics:
6050
5014
  photon_total_time_ms: Optional[int] = None
6051
5015
  """Total execution time for all individual Photon query engine tasks in the query, in milliseconds."""
6052
5016
 
5017
+ projected_remaining_task_total_time_ms: Optional[int] = None
5018
+ """projected remaining work to be done aggregated across all stages in the query, in milliseconds"""
5019
+
6053
5020
  provisioning_queue_start_timestamp: Optional[int] = None
6054
5021
  """Timestamp of when the query was enqueued waiting for a cluster to be provisioned for the
6055
5022
  warehouse. This field is optional and will not appear if the query skipped the provisioning
@@ -6079,6 +5046,10 @@ class QueryMetrics:
6079
5046
  read_remote_bytes: Optional[int] = None
6080
5047
  """Size of persistent data read from cloud object storage on your cloud tenant, in bytes."""
6081
5048
 
5049
+ remaining_task_count: Optional[int] = None
5050
+ """number of remaining tasks to complete this is based on the current status and could be bigger or
5051
+ smaller in the future based on future updates"""
5052
+
6082
5053
  result_fetch_time_ms: Optional[int] = None
6083
5054
  """Time spent fetching the query results after the execution finished, in milliseconds."""
6084
5055
 
@@ -6091,6 +5062,10 @@ class QueryMetrics:
6091
5062
  rows_read_count: Optional[int] = None
6092
5063
  """Total number of rows read by the query."""
6093
5064
 
5065
+ runnable_tasks: Optional[int] = None
5066
+ """number of remaining tasks to complete, calculated by autoscaler StatementAnalysis.scala
5067
+ deprecated: use remaining_task_count instead"""
5068
+
6094
5069
  spill_to_disk_bytes: Optional[int] = None
6095
5070
  """Size of data temporarily written to disk while executing the query, in bytes."""
6096
5071
 
@@ -6104,6 +5079,11 @@ class QueryMetrics:
6104
5079
  total_time_ms: Optional[int] = None
6105
5080
  """Total execution time of the query from the client’s point of view, in milliseconds."""
6106
5081
 
5082
+ work_to_be_done: Optional[int] = None
5083
+ """remaining work to be done across all stages in the query, calculated by autoscaler
5084
+ StatementAnalysis.scala, in milliseconds deprecated: using
5085
+ projected_remaining_task_total_time_ms instead"""
5086
+
6107
5087
  write_remote_bytes: Optional[int] = None
6108
5088
  """Size pf persistent data written to cloud object storage in your cloud tenant, in bytes."""
6109
5089
 
@@ -6120,6 +5100,8 @@ class QueryMetrics:
6120
5100
  body["overloading_queue_start_timestamp"] = self.overloading_queue_start_timestamp
6121
5101
  if self.photon_total_time_ms is not None:
6122
5102
  body["photon_total_time_ms"] = self.photon_total_time_ms
5103
+ if self.projected_remaining_task_total_time_ms is not None:
5104
+ body["projected_remaining_task_total_time_ms"] = self.projected_remaining_task_total_time_ms
6123
5105
  if self.provisioning_queue_start_timestamp is not None:
6124
5106
  body["provisioning_queue_start_timestamp"] = self.provisioning_queue_start_timestamp
6125
5107
  if self.pruned_bytes is not None:
@@ -6138,6 +5120,8 @@ class QueryMetrics:
6138
5120
  body["read_partitions_count"] = self.read_partitions_count
6139
5121
  if self.read_remote_bytes is not None:
6140
5122
  body["read_remote_bytes"] = self.read_remote_bytes
5123
+ if self.remaining_task_count is not None:
5124
+ body["remaining_task_count"] = self.remaining_task_count
6141
5125
  if self.result_fetch_time_ms is not None:
6142
5126
  body["result_fetch_time_ms"] = self.result_fetch_time_ms
6143
5127
  if self.result_from_cache is not None:
@@ -6146,6 +5130,8 @@ class QueryMetrics:
6146
5130
  body["rows_produced_count"] = self.rows_produced_count
6147
5131
  if self.rows_read_count is not None:
6148
5132
  body["rows_read_count"] = self.rows_read_count
5133
+ if self.runnable_tasks is not None:
5134
+ body["runnable_tasks"] = self.runnable_tasks
6149
5135
  if self.spill_to_disk_bytes is not None:
6150
5136
  body["spill_to_disk_bytes"] = self.spill_to_disk_bytes
6151
5137
  if self.task_time_over_time_range:
@@ -6154,6 +5140,8 @@ class QueryMetrics:
6154
5140
  body["task_total_time_ms"] = self.task_total_time_ms
6155
5141
  if self.total_time_ms is not None:
6156
5142
  body["total_time_ms"] = self.total_time_ms
5143
+ if self.work_to_be_done is not None:
5144
+ body["work_to_be_done"] = self.work_to_be_done
6157
5145
  if self.write_remote_bytes is not None:
6158
5146
  body["write_remote_bytes"] = self.write_remote_bytes
6159
5147
  return body
@@ -6171,6 +5159,8 @@ class QueryMetrics:
6171
5159
  body["overloading_queue_start_timestamp"] = self.overloading_queue_start_timestamp
6172
5160
  if self.photon_total_time_ms is not None:
6173
5161
  body["photon_total_time_ms"] = self.photon_total_time_ms
5162
+ if self.projected_remaining_task_total_time_ms is not None:
5163
+ body["projected_remaining_task_total_time_ms"] = self.projected_remaining_task_total_time_ms
6174
5164
  if self.provisioning_queue_start_timestamp is not None:
6175
5165
  body["provisioning_queue_start_timestamp"] = self.provisioning_queue_start_timestamp
6176
5166
  if self.pruned_bytes is not None:
@@ -6189,6 +5179,8 @@ class QueryMetrics:
6189
5179
  body["read_partitions_count"] = self.read_partitions_count
6190
5180
  if self.read_remote_bytes is not None:
6191
5181
  body["read_remote_bytes"] = self.read_remote_bytes
5182
+ if self.remaining_task_count is not None:
5183
+ body["remaining_task_count"] = self.remaining_task_count
6192
5184
  if self.result_fetch_time_ms is not None:
6193
5185
  body["result_fetch_time_ms"] = self.result_fetch_time_ms
6194
5186
  if self.result_from_cache is not None:
@@ -6197,6 +5189,8 @@ class QueryMetrics:
6197
5189
  body["rows_produced_count"] = self.rows_produced_count
6198
5190
  if self.rows_read_count is not None:
6199
5191
  body["rows_read_count"] = self.rows_read_count
5192
+ if self.runnable_tasks is not None:
5193
+ body["runnable_tasks"] = self.runnable_tasks
6200
5194
  if self.spill_to_disk_bytes is not None:
6201
5195
  body["spill_to_disk_bytes"] = self.spill_to_disk_bytes
6202
5196
  if self.task_time_over_time_range:
@@ -6205,6 +5199,8 @@ class QueryMetrics:
6205
5199
  body["task_total_time_ms"] = self.task_total_time_ms
6206
5200
  if self.total_time_ms is not None:
6207
5201
  body["total_time_ms"] = self.total_time_ms
5202
+ if self.work_to_be_done is not None:
5203
+ body["work_to_be_done"] = self.work_to_be_done
6208
5204
  if self.write_remote_bytes is not None:
6209
5205
  body["write_remote_bytes"] = self.write_remote_bytes
6210
5206
  return body
@@ -6218,6 +5214,7 @@ class QueryMetrics:
6218
5214
  network_sent_bytes=d.get("network_sent_bytes", None),
6219
5215
  overloading_queue_start_timestamp=d.get("overloading_queue_start_timestamp", None),
6220
5216
  photon_total_time_ms=d.get("photon_total_time_ms", None),
5217
+ projected_remaining_task_total_time_ms=d.get("projected_remaining_task_total_time_ms", None),
6221
5218
  provisioning_queue_start_timestamp=d.get("provisioning_queue_start_timestamp", None),
6222
5219
  pruned_bytes=d.get("pruned_bytes", None),
6223
5220
  pruned_files_count=d.get("pruned_files_count", None),
@@ -6227,14 +5224,17 @@ class QueryMetrics:
6227
5224
  read_files_count=d.get("read_files_count", None),
6228
5225
  read_partitions_count=d.get("read_partitions_count", None),
6229
5226
  read_remote_bytes=d.get("read_remote_bytes", None),
5227
+ remaining_task_count=d.get("remaining_task_count", None),
6230
5228
  result_fetch_time_ms=d.get("result_fetch_time_ms", None),
6231
5229
  result_from_cache=d.get("result_from_cache", None),
6232
5230
  rows_produced_count=d.get("rows_produced_count", None),
6233
5231
  rows_read_count=d.get("rows_read_count", None),
5232
+ runnable_tasks=d.get("runnable_tasks", None),
6234
5233
  spill_to_disk_bytes=d.get("spill_to_disk_bytes", None),
6235
5234
  task_time_over_time_range=_from_dict(d, "task_time_over_time_range", TaskTimeOverRange),
6236
5235
  task_total_time_ms=d.get("task_total_time_ms", None),
6237
5236
  total_time_ms=d.get("total_time_ms", None),
5237
+ work_to_be_done=d.get("work_to_be_done", None),
6238
5238
  write_remote_bytes=d.get("write_remote_bytes", None),
6239
5239
  )
6240
5240
 
@@ -6374,94 +5374,6 @@ class QueryParameter:
6374
5374
  )
6375
5375
 
6376
5376
 
6377
- @dataclass
6378
- class QueryPostContent:
6379
- data_source_id: Optional[str] = None
6380
- """Data source ID maps to the ID of the data source used by the resource and is distinct from the
6381
- warehouse ID. [Learn more]
6382
-
6383
- [Learn more]: https://docs.databricks.com/api/workspace/datasources/list"""
6384
-
6385
- description: Optional[str] = None
6386
- """General description that conveys additional information about this query such as usage notes."""
6387
-
6388
- name: Optional[str] = None
6389
- """The title of this query that appears in list views, widget headings, and on the query page."""
6390
-
6391
- options: Optional[Any] = None
6392
- """Exclusively used for storing a list parameter definitions. A parameter is an object with
6393
- `title`, `name`, `type`, and `value` properties. The `value` field here is the default value. It
6394
- can be overridden at runtime."""
6395
-
6396
- parent: Optional[str] = None
6397
- """The identifier of the workspace folder containing the object."""
6398
-
6399
- query: Optional[str] = None
6400
- """The text of the query to be run."""
6401
-
6402
- run_as_role: Optional[RunAsRole] = None
6403
- """Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
6404
- viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
6405
-
6406
- tags: Optional[List[str]] = None
6407
-
6408
- def as_dict(self) -> dict:
6409
- """Serializes the QueryPostContent into a dictionary suitable for use as a JSON request body."""
6410
- body = {}
6411
- if self.data_source_id is not None:
6412
- body["data_source_id"] = self.data_source_id
6413
- if self.description is not None:
6414
- body["description"] = self.description
6415
- if self.name is not None:
6416
- body["name"] = self.name
6417
- if self.options:
6418
- body["options"] = self.options
6419
- if self.parent is not None:
6420
- body["parent"] = self.parent
6421
- if self.query is not None:
6422
- body["query"] = self.query
6423
- if self.run_as_role is not None:
6424
- body["run_as_role"] = self.run_as_role.value
6425
- if self.tags:
6426
- body["tags"] = [v for v in self.tags]
6427
- return body
6428
-
6429
- def as_shallow_dict(self) -> dict:
6430
- """Serializes the QueryPostContent into a shallow dictionary of its immediate attributes."""
6431
- body = {}
6432
- if self.data_source_id is not None:
6433
- body["data_source_id"] = self.data_source_id
6434
- if self.description is not None:
6435
- body["description"] = self.description
6436
- if self.name is not None:
6437
- body["name"] = self.name
6438
- if self.options:
6439
- body["options"] = self.options
6440
- if self.parent is not None:
6441
- body["parent"] = self.parent
6442
- if self.query is not None:
6443
- body["query"] = self.query
6444
- if self.run_as_role is not None:
6445
- body["run_as_role"] = self.run_as_role
6446
- if self.tags:
6447
- body["tags"] = self.tags
6448
- return body
6449
-
6450
- @classmethod
6451
- def from_dict(cls, d: Dict[str, Any]) -> QueryPostContent:
6452
- """Deserializes the QueryPostContent from a dictionary."""
6453
- return cls(
6454
- data_source_id=d.get("data_source_id", None),
6455
- description=d.get("description", None),
6456
- name=d.get("name", None),
6457
- options=d.get("options", None),
6458
- parent=d.get("parent", None),
6459
- query=d.get("query", None),
6460
- run_as_role=_enum(d, "run_as_role", RunAsRole),
6461
- tags=d.get("tags", None),
6462
- )
6463
-
6464
-
6465
5377
  class QueryStatementType(Enum):
6466
5378
 
6467
5379
  ALTER = "ALTER"
@@ -6816,50 +5728,6 @@ class ServiceErrorCode(Enum):
6816
5728
  WORKSPACE_TEMPORARILY_UNAVAILABLE = "WORKSPACE_TEMPORARILY_UNAVAILABLE"
6817
5729
 
6818
5730
 
6819
- @dataclass
6820
- class SetRequest:
6821
- """Set object ACL"""
6822
-
6823
- access_control_list: Optional[List[AccessControl]] = None
6824
-
6825
- object_id: Optional[str] = None
6826
- """Object ID. The ACL for the object with this UUID is overwritten by this request's POST content."""
6827
-
6828
- object_type: Optional[ObjectTypePlural] = None
6829
- """The type of object permission to set."""
6830
-
6831
- def as_dict(self) -> dict:
6832
- """Serializes the SetRequest into a dictionary suitable for use as a JSON request body."""
6833
- body = {}
6834
- if self.access_control_list:
6835
- body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
6836
- if self.object_id is not None:
6837
- body["objectId"] = self.object_id
6838
- if self.object_type is not None:
6839
- body["objectType"] = self.object_type.value
6840
- return body
6841
-
6842
- def as_shallow_dict(self) -> dict:
6843
- """Serializes the SetRequest into a shallow dictionary of its immediate attributes."""
6844
- body = {}
6845
- if self.access_control_list:
6846
- body["access_control_list"] = self.access_control_list
6847
- if self.object_id is not None:
6848
- body["objectId"] = self.object_id
6849
- if self.object_type is not None:
6850
- body["objectType"] = self.object_type
6851
- return body
6852
-
6853
- @classmethod
6854
- def from_dict(cls, d: Dict[str, Any]) -> SetRequest:
6855
- """Deserializes the SetRequest from a dictionary."""
6856
- return cls(
6857
- access_control_list=_repeated_dict(d, "access_control_list", AccessControl),
6858
- object_id=d.get("objectId", None),
6859
- object_type=_enum(d, "objectType", ObjectTypePlural),
6860
- )
6861
-
6862
-
6863
5731
  @dataclass
6864
5732
  class SetResponse:
6865
5733
  access_control_list: Optional[List[AccessControl]] = None
@@ -6871,130 +5739,34 @@ class SetResponse:
6871
5739
  """A singular noun object type."""
6872
5740
 
6873
5741
  def as_dict(self) -> dict:
6874
- """Serializes the SetResponse into a dictionary suitable for use as a JSON request body."""
6875
- body = {}
6876
- if self.access_control_list:
6877
- body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
6878
- if self.object_id is not None:
6879
- body["object_id"] = self.object_id
6880
- if self.object_type is not None:
6881
- body["object_type"] = self.object_type.value
6882
- return body
6883
-
6884
- def as_shallow_dict(self) -> dict:
6885
- """Serializes the SetResponse into a shallow dictionary of its immediate attributes."""
6886
- body = {}
6887
- if self.access_control_list:
6888
- body["access_control_list"] = self.access_control_list
6889
- if self.object_id is not None:
6890
- body["object_id"] = self.object_id
6891
- if self.object_type is not None:
6892
- body["object_type"] = self.object_type
6893
- return body
6894
-
6895
- @classmethod
6896
- def from_dict(cls, d: Dict[str, Any]) -> SetResponse:
6897
- """Deserializes the SetResponse from a dictionary."""
6898
- return cls(
6899
- access_control_list=_repeated_dict(d, "access_control_list", AccessControl),
6900
- object_id=d.get("object_id", None),
6901
- object_type=_enum(d, "object_type", ObjectType),
6902
- )
6903
-
6904
-
6905
- @dataclass
6906
- class SetWorkspaceWarehouseConfigRequest:
6907
- channel: Optional[Channel] = None
6908
- """Optional: Channel selection details"""
6909
-
6910
- config_param: Optional[RepeatedEndpointConfPairs] = None
6911
- """Deprecated: Use sql_configuration_parameters"""
6912
-
6913
- data_access_config: Optional[List[EndpointConfPair]] = None
6914
- """Spark confs for external hive metastore configuration JSON serialized size must be less than <=
6915
- 512K"""
6916
-
6917
- enabled_warehouse_types: Optional[List[WarehouseTypePair]] = None
6918
- """List of Warehouse Types allowed in this workspace (limits allowed value of the type field in
6919
- CreateWarehouse and EditWarehouse). Note: Some types cannot be disabled, they don't need to be
6920
- specified in SetWorkspaceWarehouseConfig. Note: Disabling a type may cause existing warehouses
6921
- to be converted to another type. Used by frontend to save specific type availability in the
6922
- warehouse create and edit form UI."""
6923
-
6924
- global_param: Optional[RepeatedEndpointConfPairs] = None
6925
- """Deprecated: Use sql_configuration_parameters"""
6926
-
6927
- google_service_account: Optional[str] = None
6928
- """GCP only: Google Service Account used to pass to cluster to access Google Cloud Storage"""
6929
-
6930
- instance_profile_arn: Optional[str] = None
6931
- """AWS Only: Instance profile used to pass IAM role to the cluster"""
6932
-
6933
- security_policy: Optional[SetWorkspaceWarehouseConfigRequestSecurityPolicy] = None
6934
- """Security policy for warehouses"""
6935
-
6936
- sql_configuration_parameters: Optional[RepeatedEndpointConfPairs] = None
6937
- """SQL configuration parameters"""
6938
-
6939
- def as_dict(self) -> dict:
6940
- """Serializes the SetWorkspaceWarehouseConfigRequest into a dictionary suitable for use as a JSON request body."""
6941
- body = {}
6942
- if self.channel:
6943
- body["channel"] = self.channel.as_dict()
6944
- if self.config_param:
6945
- body["config_param"] = self.config_param.as_dict()
6946
- if self.data_access_config:
6947
- body["data_access_config"] = [v.as_dict() for v in self.data_access_config]
6948
- if self.enabled_warehouse_types:
6949
- body["enabled_warehouse_types"] = [v.as_dict() for v in self.enabled_warehouse_types]
6950
- if self.global_param:
6951
- body["global_param"] = self.global_param.as_dict()
6952
- if self.google_service_account is not None:
6953
- body["google_service_account"] = self.google_service_account
6954
- if self.instance_profile_arn is not None:
6955
- body["instance_profile_arn"] = self.instance_profile_arn
6956
- if self.security_policy is not None:
6957
- body["security_policy"] = self.security_policy.value
6958
- if self.sql_configuration_parameters:
6959
- body["sql_configuration_parameters"] = self.sql_configuration_parameters.as_dict()
5742
+ """Serializes the SetResponse into a dictionary suitable for use as a JSON request body."""
5743
+ body = {}
5744
+ if self.access_control_list:
5745
+ body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
5746
+ if self.object_id is not None:
5747
+ body["object_id"] = self.object_id
5748
+ if self.object_type is not None:
5749
+ body["object_type"] = self.object_type.value
6960
5750
  return body
6961
5751
 
6962
5752
  def as_shallow_dict(self) -> dict:
6963
- """Serializes the SetWorkspaceWarehouseConfigRequest into a shallow dictionary of its immediate attributes."""
5753
+ """Serializes the SetResponse into a shallow dictionary of its immediate attributes."""
6964
5754
  body = {}
6965
- if self.channel:
6966
- body["channel"] = self.channel
6967
- if self.config_param:
6968
- body["config_param"] = self.config_param
6969
- if self.data_access_config:
6970
- body["data_access_config"] = self.data_access_config
6971
- if self.enabled_warehouse_types:
6972
- body["enabled_warehouse_types"] = self.enabled_warehouse_types
6973
- if self.global_param:
6974
- body["global_param"] = self.global_param
6975
- if self.google_service_account is not None:
6976
- body["google_service_account"] = self.google_service_account
6977
- if self.instance_profile_arn is not None:
6978
- body["instance_profile_arn"] = self.instance_profile_arn
6979
- if self.security_policy is not None:
6980
- body["security_policy"] = self.security_policy
6981
- if self.sql_configuration_parameters:
6982
- body["sql_configuration_parameters"] = self.sql_configuration_parameters
5755
+ if self.access_control_list:
5756
+ body["access_control_list"] = self.access_control_list
5757
+ if self.object_id is not None:
5758
+ body["object_id"] = self.object_id
5759
+ if self.object_type is not None:
5760
+ body["object_type"] = self.object_type
6983
5761
  return body
6984
5762
 
6985
5763
  @classmethod
6986
- def from_dict(cls, d: Dict[str, Any]) -> SetWorkspaceWarehouseConfigRequest:
6987
- """Deserializes the SetWorkspaceWarehouseConfigRequest from a dictionary."""
5764
+ def from_dict(cls, d: Dict[str, Any]) -> SetResponse:
5765
+ """Deserializes the SetResponse from a dictionary."""
6988
5766
  return cls(
6989
- channel=_from_dict(d, "channel", Channel),
6990
- config_param=_from_dict(d, "config_param", RepeatedEndpointConfPairs),
6991
- data_access_config=_repeated_dict(d, "data_access_config", EndpointConfPair),
6992
- enabled_warehouse_types=_repeated_dict(d, "enabled_warehouse_types", WarehouseTypePair),
6993
- global_param=_from_dict(d, "global_param", RepeatedEndpointConfPairs),
6994
- google_service_account=d.get("google_service_account", None),
6995
- instance_profile_arn=d.get("instance_profile_arn", None),
6996
- security_policy=_enum(d, "security_policy", SetWorkspaceWarehouseConfigRequestSecurityPolicy),
6997
- sql_configuration_parameters=_from_dict(d, "sql_configuration_parameters", RepeatedEndpointConfPairs),
5767
+ access_control_list=_repeated_dict(d, "access_control_list", AccessControl),
5768
+ object_id=d.get("object_id", None),
5769
+ object_type=_enum(d, "object_type", ObjectType),
6998
5770
  )
6999
5771
 
7000
5772
 
@@ -7531,107 +6303,6 @@ class TransferOwnershipObjectId:
7531
6303
  return cls(new_owner=d.get("new_owner", None))
7532
6304
 
7533
6305
 
7534
- @dataclass
7535
- class TransferOwnershipRequest:
7536
- new_owner: Optional[str] = None
7537
- """Email address for the new owner, who must exist in the workspace."""
7538
-
7539
- object_id: Optional[TransferOwnershipObjectId] = None
7540
- """The ID of the object on which to change ownership."""
7541
-
7542
- object_type: Optional[OwnableObjectType] = None
7543
- """The type of object on which to change ownership."""
7544
-
7545
- def as_dict(self) -> dict:
7546
- """Serializes the TransferOwnershipRequest into a dictionary suitable for use as a JSON request body."""
7547
- body = {}
7548
- if self.new_owner is not None:
7549
- body["new_owner"] = self.new_owner
7550
- if self.object_id:
7551
- body["objectId"] = self.object_id.as_dict()
7552
- if self.object_type is not None:
7553
- body["objectType"] = self.object_type.value
7554
- return body
7555
-
7556
- def as_shallow_dict(self) -> dict:
7557
- """Serializes the TransferOwnershipRequest into a shallow dictionary of its immediate attributes."""
7558
- body = {}
7559
- if self.new_owner is not None:
7560
- body["new_owner"] = self.new_owner
7561
- if self.object_id:
7562
- body["objectId"] = self.object_id
7563
- if self.object_type is not None:
7564
- body["objectType"] = self.object_type
7565
- return body
7566
-
7567
- @classmethod
7568
- def from_dict(cls, d: Dict[str, Any]) -> TransferOwnershipRequest:
7569
- """Deserializes the TransferOwnershipRequest from a dictionary."""
7570
- return cls(
7571
- new_owner=d.get("new_owner", None),
7572
- object_id=_from_dict(d, "objectId", TransferOwnershipObjectId),
7573
- object_type=_enum(d, "objectType", OwnableObjectType),
7574
- )
7575
-
7576
-
7577
- @dataclass
7578
- class UpdateAlertRequest:
7579
- update_mask: str
7580
- """The field mask must be a single string, with multiple fields separated by commas (no spaces).
7581
- The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields
7582
- (e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed,
7583
- as only the entire collection field can be specified. Field names must exactly match the
7584
- resource field names.
7585
-
7586
- A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
7587
- fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the
7588
- API changes in the future."""
7589
-
7590
- alert: Optional[UpdateAlertRequestAlert] = None
7591
-
7592
- auto_resolve_display_name: Optional[bool] = None
7593
- """If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the
7594
- alert's display name conflicts with an existing alert's display name."""
7595
-
7596
- id: Optional[str] = None
7597
-
7598
- def as_dict(self) -> dict:
7599
- """Serializes the UpdateAlertRequest into a dictionary suitable for use as a JSON request body."""
7600
- body = {}
7601
- if self.alert:
7602
- body["alert"] = self.alert.as_dict()
7603
- if self.auto_resolve_display_name is not None:
7604
- body["auto_resolve_display_name"] = self.auto_resolve_display_name
7605
- if self.id is not None:
7606
- body["id"] = self.id
7607
- if self.update_mask is not None:
7608
- body["update_mask"] = self.update_mask
7609
- return body
7610
-
7611
- def as_shallow_dict(self) -> dict:
7612
- """Serializes the UpdateAlertRequest into a shallow dictionary of its immediate attributes."""
7613
- body = {}
7614
- if self.alert:
7615
- body["alert"] = self.alert
7616
- if self.auto_resolve_display_name is not None:
7617
- body["auto_resolve_display_name"] = self.auto_resolve_display_name
7618
- if self.id is not None:
7619
- body["id"] = self.id
7620
- if self.update_mask is not None:
7621
- body["update_mask"] = self.update_mask
7622
- return body
7623
-
7624
- @classmethod
7625
- def from_dict(cls, d: Dict[str, Any]) -> UpdateAlertRequest:
7626
- """Deserializes the UpdateAlertRequest from a dictionary."""
7627
- return cls(
7628
- alert=_from_dict(d, "alert", UpdateAlertRequestAlert),
7629
- auto_resolve_display_name=d.get("auto_resolve_display_name", None),
7630
- id=d.get("id", None),
7631
- update_mask=d.get("update_mask", None),
7632
- )
7633
-
7634
-
7635
6306
  @dataclass
7636
6307
  class UpdateAlertRequestAlert:
7637
6308
  condition: Optional[AlertCondition] = None
@@ -7721,64 +6392,6 @@ class UpdateAlertRequestAlert:
7721
6392
  )
7722
6393
 
7723
6394
 
7724
- @dataclass
7725
- class UpdateQueryRequest:
7726
- update_mask: str
7727
- """The field mask must be a single string, with multiple fields separated by commas (no spaces).
7728
- The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields
7729
- (e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed,
7730
- as only the entire collection field can be specified. Field names must exactly match the
7731
- resource field names.
7732
-
7733
- A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
7734
- fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the
7735
- API changes in the future."""
7736
-
7737
- auto_resolve_display_name: Optional[bool] = None
7738
- """If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the
7739
- alert's display name conflicts with an existing alert's display name."""
7740
-
7741
- id: Optional[str] = None
7742
-
7743
- query: Optional[UpdateQueryRequestQuery] = None
7744
-
7745
- def as_dict(self) -> dict:
7746
- """Serializes the UpdateQueryRequest into a dictionary suitable for use as a JSON request body."""
7747
- body = {}
7748
- if self.auto_resolve_display_name is not None:
7749
- body["auto_resolve_display_name"] = self.auto_resolve_display_name
7750
- if self.id is not None:
7751
- body["id"] = self.id
7752
- if self.query:
7753
- body["query"] = self.query.as_dict()
7754
- if self.update_mask is not None:
7755
- body["update_mask"] = self.update_mask
7756
- return body
7757
-
7758
- def as_shallow_dict(self) -> dict:
7759
- """Serializes the UpdateQueryRequest into a shallow dictionary of its immediate attributes."""
7760
- body = {}
7761
- if self.auto_resolve_display_name is not None:
7762
- body["auto_resolve_display_name"] = self.auto_resolve_display_name
7763
- if self.id is not None:
7764
- body["id"] = self.id
7765
- if self.query:
7766
- body["query"] = self.query
7767
- if self.update_mask is not None:
7768
- body["update_mask"] = self.update_mask
7769
- return body
7770
-
7771
- @classmethod
7772
- def from_dict(cls, d: Dict[str, Any]) -> UpdateQueryRequest:
7773
- """Deserializes the UpdateQueryRequest from a dictionary."""
7774
- return cls(
7775
- auto_resolve_display_name=d.get("auto_resolve_display_name", None),
7776
- id=d.get("id", None),
7777
- query=_from_dict(d, "query", UpdateQueryRequestQuery),
7778
- update_mask=d.get("update_mask", None),
7779
- )
7780
-
7781
-
7782
6395
  @dataclass
7783
6396
  class UpdateQueryRequestQuery:
7784
6397
  apply_auto_limit: Optional[bool] = None
@@ -7903,55 +6516,6 @@ class UpdateResponse:
7903
6516
  return cls()
7904
6517
 
7905
6518
 
7906
- @dataclass
7907
- class UpdateVisualizationRequest:
7908
- update_mask: str
7909
- """The field mask must be a single string, with multiple fields separated by commas (no spaces).
7910
- The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields
7911
- (e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed,
7912
- as only the entire collection field can be specified. Field names must exactly match the
7913
- resource field names.
7914
-
7915
- A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
7916
- fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the
7917
- API changes in the future."""
7918
-
7919
- id: Optional[str] = None
7920
-
7921
- visualization: Optional[UpdateVisualizationRequestVisualization] = None
7922
-
7923
- def as_dict(self) -> dict:
7924
- """Serializes the UpdateVisualizationRequest into a dictionary suitable for use as a JSON request body."""
7925
- body = {}
7926
- if self.id is not None:
7927
- body["id"] = self.id
7928
- if self.update_mask is not None:
7929
- body["update_mask"] = self.update_mask
7930
- if self.visualization:
7931
- body["visualization"] = self.visualization.as_dict()
7932
- return body
7933
-
7934
- def as_shallow_dict(self) -> dict:
7935
- """Serializes the UpdateVisualizationRequest into a shallow dictionary of its immediate attributes."""
7936
- body = {}
7937
- if self.id is not None:
7938
- body["id"] = self.id
7939
- if self.update_mask is not None:
7940
- body["update_mask"] = self.update_mask
7941
- if self.visualization:
7942
- body["visualization"] = self.visualization
7943
- return body
7944
-
7945
- @classmethod
7946
- def from_dict(cls, d: Dict[str, Any]) -> UpdateVisualizationRequest:
7947
- """Deserializes the UpdateVisualizationRequest from a dictionary."""
7948
- return cls(
7949
- id=d.get("id", None),
7950
- update_mask=d.get("update_mask", None),
7951
- visualization=_from_dict(d, "visualization", UpdateVisualizationRequestVisualization),
7952
- )
7953
-
7954
-
7955
6519
  @dataclass
7956
6520
  class UpdateVisualizationRequestVisualization:
7957
6521
  display_name: Optional[str] = None
@@ -8005,73 +6569,6 @@ class UpdateVisualizationRequestVisualization:
8005
6569
  )
8006
6570
 
8007
6571
 
8008
- @dataclass
8009
- class UpdateWidgetRequest:
8010
- dashboard_id: str
8011
- """Dashboard ID returned by :method:dashboards/create."""
8012
-
8013
- options: WidgetOptions
8014
-
8015
- width: int
8016
- """Width of a widget"""
8017
-
8018
- id: Optional[str] = None
8019
- """Widget ID returned by :method:dashboardwidgets/create"""
8020
-
8021
- text: Optional[str] = None
8022
- """If this is a textbox widget, the application displays this text. This field is ignored if the
8023
- widget contains a visualization in the `visualization` field."""
8024
-
8025
- visualization_id: Optional[str] = None
8026
- """Query Vizualization ID returned by :method:queryvisualizations/create."""
8027
-
8028
- def as_dict(self) -> dict:
8029
- """Serializes the UpdateWidgetRequest into a dictionary suitable for use as a JSON request body."""
8030
- body = {}
8031
- if self.dashboard_id is not None:
8032
- body["dashboard_id"] = self.dashboard_id
8033
- if self.id is not None:
8034
- body["id"] = self.id
8035
- if self.options:
8036
- body["options"] = self.options.as_dict()
8037
- if self.text is not None:
8038
- body["text"] = self.text
8039
- if self.visualization_id is not None:
8040
- body["visualization_id"] = self.visualization_id
8041
- if self.width is not None:
8042
- body["width"] = self.width
8043
- return body
8044
-
8045
- def as_shallow_dict(self) -> dict:
8046
- """Serializes the UpdateWidgetRequest into a shallow dictionary of its immediate attributes."""
8047
- body = {}
8048
- if self.dashboard_id is not None:
8049
- body["dashboard_id"] = self.dashboard_id
8050
- if self.id is not None:
8051
- body["id"] = self.id
8052
- if self.options:
8053
- body["options"] = self.options
8054
- if self.text is not None:
8055
- body["text"] = self.text
8056
- if self.visualization_id is not None:
8057
- body["visualization_id"] = self.visualization_id
8058
- if self.width is not None:
8059
- body["width"] = self.width
8060
- return body
8061
-
8062
- @classmethod
8063
- def from_dict(cls, d: Dict[str, Any]) -> UpdateWidgetRequest:
8064
- """Deserializes the UpdateWidgetRequest from a dictionary."""
8065
- return cls(
8066
- dashboard_id=d.get("dashboard_id", None),
8067
- id=d.get("id", None),
8068
- options=_from_dict(d, "options", WidgetOptions),
8069
- text=d.get("text", None),
8070
- visualization_id=d.get("visualization_id", None),
8071
- width=d.get("width", None),
8072
- )
8073
-
8074
-
8075
6572
  @dataclass
8076
6573
  class User:
8077
6574
  email: Optional[str] = None
@@ -8425,40 +6922,6 @@ class WarehousePermissionsDescription:
8425
6922
  )
8426
6923
 
8427
6924
 
8428
- @dataclass
8429
- class WarehousePermissionsRequest:
8430
- access_control_list: Optional[List[WarehouseAccessControlRequest]] = None
8431
-
8432
- warehouse_id: Optional[str] = None
8433
- """The SQL warehouse for which to get or manage permissions."""
8434
-
8435
- def as_dict(self) -> dict:
8436
- """Serializes the WarehousePermissionsRequest into a dictionary suitable for use as a JSON request body."""
8437
- body = {}
8438
- if self.access_control_list:
8439
- body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
8440
- if self.warehouse_id is not None:
8441
- body["warehouse_id"] = self.warehouse_id
8442
- return body
8443
-
8444
- def as_shallow_dict(self) -> dict:
8445
- """Serializes the WarehousePermissionsRequest into a shallow dictionary of its immediate attributes."""
8446
- body = {}
8447
- if self.access_control_list:
8448
- body["access_control_list"] = self.access_control_list
8449
- if self.warehouse_id is not None:
8450
- body["warehouse_id"] = self.warehouse_id
8451
- return body
8452
-
8453
- @classmethod
8454
- def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissionsRequest:
8455
- """Deserializes the WarehousePermissionsRequest from a dictionary."""
8456
- return cls(
8457
- access_control_list=_repeated_dict(d, "access_control_list", WarehouseAccessControlRequest),
8458
- warehouse_id=d.get("warehouse_id", None),
8459
- )
8460
-
8461
-
8462
6925
  @dataclass
8463
6926
  class WarehouseTypePair:
8464
6927
  enabled: Optional[bool] = None
@@ -9228,56 +7691,6 @@ class DashboardsAPI:
9228
7691
  def __init__(self, api_client):
9229
7692
  self._api = api_client
9230
7693
 
9231
- def create(
9232
- self,
9233
- name: str,
9234
- *,
9235
- dashboard_filters_enabled: Optional[bool] = None,
9236
- is_favorite: Optional[bool] = None,
9237
- parent: Optional[str] = None,
9238
- run_as_role: Optional[RunAsRole] = None,
9239
- tags: Optional[List[str]] = None,
9240
- ) -> Dashboard:
9241
- """Creates a new dashboard object. Only the name parameter is required in the POST request JSON body.
9242
- Other fields can be included when duplicating dashboards with this API. Databricks does not recommend
9243
- designing dashboards exclusively using this API.',
9244
-
9245
- :param name: str
9246
- The title of this dashboard that appears in list views and at the top of the dashboard page.
9247
- :param dashboard_filters_enabled: bool (optional)
9248
- Indicates whether the dashboard filters are enabled
9249
- :param is_favorite: bool (optional)
9250
- Indicates whether this dashboard object should appear in the current user's favorites list.
9251
- :param parent: str (optional)
9252
- The identifier of the workspace folder containing the object.
9253
- :param run_as_role: :class:`RunAsRole` (optional)
9254
- Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
9255
- viewer" behavior) or `"owner"` (signifying "run as owner" behavior)
9256
- :param tags: List[str] (optional)
9257
-
9258
- :returns: :class:`Dashboard`
9259
- """
9260
- body = {}
9261
- if dashboard_filters_enabled is not None:
9262
- body["dashboard_filters_enabled"] = dashboard_filters_enabled
9263
- if is_favorite is not None:
9264
- body["is_favorite"] = is_favorite
9265
- if name is not None:
9266
- body["name"] = name
9267
- if parent is not None:
9268
- body["parent"] = parent
9269
- if run_as_role is not None:
9270
- body["run_as_role"] = run_as_role.value
9271
- if tags is not None:
9272
- body["tags"] = [v for v in tags]
9273
- headers = {
9274
- "Accept": "application/json",
9275
- "Content-Type": "application/json",
9276
- }
9277
-
9278
- res = self._api.do("POST", "/api/2.0/preview/sql/dashboards", body=body, headers=headers)
9279
- return Dashboard.from_dict(res)
9280
-
9281
7694
  def delete(self, dashboard_id: str):
9282
7695
  """Moves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot
9283
7696
  be shared.