databricks-sdk 0.19.1__py3-none-any.whl → 0.21.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 (35) hide show
  1. databricks/sdk/__init__.py +28 -6
  2. databricks/sdk/_widgets/__init__.py +2 -2
  3. databricks/sdk/config.py +3 -2
  4. databricks/sdk/core.py +4 -2
  5. databricks/sdk/mixins/workspace.py +2 -1
  6. databricks/sdk/oauth.py +1 -1
  7. databricks/sdk/runtime/__init__.py +85 -11
  8. databricks/sdk/runtime/dbutils_stub.py +1 -1
  9. databricks/sdk/service/_internal.py +1 -1
  10. databricks/sdk/service/billing.py +64 -1
  11. databricks/sdk/service/catalog.py +796 -84
  12. databricks/sdk/service/compute.py +391 -13
  13. databricks/sdk/service/dashboards.py +15 -0
  14. databricks/sdk/service/files.py +289 -15
  15. databricks/sdk/service/iam.py +214 -0
  16. databricks/sdk/service/jobs.py +242 -143
  17. databricks/sdk/service/ml.py +407 -0
  18. databricks/sdk/service/oauth2.py +83 -0
  19. databricks/sdk/service/pipelines.py +78 -8
  20. databricks/sdk/service/provisioning.py +108 -36
  21. databricks/sdk/service/serving.py +101 -35
  22. databricks/sdk/service/settings.py +1316 -186
  23. databricks/sdk/service/sharing.py +94 -18
  24. databricks/sdk/service/sql.py +230 -13
  25. databricks/sdk/service/vectorsearch.py +105 -60
  26. databricks/sdk/service/workspace.py +175 -1
  27. databricks/sdk/version.py +1 -1
  28. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/METADATA +3 -1
  29. databricks_sdk-0.21.0.dist-info/RECORD +53 -0
  30. databricks/sdk/runtime/stub.py +0 -48
  31. databricks_sdk-0.19.1.dist-info/RECORD +0 -54
  32. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/LICENSE +0 -0
  33. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/NOTICE +0 -0
  34. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/WHEEL +0 -0
  35. {databricks_sdk-0.19.1.dist-info → databricks_sdk-0.21.0.dist-info}/top_level.txt +0 -0
@@ -303,6 +303,20 @@ class BaseChunkInfo:
303
303
  row_offset=d.get('row_offset', None))
304
304
 
305
305
 
306
+ @dataclass
307
+ class CancelExecutionResponse:
308
+
309
+ def as_dict(self) -> dict:
310
+ """Serializes the CancelExecutionResponse into a dictionary suitable for use as a JSON request body."""
311
+ body = {}
312
+ return body
313
+
314
+ @classmethod
315
+ def from_dict(cls, d: Dict[str, any]) -> CancelExecutionResponse:
316
+ """Deserializes the CancelExecutionResponse from a dictionary."""
317
+ return cls()
318
+
319
+
306
320
  @dataclass
307
321
  class Channel:
308
322
  dbsql_version: Optional[str] = None
@@ -346,7 +360,6 @@ class ChannelInfo:
346
360
 
347
361
 
348
362
  class ChannelName(Enum):
349
- """Name of the channel"""
350
363
 
351
364
  CHANNEL_NAME_CURRENT = 'CHANNEL_NAME_CURRENT'
352
365
  CHANNEL_NAME_CUSTOM = 'CHANNEL_NAME_CUSTOM'
@@ -896,6 +909,34 @@ class DataSource:
896
909
  warehouse_id=d.get('warehouse_id', None))
897
910
 
898
911
 
912
+ @dataclass
913
+ class DeleteResponse:
914
+
915
+ def as_dict(self) -> dict:
916
+ """Serializes the DeleteResponse into a dictionary suitable for use as a JSON request body."""
917
+ body = {}
918
+ return body
919
+
920
+ @classmethod
921
+ def from_dict(cls, d: Dict[str, any]) -> DeleteResponse:
922
+ """Deserializes the DeleteResponse from a dictionary."""
923
+ return cls()
924
+
925
+
926
+ @dataclass
927
+ class DeleteWarehouseResponse:
928
+
929
+ def as_dict(self) -> dict:
930
+ """Serializes the DeleteWarehouseResponse into a dictionary suitable for use as a JSON request body."""
931
+ body = {}
932
+ return body
933
+
934
+ @classmethod
935
+ def from_dict(cls, d: Dict[str, any]) -> DeleteWarehouseResponse:
936
+ """Deserializes the DeleteWarehouseResponse from a dictionary."""
937
+ return cls()
938
+
939
+
899
940
  class Disposition(Enum):
