google-genai 1.7.0__py3-none-any.whl → 1.9.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.
- google/genai/_api_client.py +93 -78
- google/genai/_replay_api_client.py +22 -14
- google/genai/_transformers.py +81 -16
- google/genai/batches.py +61 -295
- google/genai/caches.py +546 -526
- google/genai/chats.py +15 -8
- google/genai/client.py +5 -3
- google/genai/errors.py +47 -24
- google/genai/files.py +89 -305
- google/genai/live.py +466 -12
- google/genai/models.py +1992 -2291
- google/genai/operations.py +104 -124
- google/genai/tunings.py +256 -272
- google/genai/types.py +394 -98
- google/genai/version.py +1 -1
- {google_genai-1.7.0.dist-info → google_genai-1.9.0.dist-info}/METADATA +3 -2
- google_genai-1.9.0.dist-info/RECORD +27 -0
- {google_genai-1.7.0.dist-info → google_genai-1.9.0.dist-info}/WHEEL +1 -1
- google_genai-1.7.0.dist-info/RECORD +0 -27
- {google_genai-1.7.0.dist-info → google_genai-1.9.0.dist-info/licenses}/LICENSE +0 -0
- {google_genai-1.7.0.dist-info → google_genai-1.9.0.dist-info}/top_level.txt +0 -0
google/genai/caches.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2025 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -74,50 +74,6 @@ def _Part_to_mldev(
|
|
74
74
|
return to_object
|
75
75
|
|
76
76
|
|
77
|
-
def _Part_to_vertex(
|
78
|
-
api_client: BaseApiClient,
|
79
|
-
from_object: Union[dict, object],
|
80
|
-
parent_object: Optional[dict] = None,
|
81
|
-
) -> dict:
|
82
|
-
to_object: dict[str, Any] = {}
|
83
|
-
if getv(from_object, ['video_metadata']) is not None:
|
84
|
-
setv(to_object, ['videoMetadata'], getv(from_object, ['video_metadata']))
|
85
|
-
|
86
|
-
if getv(from_object, ['thought']) is not None:
|
87
|
-
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
88
|
-
|
89
|
-
if getv(from_object, ['code_execution_result']) is not None:
|
90
|
-
setv(
|
91
|
-
to_object,
|
92
|
-
['codeExecutionResult'],
|
93
|
-
getv(from_object, ['code_execution_result']),
|
94
|
-
)
|
95
|
-
|
96
|
-
if getv(from_object, ['executable_code']) is not None:
|
97
|
-
setv(to_object, ['executableCode'], getv(from_object, ['executable_code']))
|
98
|
-
|
99
|
-
if getv(from_object, ['file_data']) is not None:
|
100
|
-
setv(to_object, ['fileData'], getv(from_object, ['file_data']))
|
101
|
-
|
102
|
-
if getv(from_object, ['function_call']) is not None:
|
103
|
-
setv(to_object, ['functionCall'], getv(from_object, ['function_call']))
|
104
|
-
|
105
|
-
if getv(from_object, ['function_response']) is not None:
|
106
|
-
setv(
|
107
|
-
to_object,
|
108
|
-
['functionResponse'],
|
109
|
-
getv(from_object, ['function_response']),
|
110
|
-
)
|
111
|
-
|
112
|
-
if getv(from_object, ['inline_data']) is not None:
|
113
|
-
setv(to_object, ['inlineData'], getv(from_object, ['inline_data']))
|
114
|
-
|
115
|
-
if getv(from_object, ['text']) is not None:
|
116
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
117
|
-
|
118
|
-
return to_object
|
119
|
-
|
120
|
-
|
121
77
|
def _Content_to_mldev(
|
122
78
|
api_client: BaseApiClient,
|
123
79
|
from_object: Union[dict, object],
|
@@ -140,28 +96,6 @@ def _Content_to_mldev(
|
|
140
96
|
return to_object
|
141
97
|
|
142
98
|
|
143
|
-
def _Content_to_vertex(
|
144
|
-
api_client: BaseApiClient,
|
145
|
-
from_object: Union[dict, object],
|
146
|
-
parent_object: Optional[dict] = None,
|
147
|
-
) -> dict:
|
148
|
-
to_object: dict[str, Any] = {}
|
149
|
-
if getv(from_object, ['parts']) is not None:
|
150
|
-
setv(
|
151
|
-
to_object,
|
152
|
-
['parts'],
|
153
|
-
[
|
154
|
-
_Part_to_vertex(api_client, item, to_object)
|
155
|
-
for item in getv(from_object, ['parts'])
|
156
|
-
],
|
157
|
-
)
|
158
|
-
|
159
|
-
if getv(from_object, ['role']) is not None:
|
160
|
-
setv(to_object, ['role'], getv(from_object, ['role']))
|
161
|
-
|
162
|
-
return to_object
|
163
|
-
|
164
|
-
|
165
99
|
def _Schema_to_mldev(
|
166
100
|
api_client: BaseApiClient,
|
167
101
|
from_object: Union[dict, object],
|
@@ -180,9 +114,6 @@ def _Schema_to_mldev(
|
|
180
114
|
if getv(from_object, ['max_length']) is not None:
|
181
115
|
raise ValueError('max_length parameter is not supported in Gemini API.')
|
182
116
|
|
183
|
-
if getv(from_object, ['title']) is not None:
|
184
|
-
raise ValueError('title parameter is not supported in Gemini API.')
|
185
|
-
|
186
117
|
if getv(from_object, ['min_length']) is not None:
|
187
118
|
raise ValueError('min_length parameter is not supported in Gemini API.')
|
188
119
|
|
@@ -235,85 +166,9 @@ def _Schema_to_mldev(
|
|
235
166
|
if getv(from_object, ['required']) is not None:
|
236
167
|
setv(to_object, ['required'], getv(from_object, ['required']))
|
237
168
|
|
238
|
-
if getv(from_object, ['type']) is not None:
|
239
|
-
setv(to_object, ['type'], getv(from_object, ['type']))
|
240
|
-
|
241
|
-
return to_object
|
242
|
-
|
243
|
-
|
244
|
-
def _Schema_to_vertex(
|
245
|
-
api_client: BaseApiClient,
|
246
|
-
from_object: Union[dict, object],
|
247
|
-
parent_object: Optional[dict] = None,
|
248
|
-
) -> dict:
|
249
|
-
to_object: dict[str, Any] = {}
|
250
|
-
if getv(from_object, ['example']) is not None:
|
251
|
-
setv(to_object, ['example'], getv(from_object, ['example']))
|
252
|
-
|
253
|
-
if getv(from_object, ['pattern']) is not None:
|
254
|
-
setv(to_object, ['pattern'], getv(from_object, ['pattern']))
|
255
|
-
|
256
|
-
if getv(from_object, ['default']) is not None:
|
257
|
-
setv(to_object, ['default'], getv(from_object, ['default']))
|
258
|
-
|
259
|
-
if getv(from_object, ['max_length']) is not None:
|
260
|
-
setv(to_object, ['maxLength'], getv(from_object, ['max_length']))
|
261
|
-
|
262
169
|
if getv(from_object, ['title']) is not None:
|
263
170
|
setv(to_object, ['title'], getv(from_object, ['title']))
|
264
171
|
|
265
|
-
if getv(from_object, ['min_length']) is not None:
|
266
|
-
setv(to_object, ['minLength'], getv(from_object, ['min_length']))
|
267
|
-
|
268
|
-
if getv(from_object, ['min_properties']) is not None:
|
269
|
-
setv(to_object, ['minProperties'], getv(from_object, ['min_properties']))
|
270
|
-
|
271
|
-
if getv(from_object, ['max_properties']) is not None:
|
272
|
-
setv(to_object, ['maxProperties'], getv(from_object, ['max_properties']))
|
273
|
-
|
274
|
-
if getv(from_object, ['any_of']) is not None:
|
275
|
-
setv(to_object, ['anyOf'], getv(from_object, ['any_of']))
|
276
|
-
|
277
|
-
if getv(from_object, ['description']) is not None:
|
278
|
-
setv(to_object, ['description'], getv(from_object, ['description']))
|
279
|
-
|
280
|
-
if getv(from_object, ['enum']) is not None:
|
281
|
-
setv(to_object, ['enum'], getv(from_object, ['enum']))
|
282
|
-
|
283
|
-
if getv(from_object, ['format']) is not None:
|
284
|
-
setv(to_object, ['format'], getv(from_object, ['format']))
|
285
|
-
|
286
|
-
if getv(from_object, ['items']) is not None:
|
287
|
-
setv(to_object, ['items'], getv(from_object, ['items']))
|
288
|
-
|
289
|
-
if getv(from_object, ['max_items']) is not None:
|
290
|
-
setv(to_object, ['maxItems'], getv(from_object, ['max_items']))
|
291
|
-
|
292
|
-
if getv(from_object, ['maximum']) is not None:
|
293
|
-
setv(to_object, ['maximum'], getv(from_object, ['maximum']))
|
294
|
-
|
295
|
-
if getv(from_object, ['min_items']) is not None:
|
296
|
-
setv(to_object, ['minItems'], getv(from_object, ['min_items']))
|
297
|
-
|
298
|
-
if getv(from_object, ['minimum']) is not None:
|
299
|
-
setv(to_object, ['minimum'], getv(from_object, ['minimum']))
|
300
|
-
|
301
|
-
if getv(from_object, ['nullable']) is not None:
|
302
|
-
setv(to_object, ['nullable'], getv(from_object, ['nullable']))
|
303
|
-
|
304
|
-
if getv(from_object, ['properties']) is not None:
|
305
|
-
setv(to_object, ['properties'], getv(from_object, ['properties']))
|
306
|
-
|
307
|
-
if getv(from_object, ['property_ordering']) is not None:
|
308
|
-
setv(
|
309
|
-
to_object,
|
310
|
-
['propertyOrdering'],
|
311
|
-
getv(from_object, ['property_ordering']),
|
312
|
-
)
|
313
|
-
|
314
|
-
if getv(from_object, ['required']) is not None:
|
315
|
-
setv(to_object, ['required'], getv(from_object, ['required']))
|
316
|
-
|
317
172
|
if getv(from_object, ['type']) is not None:
|
318
173
|
setv(to_object, ['type'], getv(from_object, ['type']))
|
319
174
|
|
@@ -341,33 +196,6 @@ def _FunctionDeclaration_to_mldev(
|
|
341
196
|
return to_object
|
342
197
|
|
343
198
|
|
344
|
-
def _FunctionDeclaration_to_vertex(
|
345
|
-
api_client: BaseApiClient,
|
346
|
-
from_object: Union[dict, object],
|
347
|
-
parent_object: Optional[dict] = None,
|
348
|
-
) -> dict:
|
349
|
-
to_object: dict[str, Any] = {}
|
350
|
-
if getv(from_object, ['response']) is not None:
|
351
|
-
setv(
|
352
|
-
to_object,
|
353
|
-
['response'],
|
354
|
-
_Schema_to_vertex(
|
355
|
-
api_client, getv(from_object, ['response']), to_object
|
356
|
-
),
|
357
|
-
)
|
358
|
-
|
359
|
-
if getv(from_object, ['description']) is not None:
|
360
|
-
setv(to_object, ['description'], getv(from_object, ['description']))
|
361
|
-
|
362
|
-
if getv(from_object, ['name']) is not None:
|
363
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
364
|
-
|
365
|
-
if getv(from_object, ['parameters']) is not None:
|
366
|
-
setv(to_object, ['parameters'], getv(from_object, ['parameters']))
|
367
|
-
|
368
|
-
return to_object
|
369
|
-
|
370
|
-
|
371
199
|
def _GoogleSearch_to_mldev(
|
372
200
|
api_client: BaseApiClient,
|
373
201
|
from_object: Union[dict, object],
|
@@ -378,16 +206,6 @@ def _GoogleSearch_to_mldev(
|
|
378
206
|
return to_object
|
379
207
|
|
380
208
|
|
381
|
-
def _GoogleSearch_to_vertex(
|
382
|
-
api_client: BaseApiClient,
|
383
|
-
from_object: Union[dict, object],
|
384
|
-
parent_object: Optional[dict] = None,
|
385
|
-
) -> dict:
|
386
|
-
to_object: dict[str, Any] = {}
|
387
|
-
|
388
|
-
return to_object
|
389
|
-
|
390
|
-
|
391
209
|
def _DynamicRetrievalConfig_to_mldev(
|
392
210
|
api_client: BaseApiClient,
|
393
211
|
from_object: Union[dict, object],
|
@@ -407,25 +225,6 @@ def _DynamicRetrievalConfig_to_mldev(
|
|
407
225
|
return to_object
|
408
226
|
|
409
227
|
|
410
|
-
def _DynamicRetrievalConfig_to_vertex(
|
411
|
-
api_client: BaseApiClient,
|
412
|
-
from_object: Union[dict, object],
|
413
|
-
parent_object: Optional[dict] = None,
|
414
|
-
) -> dict:
|
415
|
-
to_object: dict[str, Any] = {}
|
416
|
-
if getv(from_object, ['mode']) is not None:
|
417
|
-
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
418
|
-
|
419
|
-
if getv(from_object, ['dynamic_threshold']) is not None:
|
420
|
-
setv(
|
421
|
-
to_object,
|
422
|
-
['dynamicThreshold'],
|
423
|
-
getv(from_object, ['dynamic_threshold']),
|
424
|
-
)
|
425
|
-
|
426
|
-
return to_object
|
427
|
-
|
428
|
-
|
429
228
|
def _GoogleSearchRetrieval_to_mldev(
|
430
229
|
api_client: BaseApiClient,
|
431
230
|
from_object: Union[dict, object],
|
@@ -446,26 +245,6 @@ def _GoogleSearchRetrieval_to_mldev(
|
|
446
245
|
return to_object
|
447
246
|
|
448
247
|
|
449
|
-
def _GoogleSearchRetrieval_to_vertex(
|
450
|
-
api_client: BaseApiClient,
|
451
|
-
from_object: Union[dict, object],
|
452
|
-
parent_object: Optional[dict] = None,
|
453
|
-
) -> dict:
|
454
|
-
to_object: dict[str, Any] = {}
|
455
|
-
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
456
|
-
setv(
|
457
|
-
to_object,
|
458
|
-
['dynamicRetrievalConfig'],
|
459
|
-
_DynamicRetrievalConfig_to_vertex(
|
460
|
-
api_client,
|
461
|
-
getv(from_object, ['dynamic_retrieval_config']),
|
462
|
-
to_object,
|
463
|
-
),
|
464
|
-
)
|
465
|
-
|
466
|
-
return to_object
|
467
|
-
|
468
|
-
|
469
248
|
def _Tool_to_mldev(
|
470
249
|
api_client: BaseApiClient,
|
471
250
|
from_object: Union[dict, object],
|
@@ -511,184 +290,549 @@ def _Tool_to_mldev(
|
|
511
290
|
return to_object
|
512
291
|
|
513
292
|
|
514
|
-
def
|
293
|
+
def _FunctionCallingConfig_to_mldev(
|
515
294
|
api_client: BaseApiClient,
|
516
295
|
from_object: Union[dict, object],
|
517
296
|
parent_object: Optional[dict] = None,
|
518
297
|
) -> dict:
|
519
298
|
to_object: dict[str, Any] = {}
|
520
|
-
if getv(from_object, ['
|
299
|
+
if getv(from_object, ['mode']) is not None:
|
300
|
+
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
301
|
+
|
302
|
+
if getv(from_object, ['allowed_function_names']) is not None:
|
521
303
|
setv(
|
522
304
|
to_object,
|
523
|
-
['
|
524
|
-
[
|
525
|
-
_FunctionDeclaration_to_vertex(api_client, item, to_object)
|
526
|
-
for item in getv(from_object, ['function_declarations'])
|
527
|
-
],
|
305
|
+
['allowedFunctionNames'],
|
306
|
+
getv(from_object, ['allowed_function_names']),
|
528
307
|
)
|
529
308
|
|
530
|
-
|
531
|
-
setv(to_object, ['retrieval'], getv(from_object, ['retrieval']))
|
309
|
+
return to_object
|
532
310
|
|
533
|
-
|
311
|
+
|
312
|
+
def _ToolConfig_to_mldev(
|
313
|
+
api_client: BaseApiClient,
|
314
|
+
from_object: Union[dict, object],
|
315
|
+
parent_object: Optional[dict] = None,
|
316
|
+
) -> dict:
|
317
|
+
to_object: dict[str, Any] = {}
|
318
|
+
if getv(from_object, ['function_calling_config']) is not None:
|
534
319
|
setv(
|
535
320
|
to_object,
|
536
|
-
['
|
537
|
-
|
538
|
-
api_client,
|
321
|
+
['functionCallingConfig'],
|
322
|
+
_FunctionCallingConfig_to_mldev(
|
323
|
+
api_client,
|
324
|
+
getv(from_object, ['function_calling_config']),
|
325
|
+
to_object,
|
539
326
|
),
|
540
327
|
)
|
541
328
|
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
329
|
+
return to_object
|
330
|
+
|
331
|
+
|
332
|
+
def _CreateCachedContentConfig_to_mldev(
|
333
|
+
api_client: BaseApiClient,
|
334
|
+
from_object: Union[dict, object],
|
335
|
+
parent_object: Optional[dict] = None,
|
336
|
+
) -> dict:
|
337
|
+
to_object: dict[str, Any] = {}
|
338
|
+
|
339
|
+
if getv(from_object, ['ttl']) is not None:
|
340
|
+
setv(parent_object, ['ttl'], getv(from_object, ['ttl']))
|
341
|
+
|
342
|
+
if getv(from_object, ['expire_time']) is not None:
|
343
|
+
setv(parent_object, ['expireTime'], getv(from_object, ['expire_time']))
|
344
|
+
|
345
|
+
if getv(from_object, ['display_name']) is not None:
|
346
|
+
setv(parent_object, ['displayName'], getv(from_object, ['display_name']))
|
347
|
+
|
348
|
+
if getv(from_object, ['contents']) is not None:
|
349
|
+
setv(
|
350
|
+
parent_object,
|
351
|
+
['contents'],
|
352
|
+
[
|
353
|
+
_Content_to_mldev(api_client, item, to_object)
|
354
|
+
for item in t.t_contents(
|
355
|
+
api_client, getv(from_object, ['contents'])
|
356
|
+
)
|
357
|
+
],
|
358
|
+
)
|
359
|
+
|
360
|
+
if getv(from_object, ['system_instruction']) is not None:
|
361
|
+
setv(
|
362
|
+
parent_object,
|
363
|
+
['systemInstruction'],
|
364
|
+
_Content_to_mldev(
|
547
365
|
api_client,
|
548
|
-
getv(from_object, ['
|
366
|
+
t.t_content(api_client, getv(from_object, ['system_instruction'])),
|
549
367
|
to_object,
|
550
368
|
),
|
551
369
|
)
|
552
370
|
|
553
|
-
if getv(from_object, ['
|
554
|
-
setv(
|
371
|
+
if getv(from_object, ['tools']) is not None:
|
372
|
+
setv(
|
373
|
+
parent_object,
|
374
|
+
['tools'],
|
375
|
+
[
|
376
|
+
_Tool_to_mldev(api_client, item, to_object)
|
377
|
+
for item in getv(from_object, ['tools'])
|
378
|
+
],
|
379
|
+
)
|
380
|
+
|
381
|
+
if getv(from_object, ['tool_config']) is not None:
|
382
|
+
setv(
|
383
|
+
parent_object,
|
384
|
+
['toolConfig'],
|
385
|
+
_ToolConfig_to_mldev(
|
386
|
+
api_client, getv(from_object, ['tool_config']), to_object
|
387
|
+
),
|
388
|
+
)
|
555
389
|
|
556
390
|
return to_object
|
557
391
|
|
558
392
|
|
559
|
-
def
|
393
|
+
def _CreateCachedContentParameters_to_mldev(
|
560
394
|
api_client: BaseApiClient,
|
561
395
|
from_object: Union[dict, object],
|
562
396
|
parent_object: Optional[dict] = None,
|
563
397
|
) -> dict:
|
564
398
|
to_object: dict[str, Any] = {}
|
565
|
-
if getv(from_object, ['
|
566
|
-
setv(
|
399
|
+
if getv(from_object, ['model']) is not None:
|
400
|
+
setv(
|
401
|
+
to_object,
|
402
|
+
['model'],
|
403
|
+
t.t_caches_model(api_client, getv(from_object, ['model'])),
|
404
|
+
)
|
567
405
|
|
568
|
-
if getv(from_object, ['
|
406
|
+
if getv(from_object, ['config']) is not None:
|
569
407
|
setv(
|
570
408
|
to_object,
|
571
|
-
['
|
572
|
-
|
409
|
+
['config'],
|
410
|
+
_CreateCachedContentConfig_to_mldev(
|
411
|
+
api_client, getv(from_object, ['config']), to_object
|
412
|
+
),
|
573
413
|
)
|
574
414
|
|
575
415
|
return to_object
|
576
416
|
|
577
417
|
|
578
|
-
def
|
418
|
+
def _GetCachedContentParameters_to_mldev(
|
579
419
|
api_client: BaseApiClient,
|
580
420
|
from_object: Union[dict, object],
|
581
421
|
parent_object: Optional[dict] = None,
|
582
422
|
) -> dict:
|
583
423
|
to_object: dict[str, Any] = {}
|
584
|
-
if getv(from_object, ['
|
585
|
-
setv(
|
424
|
+
if getv(from_object, ['name']) is not None:
|
425
|
+
setv(
|
426
|
+
to_object,
|
427
|
+
['_url', 'name'],
|
428
|
+
t.t_cached_content_name(api_client, getv(from_object, ['name'])),
|
429
|
+
)
|
586
430
|
|
587
|
-
if getv(from_object, ['
|
431
|
+
if getv(from_object, ['config']) is not None:
|
432
|
+
setv(to_object, ['config'], getv(from_object, ['config']))
|
433
|
+
|
434
|
+
return to_object
|
435
|
+
|
436
|
+
|
437
|
+
def _DeleteCachedContentParameters_to_mldev(
|
438
|
+
api_client: BaseApiClient,
|
439
|
+
from_object: Union[dict, object],
|
440
|
+
parent_object: Optional[dict] = None,
|
441
|
+
) -> dict:
|
442
|
+
to_object: dict[str, Any] = {}
|
443
|
+
if getv(from_object, ['name']) is not None:
|
588
444
|
setv(
|
589
445
|
to_object,
|
590
|
-
['
|
591
|
-
getv(from_object, ['
|
446
|
+
['_url', 'name'],
|
447
|
+
t.t_cached_content_name(api_client, getv(from_object, ['name'])),
|
592
448
|
)
|
593
449
|
|
450
|
+
if getv(from_object, ['config']) is not None:
|
451
|
+
setv(to_object, ['config'], getv(from_object, ['config']))
|
452
|
+
|
594
453
|
return to_object
|
595
454
|
|
596
455
|
|
597
|
-
def
|
456
|
+
def _UpdateCachedContentConfig_to_mldev(
|
598
457
|
api_client: BaseApiClient,
|
599
458
|
from_object: Union[dict, object],
|
600
459
|
parent_object: Optional[dict] = None,
|
601
460
|
) -> dict:
|
602
461
|
to_object: dict[str, Any] = {}
|
603
|
-
|
462
|
+
|
463
|
+
if getv(from_object, ['ttl']) is not None:
|
464
|
+
setv(parent_object, ['ttl'], getv(from_object, ['ttl']))
|
465
|
+
|
466
|
+
if getv(from_object, ['expire_time']) is not None:
|
467
|
+
setv(parent_object, ['expireTime'], getv(from_object, ['expire_time']))
|
468
|
+
|
469
|
+
return to_object
|
470
|
+
|
471
|
+
|
472
|
+
def _UpdateCachedContentParameters_to_mldev(
|
473
|
+
api_client: BaseApiClient,
|
474
|
+
from_object: Union[dict, object],
|
475
|
+
parent_object: Optional[dict] = None,
|
476
|
+
) -> dict:
|
477
|
+
to_object: dict[str, Any] = {}
|
478
|
+
if getv(from_object, ['name']) is not None:
|
604
479
|
setv(
|
605
480
|
to_object,
|
606
|
-
['
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
481
|
+
['_url', 'name'],
|
482
|
+
t.t_cached_content_name(api_client, getv(from_object, ['name'])),
|
483
|
+
)
|
484
|
+
|
485
|
+
if getv(from_object, ['config']) is not None:
|
486
|
+
setv(
|
487
|
+
to_object,
|
488
|
+
['config'],
|
489
|
+
_UpdateCachedContentConfig_to_mldev(
|
490
|
+
api_client, getv(from_object, ['config']), to_object
|
611
491
|
),
|
612
492
|
)
|
613
493
|
|
614
494
|
return to_object
|
615
495
|
|
616
496
|
|
617
|
-
def
|
497
|
+
def _ListCachedContentsConfig_to_mldev(
|
618
498
|
api_client: BaseApiClient,
|
619
499
|
from_object: Union[dict, object],
|
620
500
|
parent_object: Optional[dict] = None,
|
621
501
|
) -> dict:
|
622
502
|
to_object: dict[str, Any] = {}
|
623
|
-
|
503
|
+
|
504
|
+
if getv(from_object, ['page_size']) is not None:
|
505
|
+
setv(
|
506
|
+
parent_object, ['_query', 'pageSize'], getv(from_object, ['page_size'])
|
507
|
+
)
|
508
|
+
|
509
|
+
if getv(from_object, ['page_token']) is not None:
|
510
|
+
setv(
|
511
|
+
parent_object,
|
512
|
+
['_query', 'pageToken'],
|
513
|
+
getv(from_object, ['page_token']),
|
514
|
+
)
|
515
|
+
|
516
|
+
return to_object
|
517
|
+
|
518
|
+
|
519
|
+
def _ListCachedContentsParameters_to_mldev(
|
520
|
+
api_client: BaseApiClient,
|
521
|
+
from_object: Union[dict, object],
|
522
|
+
parent_object: Optional[dict] = None,
|
523
|
+
) -> dict:
|
524
|
+
to_object: dict[str, Any] = {}
|
525
|
+
if getv(from_object, ['config']) is not None:
|
624
526
|
setv(
|
625
527
|
to_object,
|
626
|
-
['
|
627
|
-
|
628
|
-
api_client,
|
629
|
-
getv(from_object, ['function_calling_config']),
|
630
|
-
to_object,
|
528
|
+
['config'],
|
529
|
+
_ListCachedContentsConfig_to_mldev(
|
530
|
+
api_client, getv(from_object, ['config']), to_object
|
631
531
|
),
|
632
532
|
)
|
633
533
|
|
634
534
|
return to_object
|
635
535
|
|
636
536
|
|
637
|
-
def
|
537
|
+
def _Part_to_vertex(
|
638
538
|
api_client: BaseApiClient,
|
639
539
|
from_object: Union[dict, object],
|
640
540
|
parent_object: Optional[dict] = None,
|
641
541
|
) -> dict:
|
642
542
|
to_object: dict[str, Any] = {}
|
543
|
+
if getv(from_object, ['video_metadata']) is not None:
|
544
|
+
setv(to_object, ['videoMetadata'], getv(from_object, ['video_metadata']))
|
643
545
|
|
644
|
-
if getv(from_object, ['
|
645
|
-
setv(
|
546
|
+
if getv(from_object, ['thought']) is not None:
|
547
|
+
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
646
548
|
|
647
|
-
if getv(from_object, ['
|
648
|
-
setv(
|
549
|
+
if getv(from_object, ['code_execution_result']) is not None:
|
550
|
+
setv(
|
551
|
+
to_object,
|
552
|
+
['codeExecutionResult'],
|
553
|
+
getv(from_object, ['code_execution_result']),
|
554
|
+
)
|
649
555
|
|
650
|
-
if getv(from_object, ['
|
651
|
-
setv(
|
556
|
+
if getv(from_object, ['executable_code']) is not None:
|
557
|
+
setv(to_object, ['executableCode'], getv(from_object, ['executable_code']))
|
652
558
|
|
653
|
-
if getv(from_object, ['
|
559
|
+
if getv(from_object, ['file_data']) is not None:
|
560
|
+
setv(to_object, ['fileData'], getv(from_object, ['file_data']))
|
561
|
+
|
562
|
+
if getv(from_object, ['function_call']) is not None:
|
563
|
+
setv(to_object, ['functionCall'], getv(from_object, ['function_call']))
|
564
|
+
|
565
|
+
if getv(from_object, ['function_response']) is not None:
|
654
566
|
setv(
|
655
|
-
|
656
|
-
['
|
567
|
+
to_object,
|
568
|
+
['functionResponse'],
|
569
|
+
getv(from_object, ['function_response']),
|
570
|
+
)
|
571
|
+
|
572
|
+
if getv(from_object, ['inline_data']) is not None:
|
573
|
+
setv(to_object, ['inlineData'], getv(from_object, ['inline_data']))
|
574
|
+
|
575
|
+
if getv(from_object, ['text']) is not None:
|
576
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
577
|
+
|
578
|
+
return to_object
|
579
|
+
|
580
|
+
|
581
|
+
def _Content_to_vertex(
|
582
|
+
api_client: BaseApiClient,
|
583
|
+
from_object: Union[dict, object],
|
584
|
+
parent_object: Optional[dict] = None,
|
585
|
+
) -> dict:
|
586
|
+
to_object: dict[str, Any] = {}
|
587
|
+
if getv(from_object, ['parts']) is not None:
|
588
|
+
setv(
|
589
|
+
to_object,
|
590
|
+
['parts'],
|
657
591
|
[
|
658
|
-
|
659
|
-
for item in
|
660
|
-
api_client, getv(from_object, ['contents'])
|
661
|
-
)
|
592
|
+
_Part_to_vertex(api_client, item, to_object)
|
593
|
+
for item in getv(from_object, ['parts'])
|
662
594
|
],
|
663
595
|
)
|
664
596
|
|
665
|
-
if getv(from_object, ['
|
597
|
+
if getv(from_object, ['role']) is not None:
|
598
|
+
setv(to_object, ['role'], getv(from_object, ['role']))
|
599
|
+
|
600
|
+
return to_object
|
601
|
+
|
602
|
+
|
603
|
+
def _Schema_to_vertex(
|
604
|
+
api_client: BaseApiClient,
|
605
|
+
from_object: Union[dict, object],
|
606
|
+
parent_object: Optional[dict] = None,
|
607
|
+
) -> dict:
|
608
|
+
to_object: dict[str, Any] = {}
|
609
|
+
if getv(from_object, ['example']) is not None:
|
610
|
+
setv(to_object, ['example'], getv(from_object, ['example']))
|
611
|
+
|
612
|
+
if getv(from_object, ['pattern']) is not None:
|
613
|
+
setv(to_object, ['pattern'], getv(from_object, ['pattern']))
|
614
|
+
|
615
|
+
if getv(from_object, ['default']) is not None:
|
616
|
+
setv(to_object, ['default'], getv(from_object, ['default']))
|
617
|
+
|
618
|
+
if getv(from_object, ['max_length']) is not None:
|
619
|
+
setv(to_object, ['maxLength'], getv(from_object, ['max_length']))
|
620
|
+
|
621
|
+
if getv(from_object, ['min_length']) is not None:
|
622
|
+
setv(to_object, ['minLength'], getv(from_object, ['min_length']))
|
623
|
+
|
624
|
+
if getv(from_object, ['min_properties']) is not None:
|
625
|
+
setv(to_object, ['minProperties'], getv(from_object, ['min_properties']))
|
626
|
+
|
627
|
+
if getv(from_object, ['max_properties']) is not None:
|
628
|
+
setv(to_object, ['maxProperties'], getv(from_object, ['max_properties']))
|
629
|
+
|
630
|
+
if getv(from_object, ['any_of']) is not None:
|
631
|
+
setv(to_object, ['anyOf'], getv(from_object, ['any_of']))
|
632
|
+
|
633
|
+
if getv(from_object, ['description']) is not None:
|
634
|
+
setv(to_object, ['description'], getv(from_object, ['description']))
|
635
|
+
|
636
|
+
if getv(from_object, ['enum']) is not None:
|
637
|
+
setv(to_object, ['enum'], getv(from_object, ['enum']))
|
638
|
+
|
639
|
+
if getv(from_object, ['format']) is not None:
|
640
|
+
setv(to_object, ['format'], getv(from_object, ['format']))
|
641
|
+
|
642
|
+
if getv(from_object, ['items']) is not None:
|
643
|
+
setv(to_object, ['items'], getv(from_object, ['items']))
|
644
|
+
|
645
|
+
if getv(from_object, ['max_items']) is not None:
|
646
|
+
setv(to_object, ['maxItems'], getv(from_object, ['max_items']))
|
647
|
+
|
648
|
+
if getv(from_object, ['maximum']) is not None:
|
649
|
+
setv(to_object, ['maximum'], getv(from_object, ['maximum']))
|
650
|
+
|
651
|
+
if getv(from_object, ['min_items']) is not None:
|
652
|
+
setv(to_object, ['minItems'], getv(from_object, ['min_items']))
|
653
|
+
|
654
|
+
if getv(from_object, ['minimum']) is not None:
|
655
|
+
setv(to_object, ['minimum'], getv(from_object, ['minimum']))
|
656
|
+
|
657
|
+
if getv(from_object, ['nullable']) is not None:
|
658
|
+
setv(to_object, ['nullable'], getv(from_object, ['nullable']))
|
659
|
+
|
660
|
+
if getv(from_object, ['properties']) is not None:
|
661
|
+
setv(to_object, ['properties'], getv(from_object, ['properties']))
|
662
|
+
|
663
|
+
if getv(from_object, ['property_ordering']) is not None:
|
666
664
|
setv(
|
667
|
-
|
668
|
-
['
|
669
|
-
|
665
|
+
to_object,
|
666
|
+
['propertyOrdering'],
|
667
|
+
getv(from_object, ['property_ordering']),
|
668
|
+
)
|
669
|
+
|
670
|
+
if getv(from_object, ['required']) is not None:
|
671
|
+
setv(to_object, ['required'], getv(from_object, ['required']))
|
672
|
+
|
673
|
+
if getv(from_object, ['title']) is not None:
|
674
|
+
setv(to_object, ['title'], getv(from_object, ['title']))
|
675
|
+
|
676
|
+
if getv(from_object, ['type']) is not None:
|
677
|
+
setv(to_object, ['type'], getv(from_object, ['type']))
|
678
|
+
|
679
|
+
return to_object
|
680
|
+
|
681
|
+
|
682
|
+
def _FunctionDeclaration_to_vertex(
|
683
|
+
api_client: BaseApiClient,
|
684
|
+
from_object: Union[dict, object],
|
685
|
+
parent_object: Optional[dict] = None,
|
686
|
+
) -> dict:
|
687
|
+
to_object: dict[str, Any] = {}
|
688
|
+
if getv(from_object, ['response']) is not None:
|
689
|
+
setv(
|
690
|
+
to_object,
|
691
|
+
['response'],
|
692
|
+
_Schema_to_vertex(
|
693
|
+
api_client, getv(from_object, ['response']), to_object
|
694
|
+
),
|
695
|
+
)
|
696
|
+
|
697
|
+
if getv(from_object, ['description']) is not None:
|
698
|
+
setv(to_object, ['description'], getv(from_object, ['description']))
|
699
|
+
|
700
|
+
if getv(from_object, ['name']) is not None:
|
701
|
+
setv(to_object, ['name'], getv(from_object, ['name']))
|
702
|
+
|
703
|
+
if getv(from_object, ['parameters']) is not None:
|
704
|
+
setv(to_object, ['parameters'], getv(from_object, ['parameters']))
|
705
|
+
|
706
|
+
return to_object
|
707
|
+
|
708
|
+
|
709
|
+
def _GoogleSearch_to_vertex(
|
710
|
+
api_client: BaseApiClient,
|
711
|
+
from_object: Union[dict, object],
|
712
|
+
parent_object: Optional[dict] = None,
|
713
|
+
) -> dict:
|
714
|
+
to_object: dict[str, Any] = {}
|
715
|
+
|
716
|
+
return to_object
|
717
|
+
|
718
|
+
|
719
|
+
def _DynamicRetrievalConfig_to_vertex(
|
720
|
+
api_client: BaseApiClient,
|
721
|
+
from_object: Union[dict, object],
|
722
|
+
parent_object: Optional[dict] = None,
|
723
|
+
) -> dict:
|
724
|
+
to_object: dict[str, Any] = {}
|
725
|
+
if getv(from_object, ['mode']) is not None:
|
726
|
+
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
727
|
+
|
728
|
+
if getv(from_object, ['dynamic_threshold']) is not None:
|
729
|
+
setv(
|
730
|
+
to_object,
|
731
|
+
['dynamicThreshold'],
|
732
|
+
getv(from_object, ['dynamic_threshold']),
|
733
|
+
)
|
734
|
+
|
735
|
+
return to_object
|
736
|
+
|
737
|
+
|
738
|
+
def _GoogleSearchRetrieval_to_vertex(
|
739
|
+
api_client: BaseApiClient,
|
740
|
+
from_object: Union[dict, object],
|
741
|
+
parent_object: Optional[dict] = None,
|
742
|
+
) -> dict:
|
743
|
+
to_object: dict[str, Any] = {}
|
744
|
+
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
745
|
+
setv(
|
746
|
+
to_object,
|
747
|
+
['dynamicRetrievalConfig'],
|
748
|
+
_DynamicRetrievalConfig_to_vertex(
|
670
749
|
api_client,
|
671
|
-
|
750
|
+
getv(from_object, ['dynamic_retrieval_config']),
|
672
751
|
to_object,
|
673
752
|
),
|
674
753
|
)
|
675
754
|
|
676
|
-
|
755
|
+
return to_object
|
756
|
+
|
757
|
+
|
758
|
+
def _Tool_to_vertex(
|
759
|
+
api_client: BaseApiClient,
|
760
|
+
from_object: Union[dict, object],
|
761
|
+
parent_object: Optional[dict] = None,
|
762
|
+
) -> dict:
|
763
|
+
to_object: dict[str, Any] = {}
|
764
|
+
if getv(from_object, ['function_declarations']) is not None:
|
765
|
+
setv(
|
766
|
+
to_object,
|
767
|
+
['functionDeclarations'],
|
768
|
+
[
|
769
|
+
_FunctionDeclaration_to_vertex(api_client, item, to_object)
|
770
|
+
for item in getv(from_object, ['function_declarations'])
|
771
|
+
],
|
772
|
+
)
|
773
|
+
|
774
|
+
if getv(from_object, ['retrieval']) is not None:
|
775
|
+
setv(to_object, ['retrieval'], getv(from_object, ['retrieval']))
|
776
|
+
|
777
|
+
if getv(from_object, ['google_search']) is not None:
|
778
|
+
setv(
|
779
|
+
to_object,
|
780
|
+
['googleSearch'],
|
781
|
+
_GoogleSearch_to_vertex(
|
782
|
+
api_client, getv(from_object, ['google_search']), to_object
|
783
|
+
),
|
784
|
+
)
|
785
|
+
|
786
|
+
if getv(from_object, ['google_search_retrieval']) is not None:
|
787
|
+
setv(
|
788
|
+
to_object,
|
789
|
+
['googleSearchRetrieval'],
|
790
|
+
_GoogleSearchRetrieval_to_vertex(
|
791
|
+
api_client,
|
792
|
+
getv(from_object, ['google_search_retrieval']),
|
793
|
+
to_object,
|
794
|
+
),
|
795
|
+
)
|
796
|
+
|
797
|
+
if getv(from_object, ['code_execution']) is not None:
|
798
|
+
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
799
|
+
|
800
|
+
return to_object
|
801
|
+
|
802
|
+
|
803
|
+
def _FunctionCallingConfig_to_vertex(
|
804
|
+
api_client: BaseApiClient,
|
805
|
+
from_object: Union[dict, object],
|
806
|
+
parent_object: Optional[dict] = None,
|
807
|
+
) -> dict:
|
808
|
+
to_object: dict[str, Any] = {}
|
809
|
+
if getv(from_object, ['mode']) is not None:
|
810
|
+
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
811
|
+
|
812
|
+
if getv(from_object, ['allowed_function_names']) is not None:
|
677
813
|
setv(
|
678
|
-
|
679
|
-
['
|
680
|
-
[
|
681
|
-
_Tool_to_mldev(api_client, item, to_object)
|
682
|
-
for item in getv(from_object, ['tools'])
|
683
|
-
],
|
814
|
+
to_object,
|
815
|
+
['allowedFunctionNames'],
|
816
|
+
getv(from_object, ['allowed_function_names']),
|
684
817
|
)
|
685
818
|
|
686
|
-
|
819
|
+
return to_object
|
820
|
+
|
821
|
+
|
822
|
+
def _ToolConfig_to_vertex(
|
823
|
+
api_client: BaseApiClient,
|
824
|
+
from_object: Union[dict, object],
|
825
|
+
parent_object: Optional[dict] = None,
|
826
|
+
) -> dict:
|
827
|
+
to_object: dict[str, Any] = {}
|
828
|
+
if getv(from_object, ['function_calling_config']) is not None:
|
687
829
|
setv(
|
688
|
-
|
689
|
-
['
|
690
|
-
|
691
|
-
api_client,
|
830
|
+
to_object,
|
831
|
+
['functionCallingConfig'],
|
832
|
+
_FunctionCallingConfig_to_vertex(
|
833
|
+
api_client,
|
834
|
+
getv(from_object, ['function_calling_config']),
|
835
|
+
to_object,
|
692
836
|
),
|
693
837
|
)
|
694
838
|
|
@@ -756,31 +900,6 @@ def _CreateCachedContentConfig_to_vertex(
|
|
756
900
|
return to_object
|
757
901
|
|
758
902
|
|
759
|
-
def _CreateCachedContentParameters_to_mldev(
|
760
|
-
api_client: BaseApiClient,
|
761
|
-
from_object: Union[dict, object],
|
762
|
-
parent_object: Optional[dict] = None,
|
763
|
-
) -> dict:
|
764
|
-
to_object: dict[str, Any] = {}
|
765
|
-
if getv(from_object, ['model']) is not None:
|
766
|
-
setv(
|
767
|
-
to_object,
|
768
|
-
['model'],
|
769
|
-
t.t_caches_model(api_client, getv(from_object, ['model'])),
|
770
|
-
)
|
771
|
-
|
772
|
-
if getv(from_object, ['config']) is not None:
|
773
|
-
setv(
|
774
|
-
to_object,
|
775
|
-
['config'],
|
776
|
-
_CreateCachedContentConfig_to_mldev(
|
777
|
-
api_client, getv(from_object, ['config']), to_object
|
778
|
-
),
|
779
|
-
)
|
780
|
-
|
781
|
-
return to_object
|
782
|
-
|
783
|
-
|
784
903
|
def _CreateCachedContentParameters_to_vertex(
|
785
904
|
api_client: BaseApiClient,
|
786
905
|
from_object: Union[dict, object],
|
@@ -806,25 +925,6 @@ def _CreateCachedContentParameters_to_vertex(
|
|
806
925
|
return to_object
|
807
926
|
|
808
927
|
|
809
|
-
def _GetCachedContentParameters_to_mldev(
|
810
|
-
api_client: BaseApiClient,
|
811
|
-
from_object: Union[dict, object],
|
812
|
-
parent_object: Optional[dict] = None,
|
813
|
-
) -> dict:
|
814
|
-
to_object: dict[str, Any] = {}
|
815
|
-
if getv(from_object, ['name']) is not None:
|
816
|
-
setv(
|
817
|
-
to_object,
|
818
|
-
['_url', 'name'],
|
819
|
-
t.t_cached_content_name(api_client, getv(from_object, ['name'])),
|
820
|
-
)
|
821
|
-
|
822
|
-
if getv(from_object, ['config']) is not None:
|
823
|
-
setv(to_object, ['config'], getv(from_object, ['config']))
|
824
|
-
|
825
|
-
return to_object
|
826
|
-
|
827
|
-
|
828
928
|
def _GetCachedContentParameters_to_vertex(
|
829
929
|
api_client: BaseApiClient,
|
830
930
|
from_object: Union[dict, object],
|
@@ -844,25 +944,6 @@ def _GetCachedContentParameters_to_vertex(
|
|
844
944
|
return to_object
|
845
945
|
|
846
946
|
|
847
|
-
def _DeleteCachedContentParameters_to_mldev(
|
848
|
-
api_client: BaseApiClient,
|
849
|
-
from_object: Union[dict, object],
|
850
|
-
parent_object: Optional[dict] = None,
|
851
|
-
) -> dict:
|
852
|
-
to_object: dict[str, Any] = {}
|
853
|
-
if getv(from_object, ['name']) is not None:
|
854
|
-
setv(
|
855
|
-
to_object,
|
856
|
-
['_url', 'name'],
|
857
|
-
t.t_cached_content_name(api_client, getv(from_object, ['name'])),
|
858
|
-
)
|
859
|
-
|
860
|
-
if getv(from_object, ['config']) is not None:
|
861
|
-
setv(to_object, ['config'], getv(from_object, ['config']))
|
862
|
-
|
863
|
-
return to_object
|
864
|
-
|
865
|
-
|
866
947
|
def _DeleteCachedContentParameters_to_vertex(
|
867
948
|
api_client: BaseApiClient,
|
868
949
|
from_object: Union[dict, object],
|
@@ -882,22 +963,6 @@ def _DeleteCachedContentParameters_to_vertex(
|
|
882
963
|
return to_object
|
883
964
|
|
884
965
|
|
885
|
-
def _UpdateCachedContentConfig_to_mldev(
|
886
|
-
api_client: BaseApiClient,
|
887
|
-
from_object: Union[dict, object],
|
888
|
-
parent_object: Optional[dict] = None,
|
889
|
-
) -> dict:
|
890
|
-
to_object: dict[str, Any] = {}
|
891
|
-
|
892
|
-
if getv(from_object, ['ttl']) is not None:
|
893
|
-
setv(parent_object, ['ttl'], getv(from_object, ['ttl']))
|
894
|
-
|
895
|
-
if getv(from_object, ['expire_time']) is not None:
|
896
|
-
setv(parent_object, ['expireTime'], getv(from_object, ['expire_time']))
|
897
|
-
|
898
|
-
return to_object
|
899
|
-
|
900
|
-
|
901
966
|
def _UpdateCachedContentConfig_to_vertex(
|
902
967
|
api_client: BaseApiClient,
|
903
968
|
from_object: Union[dict, object],
|
@@ -914,31 +979,6 @@ def _UpdateCachedContentConfig_to_vertex(
|
|
914
979
|
return to_object
|
915
980
|
|
916
981
|
|
917
|
-
def _UpdateCachedContentParameters_to_mldev(
|
918
|
-
api_client: BaseApiClient,
|
919
|
-
from_object: Union[dict, object],
|
920
|
-
parent_object: Optional[dict] = None,
|
921
|
-
) -> dict:
|
922
|
-
to_object: dict[str, Any] = {}
|
923
|
-
if getv(from_object, ['name']) is not None:
|
924
|
-
setv(
|
925
|
-
to_object,
|
926
|
-
['_url', 'name'],
|
927
|
-
t.t_cached_content_name(api_client, getv(from_object, ['name'])),
|
928
|
-
)
|
929
|
-
|
930
|
-
if getv(from_object, ['config']) is not None:
|
931
|
-
setv(
|
932
|
-
to_object,
|
933
|
-
['config'],
|
934
|
-
_UpdateCachedContentConfig_to_mldev(
|
935
|
-
api_client, getv(from_object, ['config']), to_object
|
936
|
-
),
|
937
|
-
)
|
938
|
-
|
939
|
-
return to_object
|
940
|
-
|
941
|
-
|
942
982
|
def _UpdateCachedContentParameters_to_vertex(
|
943
983
|
api_client: BaseApiClient,
|
944
984
|
from_object: Union[dict, object],
|
@@ -964,28 +1004,6 @@ def _UpdateCachedContentParameters_to_vertex(
|
|
964
1004
|
return to_object
|
965
1005
|
|
966
1006
|
|
967
|
-
def _ListCachedContentsConfig_to_mldev(
|
968
|
-
api_client: BaseApiClient,
|
969
|
-
from_object: Union[dict, object],
|
970
|
-
parent_object: Optional[dict] = None,
|
971
|
-
) -> dict:
|
972
|
-
to_object: dict[str, Any] = {}
|
973
|
-
|
974
|
-
if getv(from_object, ['page_size']) is not None:
|
975
|
-
setv(
|
976
|
-
parent_object, ['_query', 'pageSize'], getv(from_object, ['page_size'])
|
977
|
-
)
|
978
|
-
|
979
|
-
if getv(from_object, ['page_token']) is not None:
|
980
|
-
setv(
|
981
|
-
parent_object,
|
982
|
-
['_query', 'pageToken'],
|
983
|
-
getv(from_object, ['page_token']),
|
984
|
-
)
|
985
|
-
|
986
|
-
return to_object
|
987
|
-
|
988
|
-
|
989
1007
|
def _ListCachedContentsConfig_to_vertex(
|
990
1008
|
api_client: BaseApiClient,
|
991
1009
|
from_object: Union[dict, object],
|
@@ -1008,24 +1026,6 @@ def _ListCachedContentsConfig_to_vertex(
|
|
1008
1026
|
return to_object
|
1009
1027
|
|
1010
1028
|
|
1011
|
-
def _ListCachedContentsParameters_to_mldev(
|
1012
|
-
api_client: BaseApiClient,
|
1013
|
-
from_object: Union[dict, object],
|
1014
|
-
parent_object: Optional[dict] = None,
|
1015
|
-
) -> dict:
|
1016
|
-
to_object: dict[str, Any] = {}
|
1017
|
-
if getv(from_object, ['config']) is not None:
|
1018
|
-
setv(
|
1019
|
-
to_object,
|
1020
|
-
['config'],
|
1021
|
-
_ListCachedContentsConfig_to_mldev(
|
1022
|
-
api_client, getv(from_object, ['config']), to_object
|
1023
|
-
),
|
1024
|
-
)
|
1025
|
-
|
1026
|
-
return to_object
|
1027
|
-
|
1028
|
-
|
1029
1029
|
def _ListCachedContentsParameters_to_vertex(
|
1030
1030
|
api_client: BaseApiClient,
|
1031
1031
|
from_object: Union[dict, object],
|
@@ -1074,6 +1074,38 @@ def _CachedContent_from_mldev(
|
|
1074
1074
|
return to_object
|
1075
1075
|
|
1076
1076
|
|
1077
|
+
def _DeleteCachedContentResponse_from_mldev(
|
1078
|
+
api_client: BaseApiClient,
|
1079
|
+
from_object: Union[dict, object],
|
1080
|
+
parent_object: Optional[dict] = None,
|
1081
|
+
) -> dict:
|
1082
|
+
to_object: dict[str, Any] = {}
|
1083
|
+
|
1084
|
+
return to_object
|
1085
|
+
|
1086
|
+
|
1087
|
+
def _ListCachedContentsResponse_from_mldev(
|
1088
|
+
api_client: BaseApiClient,
|
1089
|
+
from_object: Union[dict, object],
|
1090
|
+
parent_object: Optional[dict] = None,
|
1091
|
+
) -> dict:
|
1092
|
+
to_object: dict[str, Any] = {}
|
1093
|
+
if getv(from_object, ['nextPageToken']) is not None:
|
1094
|
+
setv(to_object, ['next_page_token'], getv(from_object, ['nextPageToken']))
|
1095
|
+
|
1096
|
+
if getv(from_object, ['cachedContents']) is not None:
|
1097
|
+
setv(
|
1098
|
+
to_object,
|
1099
|
+
['cached_contents'],
|
1100
|
+
[
|
1101
|
+
_CachedContent_from_mldev(api_client, item, to_object)
|
1102
|
+
for item in getv(from_object, ['cachedContents'])
|
1103
|
+
],
|
1104
|
+
)
|
1105
|
+
|
1106
|
+
return to_object
|
1107
|
+
|
1108
|
+
|
1077
1109
|
def _CachedContent_from_vertex(
|
1078
1110
|
api_client: BaseApiClient,
|
1079
1111
|
from_object: Union[dict, object],
|
@@ -1104,16 +1136,6 @@ def _CachedContent_from_vertex(
|
|
1104
1136
|
return to_object
|
1105
1137
|
|
1106
1138
|
|
1107
|
-
def _DeleteCachedContentResponse_from_mldev(
|
1108
|
-
api_client: BaseApiClient,
|
1109
|
-
from_object: Union[dict, object],
|
1110
|
-
parent_object: Optional[dict] = None,
|
1111
|
-
) -> dict:
|
1112
|
-
to_object: dict[str, Any] = {}
|
1113
|
-
|
1114
|
-
return to_object
|
1115
|
-
|
1116
|
-
|
1117
1139
|
def _DeleteCachedContentResponse_from_vertex(
|
1118
1140
|
api_client: BaseApiClient,
|
1119
1141
|
from_object: Union[dict, object],
|
@@ -1124,28 +1146,6 @@ def _DeleteCachedContentResponse_from_vertex(
|
|
1124
1146
|
return to_object
|
1125
1147
|
|
1126
1148
|
|
1127
|
-
def _ListCachedContentsResponse_from_mldev(
|
1128
|
-
api_client: BaseApiClient,
|
1129
|
-
from_object: Union[dict, object],
|
1130
|
-
parent_object: Optional[dict] = None,
|
1131
|
-
) -> dict:
|
1132
|
-
to_object: dict[str, Any] = {}
|
1133
|
-
if getv(from_object, ['nextPageToken']) is not None:
|
1134
|
-
setv(to_object, ['next_page_token'], getv(from_object, ['nextPageToken']))
|
1135
|
-
|
1136
|
-
if getv(from_object, ['cachedContents']) is not None:
|
1137
|
-
setv(
|
1138
|
-
to_object,
|
1139
|
-
['cached_contents'],
|
1140
|
-
[
|
1141
|
-
_CachedContent_from_mldev(api_client, item, to_object)
|
1142
|
-
for item in getv(from_object, ['cachedContents'])
|
1143
|
-
],
|
1144
|
-
)
|
1145
|
-
|
1146
|
-
return to_object
|
1147
|
-
|
1148
|
-
|
1149
1149
|
def _ListCachedContentsResponse_from_vertex(
|
1150
1150
|
api_client: BaseApiClient,
|
1151
1151
|
from_object: Union[dict, object],
|
@@ -1225,11 +1225,12 @@ class Caches(_api_module.BaseModule):
|
|
1225
1225
|
# TODO: remove the hack that pops config.
|
1226
1226
|
request_dict.pop('config', None)
|
1227
1227
|
|
1228
|
-
http_options: Optional[types.
|
1229
|
-
if
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1228
|
+
http_options: Optional[types.HttpOptions] = None
|
1229
|
+
if (
|
1230
|
+
parameter_model.config is not None
|
1231
|
+
and parameter_model.config.http_options is not None
|
1232
|
+
):
|
1233
|
+
http_options = parameter_model.config.http_options
|
1233
1234
|
|
1234
1235
|
request_dict = _common.convert_to_dict(request_dict)
|
1235
1236
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1242,6 +1243,7 @@ class Caches(_api_module.BaseModule):
|
|
1242
1243
|
response_dict = _CachedContent_from_vertex(
|
1243
1244
|
self._api_client, response_dict
|
1244
1245
|
)
|
1246
|
+
|
1245
1247
|
else:
|
1246
1248
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1247
1249
|
|
@@ -1295,11 +1297,12 @@ class Caches(_api_module.BaseModule):
|
|
1295
1297
|
# TODO: remove the hack that pops config.
|
1296
1298
|
request_dict.pop('config', None)
|
1297
1299
|
|
1298
|
-
http_options: Optional[types.
|
1299
|
-
if
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1300
|
+
http_options: Optional[types.HttpOptions] = None
|
1301
|
+
if (
|
1302
|
+
parameter_model.config is not None
|
1303
|
+
and parameter_model.config.http_options is not None
|
1304
|
+
):
|
1305
|
+
http_options = parameter_model.config.http_options
|
1303
1306
|
|
1304
1307
|
request_dict = _common.convert_to_dict(request_dict)
|
1305
1308
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1312,6 +1315,7 @@ class Caches(_api_module.BaseModule):
|
|
1312
1315
|
response_dict = _CachedContent_from_vertex(
|
1313
1316
|
self._api_client, response_dict
|
1314
1317
|
)
|
1318
|
+
|
1315
1319
|
else:
|
1316
1320
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1317
1321
|
|
@@ -1367,11 +1371,12 @@ class Caches(_api_module.BaseModule):
|
|
1367
1371
|
# TODO: remove the hack that pops config.
|
1368
1372
|
request_dict.pop('config', None)
|
1369
1373
|
|
1370
|
-
http_options: Optional[types.
|
1371
|
-
if
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1374
|
+
http_options: Optional[types.HttpOptions] = None
|
1375
|
+
if (
|
1376
|
+
parameter_model.config is not None
|
1377
|
+
and parameter_model.config.http_options is not None
|
1378
|
+
):
|
1379
|
+
http_options = parameter_model.config.http_options
|
1375
1380
|
|
1376
1381
|
request_dict = _common.convert_to_dict(request_dict)
|
1377
1382
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1384,6 +1389,7 @@ class Caches(_api_module.BaseModule):
|
|
1384
1389
|
response_dict = _DeleteCachedContentResponse_from_vertex(
|
1385
1390
|
self._api_client, response_dict
|
1386
1391
|
)
|
1392
|
+
|
1387
1393
|
else:
|
1388
1394
|
response_dict = _DeleteCachedContentResponse_from_mldev(
|
1389
1395
|
self._api_client, response_dict
|
@@ -1444,11 +1450,12 @@ class Caches(_api_module.BaseModule):
|
|
1444
1450
|
# TODO: remove the hack that pops config.
|
1445
1451
|
request_dict.pop('config', None)
|
1446
1452
|
|
1447
|
-
http_options: Optional[types.
|
1448
|
-
if
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1453
|
+
http_options: Optional[types.HttpOptions] = None
|
1454
|
+
if (
|
1455
|
+
parameter_model.config is not None
|
1456
|
+
and parameter_model.config.http_options is not None
|
1457
|
+
):
|
1458
|
+
http_options = parameter_model.config.http_options
|
1452
1459
|
|
1453
1460
|
request_dict = _common.convert_to_dict(request_dict)
|
1454
1461
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1461,6 +1468,7 @@ class Caches(_api_module.BaseModule):
|
|
1461
1468
|
response_dict = _CachedContent_from_vertex(
|
1462
1469
|
self._api_client, response_dict
|
1463
1470
|
)
|
1471
|
+
|
1464
1472
|
else:
|
1465
1473
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1466
1474
|
|
@@ -1512,11 +1520,12 @@ class Caches(_api_module.BaseModule):
|
|
1512
1520
|
# TODO: remove the hack that pops config.
|
1513
1521
|
request_dict.pop('config', None)
|
1514
1522
|
|
1515
|
-
http_options: Optional[types.
|
1516
|
-
if
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1523
|
+
http_options: Optional[types.HttpOptions] = None
|
1524
|
+
if (
|
1525
|
+
parameter_model.config is not None
|
1526
|
+
and parameter_model.config.http_options is not None
|
1527
|
+
):
|
1528
|
+
http_options = parameter_model.config.http_options
|
1520
1529
|
|
1521
1530
|
request_dict = _common.convert_to_dict(request_dict)
|
1522
1531
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1529,6 +1538,7 @@ class Caches(_api_module.BaseModule):
|
|
1529
1538
|
response_dict = _ListCachedContentsResponse_from_vertex(
|
1530
1539
|
self._api_client, response_dict
|
1531
1540
|
)
|
1541
|
+
|
1532
1542
|
else:
|
1533
1543
|
response_dict = _ListCachedContentsResponse_from_mldev(
|
1534
1544
|
self._api_client, response_dict
|
@@ -1608,11 +1618,12 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1608
1618
|
# TODO: remove the hack that pops config.
|
1609
1619
|
request_dict.pop('config', None)
|
1610
1620
|
|
1611
|
-
http_options: Optional[types.
|
1612
|
-
if
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1621
|
+
http_options: Optional[types.HttpOptions] = None
|
1622
|
+
if (
|
1623
|
+
parameter_model.config is not None
|
1624
|
+
and parameter_model.config.http_options is not None
|
1625
|
+
):
|
1626
|
+
http_options = parameter_model.config.http_options
|
1616
1627
|
|
1617
1628
|
request_dict = _common.convert_to_dict(request_dict)
|
1618
1629
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1625,6 +1636,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1625
1636
|
response_dict = _CachedContent_from_vertex(
|
1626
1637
|
self._api_client, response_dict
|
1627
1638
|
)
|
1639
|
+
|
1628
1640
|
else:
|
1629
1641
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1630
1642
|
|
@@ -1679,11 +1691,12 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1679
1691
|
# TODO: remove the hack that pops config.
|
1680
1692
|
request_dict.pop('config', None)
|
1681
1693
|
|
1682
|
-
http_options: Optional[types.
|
1683
|
-
if
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1694
|
+
http_options: Optional[types.HttpOptions] = None
|
1695
|
+
if (
|
1696
|
+
parameter_model.config is not None
|
1697
|
+
and parameter_model.config.http_options is not None
|
1698
|
+
):
|
1699
|
+
http_options = parameter_model.config.http_options
|
1687
1700
|
|
1688
1701
|
request_dict = _common.convert_to_dict(request_dict)
|
1689
1702
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1696,6 +1709,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1696
1709
|
response_dict = _CachedContent_from_vertex(
|
1697
1710
|
self._api_client, response_dict
|
1698
1711
|
)
|
1712
|
+
|
1699
1713
|
else:
|
1700
1714
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1701
1715
|
|
@@ -1752,11 +1766,12 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1752
1766
|
# TODO: remove the hack that pops config.
|
1753
1767
|
request_dict.pop('config', None)
|
1754
1768
|
|
1755
|
-
http_options: Optional[types.
|
1756
|
-
if
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1769
|
+
http_options: Optional[types.HttpOptions] = None
|
1770
|
+
if (
|
1771
|
+
parameter_model.config is not None
|
1772
|
+
and parameter_model.config.http_options is not None
|
1773
|
+
):
|
1774
|
+
http_options = parameter_model.config.http_options
|
1760
1775
|
|
1761
1776
|
request_dict = _common.convert_to_dict(request_dict)
|
1762
1777
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1769,6 +1784,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1769
1784
|
response_dict = _DeleteCachedContentResponse_from_vertex(
|
1770
1785
|
self._api_client, response_dict
|
1771
1786
|
)
|
1787
|
+
|
1772
1788
|
else:
|
1773
1789
|
response_dict = _DeleteCachedContentResponse_from_mldev(
|
1774
1790
|
self._api_client, response_dict
|
@@ -1829,11 +1845,12 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1829
1845
|
# TODO: remove the hack that pops config.
|
1830
1846
|
request_dict.pop('config', None)
|
1831
1847
|
|
1832
|
-
http_options: Optional[types.
|
1833
|
-
if
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1848
|
+
http_options: Optional[types.HttpOptions] = None
|
1849
|
+
if (
|
1850
|
+
parameter_model.config is not None
|
1851
|
+
and parameter_model.config.http_options is not None
|
1852
|
+
):
|
1853
|
+
http_options = parameter_model.config.http_options
|
1837
1854
|
|
1838
1855
|
request_dict = _common.convert_to_dict(request_dict)
|
1839
1856
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1846,6 +1863,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1846
1863
|
response_dict = _CachedContent_from_vertex(
|
1847
1864
|
self._api_client, response_dict
|
1848
1865
|
)
|
1866
|
+
|
1849
1867
|
else:
|
1850
1868
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1851
1869
|
|
@@ -1897,11 +1915,12 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1897
1915
|
# TODO: remove the hack that pops config.
|
1898
1916
|
request_dict.pop('config', None)
|
1899
1917
|
|
1900
|
-
http_options: Optional[types.
|
1901
|
-
if
|
1902
|
-
|
1903
|
-
|
1904
|
-
|
1918
|
+
http_options: Optional[types.HttpOptions] = None
|
1919
|
+
if (
|
1920
|
+
parameter_model.config is not None
|
1921
|
+
and parameter_model.config.http_options is not None
|
1922
|
+
):
|
1923
|
+
http_options = parameter_model.config.http_options
|
1905
1924
|
|
1906
1925
|
request_dict = _common.convert_to_dict(request_dict)
|
1907
1926
|
request_dict = _common.encode_unserializable_types(request_dict)
|
@@ -1914,6 +1933,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1914
1933
|
response_dict = _ListCachedContentsResponse_from_vertex(
|
1915
1934
|
self._api_client, response_dict
|
1916
1935
|
)
|
1936
|
+
|
1917
1937
|
else:
|
1918
1938
|
response_dict = _ListCachedContentsResponse_from_mldev(
|
1919
1939
|
self._api_client, response_dict
|