databricks-sdk 0.37.0__py3-none-any.whl → 0.39.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of databricks-sdk might be problematic. Click here for more details.
- databricks/sdk/__init__.py +24 -2
- databricks/sdk/_base_client.py +61 -14
- databricks/sdk/config.py +10 -9
- databricks/sdk/credentials_provider.py +6 -5
- databricks/sdk/mixins/jobs.py +49 -0
- databricks/sdk/mixins/open_ai_client.py +2 -2
- databricks/sdk/service/apps.py +185 -4
- databricks/sdk/service/billing.py +248 -1
- databricks/sdk/service/catalog.py +1943 -46
- databricks/sdk/service/cleanrooms.py +1281 -0
- databricks/sdk/service/compute.py +1486 -8
- databricks/sdk/service/dashboards.py +336 -11
- databricks/sdk/service/files.py +162 -2
- databricks/sdk/service/iam.py +353 -2
- databricks/sdk/service/jobs.py +1281 -16
- databricks/sdk/service/marketplace.py +688 -0
- databricks/sdk/service/ml.py +1038 -2
- databricks/sdk/service/oauth2.py +176 -0
- databricks/sdk/service/pipelines.py +602 -15
- databricks/sdk/service/provisioning.py +402 -0
- databricks/sdk/service/serving.py +615 -0
- databricks/sdk/service/settings.py +1190 -3
- databricks/sdk/service/sharing.py +328 -2
- databricks/sdk/service/sql.py +1186 -2
- databricks/sdk/service/vectorsearch.py +290 -0
- databricks/sdk/service/workspace.py +453 -1
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/METADATA +26 -26
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/RECORD +33 -31
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/WHEEL +1 -1
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/top_level.txt +0 -0
|
@@ -43,6 +43,14 @@ class Ai21LabsConfig:
|
|
|
43
43
|
body['ai21labs_api_key_plaintext'] = self.ai21labs_api_key_plaintext
|
|
44
44
|
return body
|
|
45
45
|
|
|
46
|
+
def as_shallow_dict(self) -> dict:
|
|
47
|
+
"""Serializes the Ai21LabsConfig into a shallow dictionary of its immediate attributes."""
|
|
48
|
+
body = {}
|
|
49
|
+
if self.ai21labs_api_key is not None: body['ai21labs_api_key'] = self.ai21labs_api_key
|
|
50
|
+
if self.ai21labs_api_key_plaintext is not None:
|
|
51
|
+
body['ai21labs_api_key_plaintext'] = self.ai21labs_api_key_plaintext
|
|
52
|
+
return body
|
|
53
|
+
|
|
46
54
|
@classmethod
|
|
47
55
|
def from_dict(cls, d: Dict[str, any]) -> Ai21LabsConfig:
|
|
48
56
|
"""Deserializes the Ai21LabsConfig from a dictionary."""
|
|
@@ -76,6 +84,15 @@ class AiGatewayConfig:
|
|
|
76
84
|
if self.usage_tracking_config: body['usage_tracking_config'] = self.usage_tracking_config.as_dict()
|
|
77
85
|
return body
|
|
78
86
|
|
|
87
|
+
def as_shallow_dict(self) -> dict:
|
|
88
|
+
"""Serializes the AiGatewayConfig into a shallow dictionary of its immediate attributes."""
|
|
89
|
+
body = {}
|
|
90
|
+
if self.guardrails: body['guardrails'] = self.guardrails
|
|
91
|
+
if self.inference_table_config: body['inference_table_config'] = self.inference_table_config
|
|
92
|
+
if self.rate_limits: body['rate_limits'] = self.rate_limits
|
|
93
|
+
if self.usage_tracking_config: body['usage_tracking_config'] = self.usage_tracking_config
|
|
94
|
+
return body
|
|
95
|
+
|
|
79
96
|
@classmethod
|
|
80
97
|
def from_dict(cls, d: Dict[str, any]) -> AiGatewayConfig:
|
|
81
98
|
"""Deserializes the AiGatewayConfig from a dictionary."""
|
|
@@ -111,6 +128,15 @@ class AiGatewayGuardrailParameters:
|
|
|
111
128
|
if self.valid_topics: body['valid_topics'] = [v for v in self.valid_topics]
|
|
112
129
|
return body
|
|
113
130
|
|
|
131
|
+
def as_shallow_dict(self) -> dict:
|
|
132
|
+
"""Serializes the AiGatewayGuardrailParameters into a shallow dictionary of its immediate attributes."""
|
|
133
|
+
body = {}
|
|
134
|
+
if self.invalid_keywords: body['invalid_keywords'] = self.invalid_keywords
|
|
135
|
+
if self.pii: body['pii'] = self.pii
|
|
136
|
+
if self.safety is not None: body['safety'] = self.safety
|
|
137
|
+
if self.valid_topics: body['valid_topics'] = self.valid_topics
|
|
138
|
+
return body
|
|
139
|
+
|
|
114
140
|
@classmethod
|
|
115
141
|
def from_dict(cls, d: Dict[str, any]) -> AiGatewayGuardrailParameters:
|
|
116
142
|
"""Deserializes the AiGatewayGuardrailParameters from a dictionary."""
|
|
@@ -134,6 +160,12 @@ class AiGatewayGuardrailPiiBehavior:
|
|
|
134
160
|
if self.behavior is not None: body['behavior'] = self.behavior.value
|
|
135
161
|
return body
|
|
136
162
|
|
|
163
|
+
def as_shallow_dict(self) -> dict:
|
|
164
|
+
"""Serializes the AiGatewayGuardrailPiiBehavior into a shallow dictionary of its immediate attributes."""
|
|
165
|
+
body = {}
|
|
166
|
+
if self.behavior is not None: body['behavior'] = self.behavior
|
|
167
|
+
return body
|
|
168
|
+
|
|
137
169
|
@classmethod
|
|
138
170
|
def from_dict(cls, d: Dict[str, any]) -> AiGatewayGuardrailPiiBehavior:
|
|
139
171
|
"""Deserializes the AiGatewayGuardrailPiiBehavior from a dictionary."""
|
|
@@ -165,6 +197,13 @@ class AiGatewayGuardrails:
|
|
|
165
197
|
if self.output: body['output'] = self.output.as_dict()
|
|
166
198
|
return body
|
|
167
199
|
|
|
200
|
+
def as_shallow_dict(self) -> dict:
|
|
201
|
+
"""Serializes the AiGatewayGuardrails into a shallow dictionary of its immediate attributes."""
|
|
202
|
+
body = {}
|
|
203
|
+
if self.input: body['input'] = self.input
|
|
204
|
+
if self.output: body['output'] = self.output
|
|
205
|
+
return body
|
|
206
|
+
|
|
168
207
|
@classmethod
|
|
169
208
|
def from_dict(cls, d: Dict[str, any]) -> AiGatewayGuardrails:
|
|
170
209
|
"""Deserializes the AiGatewayGuardrails from a dictionary."""
|
|
@@ -198,6 +237,15 @@ class AiGatewayInferenceTableConfig:
|
|
|
198
237
|
if self.table_name_prefix is not None: body['table_name_prefix'] = self.table_name_prefix
|
|
199
238
|
return body
|
|
200
239
|
|
|
240
|
+
def as_shallow_dict(self) -> dict:
|
|
241
|
+
"""Serializes the AiGatewayInferenceTableConfig into a shallow dictionary of its immediate attributes."""
|
|
242
|
+
body = {}
|
|
243
|
+
if self.catalog_name is not None: body['catalog_name'] = self.catalog_name
|
|
244
|
+
if self.enabled is not None: body['enabled'] = self.enabled
|
|
245
|
+
if self.schema_name is not None: body['schema_name'] = self.schema_name
|
|
246
|
+
if self.table_name_prefix is not None: body['table_name_prefix'] = self.table_name_prefix
|
|
247
|
+
return body
|
|
248
|
+
|
|
201
249
|
@classmethod
|
|
202
250
|
def from_dict(cls, d: Dict[str, any]) -> AiGatewayInferenceTableConfig:
|
|
203
251
|
"""Deserializes the AiGatewayInferenceTableConfig from a dictionary."""
|
|
@@ -227,6 +275,14 @@ class AiGatewayRateLimit:
|
|
|
227
275
|
if self.renewal_period is not None: body['renewal_period'] = self.renewal_period.value
|
|
228
276
|
return body
|
|
229
277
|
|
|
278
|
+
def as_shallow_dict(self) -> dict:
|
|
279
|
+
"""Serializes the AiGatewayRateLimit into a shallow dictionary of its immediate attributes."""
|
|
280
|
+
body = {}
|
|
281
|
+
if self.calls is not None: body['calls'] = self.calls
|
|
282
|
+
if self.key is not None: body['key'] = self.key
|
|
283
|
+
if self.renewal_period is not None: body['renewal_period'] = self.renewal_period
|
|
284
|
+
return body
|
|
285
|
+
|
|
230
286
|
@classmethod
|
|
231
287
|
def from_dict(cls, d: Dict[str, any]) -> AiGatewayRateLimit:
|
|
232
288
|
"""Deserializes the AiGatewayRateLimit from a dictionary."""
|
|
@@ -260,6 +316,12 @@ class AiGatewayUsageTrackingConfig:
|
|
|
260
316
|
if self.enabled is not None: body['enabled'] = self.enabled
|
|
261
317
|
return body
|
|
262
318
|
|
|
319
|
+
def as_shallow_dict(self) -> dict:
|
|
320
|
+
"""Serializes the AiGatewayUsageTrackingConfig into a shallow dictionary of its immediate attributes."""
|
|
321
|
+
body = {}
|
|
322
|
+
if self.enabled is not None: body['enabled'] = self.enabled
|
|
323
|
+
return body
|
|
324
|
+
|
|
263
325
|
@classmethod
|
|
264
326
|
def from_dict(cls, d: Dict[str, any]) -> AiGatewayUsageTrackingConfig:
|
|
265
327
|
"""Deserializes the AiGatewayUsageTrackingConfig from a dictionary."""
|
|
@@ -312,6 +374,19 @@ class AmazonBedrockConfig:
|
|
|
312
374
|
if self.bedrock_provider is not None: body['bedrock_provider'] = self.bedrock_provider.value
|
|
313
375
|
return body
|
|
314
376
|
|
|
377
|
+
def as_shallow_dict(self) -> dict:
|
|
378
|
+
"""Serializes the AmazonBedrockConfig into a shallow dictionary of its immediate attributes."""
|
|
379
|
+
body = {}
|
|
380
|
+
if self.aws_access_key_id is not None: body['aws_access_key_id'] = self.aws_access_key_id
|
|
381
|
+
if self.aws_access_key_id_plaintext is not None:
|
|
382
|
+
body['aws_access_key_id_plaintext'] = self.aws_access_key_id_plaintext
|
|
383
|
+
if self.aws_region is not None: body['aws_region'] = self.aws_region
|
|
384
|
+
if self.aws_secret_access_key is not None: body['aws_secret_access_key'] = self.aws_secret_access_key
|
|
385
|
+
if self.aws_secret_access_key_plaintext is not None:
|
|
386
|
+
body['aws_secret_access_key_plaintext'] = self.aws_secret_access_key_plaintext
|
|
387
|
+
if self.bedrock_provider is not None: body['bedrock_provider'] = self.bedrock_provider
|
|
388
|
+
return body
|
|
389
|
+
|
|
315
390
|
@classmethod
|
|
316
391
|
def from_dict(cls, d: Dict[str, any]) -> AmazonBedrockConfig:
|
|
317
392
|
"""Deserializes the AmazonBedrockConfig from a dictionary."""
|
|
@@ -353,6 +428,14 @@ class AnthropicConfig:
|
|
|
353
428
|
body['anthropic_api_key_plaintext'] = self.anthropic_api_key_plaintext
|
|
354
429
|
return body
|
|
355
430
|
|
|
431
|
+
def as_shallow_dict(self) -> dict:
|
|
432
|
+
"""Serializes the AnthropicConfig into a shallow dictionary of its immediate attributes."""
|
|
433
|
+
body = {}
|
|
434
|
+
if self.anthropic_api_key is not None: body['anthropic_api_key'] = self.anthropic_api_key
|
|
435
|
+
if self.anthropic_api_key_plaintext is not None:
|
|
436
|
+
body['anthropic_api_key_plaintext'] = self.anthropic_api_key_plaintext
|
|
437
|
+
return body
|
|
438
|
+
|
|
356
439
|
@classmethod
|
|
357
440
|
def from_dict(cls, d: Dict[str, any]) -> AnthropicConfig:
|
|
358
441
|
"""Deserializes the AnthropicConfig from a dictionary."""
|
|
@@ -386,6 +469,15 @@ class AutoCaptureConfigInput:
|
|
|
386
469
|
if self.table_name_prefix is not None: body['table_name_prefix'] = self.table_name_prefix
|
|
387
470
|
return body
|
|
388
471
|
|
|
472
|
+
def as_shallow_dict(self) -> dict:
|
|
473
|
+
"""Serializes the AutoCaptureConfigInput into a shallow dictionary of its immediate attributes."""
|
|
474
|
+
body = {}
|
|
475
|
+
if self.catalog_name is not None: body['catalog_name'] = self.catalog_name
|
|
476
|
+
if self.enabled is not None: body['enabled'] = self.enabled
|
|
477
|
+
if self.schema_name is not None: body['schema_name'] = self.schema_name
|
|
478
|
+
if self.table_name_prefix is not None: body['table_name_prefix'] = self.table_name_prefix
|
|
479
|
+
return body
|
|
480
|
+
|
|
389
481
|
@classmethod
|
|
390
482
|
def from_dict(cls, d: Dict[str, any]) -> AutoCaptureConfigInput:
|
|
391
483
|
"""Deserializes the AutoCaptureConfigInput from a dictionary."""
|
|
@@ -421,6 +513,16 @@ class AutoCaptureConfigOutput:
|
|
|
421
513
|
if self.table_name_prefix is not None: body['table_name_prefix'] = self.table_name_prefix
|
|
422
514
|
return body
|
|
423
515
|
|
|
516
|
+
def as_shallow_dict(self) -> dict:
|
|
517
|
+
"""Serializes the AutoCaptureConfigOutput into a shallow dictionary of its immediate attributes."""
|
|
518
|
+
body = {}
|
|
519
|
+
if self.catalog_name is not None: body['catalog_name'] = self.catalog_name
|
|
520
|
+
if self.enabled is not None: body['enabled'] = self.enabled
|
|
521
|
+
if self.schema_name is not None: body['schema_name'] = self.schema_name
|
|
522
|
+
if self.state: body['state'] = self.state
|
|
523
|
+
if self.table_name_prefix is not None: body['table_name_prefix'] = self.table_name_prefix
|
|
524
|
+
return body
|
|
525
|
+
|
|
424
526
|
@classmethod
|
|
425
527
|
def from_dict(cls, d: Dict[str, any]) -> AutoCaptureConfigOutput:
|
|
426
528
|
"""Deserializes the AutoCaptureConfigOutput from a dictionary."""
|
|
@@ -441,6 +543,12 @@ class AutoCaptureState:
|
|
|
441
543
|
if self.payload_table: body['payload_table'] = self.payload_table.as_dict()
|
|
442
544
|
return body
|
|
443
545
|
|
|
546
|
+
def as_shallow_dict(self) -> dict:
|
|
547
|
+
"""Serializes the AutoCaptureState into a shallow dictionary of its immediate attributes."""
|
|
548
|
+
body = {}
|
|
549
|
+
if self.payload_table: body['payload_table'] = self.payload_table
|
|
550
|
+
return body
|
|
551
|
+
|
|
444
552
|
@classmethod
|
|
445
553
|
def from_dict(cls, d: Dict[str, any]) -> AutoCaptureState:
|
|
446
554
|
"""Deserializes the AutoCaptureState from a dictionary."""
|
|
@@ -458,6 +566,12 @@ class BuildLogsResponse:
|
|
|
458
566
|
if self.logs is not None: body['logs'] = self.logs
|
|
459
567
|
return body
|
|
460
568
|
|
|
569
|
+
def as_shallow_dict(self) -> dict:
|
|
570
|
+
"""Serializes the BuildLogsResponse into a shallow dictionary of its immediate attributes."""
|
|
571
|
+
body = {}
|
|
572
|
+
if self.logs is not None: body['logs'] = self.logs
|
|
573
|
+
return body
|
|
574
|
+
|
|
461
575
|
@classmethod
|
|
462
576
|
def from_dict(cls, d: Dict[str, any]) -> BuildLogsResponse:
|
|
463
577
|
"""Deserializes the BuildLogsResponse from a dictionary."""
|
|
@@ -479,6 +593,13 @@ class ChatMessage:
|
|
|
479
593
|
if self.role is not None: body['role'] = self.role.value
|
|
480
594
|
return body
|
|
481
595
|
|
|
596
|
+
def as_shallow_dict(self) -> dict:
|
|
597
|
+
"""Serializes the ChatMessage into a shallow dictionary of its immediate attributes."""
|
|
598
|
+
body = {}
|
|
599
|
+
if self.content is not None: body['content'] = self.content
|
|
600
|
+
if self.role is not None: body['role'] = self.role
|
|
601
|
+
return body
|
|
602
|
+
|
|
482
603
|
@classmethod
|
|
483
604
|
def from_dict(cls, d: Dict[str, any]) -> ChatMessage:
|
|
484
605
|
"""Deserializes the ChatMessage from a dictionary."""
|
|
@@ -518,6 +639,15 @@ class CohereConfig:
|
|
|
518
639
|
body['cohere_api_key_plaintext'] = self.cohere_api_key_plaintext
|
|
519
640
|
return body
|
|
520
641
|
|
|
642
|
+
def as_shallow_dict(self) -> dict:
|
|
643
|
+
"""Serializes the CohereConfig into a shallow dictionary of its immediate attributes."""
|
|
644
|
+
body = {}
|
|
645
|
+
if self.cohere_api_base is not None: body['cohere_api_base'] = self.cohere_api_base
|
|
646
|
+
if self.cohere_api_key is not None: body['cohere_api_key'] = self.cohere_api_key
|
|
647
|
+
if self.cohere_api_key_plaintext is not None:
|
|
648
|
+
body['cohere_api_key_plaintext'] = self.cohere_api_key_plaintext
|
|
649
|
+
return body
|
|
650
|
+
|
|
521
651
|
@classmethod
|
|
522
652
|
def from_dict(cls, d: Dict[str, any]) -> CohereConfig:
|
|
523
653
|
"""Deserializes the CohereConfig from a dictionary."""
|
|
@@ -560,6 +690,17 @@ class CreateServingEndpoint:
|
|
|
560
690
|
if self.tags: body['tags'] = [v.as_dict() for v in self.tags]
|
|
561
691
|
return body
|
|
562
692
|
|
|
693
|
+
def as_shallow_dict(self) -> dict:
|
|
694
|
+
"""Serializes the CreateServingEndpoint into a shallow dictionary of its immediate attributes."""
|
|
695
|
+
body = {}
|
|
696
|
+
if self.ai_gateway: body['ai_gateway'] = self.ai_gateway
|
|
697
|
+
if self.config: body['config'] = self.config
|
|
698
|
+
if self.name is not None: body['name'] = self.name
|
|
699
|
+
if self.rate_limits: body['rate_limits'] = self.rate_limits
|
|
700
|
+
if self.route_optimized is not None: body['route_optimized'] = self.route_optimized
|
|
701
|
+
if self.tags: body['tags'] = self.tags
|
|
702
|
+
return body
|
|
703
|
+
|
|
563
704
|
@classmethod
|
|
564
705
|
def from_dict(cls, d: Dict[str, any]) -> CreateServingEndpoint:
|
|
565
706
|
"""Deserializes the CreateServingEndpoint from a dictionary."""
|
|
@@ -601,6 +742,16 @@ class DatabricksModelServingConfig:
|
|
|
601
742
|
body['databricks_workspace_url'] = self.databricks_workspace_url
|
|
602
743
|
return body
|
|
603
744
|
|
|
745
|
+
def as_shallow_dict(self) -> dict:
|
|
746
|
+
"""Serializes the DatabricksModelServingConfig into a shallow dictionary of its immediate attributes."""
|
|
747
|
+
body = {}
|
|
748
|
+
if self.databricks_api_token is not None: body['databricks_api_token'] = self.databricks_api_token
|
|
749
|
+
if self.databricks_api_token_plaintext is not None:
|
|
750
|
+
body['databricks_api_token_plaintext'] = self.databricks_api_token_plaintext
|
|
751
|
+
if self.databricks_workspace_url is not None:
|
|
752
|
+
body['databricks_workspace_url'] = self.databricks_workspace_url
|
|
753
|
+
return body
|
|
754
|
+
|
|
604
755
|
@classmethod
|
|
605
756
|
def from_dict(cls, d: Dict[str, any]) -> DatabricksModelServingConfig:
|
|
606
757
|
"""Deserializes the DatabricksModelServingConfig from a dictionary."""
|
|
@@ -625,6 +776,14 @@ class DataframeSplitInput:
|
|
|
625
776
|
if self.index: body['index'] = [v for v in self.index]
|
|
626
777
|
return body
|
|
627
778
|
|
|
779
|
+
def as_shallow_dict(self) -> dict:
|
|
780
|
+
"""Serializes the DataframeSplitInput into a shallow dictionary of its immediate attributes."""
|
|
781
|
+
body = {}
|
|
782
|
+
if self.columns: body['columns'] = self.columns
|
|
783
|
+
if self.data: body['data'] = self.data
|
|
784
|
+
if self.index: body['index'] = self.index
|
|
785
|
+
return body
|
|
786
|
+
|
|
628
787
|
@classmethod
|
|
629
788
|
def from_dict(cls, d: Dict[str, any]) -> DataframeSplitInput:
|
|
630
789
|
"""Deserializes the DataframeSplitInput from a dictionary."""
|
|
@@ -639,6 +798,11 @@ class DeleteResponse:
|
|
|
639
798
|
body = {}
|
|
640
799
|
return body
|
|
641
800
|
|
|
801
|
+
def as_shallow_dict(self) -> dict:
|
|
802
|
+
"""Serializes the DeleteResponse into a shallow dictionary of its immediate attributes."""
|
|
803
|
+
body = {}
|
|
804
|
+
return body
|
|
805
|
+
|
|
642
806
|
@classmethod
|
|
643
807
|
def from_dict(cls, d: Dict[str, any]) -> DeleteResponse:
|
|
644
808
|
"""Deserializes the DeleteResponse from a dictionary."""
|
|
@@ -663,6 +827,14 @@ class EmbeddingsV1ResponseEmbeddingElement:
|
|
|
663
827
|
if self.object is not None: body['object'] = self.object.value
|
|
664
828
|
return body
|
|
665
829
|
|
|
830
|
+
def as_shallow_dict(self) -> dict:
|
|
831
|
+
"""Serializes the EmbeddingsV1ResponseEmbeddingElement into a shallow dictionary of its immediate attributes."""
|
|
832
|
+
body = {}
|
|
833
|
+
if self.embedding: body['embedding'] = self.embedding
|
|
834
|
+
if self.index is not None: body['index'] = self.index
|
|
835
|
+
if self.object is not None: body['object'] = self.object
|
|
836
|
+
return body
|
|
837
|
+
|
|
666
838
|
@classmethod
|
|
667
839
|
def from_dict(cls, d: Dict[str, any]) -> EmbeddingsV1ResponseEmbeddingElement:
|
|
668
840
|
"""Deserializes the EmbeddingsV1ResponseEmbeddingElement from a dictionary."""
|
|
@@ -707,6 +879,16 @@ class EndpointCoreConfigInput:
|
|
|
707
879
|
if self.traffic_config: body['traffic_config'] = self.traffic_config.as_dict()
|
|
708
880
|
return body
|
|
709
881
|
|
|
882
|
+
def as_shallow_dict(self) -> dict:
|
|
883
|
+
"""Serializes the EndpointCoreConfigInput into a shallow dictionary of its immediate attributes."""
|
|
884
|
+
body = {}
|
|
885
|
+
if self.auto_capture_config: body['auto_capture_config'] = self.auto_capture_config
|
|
886
|
+
if self.name is not None: body['name'] = self.name
|
|
887
|
+
if self.served_entities: body['served_entities'] = self.served_entities
|
|
888
|
+
if self.served_models: body['served_models'] = self.served_models
|
|
889
|
+
if self.traffic_config: body['traffic_config'] = self.traffic_config
|
|
890
|
+
return body
|
|
891
|
+
|
|
710
892
|
@classmethod
|
|
711
893
|
def from_dict(cls, d: Dict[str, any]) -> EndpointCoreConfigInput:
|
|
712
894
|
"""Deserializes the EndpointCoreConfigInput from a dictionary."""
|
|
@@ -746,6 +928,16 @@ class EndpointCoreConfigOutput:
|
|
|
746
928
|
if self.traffic_config: body['traffic_config'] = self.traffic_config.as_dict()
|
|
747
929
|
return body
|
|
748
930
|
|
|
931
|
+
def as_shallow_dict(self) -> dict:
|
|
932
|
+
"""Serializes the EndpointCoreConfigOutput into a shallow dictionary of its immediate attributes."""
|
|
933
|
+
body = {}
|
|
934
|
+
if self.auto_capture_config: body['auto_capture_config'] = self.auto_capture_config
|
|
935
|
+
if self.config_version is not None: body['config_version'] = self.config_version
|
|
936
|
+
if self.served_entities: body['served_entities'] = self.served_entities
|
|
937
|
+
if self.served_models: body['served_models'] = self.served_models
|
|
938
|
+
if self.traffic_config: body['traffic_config'] = self.traffic_config
|
|
939
|
+
return body
|
|
940
|
+
|
|
749
941
|
@classmethod
|
|
750
942
|
def from_dict(cls, d: Dict[str, any]) -> EndpointCoreConfigOutput:
|
|
751
943
|
"""Deserializes the EndpointCoreConfigOutput from a dictionary."""
|
|
@@ -772,6 +964,13 @@ class EndpointCoreConfigSummary:
|
|
|
772
964
|
if self.served_models: body['served_models'] = [v.as_dict() for v in self.served_models]
|
|
773
965
|
return body
|
|
774
966
|
|
|
967
|
+
def as_shallow_dict(self) -> dict:
|
|
968
|
+
"""Serializes the EndpointCoreConfigSummary into a shallow dictionary of its immediate attributes."""
|
|
969
|
+
body = {}
|
|
970
|
+
if self.served_entities: body['served_entities'] = self.served_entities
|
|
971
|
+
if self.served_models: body['served_models'] = self.served_models
|
|
972
|
+
return body
|
|
973
|
+
|
|
775
974
|
@classmethod
|
|
776
975
|
def from_dict(cls, d: Dict[str, any]) -> EndpointCoreConfigSummary:
|
|
777
976
|
"""Deserializes the EndpointCoreConfigSummary from a dictionary."""
|
|
@@ -812,6 +1011,17 @@ class EndpointPendingConfig:
|
|
|
812
1011
|
if self.traffic_config: body['traffic_config'] = self.traffic_config.as_dict()
|
|
813
1012
|
return body
|
|
814
1013
|
|
|
1014
|
+
def as_shallow_dict(self) -> dict:
|
|
1015
|
+
"""Serializes the EndpointPendingConfig into a shallow dictionary of its immediate attributes."""
|
|
1016
|
+
body = {}
|
|
1017
|
+
if self.auto_capture_config: body['auto_capture_config'] = self.auto_capture_config
|
|
1018
|
+
if self.config_version is not None: body['config_version'] = self.config_version
|
|
1019
|
+
if self.served_entities: body['served_entities'] = self.served_entities
|
|
1020
|
+
if self.served_models: body['served_models'] = self.served_models
|
|
1021
|
+
if self.start_time is not None: body['start_time'] = self.start_time
|
|
1022
|
+
if self.traffic_config: body['traffic_config'] = self.traffic_config
|
|
1023
|
+
return body
|
|
1024
|
+
|
|
815
1025
|
@classmethod
|
|
816
1026
|
def from_dict(cls, d: Dict[str, any]) -> EndpointPendingConfig:
|
|
817
1027
|
"""Deserializes the EndpointPendingConfig from a dictionary."""
|
|
@@ -843,6 +1053,13 @@ class EndpointState:
|
|
|
843
1053
|
if self.ready is not None: body['ready'] = self.ready.value
|
|
844
1054
|
return body
|
|
845
1055
|
|
|
1056
|
+
def as_shallow_dict(self) -> dict:
|
|
1057
|
+
"""Serializes the EndpointState into a shallow dictionary of its immediate attributes."""
|
|
1058
|
+
body = {}
|
|
1059
|
+
if self.config_update is not None: body['config_update'] = self.config_update
|
|
1060
|
+
if self.ready is not None: body['ready'] = self.ready
|
|
1061
|
+
return body
|
|
1062
|
+
|
|
846
1063
|
@classmethod
|
|
847
1064
|
def from_dict(cls, d: Dict[str, any]) -> EndpointState:
|
|
848
1065
|
"""Deserializes the EndpointState from a dictionary."""
|
|
@@ -886,6 +1103,13 @@ class EndpointTag:
|
|
|
886
1103
|
if self.value is not None: body['value'] = self.value
|
|
887
1104
|
return body
|
|
888
1105
|
|
|
1106
|
+
def as_shallow_dict(self) -> dict:
|
|
1107
|
+
"""Serializes the EndpointTag into a shallow dictionary of its immediate attributes."""
|
|
1108
|
+
body = {}
|
|
1109
|
+
if self.key is not None: body['key'] = self.key
|
|
1110
|
+
if self.value is not None: body['value'] = self.value
|
|
1111
|
+
return body
|
|
1112
|
+
|
|
889
1113
|
@classmethod
|
|
890
1114
|
def from_dict(cls, d: Dict[str, any]) -> EndpointTag:
|
|
891
1115
|
"""Deserializes the EndpointTag from a dictionary."""
|
|
@@ -902,6 +1126,12 @@ class ExportMetricsResponse:
|
|
|
902
1126
|
if self.contents: body['contents'] = self.contents
|
|
903
1127
|
return body
|
|
904
1128
|
|
|
1129
|
+
def as_shallow_dict(self) -> dict:
|
|
1130
|
+
"""Serializes the ExportMetricsResponse into a shallow dictionary of its immediate attributes."""
|
|
1131
|
+
body = {}
|
|
1132
|
+
if self.contents: body['contents'] = self.contents
|
|
1133
|
+
return body
|
|
1134
|
+
|
|
905
1135
|
@classmethod
|
|
906
1136
|
def from_dict(cls, d: Dict[str, any]) -> ExportMetricsResponse:
|
|
907
1137
|
"""Deserializes the ExportMetricsResponse from a dictionary."""
|
|
@@ -963,6 +1193,24 @@ class ExternalModel:
|
|
|
963
1193
|
if self.task is not None: body['task'] = self.task
|
|
964
1194
|
return body
|
|
965
1195
|
|
|
1196
|
+
def as_shallow_dict(self) -> dict:
|
|
1197
|
+
"""Serializes the ExternalModel into a shallow dictionary of its immediate attributes."""
|
|
1198
|
+
body = {}
|
|
1199
|
+
if self.ai21labs_config: body['ai21labs_config'] = self.ai21labs_config
|
|
1200
|
+
if self.amazon_bedrock_config: body['amazon_bedrock_config'] = self.amazon_bedrock_config
|
|
1201
|
+
if self.anthropic_config: body['anthropic_config'] = self.anthropic_config
|
|
1202
|
+
if self.cohere_config: body['cohere_config'] = self.cohere_config
|
|
1203
|
+
if self.databricks_model_serving_config:
|
|
1204
|
+
body['databricks_model_serving_config'] = self.databricks_model_serving_config
|
|
1205
|
+
if self.google_cloud_vertex_ai_config:
|
|
1206
|
+
body['google_cloud_vertex_ai_config'] = self.google_cloud_vertex_ai_config
|
|
1207
|
+
if self.name is not None: body['name'] = self.name
|
|
1208
|
+
if self.openai_config: body['openai_config'] = self.openai_config
|
|
1209
|
+
if self.palm_config: body['palm_config'] = self.palm_config
|
|
1210
|
+
if self.provider is not None: body['provider'] = self.provider
|
|
1211
|
+
if self.task is not None: body['task'] = self.task
|
|
1212
|
+
return body
|
|
1213
|
+
|
|
966
1214
|
@classmethod
|
|
967
1215
|
def from_dict(cls, d: Dict[str, any]) -> ExternalModel:
|
|
968
1216
|
"""Deserializes the ExternalModel from a dictionary."""
|
|
@@ -1015,6 +1263,14 @@ class ExternalModelUsageElement:
|
|
|
1015
1263
|
if self.total_tokens is not None: body['total_tokens'] = self.total_tokens
|
|
1016
1264
|
return body
|
|
1017
1265
|
|
|
1266
|
+
def as_shallow_dict(self) -> dict:
|
|
1267
|
+
"""Serializes the ExternalModelUsageElement into a shallow dictionary of its immediate attributes."""
|
|
1268
|
+
body = {}
|
|
1269
|
+
if self.completion_tokens is not None: body['completion_tokens'] = self.completion_tokens
|
|
1270
|
+
if self.prompt_tokens is not None: body['prompt_tokens'] = self.prompt_tokens
|
|
1271
|
+
if self.total_tokens is not None: body['total_tokens'] = self.total_tokens
|
|
1272
|
+
return body
|
|
1273
|
+
|
|
1018
1274
|
@classmethod
|
|
1019
1275
|
def from_dict(cls, d: Dict[str, any]) -> ExternalModelUsageElement:
|
|
1020
1276
|
"""Deserializes the ExternalModelUsageElement from a dictionary."""
|
|
@@ -1046,6 +1302,15 @@ class FoundationModel:
|
|
|
1046
1302
|
if self.name is not None: body['name'] = self.name
|
|
1047
1303
|
return body
|
|
1048
1304
|
|
|
1305
|
+
def as_shallow_dict(self) -> dict:
|
|
1306
|
+
"""Serializes the FoundationModel into a shallow dictionary of its immediate attributes."""
|
|
1307
|
+
body = {}
|
|
1308
|
+
if self.description is not None: body['description'] = self.description
|
|
1309
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
1310
|
+
if self.docs is not None: body['docs'] = self.docs
|
|
1311
|
+
if self.name is not None: body['name'] = self.name
|
|
1312
|
+
return body
|
|
1313
|
+
|
|
1049
1314
|
@classmethod
|
|
1050
1315
|
def from_dict(cls, d: Dict[str, any]) -> FoundationModel:
|
|
1051
1316
|
"""Deserializes the FoundationModel from a dictionary."""
|
|
@@ -1065,6 +1330,11 @@ class GetOpenApiResponse:
|
|
|
1065
1330
|
body = {}
|
|
1066
1331
|
return body
|
|
1067
1332
|
|
|
1333
|
+
def as_shallow_dict(self) -> dict:
|
|
1334
|
+
"""Serializes the GetOpenApiResponse into a shallow dictionary of its immediate attributes."""
|
|
1335
|
+
body = {}
|
|
1336
|
+
return body
|
|
1337
|
+
|
|
1068
1338
|
@classmethod
|
|
1069
1339
|
def from_dict(cls, d: Dict[str, any]) -> GetOpenApiResponse:
|
|
1070
1340
|
"""Deserializes the GetOpenApiResponse from a dictionary."""
|
|
@@ -1082,6 +1352,12 @@ class GetServingEndpointPermissionLevelsResponse:
|
|
|
1082
1352
|
if self.permission_levels: body['permission_levels'] = [v.as_dict() for v in self.permission_levels]
|
|
1083
1353
|
return body
|
|
1084
1354
|
|
|
1355
|
+
def as_shallow_dict(self) -> dict:
|
|
1356
|
+
"""Serializes the GetServingEndpointPermissionLevelsResponse into a shallow dictionary of its immediate attributes."""
|
|
1357
|
+
body = {}
|
|
1358
|
+
if self.permission_levels: body['permission_levels'] = self.permission_levels
|
|
1359
|
+
return body
|
|
1360
|
+
|
|
1085
1361
|
@classmethod
|
|
1086
1362
|
def from_dict(cls, d: Dict[str, any]) -> GetServingEndpointPermissionLevelsResponse:
|
|
1087
1363
|
"""Deserializes the GetServingEndpointPermissionLevelsResponse from a dictionary."""
|
|
@@ -1125,6 +1401,15 @@ class GoogleCloudVertexAiConfig:
|
|
|
1125
1401
|
if self.region is not None: body['region'] = self.region
|
|
1126
1402
|
return body
|
|
1127
1403
|
|
|
1404
|
+
def as_shallow_dict(self) -> dict:
|
|
1405
|
+
"""Serializes the GoogleCloudVertexAiConfig into a shallow dictionary of its immediate attributes."""
|
|
1406
|
+
body = {}
|
|
1407
|
+
if self.private_key is not None: body['private_key'] = self.private_key
|
|
1408
|
+
if self.private_key_plaintext is not None: body['private_key_plaintext'] = self.private_key_plaintext
|
|
1409
|
+
if self.project_id is not None: body['project_id'] = self.project_id
|
|
1410
|
+
if self.region is not None: body['region'] = self.region
|
|
1411
|
+
return body
|
|
1412
|
+
|
|
1128
1413
|
@classmethod
|
|
1129
1414
|
def from_dict(cls, d: Dict[str, any]) -> GoogleCloudVertexAiConfig:
|
|
1130
1415
|
"""Deserializes the GoogleCloudVertexAiConfig from a dictionary."""
|
|
@@ -1145,6 +1430,12 @@ class ListEndpointsResponse:
|
|
|
1145
1430
|
if self.endpoints: body['endpoints'] = [v.as_dict() for v in self.endpoints]
|
|
1146
1431
|
return body
|
|
1147
1432
|
|
|
1433
|
+
def as_shallow_dict(self) -> dict:
|
|
1434
|
+
"""Serializes the ListEndpointsResponse into a shallow dictionary of its immediate attributes."""
|
|
1435
|
+
body = {}
|
|
1436
|
+
if self.endpoints: body['endpoints'] = self.endpoints
|
|
1437
|
+
return body
|
|
1438
|
+
|
|
1148
1439
|
@classmethod
|
|
1149
1440
|
def from_dict(cls, d: Dict[str, any]) -> ListEndpointsResponse:
|
|
1150
1441
|
"""Deserializes the ListEndpointsResponse from a dictionary."""
|
|
@@ -1162,6 +1453,12 @@ class ModelDataPlaneInfo:
|
|
|
1162
1453
|
if self.query_info: body['query_info'] = self.query_info.as_dict()
|
|
1163
1454
|
return body
|
|
1164
1455
|
|
|
1456
|
+
def as_shallow_dict(self) -> dict:
|
|
1457
|
+
"""Serializes the ModelDataPlaneInfo into a shallow dictionary of its immediate attributes."""
|
|
1458
|
+
body = {}
|
|
1459
|
+
if self.query_info: body['query_info'] = self.query_info
|
|
1460
|
+
return body
|
|
1461
|
+
|
|
1165
1462
|
@classmethod
|
|
1166
1463
|
def from_dict(cls, d: Dict[str, any]) -> ModelDataPlaneInfo:
|
|
1167
1464
|
"""Deserializes the ModelDataPlaneInfo from a dictionary."""
|
|
@@ -1243,6 +1540,28 @@ class OpenAiConfig:
|
|
|
1243
1540
|
if self.openai_organization is not None: body['openai_organization'] = self.openai_organization
|
|
1244
1541
|
return body
|
|
1245
1542
|
|
|
1543
|
+
def as_shallow_dict(self) -> dict:
|
|
1544
|
+
"""Serializes the OpenAiConfig into a shallow dictionary of its immediate attributes."""
|
|
1545
|
+
body = {}
|
|
1546
|
+
if self.microsoft_entra_client_id is not None:
|
|
1547
|
+
body['microsoft_entra_client_id'] = self.microsoft_entra_client_id
|
|
1548
|
+
if self.microsoft_entra_client_secret is not None:
|
|
1549
|
+
body['microsoft_entra_client_secret'] = self.microsoft_entra_client_secret
|
|
1550
|
+
if self.microsoft_entra_client_secret_plaintext is not None:
|
|
1551
|
+
body['microsoft_entra_client_secret_plaintext'] = self.microsoft_entra_client_secret_plaintext
|
|
1552
|
+
if self.microsoft_entra_tenant_id is not None:
|
|
1553
|
+
body['microsoft_entra_tenant_id'] = self.microsoft_entra_tenant_id
|
|
1554
|
+
if self.openai_api_base is not None: body['openai_api_base'] = self.openai_api_base
|
|
1555
|
+
if self.openai_api_key is not None: body['openai_api_key'] = self.openai_api_key
|
|
1556
|
+
if self.openai_api_key_plaintext is not None:
|
|
1557
|
+
body['openai_api_key_plaintext'] = self.openai_api_key_plaintext
|
|
1558
|
+
if self.openai_api_type is not None: body['openai_api_type'] = self.openai_api_type
|
|
1559
|
+
if self.openai_api_version is not None: body['openai_api_version'] = self.openai_api_version
|
|
1560
|
+
if self.openai_deployment_name is not None:
|
|
1561
|
+
body['openai_deployment_name'] = self.openai_deployment_name
|
|
1562
|
+
if self.openai_organization is not None: body['openai_organization'] = self.openai_organization
|
|
1563
|
+
return body
|
|
1564
|
+
|
|
1246
1565
|
@classmethod
|
|
1247
1566
|
def from_dict(cls, d: Dict[str, any]) -> OpenAiConfig:
|
|
1248
1567
|
"""Deserializes the OpenAiConfig from a dictionary."""
|
|
@@ -1280,6 +1599,14 @@ class PaLmConfig:
|
|
|
1280
1599
|
body['palm_api_key_plaintext'] = self.palm_api_key_plaintext
|
|
1281
1600
|
return body
|
|
1282
1601
|
|
|
1602
|
+
def as_shallow_dict(self) -> dict:
|
|
1603
|
+
"""Serializes the PaLmConfig into a shallow dictionary of its immediate attributes."""
|
|
1604
|
+
body = {}
|
|
1605
|
+
if self.palm_api_key is not None: body['palm_api_key'] = self.palm_api_key
|
|
1606
|
+
if self.palm_api_key_plaintext is not None:
|
|
1607
|
+
body['palm_api_key_plaintext'] = self.palm_api_key_plaintext
|
|
1608
|
+
return body
|
|
1609
|
+
|
|
1283
1610
|
@classmethod
|
|
1284
1611
|
def from_dict(cls, d: Dict[str, any]) -> PaLmConfig:
|
|
1285
1612
|
"""Deserializes the PaLmConfig from a dictionary."""
|
|
@@ -1306,6 +1633,14 @@ class PatchServingEndpointTags:
|
|
|
1306
1633
|
if self.name is not None: body['name'] = self.name
|
|
1307
1634
|
return body
|
|
1308
1635
|
|
|
1636
|
+
def as_shallow_dict(self) -> dict:
|
|
1637
|
+
"""Serializes the PatchServingEndpointTags into a shallow dictionary of its immediate attributes."""
|
|
1638
|
+
body = {}
|
|
1639
|
+
if self.add_tags: body['add_tags'] = self.add_tags
|
|
1640
|
+
if self.delete_tags: body['delete_tags'] = self.delete_tags
|
|
1641
|
+
if self.name is not None: body['name'] = self.name
|
|
1642
|
+
return body
|
|
1643
|
+
|
|
1309
1644
|
@classmethod
|
|
1310
1645
|
def from_dict(cls, d: Dict[str, any]) -> PatchServingEndpointTags:
|
|
1311
1646
|
"""Deserializes the PatchServingEndpointTags from a dictionary."""
|
|
@@ -1333,6 +1668,14 @@ class PayloadTable:
|
|
|
1333
1668
|
if self.status_message is not None: body['status_message'] = self.status_message
|
|
1334
1669
|
return body
|
|
1335
1670
|
|
|
1671
|
+
def as_shallow_dict(self) -> dict:
|
|
1672
|
+
"""Serializes the PayloadTable into a shallow dictionary of its immediate attributes."""
|
|
1673
|
+
body = {}
|
|
1674
|
+
if self.name is not None: body['name'] = self.name
|
|
1675
|
+
if self.status is not None: body['status'] = self.status
|
|
1676
|
+
if self.status_message is not None: body['status_message'] = self.status_message
|
|
1677
|
+
return body
|
|
1678
|
+
|
|
1336
1679
|
@classmethod
|
|
1337
1680
|
def from_dict(cls, d: Dict[str, any]) -> PayloadTable:
|
|
1338
1681
|
"""Deserializes the PayloadTable from a dictionary."""
|
|
@@ -1367,6 +1710,15 @@ class PutAiGatewayResponse:
|
|
|
1367
1710
|
if self.usage_tracking_config: body['usage_tracking_config'] = self.usage_tracking_config.as_dict()
|
|
1368
1711
|
return body
|
|
1369
1712
|
|
|
1713
|
+
def as_shallow_dict(self) -> dict:
|
|
1714
|
+
"""Serializes the PutAiGatewayResponse into a shallow dictionary of its immediate attributes."""
|
|
1715
|
+
body = {}
|
|
1716
|
+
if self.guardrails: body['guardrails'] = self.guardrails
|
|
1717
|
+
if self.inference_table_config: body['inference_table_config'] = self.inference_table_config
|
|
1718
|
+
if self.rate_limits: body['rate_limits'] = self.rate_limits
|
|
1719
|
+
if self.usage_tracking_config: body['usage_tracking_config'] = self.usage_tracking_config
|
|
1720
|
+
return body
|
|
1721
|
+
|
|
1370
1722
|
@classmethod
|
|
1371
1723
|
def from_dict(cls, d: Dict[str, any]) -> PutAiGatewayResponse:
|
|
1372
1724
|
"""Deserializes the PutAiGatewayResponse from a dictionary."""
|
|
@@ -1388,6 +1740,12 @@ class PutResponse:
|
|
|
1388
1740
|
if self.rate_limits: body['rate_limits'] = [v.as_dict() for v in self.rate_limits]
|
|
1389
1741
|
return body
|
|
1390
1742
|
|
|
1743
|
+
def as_shallow_dict(self) -> dict:
|
|
1744
|
+
"""Serializes the PutResponse into a shallow dictionary of its immediate attributes."""
|
|
1745
|
+
body = {}
|
|
1746
|
+
if self.rate_limits: body['rate_limits'] = self.rate_limits
|
|
1747
|
+
return body
|
|
1748
|
+
|
|
1391
1749
|
@classmethod
|
|
1392
1750
|
def from_dict(cls, d: Dict[str, any]) -> PutResponse:
|
|
1393
1751
|
"""Deserializes the PutResponse from a dictionary."""
|
|
@@ -1473,6 +1831,25 @@ class QueryEndpointInput:
|
|
|
1473
1831
|
if self.temperature is not None: body['temperature'] = self.temperature
|
|
1474
1832
|
return body
|
|
1475
1833
|
|
|
1834
|
+
def as_shallow_dict(self) -> dict:
|
|
1835
|
+
"""Serializes the QueryEndpointInput into a shallow dictionary of its immediate attributes."""
|
|
1836
|
+
body = {}
|
|
1837
|
+
if self.dataframe_records: body['dataframe_records'] = self.dataframe_records
|
|
1838
|
+
if self.dataframe_split: body['dataframe_split'] = self.dataframe_split
|
|
1839
|
+
if self.extra_params: body['extra_params'] = self.extra_params
|
|
1840
|
+
if self.input: body['input'] = self.input
|
|
1841
|
+
if self.inputs: body['inputs'] = self.inputs
|
|
1842
|
+
if self.instances: body['instances'] = self.instances
|
|
1843
|
+
if self.max_tokens is not None: body['max_tokens'] = self.max_tokens
|
|
1844
|
+
if self.messages: body['messages'] = self.messages
|
|
1845
|
+
if self.n is not None: body['n'] = self.n
|
|
1846
|
+
if self.name is not None: body['name'] = self.name
|
|
1847
|
+
if self.prompt: body['prompt'] = self.prompt
|
|
1848
|
+
if self.stop: body['stop'] = self.stop
|
|
1849
|
+
if self.stream is not None: body['stream'] = self.stream
|
|
1850
|
+
if self.temperature is not None: body['temperature'] = self.temperature
|
|
1851
|
+
return body
|
|
1852
|
+
|
|
1476
1853
|
@classmethod
|
|
1477
1854
|
def from_dict(cls, d: Dict[str, any]) -> QueryEndpointInput:
|
|
1478
1855
|
"""Deserializes the QueryEndpointInput from a dictionary."""
|
|
@@ -1543,6 +1920,20 @@ class QueryEndpointResponse:
|
|
|
1543
1920
|
if self.usage: body['usage'] = self.usage.as_dict()
|
|
1544
1921
|
return body
|
|
1545
1922
|
|
|
1923
|
+
def as_shallow_dict(self) -> dict:
|
|
1924
|
+
"""Serializes the QueryEndpointResponse into a shallow dictionary of its immediate attributes."""
|
|
1925
|
+
body = {}
|
|
1926
|
+
if self.choices: body['choices'] = self.choices
|
|
1927
|
+
if self.created is not None: body['created'] = self.created
|
|
1928
|
+
if self.data: body['data'] = self.data
|
|
1929
|
+
if self.id is not None: body['id'] = self.id
|
|
1930
|
+
if self.model is not None: body['model'] = self.model
|
|
1931
|
+
if self.object is not None: body['object'] = self.object
|
|
1932
|
+
if self.predictions: body['predictions'] = self.predictions
|
|
1933
|
+
if self.served_model_name is not None: body['served-model-name'] = self.served_model_name
|
|
1934
|
+
if self.usage: body['usage'] = self.usage
|
|
1935
|
+
return body
|
|
1936
|
+
|
|
1546
1937
|
@classmethod
|
|
1547
1938
|
def from_dict(cls, d: Dict[str, any]) -> QueryEndpointResponse:
|
|
1548
1939
|
"""Deserializes the QueryEndpointResponse from a dictionary."""
|
|
@@ -1586,6 +1977,14 @@ class RateLimit:
|
|
|
1586
1977
|
if self.renewal_period is not None: body['renewal_period'] = self.renewal_period.value
|
|
1587
1978
|
return body
|
|
1588
1979
|
|
|
1980
|
+
def as_shallow_dict(self) -> dict:
|
|
1981
|
+
"""Serializes the RateLimit into a shallow dictionary of its immediate attributes."""
|
|
1982
|
+
body = {}
|
|
1983
|
+
if self.calls is not None: body['calls'] = self.calls
|
|
1984
|
+
if self.key is not None: body['key'] = self.key
|
|
1985
|
+
if self.renewal_period is not None: body['renewal_period'] = self.renewal_period
|
|
1986
|
+
return body
|
|
1987
|
+
|
|
1589
1988
|
@classmethod
|
|
1590
1989
|
def from_dict(cls, d: Dict[str, any]) -> RateLimit:
|
|
1591
1990
|
"""Deserializes the RateLimit from a dictionary."""
|
|
@@ -1624,6 +2023,13 @@ class Route:
|
|
|
1624
2023
|
if self.traffic_percentage is not None: body['traffic_percentage'] = self.traffic_percentage
|
|
1625
2024
|
return body
|
|
1626
2025
|
|
|
2026
|
+
def as_shallow_dict(self) -> dict:
|
|
2027
|
+
"""Serializes the Route into a shallow dictionary of its immediate attributes."""
|
|
2028
|
+
body = {}
|
|
2029
|
+
if self.served_model_name is not None: body['served_model_name'] = self.served_model_name
|
|
2030
|
+
if self.traffic_percentage is not None: body['traffic_percentage'] = self.traffic_percentage
|
|
2031
|
+
return body
|
|
2032
|
+
|
|
1627
2033
|
@classmethod
|
|
1628
2034
|
def from_dict(cls, d: Dict[str, any]) -> Route:
|
|
1629
2035
|
"""Deserializes the Route from a dictionary."""
|
|
@@ -1709,6 +2115,24 @@ class ServedEntityInput:
|
|
|
1709
2115
|
if self.workload_type is not None: body['workload_type'] = self.workload_type
|
|
1710
2116
|
return body
|
|
1711
2117
|
|
|
2118
|
+
def as_shallow_dict(self) -> dict:
|
|
2119
|
+
"""Serializes the ServedEntityInput into a shallow dictionary of its immediate attributes."""
|
|
2120
|
+
body = {}
|
|
2121
|
+
if self.entity_name is not None: body['entity_name'] = self.entity_name
|
|
2122
|
+
if self.entity_version is not None: body['entity_version'] = self.entity_version
|
|
2123
|
+
if self.environment_vars: body['environment_vars'] = self.environment_vars
|
|
2124
|
+
if self.external_model: body['external_model'] = self.external_model
|
|
2125
|
+
if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn
|
|
2126
|
+
if self.max_provisioned_throughput is not None:
|
|
2127
|
+
body['max_provisioned_throughput'] = self.max_provisioned_throughput
|
|
2128
|
+
if self.min_provisioned_throughput is not None:
|
|
2129
|
+
body['min_provisioned_throughput'] = self.min_provisioned_throughput
|
|
2130
|
+
if self.name is not None: body['name'] = self.name
|
|
2131
|
+
if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled
|
|
2132
|
+
if self.workload_size is not None: body['workload_size'] = self.workload_size
|
|
2133
|
+
if self.workload_type is not None: body['workload_type'] = self.workload_type
|
|
2134
|
+
return body
|
|
2135
|
+
|
|
1712
2136
|
@classmethod
|
|
1713
2137
|
def from_dict(cls, d: Dict[str, any]) -> ServedEntityInput:
|
|
1714
2138
|
"""Deserializes the ServedEntityInput from a dictionary."""
|
|
@@ -1815,6 +2239,28 @@ class ServedEntityOutput:
|
|
|
1815
2239
|
if self.workload_type is not None: body['workload_type'] = self.workload_type
|
|
1816
2240
|
return body
|
|
1817
2241
|
|
|
2242
|
+
def as_shallow_dict(self) -> dict:
|
|
2243
|
+
"""Serializes the ServedEntityOutput into a shallow dictionary of its immediate attributes."""
|
|
2244
|
+
body = {}
|
|
2245
|
+
if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp
|
|
2246
|
+
if self.creator is not None: body['creator'] = self.creator
|
|
2247
|
+
if self.entity_name is not None: body['entity_name'] = self.entity_name
|
|
2248
|
+
if self.entity_version is not None: body['entity_version'] = self.entity_version
|
|
2249
|
+
if self.environment_vars: body['environment_vars'] = self.environment_vars
|
|
2250
|
+
if self.external_model: body['external_model'] = self.external_model
|
|
2251
|
+
if self.foundation_model: body['foundation_model'] = self.foundation_model
|
|
2252
|
+
if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn
|
|
2253
|
+
if self.max_provisioned_throughput is not None:
|
|
2254
|
+
body['max_provisioned_throughput'] = self.max_provisioned_throughput
|
|
2255
|
+
if self.min_provisioned_throughput is not None:
|
|
2256
|
+
body['min_provisioned_throughput'] = self.min_provisioned_throughput
|
|
2257
|
+
if self.name is not None: body['name'] = self.name
|
|
2258
|
+
if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled
|
|
2259
|
+
if self.state: body['state'] = self.state
|
|
2260
|
+
if self.workload_size is not None: body['workload_size'] = self.workload_size
|
|
2261
|
+
if self.workload_type is not None: body['workload_type'] = self.workload_type
|
|
2262
|
+
return body
|
|
2263
|
+
|
|
1818
2264
|
@classmethod
|
|
1819
2265
|
def from_dict(cls, d: Dict[str, any]) -> ServedEntityOutput:
|
|
1820
2266
|
"""Deserializes the ServedEntityOutput from a dictionary."""
|
|
@@ -1868,6 +2314,16 @@ class ServedEntitySpec:
|
|
|
1868
2314
|
if self.name is not None: body['name'] = self.name
|
|
1869
2315
|
return body
|
|
1870
2316
|
|
|
2317
|
+
def as_shallow_dict(self) -> dict:
|
|
2318
|
+
"""Serializes the ServedEntitySpec into a shallow dictionary of its immediate attributes."""
|
|
2319
|
+
body = {}
|
|
2320
|
+
if self.entity_name is not None: body['entity_name'] = self.entity_name
|
|
2321
|
+
if self.entity_version is not None: body['entity_version'] = self.entity_version
|
|
2322
|
+
if self.external_model: body['external_model'] = self.external_model
|
|
2323
|
+
if self.foundation_model: body['foundation_model'] = self.foundation_model
|
|
2324
|
+
if self.name is not None: body['name'] = self.name
|
|
2325
|
+
return body
|
|
2326
|
+
|
|
1871
2327
|
@classmethod
|
|
1872
2328
|
def from_dict(cls, d: Dict[str, any]) -> ServedEntitySpec:
|
|
1873
2329
|
"""Deserializes the ServedEntitySpec from a dictionary."""
|
|
@@ -1943,6 +2399,23 @@ class ServedModelInput:
|
|
|
1943
2399
|
if self.workload_type is not None: body['workload_type'] = self.workload_type.value
|
|
1944
2400
|
return body
|
|
1945
2401
|
|
|
2402
|
+
def as_shallow_dict(self) -> dict:
|
|
2403
|
+
"""Serializes the ServedModelInput into a shallow dictionary of its immediate attributes."""
|
|
2404
|
+
body = {}
|
|
2405
|
+
if self.environment_vars: body['environment_vars'] = self.environment_vars
|
|
2406
|
+
if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn
|
|
2407
|
+
if self.max_provisioned_throughput is not None:
|
|
2408
|
+
body['max_provisioned_throughput'] = self.max_provisioned_throughput
|
|
2409
|
+
if self.min_provisioned_throughput is not None:
|
|
2410
|
+
body['min_provisioned_throughput'] = self.min_provisioned_throughput
|
|
2411
|
+
if self.model_name is not None: body['model_name'] = self.model_name
|
|
2412
|
+
if self.model_version is not None: body['model_version'] = self.model_version
|
|
2413
|
+
if self.name is not None: body['name'] = self.name
|
|
2414
|
+
if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled
|
|
2415
|
+
if self.workload_size is not None: body['workload_size'] = self.workload_size
|
|
2416
|
+
if self.workload_type is not None: body['workload_type'] = self.workload_type
|
|
2417
|
+
return body
|
|
2418
|
+
|
|
1946
2419
|
@classmethod
|
|
1947
2420
|
def from_dict(cls, d: Dict[str, any]) -> ServedModelInput:
|
|
1948
2421
|
"""Deserializes the ServedModelInput from a dictionary."""
|
|
@@ -2051,6 +2524,22 @@ class ServedModelOutput:
|
|
|
2051
2524
|
if self.workload_type is not None: body['workload_type'] = self.workload_type
|
|
2052
2525
|
return body
|
|
2053
2526
|
|
|
2527
|
+
def as_shallow_dict(self) -> dict:
|
|
2528
|
+
"""Serializes the ServedModelOutput into a shallow dictionary of its immediate attributes."""
|
|
2529
|
+
body = {}
|
|
2530
|
+
if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp
|
|
2531
|
+
if self.creator is not None: body['creator'] = self.creator
|
|
2532
|
+
if self.environment_vars: body['environment_vars'] = self.environment_vars
|
|
2533
|
+
if self.instance_profile_arn is not None: body['instance_profile_arn'] = self.instance_profile_arn
|
|
2534
|
+
if self.model_name is not None: body['model_name'] = self.model_name
|
|
2535
|
+
if self.model_version is not None: body['model_version'] = self.model_version
|
|
2536
|
+
if self.name is not None: body['name'] = self.name
|
|
2537
|
+
if self.scale_to_zero_enabled is not None: body['scale_to_zero_enabled'] = self.scale_to_zero_enabled
|
|
2538
|
+
if self.state: body['state'] = self.state
|
|
2539
|
+
if self.workload_size is not None: body['workload_size'] = self.workload_size
|
|
2540
|
+
if self.workload_type is not None: body['workload_type'] = self.workload_type
|
|
2541
|
+
return body
|
|
2542
|
+
|
|
2054
2543
|
@classmethod
|
|
2055
2544
|
def from_dict(cls, d: Dict[str, any]) -> ServedModelOutput:
|
|
2056
2545
|
"""Deserializes the ServedModelOutput from a dictionary."""
|
|
@@ -2087,6 +2576,14 @@ class ServedModelSpec:
|
|
|
2087
2576
|
if self.name is not None: body['name'] = self.name
|
|
2088
2577
|
return body
|
|
2089
2578
|
|
|
2579
|
+
def as_shallow_dict(self) -> dict:
|
|
2580
|
+
"""Serializes the ServedModelSpec into a shallow dictionary of its immediate attributes."""
|
|
2581
|
+
body = {}
|
|
2582
|
+
if self.model_name is not None: body['model_name'] = self.model_name
|
|
2583
|
+
if self.model_version is not None: body['model_version'] = self.model_version
|
|
2584
|
+
if self.name is not None: body['name'] = self.name
|
|
2585
|
+
return body
|
|
2586
|
+
|
|
2090
2587
|
@classmethod
|
|
2091
2588
|
def from_dict(cls, d: Dict[str, any]) -> ServedModelSpec:
|
|
2092
2589
|
"""Deserializes the ServedModelSpec from a dictionary."""
|
|
@@ -2119,6 +2616,14 @@ class ServedModelState:
|
|
|
2119
2616
|
body['deployment_state_message'] = self.deployment_state_message
|
|
2120
2617
|
return body
|
|
2121
2618
|
|
|
2619
|
+
def as_shallow_dict(self) -> dict:
|
|
2620
|
+
"""Serializes the ServedModelState into a shallow dictionary of its immediate attributes."""
|
|
2621
|
+
body = {}
|
|
2622
|
+
if self.deployment is not None: body['deployment'] = self.deployment
|
|
2623
|
+
if self.deployment_state_message is not None:
|
|
2624
|
+
body['deployment_state_message'] = self.deployment_state_message
|
|
2625
|
+
return body
|
|
2626
|
+
|
|
2122
2627
|
@classmethod
|
|
2123
2628
|
def from_dict(cls, d: Dict[str, any]) -> ServedModelState:
|
|
2124
2629
|
"""Deserializes the ServedModelState from a dictionary."""
|
|
@@ -2155,6 +2660,12 @@ class ServerLogsResponse:
|
|
|
2155
2660
|
if self.logs is not None: body['logs'] = self.logs
|
|
2156
2661
|
return body
|
|
2157
2662
|
|
|
2663
|
+
def as_shallow_dict(self) -> dict:
|
|
2664
|
+
"""Serializes the ServerLogsResponse into a shallow dictionary of its immediate attributes."""
|
|
2665
|
+
body = {}
|
|
2666
|
+
if self.logs is not None: body['logs'] = self.logs
|
|
2667
|
+
return body
|
|
2668
|
+
|
|
2158
2669
|
@classmethod
|
|
2159
2670
|
def from_dict(cls, d: Dict[str, any]) -> ServerLogsResponse:
|
|
2160
2671
|
"""Deserializes the ServerLogsResponse from a dictionary."""
|
|
@@ -2211,6 +2722,22 @@ class ServingEndpoint:
|
|
|
2211
2722
|
if self.task is not None: body['task'] = self.task
|
|
2212
2723
|
return body
|
|
2213
2724
|
|
|
2725
|
+
def as_shallow_dict(self) -> dict:
|
|
2726
|
+
"""Serializes the ServingEndpoint into a shallow dictionary of its immediate attributes."""
|
|
2727
|
+
body = {}
|
|
2728
|
+
if self.ai_gateway: body['ai_gateway'] = self.ai_gateway
|
|
2729
|
+
if self.config: body['config'] = self.config
|
|
2730
|
+
if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp
|
|
2731
|
+
if self.creator is not None: body['creator'] = self.creator
|
|
2732
|
+
if self.id is not None: body['id'] = self.id
|
|
2733
|
+
if self.last_updated_timestamp is not None:
|
|
2734
|
+
body['last_updated_timestamp'] = self.last_updated_timestamp
|
|
2735
|
+
if self.name is not None: body['name'] = self.name
|
|
2736
|
+
if self.state: body['state'] = self.state
|
|
2737
|
+
if self.tags: body['tags'] = self.tags
|
|
2738
|
+
if self.task is not None: body['task'] = self.task
|
|
2739
|
+
return body
|
|
2740
|
+
|
|
2214
2741
|
@classmethod
|
|
2215
2742
|
def from_dict(cls, d: Dict[str, any]) -> ServingEndpoint:
|
|
2216
2743
|
"""Deserializes the ServingEndpoint from a dictionary."""
|
|
@@ -2250,6 +2777,16 @@ class ServingEndpointAccessControlRequest:
|
|
|
2250
2777
|
if self.user_name is not None: body['user_name'] = self.user_name
|
|
2251
2778
|
return body
|
|
2252
2779
|
|
|
2780
|
+
def as_shallow_dict(self) -> dict:
|
|
2781
|
+
"""Serializes the ServingEndpointAccessControlRequest into a shallow dictionary of its immediate attributes."""
|
|
2782
|
+
body = {}
|
|
2783
|
+
if self.group_name is not None: body['group_name'] = self.group_name
|
|
2784
|
+
if self.permission_level is not None: body['permission_level'] = self.permission_level
|
|
2785
|
+
if self.service_principal_name is not None:
|
|
2786
|
+
body['service_principal_name'] = self.service_principal_name
|
|
2787
|
+
if self.user_name is not None: body['user_name'] = self.user_name
|
|
2788
|
+
return body
|
|
2789
|
+
|
|
2253
2790
|
@classmethod
|
|
2254
2791
|
def from_dict(cls, d: Dict[str, any]) -> ServingEndpointAccessControlRequest:
|
|
2255
2792
|
"""Deserializes the ServingEndpointAccessControlRequest from a dictionary."""
|
|
@@ -2287,6 +2824,17 @@ class ServingEndpointAccessControlResponse:
|
|
|
2287
2824
|
if self.user_name is not None: body['user_name'] = self.user_name
|
|
2288
2825
|
return body
|
|
2289
2826
|
|
|
2827
|
+
def as_shallow_dict(self) -> dict:
|
|
2828
|
+
"""Serializes the ServingEndpointAccessControlResponse into a shallow dictionary of its immediate attributes."""
|
|
2829
|
+
body = {}
|
|
2830
|
+
if self.all_permissions: body['all_permissions'] = self.all_permissions
|
|
2831
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
2832
|
+
if self.group_name is not None: body['group_name'] = self.group_name
|
|
2833
|
+
if self.service_principal_name is not None:
|
|
2834
|
+
body['service_principal_name'] = self.service_principal_name
|
|
2835
|
+
if self.user_name is not None: body['user_name'] = self.user_name
|
|
2836
|
+
return body
|
|
2837
|
+
|
|
2290
2838
|
@classmethod
|
|
2291
2839
|
def from_dict(cls, d: Dict[str, any]) -> ServingEndpointAccessControlResponse:
|
|
2292
2840
|
"""Deserializes the ServingEndpointAccessControlResponse from a dictionary."""
|
|
@@ -2367,6 +2915,27 @@ class ServingEndpointDetailed:
|
|
|
2367
2915
|
if self.task is not None: body['task'] = self.task
|
|
2368
2916
|
return body
|
|
2369
2917
|
|
|
2918
|
+
def as_shallow_dict(self) -> dict:
|
|
2919
|
+
"""Serializes the ServingEndpointDetailed into a shallow dictionary of its immediate attributes."""
|
|
2920
|
+
body = {}
|
|
2921
|
+
if self.ai_gateway: body['ai_gateway'] = self.ai_gateway
|
|
2922
|
+
if self.config: body['config'] = self.config
|
|
2923
|
+
if self.creation_timestamp is not None: body['creation_timestamp'] = self.creation_timestamp
|
|
2924
|
+
if self.creator is not None: body['creator'] = self.creator
|
|
2925
|
+
if self.data_plane_info: body['data_plane_info'] = self.data_plane_info
|
|
2926
|
+
if self.endpoint_url is not None: body['endpoint_url'] = self.endpoint_url
|
|
2927
|
+
if self.id is not None: body['id'] = self.id
|
|
2928
|
+
if self.last_updated_timestamp is not None:
|
|
2929
|
+
body['last_updated_timestamp'] = self.last_updated_timestamp
|
|
2930
|
+
if self.name is not None: body['name'] = self.name
|
|
2931
|
+
if self.pending_config: body['pending_config'] = self.pending_config
|
|
2932
|
+
if self.permission_level is not None: body['permission_level'] = self.permission_level
|
|
2933
|
+
if self.route_optimized is not None: body['route_optimized'] = self.route_optimized
|
|
2934
|
+
if self.state: body['state'] = self.state
|
|
2935
|
+
if self.tags: body['tags'] = self.tags
|
|
2936
|
+
if self.task is not None: body['task'] = self.task
|
|
2937
|
+
return body
|
|
2938
|
+
|
|
2370
2939
|
@classmethod
|
|
2371
2940
|
def from_dict(cls, d: Dict[str, any]) -> ServingEndpointDetailed:
|
|
2372
2941
|
"""Deserializes the ServingEndpointDetailed from a dictionary."""
|
|
@@ -2412,6 +2981,14 @@ class ServingEndpointPermission:
|
|
|
2412
2981
|
if self.permission_level is not None: body['permission_level'] = self.permission_level.value
|
|
2413
2982
|
return body
|
|
2414
2983
|
|
|
2984
|
+
def as_shallow_dict(self) -> dict:
|
|
2985
|
+
"""Serializes the ServingEndpointPermission into a shallow dictionary of its immediate attributes."""
|
|
2986
|
+
body = {}
|
|
2987
|
+
if self.inherited is not None: body['inherited'] = self.inherited
|
|
2988
|
+
if self.inherited_from_object: body['inherited_from_object'] = self.inherited_from_object
|
|
2989
|
+
if self.permission_level is not None: body['permission_level'] = self.permission_level
|
|
2990
|
+
return body
|
|
2991
|
+
|
|
2415
2992
|
@classmethod
|
|
2416
2993
|
def from_dict(cls, d: Dict[str, any]) -> ServingEndpointPermission:
|
|
2417
2994
|
"""Deserializes the ServingEndpointPermission from a dictionary."""
|
|
@@ -2445,6 +3022,14 @@ class ServingEndpointPermissions:
|
|
|
2445
3022
|
if self.object_type is not None: body['object_type'] = self.object_type
|
|
2446
3023
|
return body
|
|
2447
3024
|
|
|
3025
|
+
def as_shallow_dict(self) -> dict:
|
|
3026
|
+
"""Serializes the ServingEndpointPermissions into a shallow dictionary of its immediate attributes."""
|
|
3027
|
+
body = {}
|
|
3028
|
+
if self.access_control_list: body['access_control_list'] = self.access_control_list
|
|
3029
|
+
if self.object_id is not None: body['object_id'] = self.object_id
|
|
3030
|
+
if self.object_type is not None: body['object_type'] = self.object_type
|
|
3031
|
+
return body
|
|
3032
|
+
|
|
2448
3033
|
@classmethod
|
|
2449
3034
|
def from_dict(cls, d: Dict[str, any]) -> ServingEndpointPermissions:
|
|
2450
3035
|
"""Deserializes the ServingEndpointPermissions from a dictionary."""
|
|
@@ -2468,6 +3053,13 @@ class ServingEndpointPermissionsDescription:
|
|
|
2468
3053
|
if self.permission_level is not None: body['permission_level'] = self.permission_level.value
|
|
2469
3054
|
return body
|
|
2470
3055
|
|
|
3056
|
+
def as_shallow_dict(self) -> dict:
|
|
3057
|
+
"""Serializes the ServingEndpointPermissionsDescription into a shallow dictionary of its immediate attributes."""
|
|
3058
|
+
body = {}
|
|
3059
|
+
if self.description is not None: body['description'] = self.description
|
|
3060
|
+
if self.permission_level is not None: body['permission_level'] = self.permission_level
|
|
3061
|
+
return body
|
|
3062
|
+
|
|
2471
3063
|
@classmethod
|
|
2472
3064
|
def from_dict(cls, d: Dict[str, any]) -> ServingEndpointPermissionsDescription:
|
|
2473
3065
|
"""Deserializes the ServingEndpointPermissionsDescription from a dictionary."""
|
|
@@ -2490,6 +3082,13 @@ class ServingEndpointPermissionsRequest:
|
|
|
2490
3082
|
if self.serving_endpoint_id is not None: body['serving_endpoint_id'] = self.serving_endpoint_id
|
|
2491
3083
|
return body
|
|
2492
3084
|
|
|
3085
|
+
def as_shallow_dict(self) -> dict:
|
|
3086
|
+
"""Serializes the ServingEndpointPermissionsRequest into a shallow dictionary of its immediate attributes."""
|
|
3087
|
+
body = {}
|
|
3088
|
+
if self.access_control_list: body['access_control_list'] = self.access_control_list
|
|
3089
|
+
if self.serving_endpoint_id is not None: body['serving_endpoint_id'] = self.serving_endpoint_id
|
|
3090
|
+
return body
|
|
3091
|
+
|
|
2493
3092
|
@classmethod
|
|
2494
3093
|
def from_dict(cls, d: Dict[str, any]) -> ServingEndpointPermissionsRequest:
|
|
2495
3094
|
"""Deserializes the ServingEndpointPermissionsRequest from a dictionary."""
|
|
@@ -2509,6 +3108,12 @@ class TrafficConfig:
|
|
|
2509
3108
|
if self.routes: body['routes'] = [v.as_dict() for v in self.routes]
|
|
2510
3109
|
return body
|
|
2511
3110
|
|
|
3111
|
+
def as_shallow_dict(self) -> dict:
|
|
3112
|
+
"""Serializes the TrafficConfig into a shallow dictionary of its immediate attributes."""
|
|
3113
|
+
body = {}
|
|
3114
|
+
if self.routes: body['routes'] = self.routes
|
|
3115
|
+
return body
|
|
3116
|
+
|
|
2512
3117
|
@classmethod
|
|
2513
3118
|
def from_dict(cls, d: Dict[str, any]) -> TrafficConfig:
|
|
2514
3119
|
"""Deserializes the TrafficConfig from a dictionary."""
|
|
@@ -2542,6 +3147,16 @@ class V1ResponseChoiceElement:
|
|
|
2542
3147
|
if self.text is not None: body['text'] = self.text
|
|
2543
3148
|
return body
|
|
2544
3149
|
|
|
3150
|
+
def as_shallow_dict(self) -> dict:
|
|
3151
|
+
"""Serializes the V1ResponseChoiceElement into a shallow dictionary of its immediate attributes."""
|
|
3152
|
+
body = {}
|
|
3153
|
+
if self.finish_reason is not None: body['finishReason'] = self.finish_reason
|
|
3154
|
+
if self.index is not None: body['index'] = self.index
|
|
3155
|
+
if self.logprobs is not None: body['logprobs'] = self.logprobs
|
|
3156
|
+
if self.message: body['message'] = self.message
|
|
3157
|
+
if self.text is not None: body['text'] = self.text
|
|
3158
|
+
return body
|
|
3159
|
+
|
|
2545
3160
|
@classmethod
|
|
2546
3161
|
def from_dict(cls, d: Dict[str, any]) -> V1ResponseChoiceElement:
|
|
2547
3162
|
"""Deserializes the V1ResponseChoiceElement from a dictionary."""
|