900
941
  """The fetch disposition provides two modes of fetching results: `INLINE` and `EXTERNAL_LINKS`.
901
942
 
@@ -1081,6 +1122,20 @@ class EditWarehouseRequestWarehouseType(Enum):
1081
1122
  TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED'
1082
1123
 
1083
1124
 
1125
+ @dataclass
1126
+ class EditWarehouseResponse:
1127
+
1128
+ def as_dict(self) -> dict:
1129
+ """Serializes the EditWarehouseResponse into a dictionary suitable for use as a JSON request body."""
1130
+ body = {}
1131
+ return body
1132
+
1133
+ @classmethod
1134
+ def from_dict(cls, d: Dict[str, any]) -> EditWarehouseResponse:
1135
+ """Deserializes the EditWarehouseResponse from a dictionary."""
1136
+ return cls()
1137
+
1138
+
1084
1139
  @dataclass
1085
1140
  class EndpointConfPair:
1086
1141
  key: Optional[str] = None
@@ -2008,6 +2063,36 @@ class ListWarehousesResponse:
2008
2063
  return cls(warehouses=_repeated_dict(d, 'warehouses', EndpointInfo))
2009
2064
 
2010
2065
 
2066
+ @dataclass
2067
+ class MultiValuesOptions:
2068
+ """If specified, allows multiple values to be selected for this parameter. Only applies to dropdown
2069
+ list and query-based dropdown list parameters."""
2070
+
2071
+ prefix: Optional[str] = None
2072
+ """Character that prefixes each selected parameter value."""
2073
+
2074
+ separator: Optional[str] = None
2075
+ """Character that separates each selected parameter value. Defaults to a comma."""
2076
+
2077
+ suffix: Optional[str] = None
2078
+ """Character that suffixes each selected parameter value."""
2079
+
2080
+ def as_dict(self) -> dict:
2081
+ """Serializes the MultiValuesOptions into a dictionary suitable for use as a JSON request body."""
2082
+ body = {}
2083
+ if self.prefix is not None: body['prefix'] = self.prefix
2084
+ if self.separator is not None: body['separator'] = self.separator
2085
+ if self.suffix is not None: body['suffix'] = self.suffix
2086
+ return body
2087
+
2088
+ @classmethod
2089
+ def from_dict(cls, d: Dict[str, any]) -> MultiValuesOptions:
2090
+ """Deserializes the MultiValuesOptions from a dictionary."""
2091
+ return cls(prefix=d.get('prefix', None),
2092
+ separator=d.get('separator', None),
2093
+ suffix=d.get('suffix', None))
2094
+
2095
+
2011
2096
  class ObjectType(Enum):
2012
2097
  """A singular noun object type."""
2013
2098
 
@@ -2064,9 +2149,20 @@ class OwnableObjectType(Enum):
2064
2149
 
2065
2150
  @dataclass
2066
2151
  class Parameter:
2152
+ enum_options: Optional[str] = None
2153
+ """List of valid parameter values, newline delimited. Only applies for dropdown list parameters."""
2154
+
2155
+ multi_values_options: Optional[MultiValuesOptions] = None
2156
+ """If specified, allows multiple values to be selected for this parameter. Only applies to dropdown
2157
+ list and query-based dropdown list parameters."""
2158
+
2067
2159
  name: Optional[str] = None
2068
2160
  """The literal parameter marker that appears between double curly braces in the query text."""
2069
2161
 
2162
+ query_id: Optional[str] = None
2163
+ """The UUID of the query that provides the parameter values. Only applies for query-based dropdown
2164
+ list parameters."""
2165
+
2070
2166
  title: Optional[str] = None
2071
2167
  """The text displayed in a parameter picking widget."""
2072
2168
 
@@ -2079,7 +2175,10 @@ class Parameter:
2079
2175
  def as_dict(self) -> dict:
2080
2176
  """Serializes the Parameter into a dictionary suitable for use as a JSON request body."""
2081
2177
  body = {}
2178
+ if self.enum_options is not None: body['enumOptions'] = self.enum_options
2179
+ if self.multi_values_options: body['multiValuesOptions'] = self.multi_values_options.as_dict()
2082
2180
  if self.name is not None: body['name'] = self.name
2181
+ if self.query_id is not None: body['queryId'] = self.query_id
2083
2182
  if self.title is not None: body['title'] = self.title
2084
2183
  if self.type is not None: body['type'] = self.type.value
2085
2184
  if self.value: body['value'] = self.value
@@ -2088,7 +2187,10 @@ class Parameter:
2088
2187
  @classmethod
2089
2188
  def from_dict(cls, d: Dict[str, any]) -> Parameter:
2090
2189
  """Deserializes the Parameter from a dictionary."""
2091
- return cls(name=d.get('name', None),
2190
+ return cls(enum_options=d.get('enumOptions', None),
2191
+ multi_values_options=_from_dict(d, 'multiValuesOptions', MultiValuesOptions),
2192
+ name=d.get('name', None),
2193
+ query_id=d.get('queryId', None),
2092
2194
  title=d.get('title', None),
2093
2195
  type=_enum(d, 'type', ParameterType),
2094
2196
  value=d.get('value', None))
@@ -2098,7 +2200,9 @@ class ParameterType(Enum):
2098
2200
  """Parameters can have several different types."""
2099
2201
 
2100
2202
  DATETIME = 'datetime'
2203
+ ENUM = 'enum'
2101
2204
  NUMBER = 'number'
2205
+ QUERY = 'query'
2102
2206
  TEXT = 'text'
2103
2207
 
2104
2208
 
@@ -2536,9 +2640,6 @@ class QueryMetrics:
2536
2640
  photon_total_time_ms: Optional[int] = None
2537
2641
  """Total execution time for all individual Photon query engine tasks in the query, in milliseconds."""
2538
2642
 
2539
- planning_phases: Optional[List[Any]] = None
2540
- """Reserved for internal use."""
2541
-
2542
2643
  planning_time_ms: Optional[int] = None
2543
2644
  """Reserved for internal use."""
2544
2645
 
@@ -2608,7 +2709,6 @@ class QueryMetrics:
2608
2709
  if self.overloading_queue_start_timestamp is not None:
2609
2710
  body['overloading_queue_start_timestamp'] = self.overloading_queue_start_timestamp
2610
2711
  if self.photon_total_time_ms is not None: body['photon_total_time_ms'] = self.photon_total_time_ms
2611
- if self.planning_phases: body['planning_phases'] = [v for v in self.planning_phases]
2612
2712
  if self.planning_time_ms is not None: body['planning_time_ms'] = self.planning_time_ms
2613
2713
  if self.provisioning_queue_start_timestamp is not None:
2614
2714
  body['provisioning_queue_start_timestamp'] = self.provisioning_queue_start_timestamp
@@ -2642,7 +2742,6 @@ class QueryMetrics:
2642
2742
  network_sent_bytes=d.get('network_sent_bytes', None),
2643
2743
  overloading_queue_start_timestamp=d.get('overloading_queue_start_timestamp', None),
2644
2744
  photon_total_time_ms=d.get('photon_total_time_ms', None),
2645
- planning_phases=d.get('planning_phases', None),
2646
2745
  planning_time_ms=d.get('planning_time_ms', None),
2647
2746
  provisioning_queue_start_timestamp=d.get('provisioning_queue_start_timestamp', None),
2648
2747
  pruned_bytes=d.get('pruned_bytes', None),
@@ -2800,6 +2899,20 @@ class RepeatedEndpointConfPairs:
2800
2899
  configuration_pairs=_repeated_dict(d, 'configuration_pairs', EndpointConfPair))
2801
2900
 
2802
2901
 
2902
+ @dataclass
2903
+ class RestoreResponse:
2904
+
2905
+ def as_dict(self) -> dict:
2906
+ """Serializes the RestoreResponse into a dictionary suitable for use as a JSON request body."""
2907
+ body = {}
2908
+ return body
2909
+
2910
+ @classmethod
2911
+ def from_dict(cls, d: Dict[str, any]) -> RestoreResponse:
2912
+ """Deserializes the RestoreResponse from a dictionary."""
2913
+ return cls()
2914
+
2915
+
2803
2916
  @dataclass
2804
2917
  class ResultData:
2805
2918
  """Contains the result data of a single chunk when using `INLINE` disposition. When using
@@ -3083,6 +3196,20 @@ class SetWorkspaceWarehouseConfigRequestSecurityPolicy(Enum):
3083
3196
  PASSTHROUGH = 'PASSTHROUGH'
3084
3197
 
3085
3198
 
3199
+ @dataclass
3200
+ class SetWorkspaceWarehouseConfigResponse:
3201
+
3202
+ def as_dict(self) -> dict:
3203
+ """Serializes the SetWorkspaceWarehouseConfigResponse into a dictionary suitable for use as a JSON request body."""
3204
+ body = {}
3205
+ return body
3206
+
3207
+ @classmethod
3208
+ def from_dict(cls, d: Dict[str, any]) -> SetWorkspaceWarehouseConfigResponse:
3209
+ """Deserializes the SetWorkspaceWarehouseConfigResponse from a dictionary."""
3210
+ return cls()
3211
+
3212
+
3086
3213
  class SpotInstancePolicy(Enum):
3087
3214
  """Configurations whether the warehouse should use spot instances."""
3088
3215
 
@@ -3091,6 +3218,20 @@ class SpotInstancePolicy(Enum):
3091
3218
  RELIABILITY_OPTIMIZED = 'RELIABILITY_OPTIMIZED'
3092
3219
 
3093
3220
 
3221
+ @dataclass
3222
+ class StartWarehouseResponse:
3223
+
3224
+ def as_dict(self) -> dict:
3225
+ """Serializes the StartWarehouseResponse into a dictionary suitable for use as a JSON request body."""
3226
+ body = {}
3227
+ return body
3228
+
3229
+ @classmethod
3230
+ def from_dict(cls, d: Dict[str, any]) -> StartWarehouseResponse:
3231
+ """Deserializes the StartWarehouseResponse from a dictionary."""
3232
+ return cls()
3233
+
3234
+
3094
3235
  class State(Enum):
3095
3236
  """State of the warehouse"""
3096
3237
 
@@ -3180,6 +3321,20 @@ class Status(Enum):
3180
3321
  STATUS_UNSPECIFIED = 'STATUS_UNSPECIFIED'
3181
3322
 
3182
3323
 
3324
+ @dataclass
3325
+ class StopWarehouseResponse:
3326
+
3327
+ def as_dict(self) -> dict:
3328
+ """Serializes the StopWarehouseResponse into a dictionary suitable for use as a JSON request body."""
3329
+ body = {}
3330
+ return body
3331
+
3332
+ @classmethod
3333
+ def from_dict(cls, d: Dict[str, any]) -> StopWarehouseResponse:
3334
+ """Deserializes the StopWarehouseResponse from a dictionary."""
3335
+ return cls()
3336
+
3337
+
3183
3338
  @dataclass
3184
3339
  class Success:
3185
3340
  message: Optional[SuccessMessage] = None
@@ -3359,6 +3514,20 @@ class TransferOwnershipObjectId:
3359
3514
  return cls(new_owner=d.get('new_owner', None))
3360
3515
 
3361
3516
 
3517
+ @dataclass
3518
+ class UpdateResponse:
3519
+
3520
+ def as_dict(self) -> dict:
3521
+ """Serializes the UpdateResponse into a dictionary suitable for use as a JSON request body."""
3522
+ body = {}
3523
+ return body
3524
+
3525
+ @classmethod
3526
+ def from_dict(cls, d: Dict[str, any]) -> UpdateResponse:
3527
+ """Deserializes the UpdateResponse from a dictionary."""
3528
+ return cls()
3529
+
3530
+
3362
3531
  @dataclass
3363
3532
  class User:
3364
3533
  email: Optional[str] = None
@@ -3802,6 +3971,7 @@ class AlertsAPI:
3802
3971
  if query_id is not None: body['query_id'] = query_id
3803
3972
  if rearm is not None: body['rearm'] = rearm
3804
3973
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
3974
+
3805
3975
  res = self._api.do('POST', '/api/2.0/preview/sql/alerts', body=body, headers=headers)
3806
3976
  return Alert.from_dict(res)
3807
3977
 
@@ -3817,6 +3987,7 @@ class AlertsAPI:
3817
3987
  """
3818
3988
 
3819
3989
  headers = {'Accept': 'application/json', }
3990
+
3820
3991
  self._api.do('DELETE', f'/api/2.0/preview/sql/alerts/{alert_id}', headers=headers)
3821
3992
 
3822
3993
  def get(self, alert_id: str) -> Alert:
@@ -3830,6 +4001,7 @@ class AlertsAPI:
3830
4001
  """
3831
4002
 
3832
4003
  headers = {'Accept': 'application/json', }
4004
+
3833
4005
  res = self._api.do('GET', f'/api/2.0/preview/sql/alerts/{alert_id}', headers=headers)
3834
4006
  return Alert.from_dict(res)
3835
4007
 
@@ -3842,6 +4014,7 @@ class AlertsAPI:
3842
4014
  """
3843
4015
 
3844
4016
  headers = {'Accept': 'application/json', }
4017
+
3845
4018
  res = self._api.do('GET', '/api/2.0/preview/sql/alerts', headers=headers)
3846
4019
  return [Alert.from_dict(v) for v in res]
3847
4020
 
@@ -3875,6 +4048,7 @@ class AlertsAPI:
3875
4048
  if query_id is not None: body['query_id'] = query_id
3876
4049
  if rearm is not None: body['rearm'] = rearm
3877
4050
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4051
+
3878
4052
  self._api.do('PUT', f'/api/2.0/preview/sql/alerts/{alert_id}', body=body, headers=headers)
3879
4053
 
3880
4054
 
@@ -3914,6 +4088,7 @@ class DashboardWidgetsAPI:
3914
4088
  if visualization_id is not None: body['visualization_id'] = visualization_id
3915
4089
  if width is not None: body['width'] = width
3916
4090
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4091
+
3917
4092
  res = self._api.do('POST', '/api/2.0/preview/sql/widgets', body=body, headers=headers)
3918
4093
  return Widget.from_dict(res)
3919
4094
 
@@ -3927,6 +4102,7 @@ class DashboardWidgetsAPI:
3927
4102
  """
3928
4103
 
3929
4104
  headers = {'Accept': 'application/json', }
4105
+
3930
4106
  self._api.do('DELETE', f'/api/2.0/preview/sql/widgets/{id}', headers=headers)
3931
4107
 
3932
4108
  def update(self,
@@ -3961,6 +4137,7 @@ class DashboardWidgetsAPI:
3961
4137
  if visualization_id is not None: body['visualization_id'] = visualization_id
3962
4138
  if width is not None: body['width'] = width
3963
4139
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4140
+
3964
4141
  res = self._api.do('POST', f'/api/2.0/preview/sql/widgets/{id}', body=body, headers=headers)
3965
4142
  return Widget.from_dict(res)
3966
4143
 
@@ -4009,6 +4186,7 @@ class DashboardsAPI:
4009
4186
  if run_as_role is not None: body['run_as_role'] = run_as_role.value
4010
4187
  if tags is not None: body['tags'] = [v for v in tags]
4011
4188
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4189
+
4012
4190
  res = self._api.do('POST', '/api/2.0/preview/sql/dashboards', body=body, headers=headers)
4013
4191
  return Dashboard.from_dict(res)
4014
4192
 
@@ -4024,6 +4202,7 @@ class DashboardsAPI:
4024
4202
  """
4025
4203
 
4026
4204
  headers = {'Accept': 'application/json', }
4205
+
4027
4206
  self._api.do('DELETE', f'/api/2.0/preview/sql/dashboards/{dashboard_id}', headers=headers)
4028
4207
 
4029
4208
  def get(self, dashboard_id: str) -> Dashboard:
@@ -4037,6 +4216,7 @@ class DashboardsAPI:
4037
4216
  """
4038
4217
 
4039
4218
  headers = {'Accept': 'application/json', }
4219
+
4040
4220
  res = self._api.do('GET', f'/api/2.0/preview/sql/dashboards/{dashboard_id}', headers=headers)
4041
4221
  return Dashboard.from_dict(res)
4042
4222
 
@@ -4099,6 +4279,7 @@ class DashboardsAPI:
4099
4279
  """
4100
4280
 
4101
4281
  headers = {'Accept': 'application/json', }
4282
+
4102
4283
  self._api.do('POST', f'/api/2.0/preview/sql/dashboards/trash/{dashboard_id}', headers=headers)
4103
4284
 
4104
4285
  def update(self,
@@ -4126,6 +4307,7 @@ class DashboardsAPI:
4126
4307
  if name is not None: body['name'] = name
4127
4308
  if run_as_role is not None: body['run_as_role'] = run_as_role.value
4128
4309
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4310
+
4129
4311
  res = self._api.do('POST',
4130
4312
  f'/api/2.0/preview/sql/dashboards/{dashboard_id}',
4131
4313
  body=body,
@@ -4156,6 +4338,7 @@ class DataSourcesAPI:
4156
4338
  """
4157
4339
 
4158
4340
  headers = {'Accept': 'application/json', }
4341
+
4159
4342
  res = self._api.do('GET', '/api/2.0/preview/sql/data_sources', headers=headers)
4160
4343
  return [DataSource.from_dict(v) for v in res]
4161
4344
 
@@ -4190,6 +4373,7 @@ class DbsqlPermissionsAPI:
4190
4373
  """
4191
4374
 
4192
4375
  headers = {'Accept': 'application/json', }
4376
+
4193
4377
  res = self._api.do('GET',
4194
4378
  f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}',
4195
4379
  headers=headers)
@@ -4217,6 +4401,7 @@ class DbsqlPermissionsAPI:
4217
4401
  if access_control_list is not None:
4218
4402
  body['access_control_list'] = [v.as_dict() for v in access_control_list]
4219
4403
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4404
+
4220
4405
  res = self._api.do('POST',
4221
4406
  f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}',
4222
4407
  body=body,
@@ -4244,6 +4429,7 @@ class DbsqlPermissionsAPI:
4244
4429
  body = {}
4245
4430
  if new_owner is not None: body['new_owner'] = new_owner
4246
4431
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4432
+
4247
4433
  res = self._api.do('POST',
4248
4434
  f'/api/2.0/preview/sql/permissions/{object_type.value}/{object_id}/transfer',
4249
4435
  body=body,
@@ -4311,6 +4497,7 @@ class QueriesAPI:
4311
4497
  if query is not None: body['query'] = query
4312
4498
  if run_as_role is not None: body['run_as_role'] = run_as_role.value
4313
4499
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4500
+
4314
4501
  res = self._api.do('POST', '/api/2.0/preview/sql/queries', body=body, headers=headers)
4315
4502
  return Query.from_dict(res)
4316
4503
 
@@ -4326,6 +4513,7 @@ class QueriesAPI:
4326
4513
  """
4327
4514
 
4328
4515
  headers = {'Accept': 'application/json', }
4516
+
4329
4517
  self._api.do('DELETE', f'/api/2.0/preview/sql/queries/{query_id}', headers=headers)
4330
4518
 
4331
4519
  def get(self, query_id: str) -> Query:
@@ -4340,6 +4528,7 @@ class QueriesAPI:
4340
4528
  """
4341
4529
 
4342
4530
  headers = {'Accept': 'application/json', }
4531
+
4343
4532
  res = self._api.do('GET', f'/api/2.0/preview/sql/queries/{query_id}', headers=headers)
4344
4533
  return Query.from_dict(res)
4345
4534
 
@@ -4415,6 +4604,7 @@ class QueriesAPI:
4415
4604
  """
4416
4605
 
4417
4606
  headers = {'Accept': 'application/json', }
4607
+
4418
4608
  self._api.do('POST', f'/api/2.0/preview/sql/queries/trash/{query_id}', headers=headers)
4419
4609
 
4420
4610
  def update(self,
@@ -4462,6 +4652,7 @@ class QueriesAPI:
4462
4652
  if query is not None: body['query'] = query
4463
4653
  if run_as_role is not None: body['run_as_role'] = run_as_role.value
4464
4654
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4655
+
4465
4656
  res = self._api.do('POST', f'/api/2.0/preview/sql/queries/{query_id}', body=body, headers=headers)
4466
4657
  return Query.from_dict(res)
4467
4658
 
@@ -4552,6 +4743,7 @@ class QueryVisualizationsAPI:
4552
4743
  if query_id is not None: body['query_id'] = query_id
4553
4744
  if type is not None: body['type'] = type
4554
4745
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4746
+
4555
4747
  res = self._api.do('POST', '/api/2.0/preview/sql/visualizations', body=body, headers=headers)
4556
4748
  return Visualization.from_dict(res)
4557
4749
 
@@ -4565,6 +4757,7 @@ class QueryVisualizationsAPI:
4565
4757
  """
4566
4758
 
4567
4759
  headers = {'Accept': 'application/json', }
4760
+
4568
4761
  self._api.do('DELETE', f'/api/2.0/preview/sql/visualizations/{id}', headers=headers)
4569
4762
 
4570
4763
  def update(self,
@@ -4602,6 +4795,7 @@ class QueryVisualizationsAPI:
4602
4795
  if type is not None: body['type'] = type
4603
4796
  if updated_at is not None: body['updated_at'] = updated_at
4604
4797
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
4798
+
4605
4799
  res = self._api.do('POST', f'/api/2.0/preview/sql/visualizations/{id}', body=body, headers=headers)
4606
4800
  return Visualization.from_dict(res)
4607
4801
 
@@ -4707,6 +4901,7 @@ class StatementExecutionAPI:
4707
4901
  """
4708
4902
 
4709
4903
  headers = {}
4904
+
4710
4905
  self._api.do('POST', f'/api/2.0/sql/statements/{statement_id}/cancel', headers=headers)
4711
4906
 
4712
4907
  def execute_statement(self,
@@ -4862,6 +5057,7 @@ class StatementExecutionAPI:
4862
5057
  if wait_timeout is not None: body['wait_timeout'] = wait_timeout
4863
5058
  if warehouse_id is not None: body['warehouse_id'] = warehouse_id
4864
5059
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
5060
+
4865
5061
  res = self._api.do('POST', '/api/2.0/sql/statements/', body=body, headers=headers)
4866
5062
  return ExecuteStatementResponse.from_dict(res)
4867
5063
 
@@ -4884,6 +5080,7 @@ class StatementExecutionAPI:
4884
5080
  """
4885
5081
 
4886
5082
  headers = {'Accept': 'application/json', }
5083
+
4887
5084
  res = self._api.do('GET', f'/api/2.0/sql/statements/{statement_id}', headers=headers)
4888
5085
  return GetStatementResponse.from_dict(res)
4889
5086
 
@@ -4906,6 +5103,7 @@ class StatementExecutionAPI:
4906
5103
  """
4907
5104
 
4908
5105
  headers = {'Accept': 'application/json', }
5106
+
4909
5107
  res = self._api.do('GET',
4910
5108
  f'/api/2.0/sql/statements/{statement_id}/result/chunks/{chunk_index}',
4911
5109
  headers=headers)
@@ -5077,6 +5275,7 @@ class WarehousesAPI:
5077
5275
  if tags is not None: body['tags'] = tags.as_dict()
5078
5276
  if warehouse_type is not None: body['warehouse_type'] = warehouse_type.value
5079
5277
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
5278
+
5080
5279
  op_response = self._api.do('POST', '/api/2.0/sql/warehouses', body=body, headers=headers)
5081
5280
  return Wait(self.wait_get_warehouse_running,
5082
5281
  response=CreateWarehouseResponse.from_dict(op_response),
@@ -5126,6 +5325,7 @@ class WarehousesAPI:
5126
5325
  """
5127
5326
 
5128
5327
  headers = {'Accept': 'application/json', }
5328
+
5129
5329
  self._api.do('DELETE', f'/api/2.0/sql/warehouses/{id}', headers=headers)
5130
5330
 
5131
5331
  def edit(
@@ -5226,8 +5426,11 @@ class WarehousesAPI:
5226
5426
  if tags is not None: body['tags'] = tags.as_dict()
5227
5427
  if warehouse_type is not None: body['warehouse_type'] = warehouse_type.value
5228
5428
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
5229
- self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/edit', body=body, headers=headers)
5230
- return Wait(self.wait_get_warehouse_running, id=id)
5429
+
5430
+ op_response = self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/edit', body=body, headers=headers)
5431
+ return Wait(self.wait_get_warehouse_running,
5432
+ response=EditWarehouseResponse.from_dict(op_response),
5433
+ id=id)
5231
5434
 
5232
5435
  def edit_and_wait(
5233
5436
  self,
@@ -5275,6 +5478,7 @@ class WarehousesAPI:
5275
5478
  """
5276
5479
 
5277
5480
  headers = {'Accept': 'application/json', }
5481
+
5278
5482
  res = self._api.do('GET', f'/api/2.0/sql/warehouses/{id}', headers=headers)
5279
5483
  return GetWarehouseResponse.from_dict(res)
5280
5484
 
@@ -5290,6 +5494,7 @@ class WarehousesAPI:
5290
5494
  """
5291
5495
 
5292
5496
  headers = {'Accept': 'application/json', }
5497
+
5293
5498
  res = self._api.do('GET',
5294
5499
  f'/api/2.0/permissions/warehouses/{warehouse_id}/permissionLevels',
5295
5500
  headers=headers)
@@ -5308,6 +5513,7 @@ class WarehousesAPI:
5308
5513
  """
5309
5514
 
5310
5515
  headers = {'Accept': 'application/json', }
5516
+
5311
5517
  res = self._api.do('GET', f'/api/2.0/permissions/warehouses/{warehouse_id}', headers=headers)
5312
5518
  return WarehousePermissions.from_dict(res)
5313
5519
 
@@ -5320,6 +5526,7 @@ class WarehousesAPI:
5320
5526
  """
5321
5527
 
5322
5528
  headers = {'Accept': 'application/json', }
5529
+
5323
5530
  res = self._api.do('GET', '/api/2.0/sql/config/warehouses', headers=headers)
5324
5531
  return GetWorkspaceWarehouseConfigResponse.from_dict(res)
5325
5532
 
@@ -5338,6 +5545,7 @@ class WarehousesAPI:
5338
5545
  query = {}
5339
5546
  if run_as_user_id is not None: query['run_as_user_id'] = run_as_user_id
5340
5547
  headers = {'Accept': 'application/json', }
5548
+
5341
5549
  json = self._api.do('GET', '/api/2.0/sql/warehouses', query=query, headers=headers)
5342
5550
  parsed = ListWarehousesResponse.from_dict(json).warehouses
5343
5551
  return parsed if parsed is not None else []
@@ -5361,6 +5569,7 @@ class WarehousesAPI:
5361
5569
  if access_control_list is not None:
5362
5570
  body['access_control_list'] = [v.as_dict() for v in access_control_list]
5363
5571
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
5572
+
5364
5573
  res = self._api.do('PUT',
5365
5574
  f'/api/2.0/permissions/warehouses/{warehouse_id}',
5366
5575
  body=body,
@@ -5422,6 +5631,7 @@ class WarehousesAPI:
5422
5631
  if sql_configuration_parameters is not None:
5423
5632
  body['sql_configuration_parameters'] = sql_configuration_parameters.as_dict()
5424
5633
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
5634
+
5425
5635
  self._api.do('PUT', '/api/2.0/sql/config/warehouses', body=body, headers=headers)
5426
5636
 
5427
5637
  def start(self, id: str) -> Wait[GetWarehouseResponse]:
@@ -5438,8 +5648,11 @@ class WarehousesAPI:
5438
5648
  """
5439
5649
 
5440
5650
  headers = {'Accept': 'application/json', }
5441
- self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/start', headers=headers)
5442
- return Wait(self.wait_get_warehouse_running, id=id)
5651
+
5652
+ op_response = self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/start', headers=headers)
5653
+ return Wait(self.wait_get_warehouse_running,
5654
+ response=StartWarehouseResponse.from_dict(op_response),
5655
+ id=id)
5443
5656
 
5444
5657
  def start_and_wait(self, id: str, timeout=timedelta(minutes=20)) -> GetWarehouseResponse:
5445
5658
  return self.start(id=id).result(timeout=timeout)
@@ -5458,8 +5671,11 @@ class WarehousesAPI:
5458
5671
  """
5459
5672
 
5460
5673
  headers = {'Accept': 'application/json', }
5461
- self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/stop', headers=headers)
5462
- return Wait(self.wait_get_warehouse_stopped, id=id)
5674
+
5675
+ op_response = self._api.do('POST', f'/api/2.0/sql/warehouses/{id}/stop', headers=headers)
5676
+ return Wait(self.wait_get_warehouse_stopped,
5677
+ response=StopWarehouseResponse.from_dict(op_response),
5678
+ id=id)
5463
5679
 
5464
5680
  def stop_and_wait(self, id: str, timeout=timedelta(minutes=20)) -> GetWarehouseResponse:
5465
5681
  return self.stop(id=id).result(timeout=timeout)
@@ -5484,6 +5700,7 @@ class WarehousesAPI:
5484
5700
  if access_control_list is not None:
5485
5701
  body['access_control_list'] = [v.as_dict() for v in access_control_list]
5486
5702
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
5703
+
5487
5704
  res = self._api.do('PATCH',
5488
5705
  f'/api/2.0/permissions/warehouses/{warehouse_id}',
5489
5706
  body=body,