google-genai 1.19.0__py3-none-any.whl → 1.21.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
google/genai/caches.py CHANGED
@@ -15,9 +15,11 @@
15
15
 
16
16
  # Code generated by the Google Gen AI SDK generator DO NOT EDIT.
17
17
 
18
+ import json
18
19
  import logging
19
20
  from typing import Any, Optional, Union
20
21
  from urllib.parse import urlencode
22
+
21
23
  from . import _api_module
22
24
  from . import _common
23
25
  from . import _transformers as t
@@ -31,7 +33,6 @@ logger = logging.getLogger('google_genai.caches')
31
33
 
32
34
 
33
35
  def _VideoMetadata_to_mldev(
34
- api_client: BaseApiClient,
35
36
  from_object: Union[dict[str, Any], object],
36
37
  parent_object: Optional[dict[str, Any]] = None,
37
38
  ) -> dict[str, Any]:
@@ -49,7 +50,6 @@ def _VideoMetadata_to_mldev(
49
50
 
50
51
 
51
52
  def _Blob_to_mldev(
52
- api_client: BaseApiClient,
53
53
  from_object: Union[dict[str, Any], object],
54
54
  parent_object: Optional[dict[str, Any]] = None,
55
55
  ) -> dict[str, Any]:
@@ -67,7 +67,6 @@ def _Blob_to_mldev(
67
67
 
68
68
 
69
69
  def _FileData_to_mldev(
70
- api_client: BaseApiClient,
71
70
  from_object: Union[dict[str, Any], object],
72
71
  parent_object: Optional[dict[str, Any]] = None,
73
72
  ) -> dict[str, Any]:
@@ -85,7 +84,6 @@ def _FileData_to_mldev(
85
84
 
86
85
 
87
86
  def _Part_to_mldev(
88
- api_client: BaseApiClient,
89
87
  from_object: Union[dict[str, Any], object],
90
88
  parent_object: Optional[dict[str, Any]] = None,
91
89
  ) -> dict[str, Any]:
@@ -95,7 +93,7 @@ def _Part_to_mldev(
95
93
  to_object,
96
94
  ['videoMetadata'],
97
95
  _VideoMetadata_to_mldev(
98
- api_client, getv(from_object, ['video_metadata']), to_object
96
+ getv(from_object, ['video_metadata']), to_object
99
97
  ),
100
98
  )
101
99
 
@@ -106,18 +104,14 @@ def _Part_to_mldev(
106
104
  setv(
107
105
  to_object,
108
106
  ['inlineData'],
109
- _Blob_to_mldev(
110
- api_client, getv(from_object, ['inline_data']), to_object
111
- ),
107
+ _Blob_to_mldev(getv(from_object, ['inline_data']), to_object),
112
108
  )
113
109
 
114
110
  if getv(from_object, ['file_data']) is not None:
115
111
  setv(
116
112
  to_object,
117
113
  ['fileData'],
118
- _FileData_to_mldev(
119
- api_client, getv(from_object, ['file_data']), to_object
120
- ),
114
+ _FileData_to_mldev(getv(from_object, ['file_data']), to_object),
121
115
  )
122
116
 
123
117
  if getv(from_object, ['thought_signature']) is not None:
@@ -154,7 +148,6 @@ def _Part_to_mldev(
154
148
 
155
149
 
156
150
  def _Content_to_mldev(
157
- api_client: BaseApiClient,
158
151
  from_object: Union[dict[str, Any], object],
159
152
  parent_object: Optional[dict[str, Any]] = None,
160
153
  ) -> dict[str, Any]:
@@ -164,7 +157,7 @@ def _Content_to_mldev(
164
157
  to_object,
165
158
  ['parts'],
166
159
  [
167
- _Part_to_mldev(api_client, item, to_object)
160
+ _Part_to_mldev(item, to_object)
168
161
  for item in getv(from_object, ['parts'])
169
162
  ],
170
163
  )
@@ -176,7 +169,6 @@ def _Content_to_mldev(
176
169
 
177
170
 
178
171
  def _FunctionDeclaration_to_mldev(
179
- api_client: BaseApiClient,
180
172
  from_object: Union[dict[str, Any], object],
181
173
  parent_object: Optional[dict[str, Any]] = None,
182
174
  ) -> dict[str, Any]:
@@ -193,14 +185,27 @@ def _FunctionDeclaration_to_mldev(
193
185
  if getv(from_object, ['parameters']) is not None:
194
186
  setv(to_object, ['parameters'], getv(from_object, ['parameters']))
195
187
 
188
+ if getv(from_object, ['parameters_json_schema']) is not None:
189
+ setv(
190
+ to_object,
191
+ ['parametersJsonSchema'],
192
+ getv(from_object, ['parameters_json_schema']),
193
+ )
194
+
196
195
  if getv(from_object, ['response']) is not None:
197
196
  setv(to_object, ['response'], getv(from_object, ['response']))
198
197
 
198
+ if getv(from_object, ['response_json_schema']) is not None:
199
+ setv(
200
+ to_object,
201
+ ['responseJsonSchema'],
202
+ getv(from_object, ['response_json_schema']),
203
+ )
204
+
199
205
  return to_object
200
206
 
201
207
 
202
208
  def _Interval_to_mldev(
203
- api_client: BaseApiClient,
204
209
  from_object: Union[dict[str, Any], object],
205
210
  parent_object: Optional[dict[str, Any]] = None,
206
211
  ) -> dict[str, Any]:
@@ -215,7 +220,6 @@ def _Interval_to_mldev(
215
220
 
216
221
 
217
222
  def _GoogleSearch_to_mldev(
218
- api_client: BaseApiClient,
219
223
  from_object: Union[dict[str, Any], object],
220
224
  parent_object: Optional[dict[str, Any]] = None,
221
225
  ) -> dict[str, Any]:
@@ -224,16 +228,13 @@ def _GoogleSearch_to_mldev(
224
228
  setv(
225
229
  to_object,
226
230
  ['timeRangeFilter'],
227
- _Interval_to_mldev(
228
- api_client, getv(from_object, ['time_range_filter']), to_object
229
- ),
231
+ _Interval_to_mldev(getv(from_object, ['time_range_filter']), to_object),
230
232
  )
231
233
 
232
234
  return to_object
233
235
 
234
236
 
235
237
  def _DynamicRetrievalConfig_to_mldev(
236
- api_client: BaseApiClient,
237
238
  from_object: Union[dict[str, Any], object],
238
239
  parent_object: Optional[dict[str, Any]] = None,
239
240
  ) -> dict[str, Any]:
@@ -252,7 +253,6 @@ def _DynamicRetrievalConfig_to_mldev(
252
253
 
253
254
 
254
255
  def _GoogleSearchRetrieval_to_mldev(
255
- api_client: BaseApiClient,
256
256
  from_object: Union[dict[str, Any], object],
257
257
  parent_object: Optional[dict[str, Any]] = None,
258
258
  ) -> dict[str, Any]:
@@ -262,9 +262,7 @@ def _GoogleSearchRetrieval_to_mldev(
262
262
  to_object,
263
263
  ['dynamicRetrievalConfig'],
264
264
  _DynamicRetrievalConfig_to_mldev(
265
- api_client,
266
- getv(from_object, ['dynamic_retrieval_config']),
267
- to_object,
265
+ getv(from_object, ['dynamic_retrieval_config']), to_object
268
266
  ),
269
267
  )
270
268
 
@@ -272,7 +270,6 @@ def _GoogleSearchRetrieval_to_mldev(
272
270
 
273
271
 
274
272
  def _EnterpriseWebSearch_to_mldev(
275
- api_client: BaseApiClient,
276
273
  from_object: Union[dict[str, Any], object],
277
274
  parent_object: Optional[dict[str, Any]] = None,
278
275
  ) -> dict[str, Any]:
@@ -282,7 +279,6 @@ def _EnterpriseWebSearch_to_mldev(
282
279
 
283
280
 
284
281
  def _ApiKeyConfig_to_mldev(
285
- api_client: BaseApiClient,
286
282
  from_object: Union[dict[str, Any], object],
287
283
  parent_object: Optional[dict[str, Any]] = None,
288
284
  ) -> dict[str, Any]:
@@ -294,7 +290,6 @@ def _ApiKeyConfig_to_mldev(
294
290
 
295
291
 
296
292
  def _AuthConfig_to_mldev(
297
- api_client: BaseApiClient,
298
293
  from_object: Union[dict[str, Any], object],
299
294
  parent_object: Optional[dict[str, Any]] = None,
300
295
  ) -> dict[str, Any]:
@@ -329,7 +324,6 @@ def _AuthConfig_to_mldev(
329
324
 
330
325
 
331
326
  def _GoogleMaps_to_mldev(
332
- api_client: BaseApiClient,
333
327
  from_object: Union[dict[str, Any], object],
334
328
  parent_object: Optional[dict[str, Any]] = None,
335
329
  ) -> dict[str, Any]:
@@ -341,7 +335,6 @@ def _GoogleMaps_to_mldev(
341
335
 
342
336
 
343
337
  def _UrlContext_to_mldev(
344
- api_client: BaseApiClient,
345
338
  from_object: Union[dict[str, Any], object],
346
339
  parent_object: Optional[dict[str, Any]] = None,
347
340
  ) -> dict[str, Any]:
@@ -351,7 +344,6 @@ def _UrlContext_to_mldev(
351
344
 
352
345
 
353
346
  def _Tool_to_mldev(
354
- api_client: BaseApiClient,
355
347
  from_object: Union[dict[str, Any], object],
356
348
  parent_object: Optional[dict[str, Any]] = None,
357
349
  ) -> dict[str, Any]:
@@ -361,7 +353,7 @@ def _Tool_to_mldev(
361
353
  to_object,
362
354
  ['functionDeclarations'],
363
355
  [
364
- _FunctionDeclaration_to_mldev(api_client, item, to_object)
356
+ _FunctionDeclaration_to_mldev(item, to_object)
365
357
  for item in getv(from_object, ['function_declarations'])
366
358
  ],
367
359
  )
@@ -373,9 +365,7 @@ def _Tool_to_mldev(
373
365
  setv(
374
366
  to_object,
375
367
  ['googleSearch'],
376
- _GoogleSearch_to_mldev(
377
- api_client, getv(from_object, ['google_search']), to_object
378
- ),
368
+ _GoogleSearch_to_mldev(getv(from_object, ['google_search']), to_object),
379
369
  )
380
370
 
381
371
  if getv(from_object, ['google_search_retrieval']) is not None:
@@ -383,9 +373,7 @@ def _Tool_to_mldev(
383
373
  to_object,
384
374
  ['googleSearchRetrieval'],
385
375
  _GoogleSearchRetrieval_to_mldev(
386
- api_client,
387
- getv(from_object, ['google_search_retrieval']),
388
- to_object,
376
+ getv(from_object, ['google_search_retrieval']), to_object
389
377
  ),
390
378
  )
391
379
 
@@ -401,9 +389,7 @@ def _Tool_to_mldev(
401
389
  setv(
402
390
  to_object,
403
391
  ['urlContext'],
404
- _UrlContext_to_mldev(
405
- api_client, getv(from_object, ['url_context']), to_object
406
- ),
392
+ _UrlContext_to_mldev(getv(from_object, ['url_context']), to_object),
407
393
  )
408
394
 
409
395
  if getv(from_object, ['code_execution']) is not None:
@@ -413,7 +399,6 @@ def _Tool_to_mldev(
413
399
 
414
400
 
415
401
  def _FunctionCallingConfig_to_mldev(
416
- api_client: BaseApiClient,
417
402
  from_object: Union[dict[str, Any], object],
418
403
  parent_object: Optional[dict[str, Any]] = None,
419
404
  ) -> dict[str, Any]:
@@ -432,7 +417,6 @@ def _FunctionCallingConfig_to_mldev(
432
417
 
433
418
 
434
419
  def _LatLng_to_mldev(
435
- api_client: BaseApiClient,
436
420
  from_object: Union[dict[str, Any], object],
437
421
  parent_object: Optional[dict[str, Any]] = None,
438
422
  ) -> dict[str, Any]:
@@ -447,7 +431,6 @@ def _LatLng_to_mldev(
447
431
 
448
432
 
449
433
  def _RetrievalConfig_to_mldev(
450
- api_client: BaseApiClient,
451
434
  from_object: Union[dict[str, Any], object],
452
435
  parent_object: Optional[dict[str, Any]] = None,
453
436
  ) -> dict[str, Any]:
@@ -456,7 +439,7 @@ def _RetrievalConfig_to_mldev(
456
439
  setv(
457
440
  to_object,
458
441
  ['latLng'],
459
- _LatLng_to_mldev(api_client, getv(from_object, ['lat_lng']), to_object),
442
+ _LatLng_to_mldev(getv(from_object, ['lat_lng']), to_object),
460
443
  )
461
444
 
462
445
  if getv(from_object, ['language_code']) is not None:
@@ -466,7 +449,6 @@ def _RetrievalConfig_to_mldev(
466
449
 
467
450
 
468
451
  def _ToolConfig_to_mldev(
469
- api_client: BaseApiClient,
470
452
  from_object: Union[dict[str, Any], object],
471
453
  parent_object: Optional[dict[str, Any]] = None,
472
454
  ) -> dict[str, Any]:
@@ -476,9 +458,7 @@ def _ToolConfig_to_mldev(
476
458
  to_object,
477
459
  ['functionCallingConfig'],
478
460
  _FunctionCallingConfig_to_mldev(
479
- api_client,
480
- getv(from_object, ['function_calling_config']),
481
- to_object,
461
+ getv(from_object, ['function_calling_config']), to_object
482
462
  ),
483
463
  )
484
464
 
@@ -487,7 +467,7 @@ def _ToolConfig_to_mldev(
487
467
  to_object,
488
468
  ['retrievalConfig'],
489
469
  _RetrievalConfig_to_mldev(
490
- api_client, getv(from_object, ['retrieval_config']), to_object
470
+ getv(from_object, ['retrieval_config']), to_object
491
471
  ),
492
472
  )
493
473
 
@@ -495,7 +475,6 @@ def _ToolConfig_to_mldev(
495
475
 
496
476
 
497
477
  def _CreateCachedContentConfig_to_mldev(
498
- api_client: BaseApiClient,
499
478
  from_object: Union[dict[str, Any], object],
500
479
  parent_object: Optional[dict[str, Any]] = None,
501
480
  ) -> dict[str, Any]:
@@ -515,10 +494,8 @@ def _CreateCachedContentConfig_to_mldev(
515
494
  parent_object,
516
495
  ['contents'],
517
496
  [
518
- _Content_to_mldev(api_client, item, to_object)
519
- for item in t.t_contents(
520
- api_client, getv(from_object, ['contents'])
521
- )
497
+ _Content_to_mldev(item, to_object)
498
+ for item in t.t_contents(getv(from_object, ['contents']))
522
499
  ],
523
500
  )
524
501
 
@@ -527,9 +504,7 @@ def _CreateCachedContentConfig_to_mldev(
527
504
  parent_object,
528
505
  ['systemInstruction'],
529
506
  _Content_to_mldev(
530
- api_client,
531
- t.t_content(api_client, getv(from_object, ['system_instruction'])),
532
- to_object,
507
+ t.t_content(getv(from_object, ['system_instruction'])), to_object
533
508
  ),
534
509
  )
535
510
 
@@ -538,7 +513,7 @@ def _CreateCachedContentConfig_to_mldev(
538
513
  parent_object,
539
514
  ['tools'],
540
515
  [
541
- _Tool_to_mldev(api_client, item, to_object)
516
+ _Tool_to_mldev(item, to_object)
542
517
  for item in getv(from_object, ['tools'])
543
518
  ],
544
519
  )
@@ -547,9 +522,7 @@ def _CreateCachedContentConfig_to_mldev(
547
522
  setv(
548
523
  parent_object,
549
524
  ['toolConfig'],
550
- _ToolConfig_to_mldev(
551
- api_client, getv(from_object, ['tool_config']), to_object
552
- ),
525
+ _ToolConfig_to_mldev(getv(from_object, ['tool_config']), to_object),
553
526
  )
554
527
 
555
528
  if getv(from_object, ['kms_key_name']) is not None:
@@ -576,7 +549,7 @@ def _CreateCachedContentParameters_to_mldev(
576
549
  to_object,
577
550
  ['config'],
578
551
  _CreateCachedContentConfig_to_mldev(
579
- api_client, getv(from_object, ['config']), to_object
552
+ getv(from_object, ['config']), to_object
580
553
  ),
581
554
  )
582
555
 
@@ -622,7 +595,6 @@ def _DeleteCachedContentParameters_to_mldev(
622
595
 
623
596
 
624
597
  def _UpdateCachedContentConfig_to_mldev(
625
- api_client: BaseApiClient,
626
598
  from_object: Union[dict[str, Any], object],
627
599
  parent_object: Optional[dict[str, Any]] = None,
628
600
  ) -> dict[str, Any]:
@@ -655,7 +627,7 @@ def _UpdateCachedContentParameters_to_mldev(
655
627
  to_object,
656
628
  ['config'],
657
629
  _UpdateCachedContentConfig_to_mldev(
658
- api_client, getv(from_object, ['config']), to_object
630
+ getv(from_object, ['config']), to_object
659
631
  ),
660
632
  )
661
633
 
@@ -663,7 +635,6 @@ def _UpdateCachedContentParameters_to_mldev(
663
635
 
664
636
 
665
637
  def _ListCachedContentsConfig_to_mldev(
666
- api_client: BaseApiClient,
667
638
  from_object: Union[dict[str, Any], object],
668
639
  parent_object: Optional[dict[str, Any]] = None,
669
640
  ) -> dict[str, Any]:
@@ -685,7 +656,6 @@ def _ListCachedContentsConfig_to_mldev(
685
656
 
686
657
 
687
658
  def _ListCachedContentsParameters_to_mldev(
688
- api_client: BaseApiClient,
689
659
  from_object: Union[dict[str, Any], object],
690
660
  parent_object: Optional[dict[str, Any]] = None,
691
661
  ) -> dict[str, Any]:
@@ -695,7 +665,7 @@ def _ListCachedContentsParameters_to_mldev(
695
665
  to_object,
696
666
  ['config'],
697
667
  _ListCachedContentsConfig_to_mldev(
698
- api_client, getv(from_object, ['config']), to_object
668
+ getv(from_object, ['config']), to_object
699
669
  ),
700
670
  )
701
671
 
@@ -703,7 +673,6 @@ def _ListCachedContentsParameters_to_mldev(
703
673
 
704
674
 
705
675
  def _VideoMetadata_to_vertex(
706
- api_client: BaseApiClient,
707
676
  from_object: Union[dict[str, Any], object],
708
677
  parent_object: Optional[dict[str, Any]] = None,
709
678
  ) -> dict[str, Any]:
@@ -721,7 +690,6 @@ def _VideoMetadata_to_vertex(
721
690
 
722
691
 
723
692
  def _Blob_to_vertex(
724
- api_client: BaseApiClient,
725
693
  from_object: Union[dict[str, Any], object],
726
694
  parent_object: Optional[dict[str, Any]] = None,
727
695
  ) -> dict[str, Any]:
@@ -739,7 +707,6 @@ def _Blob_to_vertex(
739
707
 
740
708
 
741
709
  def _FileData_to_vertex(
742
- api_client: BaseApiClient,
743
710
  from_object: Union[dict[str, Any], object],
744
711
  parent_object: Optional[dict[str, Any]] = None,
745
712
  ) -> dict[str, Any]:
@@ -757,7 +724,6 @@ def _FileData_to_vertex(
757
724
 
758
725
 
759
726
  def _Part_to_vertex(
760
- api_client: BaseApiClient,
761
727
  from_object: Union[dict[str, Any], object],
762
728
  parent_object: Optional[dict[str, Any]] = None,
763
729
  ) -> dict[str, Any]:
@@ -767,7 +733,7 @@ def _Part_to_vertex(
767
733
  to_object,
768
734
  ['videoMetadata'],
769
735
  _VideoMetadata_to_vertex(
770
- api_client, getv(from_object, ['video_metadata']), to_object
736
+ getv(from_object, ['video_metadata']), to_object
771
737
  ),
772
738
  )
773
739
 
@@ -778,18 +744,14 @@ def _Part_to_vertex(
778
744
  setv(
779
745
  to_object,
780
746
  ['inlineData'],
781
- _Blob_to_vertex(
782
- api_client, getv(from_object, ['inline_data']), to_object
783
- ),
747
+ _Blob_to_vertex(getv(from_object, ['inline_data']), to_object),
784
748
  )
785
749
 
786
750
  if getv(from_object, ['file_data']) is not None:
787
751
  setv(
788
752
  to_object,
789
753
  ['fileData'],
790
- _FileData_to_vertex(
791
- api_client, getv(from_object, ['file_data']), to_object
792
- ),
754
+ _FileData_to_vertex(getv(from_object, ['file_data']), to_object),
793
755
  )
794
756
 
795
757
  if getv(from_object, ['thought_signature']) is not None:
@@ -826,7 +788,6 @@ def _Part_to_vertex(
826
788
 
827
789
 
828
790
  def _Content_to_vertex(
829
- api_client: BaseApiClient,
830
791
  from_object: Union[dict[str, Any], object],
831
792
  parent_object: Optional[dict[str, Any]] = None,
832
793
  ) -> dict[str, Any]:
@@ -836,7 +797,7 @@ def _Content_to_vertex(
836
797
  to_object,
837
798
  ['parts'],
838
799
  [
839
- _Part_to_vertex(api_client, item, to_object)
800
+ _Part_to_vertex(item, to_object)
840
801
  for item in getv(from_object, ['parts'])
841
802
  ],
842
803
  )
@@ -848,7 +809,6 @@ def _Content_to_vertex(
848
809
 
849
810
 
850
811
  def _FunctionDeclaration_to_vertex(
851
- api_client: BaseApiClient,
852
812
  from_object: Union[dict[str, Any], object],
853
813
  parent_object: Optional[dict[str, Any]] = None,
854
814
  ) -> dict[str, Any]:
@@ -865,14 +825,27 @@ def _FunctionDeclaration_to_vertex(
865
825
  if getv(from_object, ['parameters']) is not None:
866
826
  setv(to_object, ['parameters'], getv(from_object, ['parameters']))
867
827
 
828
+ if getv(from_object, ['parameters_json_schema']) is not None:
829
+ setv(
830
+ to_object,
831
+ ['parametersJsonSchema'],
832
+ getv(from_object, ['parameters_json_schema']),
833
+ )
834
+
868
835
  if getv(from_object, ['response']) is not None:
869
836
  setv(to_object, ['response'], getv(from_object, ['response']))
870
837
 
838
+ if getv(from_object, ['response_json_schema']) is not None:
839
+ setv(
840
+ to_object,
841
+ ['responseJsonSchema'],
842
+ getv(from_object, ['response_json_schema']),
843
+ )
844
+
871
845
  return to_object
872
846
 
873
847
 
874
848
  def _Interval_to_vertex(
875
- api_client: BaseApiClient,
876
849
  from_object: Union[dict[str, Any], object],
877
850
  parent_object: Optional[dict[str, Any]] = None,
878
851
  ) -> dict[str, Any]:
@@ -887,7 +860,6 @@ def _Interval_to_vertex(
887
860
 
888
861
 
889
862
  def _GoogleSearch_to_vertex(
890
- api_client: BaseApiClient,
891
863
  from_object: Union[dict[str, Any], object],
892
864
  parent_object: Optional[dict[str, Any]] = None,
893
865
  ) -> dict[str, Any]:
@@ -897,7 +869,7 @@ def _GoogleSearch_to_vertex(
897
869
  to_object,
898
870
  ['timeRangeFilter'],
899
871
  _Interval_to_vertex(
900
- api_client, getv(from_object, ['time_range_filter']), to_object
872
+ getv(from_object, ['time_range_filter']), to_object
901
873
  ),
902
874
  )
903
875
 
@@ -905,7 +877,6 @@ def _GoogleSearch_to_vertex(
905
877
 
906
878
 
907
879
  def _DynamicRetrievalConfig_to_vertex(
908
- api_client: BaseApiClient,
909
880
  from_object: Union[dict[str, Any], object],
910
881
  parent_object: Optional[dict[str, Any]] = None,
911
882
  ) -> dict[str, Any]:
@@ -924,7 +895,6 @@ def _DynamicRetrievalConfig_to_vertex(
924
895
 
925
896
 
926
897
  def _GoogleSearchRetrieval_to_vertex(
927
- api_client: BaseApiClient,
928
898
  from_object: Union[dict[str, Any], object],
929
899
  parent_object: Optional[dict[str, Any]] = None,
930
900
  ) -> dict[str, Any]:
@@ -934,9 +904,7 @@ def _GoogleSearchRetrieval_to_vertex(
934
904
  to_object,
935
905
  ['dynamicRetrievalConfig'],
936
906
  _DynamicRetrievalConfig_to_vertex(
937
- api_client,
938
- getv(from_object, ['dynamic_retrieval_config']),
939
- to_object,
907
+ getv(from_object, ['dynamic_retrieval_config']), to_object
940
908
  ),
941
909
  )
942
910
 
@@ -944,7 +912,6 @@ def _GoogleSearchRetrieval_to_vertex(
944
912
 
945
913
 
946
914
  def _EnterpriseWebSearch_to_vertex(
947
- api_client: BaseApiClient,
948
915
  from_object: Union[dict[str, Any], object],
949
916
  parent_object: Optional[dict[str, Any]] = None,
950
917
  ) -> dict[str, Any]:
@@ -954,7 +921,6 @@ def _EnterpriseWebSearch_to_vertex(
954
921
 
955
922
 
956
923
  def _ApiKeyConfig_to_vertex(
957
- api_client: BaseApiClient,
958
924
  from_object: Union[dict[str, Any], object],
959
925
  parent_object: Optional[dict[str, Any]] = None,
960
926
  ) -> dict[str, Any]:
@@ -966,7 +932,6 @@ def _ApiKeyConfig_to_vertex(
966
932
 
967
933
 
968
934
  def _AuthConfig_to_vertex(
969
- api_client: BaseApiClient,
970
935
  from_object: Union[dict[str, Any], object],
971
936
  parent_object: Optional[dict[str, Any]] = None,
972
937
  ) -> dict[str, Any]:
@@ -976,7 +941,7 @@ def _AuthConfig_to_vertex(
976
941
  to_object,
977
942
  ['apiKeyConfig'],
978
943
  _ApiKeyConfig_to_vertex(
979
- api_client, getv(from_object, ['api_key_config']), to_object
944
+ getv(from_object, ['api_key_config']), to_object
980
945
  ),
981
946
  )
982
947
 
@@ -1007,7 +972,6 @@ def _AuthConfig_to_vertex(
1007
972
 
1008
973
 
1009
974
  def _GoogleMaps_to_vertex(
1010
- api_client: BaseApiClient,
1011
975
  from_object: Union[dict[str, Any], object],
1012
976
  parent_object: Optional[dict[str, Any]] = None,
1013
977
  ) -> dict[str, Any]:
@@ -1016,16 +980,13 @@ def _GoogleMaps_to_vertex(
1016
980
  setv(
1017
981
  to_object,
1018
982
  ['authConfig'],
1019
- _AuthConfig_to_vertex(
1020
- api_client, getv(from_object, ['auth_config']), to_object
1021
- ),
983
+ _AuthConfig_to_vertex(getv(from_object, ['auth_config']), to_object),
1022
984
  )
1023
985
 
1024
986
  return to_object
1025
987
 
1026
988
 
1027
989
  def _UrlContext_to_vertex(
1028
- api_client: BaseApiClient,
1029
990
  from_object: Union[dict[str, Any], object],
1030
991
  parent_object: Optional[dict[str, Any]] = None,
1031
992
  ) -> dict[str, Any]:
@@ -1035,7 +996,6 @@ def _UrlContext_to_vertex(
1035
996
 
1036
997
 
1037
998
  def _Tool_to_vertex(
1038
- api_client: BaseApiClient,
1039
999
  from_object: Union[dict[str, Any], object],
1040
1000
  parent_object: Optional[dict[str, Any]] = None,
1041
1001
  ) -> dict[str, Any]:
@@ -1045,7 +1005,7 @@ def _Tool_to_vertex(
1045
1005
  to_object,
1046
1006
  ['functionDeclarations'],
1047
1007
  [
1048
- _FunctionDeclaration_to_vertex(api_client, item, to_object)
1008
+ _FunctionDeclaration_to_vertex(item, to_object)
1049
1009
  for item in getv(from_object, ['function_declarations'])
1050
1010
  ],
1051
1011
  )
@@ -1058,7 +1018,7 @@ def _Tool_to_vertex(
1058
1018
  to_object,
1059
1019
  ['googleSearch'],
1060
1020
  _GoogleSearch_to_vertex(
1061
- api_client, getv(from_object, ['google_search']), to_object
1021
+ getv(from_object, ['google_search']), to_object
1062
1022
  ),
1063
1023
  )
1064
1024
 
@@ -1067,9 +1027,7 @@ def _Tool_to_vertex(
1067
1027
  to_object,
1068
1028
  ['googleSearchRetrieval'],
1069
1029
  _GoogleSearchRetrieval_to_vertex(
1070
- api_client,
1071
- getv(from_object, ['google_search_retrieval']),
1072
- to_object,
1030
+ getv(from_object, ['google_search_retrieval']), to_object
1073
1031
  ),
1074
1032
  )
1075
1033
 
@@ -1078,7 +1036,7 @@ def _Tool_to_vertex(
1078
1036
  to_object,
1079
1037
  ['enterpriseWebSearch'],
1080
1038
  _EnterpriseWebSearch_to_vertex(
1081
- api_client, getv(from_object, ['enterprise_web_search']), to_object
1039
+ getv(from_object, ['enterprise_web_search']), to_object
1082
1040
  ),
1083
1041
  )
1084
1042
 
@@ -1086,18 +1044,14 @@ def _Tool_to_vertex(
1086
1044
  setv(
1087
1045
  to_object,
1088
1046
  ['googleMaps'],
1089
- _GoogleMaps_to_vertex(
1090
- api_client, getv(from_object, ['google_maps']), to_object
1091
- ),
1047
+ _GoogleMaps_to_vertex(getv(from_object, ['google_maps']), to_object),
1092
1048
  )
1093
1049
 
1094
1050
  if getv(from_object, ['url_context']) is not None:
1095
1051
  setv(
1096
1052
  to_object,
1097
1053
  ['urlContext'],
1098
- _UrlContext_to_vertex(
1099
- api_client, getv(from_object, ['url_context']), to_object
1100
- ),
1054
+ _UrlContext_to_vertex(getv(from_object, ['url_context']), to_object),
1101
1055
  )
1102
1056
 
1103
1057
  if getv(from_object, ['code_execution']) is not None:
@@ -1107,7 +1061,6 @@ def _Tool_to_vertex(
1107
1061
 
1108
1062
 
1109
1063
  def _FunctionCallingConfig_to_vertex(
1110
- api_client: BaseApiClient,
1111
1064
  from_object: Union[dict[str, Any], object],
1112
1065
  parent_object: Optional[dict[str, Any]] = None,
1113
1066
  ) -> dict[str, Any]:
@@ -1126,7 +1079,6 @@ def _FunctionCallingConfig_to_vertex(
1126
1079
 
1127
1080
 
1128
1081
  def _LatLng_to_vertex(
1129
- api_client: BaseApiClient,
1130
1082
  from_object: Union[dict[str, Any], object],
1131
1083
  parent_object: Optional[dict[str, Any]] = None,
1132
1084
  ) -> dict[str, Any]:
@@ -1141,7 +1093,6 @@ def _LatLng_to_vertex(
1141
1093
 
1142
1094
 
1143
1095
  def _RetrievalConfig_to_vertex(
1144
- api_client: BaseApiClient,
1145
1096
  from_object: Union[dict[str, Any], object],
1146
1097
  parent_object: Optional[dict[str, Any]] = None,
1147
1098
  ) -> dict[str, Any]:
@@ -1150,9 +1101,7 @@ def _RetrievalConfig_to_vertex(
1150
1101
  setv(
1151
1102
  to_object,
1152
1103
  ['latLng'],
1153
- _LatLng_to_vertex(
1154
- api_client, getv(from_object, ['lat_lng']), to_object
1155
- ),
1104
+ _LatLng_to_vertex(getv(from_object, ['lat_lng']), to_object),
1156
1105
  )
1157
1106
 
1158
1107
  if getv(from_object, ['language_code']) is not None:
@@ -1162,7 +1111,6 @@ def _RetrievalConfig_to_vertex(
1162
1111
 
1163
1112
 
1164
1113
  def _ToolConfig_to_vertex(
1165
- api_client: BaseApiClient,
1166
1114
  from_object: Union[dict[str, Any], object],
1167
1115
  parent_object: Optional[dict[str, Any]] = None,
1168
1116
  ) -> dict[str, Any]:
@@ -1172,9 +1120,7 @@ def _ToolConfig_to_vertex(
1172
1120
  to_object,
1173
1121
  ['functionCallingConfig'],
1174
1122
  _FunctionCallingConfig_to_vertex(
1175
- api_client,
1176
- getv(from_object, ['function_calling_config']),
1177
- to_object,
1123
+ getv(from_object, ['function_calling_config']), to_object
1178
1124
  ),
1179
1125
  )
1180
1126
 
@@ -1183,7 +1129,7 @@ def _ToolConfig_to_vertex(
1183
1129
  to_object,
1184
1130
  ['retrievalConfig'],
1185
1131
  _RetrievalConfig_to_vertex(
1186
- api_client, getv(from_object, ['retrieval_config']), to_object
1132
+ getv(from_object, ['retrieval_config']), to_object
1187
1133
  ),
1188
1134
  )
1189
1135
 
@@ -1191,7 +1137,6 @@ def _ToolConfig_to_vertex(
1191
1137
 
1192
1138
 
1193
1139
  def _CreateCachedContentConfig_to_vertex(
1194
- api_client: BaseApiClient,
1195
1140
  from_object: Union[dict[str, Any], object],
1196
1141
  parent_object: Optional[dict[str, Any]] = None,
1197
1142
  ) -> dict[str, Any]:
@@ -1211,10 +1156,8 @@ def _CreateCachedContentConfig_to_vertex(
1211
1156
  parent_object,
1212
1157
  ['contents'],
1213
1158
  [
1214
- _Content_to_vertex(api_client, item, to_object)
1215
- for item in t.t_contents(
1216
- api_client, getv(from_object, ['contents'])
1217
- )
1159
+ _Content_to_vertex(item, to_object)
1160
+ for item in t.t_contents(getv(from_object, ['contents']))
1218
1161
  ],
1219
1162
  )
1220
1163
 
@@ -1223,9 +1166,7 @@ def _CreateCachedContentConfig_to_vertex(
1223
1166
  parent_object,
1224
1167
  ['systemInstruction'],
1225
1168
  _Content_to_vertex(
1226
- api_client,
1227
- t.t_content(api_client, getv(from_object, ['system_instruction'])),
1228
- to_object,
1169
+ t.t_content(getv(from_object, ['system_instruction'])), to_object
1229
1170
  ),
1230
1171
  )
1231
1172
 
@@ -1234,7 +1175,7 @@ def _CreateCachedContentConfig_to_vertex(
1234
1175
  parent_object,
1235
1176
  ['tools'],
1236
1177
  [
1237
- _Tool_to_vertex(api_client, item, to_object)
1178
+ _Tool_to_vertex(item, to_object)
1238
1179
  for item in getv(from_object, ['tools'])
1239
1180
  ],
1240
1181
  )
@@ -1243,9 +1184,7 @@ def _CreateCachedContentConfig_to_vertex(
1243
1184
  setv(
1244
1185
  parent_object,
1245
1186
  ['toolConfig'],
1246
- _ToolConfig_to_vertex(
1247
- api_client, getv(from_object, ['tool_config']), to_object
1248
- ),
1187
+ _ToolConfig_to_vertex(getv(from_object, ['tool_config']), to_object),
1249
1188
  )
1250
1189
 
1251
1190
  if getv(from_object, ['kms_key_name']) is not None:
@@ -1276,7 +1215,7 @@ def _CreateCachedContentParameters_to_vertex(
1276
1215
  to_object,
1277
1216
  ['config'],
1278
1217
  _CreateCachedContentConfig_to_vertex(
1279
- api_client, getv(from_object, ['config']), to_object
1218
+ getv(from_object, ['config']), to_object
1280
1219
  ),
1281
1220
  )
1282
1221
 
@@ -1322,7 +1261,6 @@ def _DeleteCachedContentParameters_to_vertex(
1322
1261
 
1323
1262
 
1324
1263
  def _UpdateCachedContentConfig_to_vertex(
1325
- api_client: BaseApiClient,
1326
1264
  from_object: Union[dict[str, Any], object],
1327
1265
  parent_object: Optional[dict[str, Any]] = None,
1328
1266
  ) -> dict[str, Any]:
@@ -1355,7 +1293,7 @@ def _UpdateCachedContentParameters_to_vertex(
1355
1293
  to_object,
1356
1294
  ['config'],
1357
1295
  _UpdateCachedContentConfig_to_vertex(
1358
- api_client, getv(from_object, ['config']), to_object
1296
+ getv(from_object, ['config']), to_object
1359
1297
  ),
1360
1298
  )
1361
1299
 
@@ -1363,7 +1301,6 @@ def _UpdateCachedContentParameters_to_vertex(
1363
1301
 
1364
1302
 
1365
1303
  def _ListCachedContentsConfig_to_vertex(
1366
- api_client: BaseApiClient,
1367
1304
  from_object: Union[dict[str, Any], object],
1368
1305
  parent_object: Optional[dict[str, Any]] = None,
1369
1306
  ) -> dict[str, Any]:
@@ -1385,7 +1322,6 @@ def _ListCachedContentsConfig_to_vertex(
1385
1322
 
1386
1323
 
1387
1324
  def _ListCachedContentsParameters_to_vertex(
1388
- api_client: BaseApiClient,
1389
1325
  from_object: Union[dict[str, Any], object],
1390
1326
  parent_object: Optional[dict[str, Any]] = None,
1391
1327
  ) -> dict[str, Any]:
@@ -1395,7 +1331,7 @@ def _ListCachedContentsParameters_to_vertex(
1395
1331
  to_object,
1396
1332
  ['config'],
1397
1333
  _ListCachedContentsConfig_to_vertex(
1398
- api_client, getv(from_object, ['config']), to_object
1334
+ getv(from_object, ['config']), to_object
1399
1335
  ),
1400
1336
  )
1401
1337
 
@@ -1408,7 +1344,6 @@ def _Behavior_to_vertex_enum_validate(enum_value: Any) -> None:
1408
1344
 
1409
1345
 
1410
1346
  def _CachedContent_from_mldev(
1411
- api_client: BaseApiClient,
1412
1347
  from_object: Union[dict[str, Any], object],
1413
1348
  parent_object: Optional[dict[str, Any]] = None,
1414
1349
  ) -> dict[str, Any]:
@@ -1438,7 +1373,6 @@ def _CachedContent_from_mldev(
1438
1373
 
1439
1374
 
1440
1375
  def _DeleteCachedContentResponse_from_mldev(
1441
- api_client: BaseApiClient,
1442
1376
  from_object: Union[dict[str, Any], object],
1443
1377
  parent_object: Optional[dict[str, Any]] = None,
1444
1378
  ) -> dict[str, Any]:
@@ -1448,7 +1382,6 @@ def _DeleteCachedContentResponse_from_mldev(
1448
1382
 
1449
1383
 
1450
1384
  def _ListCachedContentsResponse_from_mldev(
1451
- api_client: BaseApiClient,
1452
1385
  from_object: Union[dict[str, Any], object],
1453
1386
  parent_object: Optional[dict[str, Any]] = None,
1454
1387
  ) -> dict[str, Any]:
@@ -1461,7 +1394,7 @@ def _ListCachedContentsResponse_from_mldev(
1461
1394
  to_object,
1462
1395
  ['cached_contents'],
1463
1396
  [
1464
- _CachedContent_from_mldev(api_client, item, to_object)
1397
+ _CachedContent_from_mldev(item, to_object)
1465
1398
  for item in getv(from_object, ['cachedContents'])
1466
1399
  ],
1467
1400
  )
@@ -1470,7 +1403,6 @@ def _ListCachedContentsResponse_from_mldev(
1470
1403
 
1471
1404
 
1472
1405
  def _CachedContent_from_vertex(
1473
- api_client: BaseApiClient,
1474
1406
  from_object: Union[dict[str, Any], object],
1475
1407
  parent_object: Optional[dict[str, Any]] = None,
1476
1408
  ) -> dict[str, Any]:
@@ -1500,7 +1432,6 @@ def _CachedContent_from_vertex(
1500
1432
 
1501
1433
 
1502
1434
  def _DeleteCachedContentResponse_from_vertex(
1503
- api_client: BaseApiClient,
1504
1435
  from_object: Union[dict[str, Any], object],
1505
1436
  parent_object: Optional[dict[str, Any]] = None,
1506
1437
  ) -> dict[str, Any]:
@@ -1510,7 +1441,6 @@ def _DeleteCachedContentResponse_from_vertex(
1510
1441
 
1511
1442
 
1512
1443
  def _ListCachedContentsResponse_from_vertex(
1513
- api_client: BaseApiClient,
1514
1444
  from_object: Union[dict[str, Any], object],
1515
1445
  parent_object: Optional[dict[str, Any]] = None,
1516
1446
  ) -> dict[str, Any]:
@@ -1523,7 +1453,7 @@ def _ListCachedContentsResponse_from_vertex(
1523
1453
  to_object,
1524
1454
  ['cached_contents'],
1525
1455
  [
1526
- _CachedContent_from_vertex(api_client, item, to_object)
1456
+ _CachedContent_from_vertex(item, to_object)
1527
1457
  for item in getv(from_object, ['cachedContents'])
1528
1458
  ],
1529
1459
  )
@@ -1598,17 +1528,17 @@ class Caches(_api_module.BaseModule):
1598
1528
  request_dict = _common.convert_to_dict(request_dict)
1599
1529
  request_dict = _common.encode_unserializable_types(request_dict)
1600
1530
 
1601
- response_dict = self._api_client.request(
1531
+ response = self._api_client.request(
1602
1532
  'post', path, request_dict, http_options
1603
1533
  )
1604
1534
 
1535
+ response_dict = '' if not response.body else json.loads(response.body)
1536
+
1605
1537
  if self._api_client.vertexai:
1606
- response_dict = _CachedContent_from_vertex(
1607
- self._api_client, response_dict
1608
- )
1538
+ response_dict = _CachedContent_from_vertex(response_dict)
1609
1539
 
1610
1540
  else:
1611
- response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
1541
+ response_dict = _CachedContent_from_mldev(response_dict)
1612
1542
 
1613
1543
  return_value = types.CachedContent._from_response(
1614
1544
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -1670,17 +1600,15 @@ class Caches(_api_module.BaseModule):
1670
1600
  request_dict = _common.convert_to_dict(request_dict)
1671
1601
  request_dict = _common.encode_unserializable_types(request_dict)
1672
1602
 
1673
- response_dict = self._api_client.request(
1674
- 'get', path, request_dict, http_options
1675
- )
1603
+ response = self._api_client.request('get', path, request_dict, http_options)
1604
+
1605
+ response_dict = '' if not response.body else json.loads(response.body)
1676
1606
 
1677
1607
  if self._api_client.vertexai:
1678
- response_dict = _CachedContent_from_vertex(
1679
- self._api_client, response_dict
1680
- )
1608
+ response_dict = _CachedContent_from_vertex(response_dict)
1681
1609
 
1682
1610
  else:
1683
- response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
1611
+ response_dict = _CachedContent_from_mldev(response_dict)
1684
1612
 
1685
1613
  return_value = types.CachedContent._from_response(
1686
1614
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -1744,19 +1672,17 @@ class Caches(_api_module.BaseModule):
1744
1672
  request_dict = _common.convert_to_dict(request_dict)
1745
1673
  request_dict = _common.encode_unserializable_types(request_dict)
1746
1674
 
1747
- response_dict = self._api_client.request(
1675
+ response = self._api_client.request(
1748
1676
  'delete', path, request_dict, http_options
1749
1677
  )
1750
1678
 
1679
+ response_dict = '' if not response.body else json.loads(response.body)
1680
+
1751
1681
  if self._api_client.vertexai:
1752
- response_dict = _DeleteCachedContentResponse_from_vertex(
1753
- self._api_client, response_dict
1754
- )
1682
+ response_dict = _DeleteCachedContentResponse_from_vertex(response_dict)
1755
1683
 
1756
1684
  else:
1757
- response_dict = _DeleteCachedContentResponse_from_mldev(
1758
- self._api_client, response_dict
1759
- )
1685
+ response_dict = _DeleteCachedContentResponse_from_mldev(response_dict)
1760
1686
 
1761
1687
  return_value = types.DeleteCachedContentResponse._from_response(
1762
1688
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -1823,17 +1749,17 @@ class Caches(_api_module.BaseModule):
1823
1749
  request_dict = _common.convert_to_dict(request_dict)
1824
1750
  request_dict = _common.encode_unserializable_types(request_dict)
1825
1751
 
1826
- response_dict = self._api_client.request(
1752
+ response = self._api_client.request(
1827
1753
  'patch', path, request_dict, http_options
1828
1754
  )
1829
1755
 
1756
+ response_dict = '' if not response.body else json.loads(response.body)
1757
+
1830
1758
  if self._api_client.vertexai:
1831
- response_dict = _CachedContent_from_vertex(
1832
- self._api_client, response_dict
1833
- )
1759
+ response_dict = _CachedContent_from_vertex(response_dict)
1834
1760
 
1835
1761
  else:
1836
- response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
1762
+ response_dict = _CachedContent_from_mldev(response_dict)
1837
1763
 
1838
1764
  return_value = types.CachedContent._from_response(
1839
1765
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -1860,18 +1786,14 @@ class Caches(_api_module.BaseModule):
1860
1786
  request_url_dict: Optional[dict[str, str]]
1861
1787
 
1862
1788
  if self._api_client.vertexai:
1863
- request_dict = _ListCachedContentsParameters_to_vertex(
1864
- self._api_client, parameter_model
1865
- )
1789
+ request_dict = _ListCachedContentsParameters_to_vertex(parameter_model)
1866
1790
  request_url_dict = request_dict.get('_url')
1867
1791
  if request_url_dict:
1868
1792
  path = 'cachedContents'.format_map(request_url_dict)
1869
1793
  else:
1870
1794
  path = 'cachedContents'
1871
1795
  else:
1872
- request_dict = _ListCachedContentsParameters_to_mldev(
1873
- self._api_client, parameter_model
1874
- )
1796
+ request_dict = _ListCachedContentsParameters_to_mldev(parameter_model)
1875
1797
  request_url_dict = request_dict.get('_url')
1876
1798
  if request_url_dict:
1877
1799
  path = 'cachedContents'.format_map(request_url_dict)
@@ -1893,19 +1815,15 @@ class Caches(_api_module.BaseModule):
1893
1815
  request_dict = _common.convert_to_dict(request_dict)
1894
1816
  request_dict = _common.encode_unserializable_types(request_dict)
1895
1817
 
1896
- response_dict = self._api_client.request(
1897
- 'get', path, request_dict, http_options
1898
- )
1818
+ response = self._api_client.request('get', path, request_dict, http_options)
1819
+
1820
+ response_dict = '' if not response.body else json.loads(response.body)
1899
1821
 
1900
1822
  if self._api_client.vertexai:
1901
- response_dict = _ListCachedContentsResponse_from_vertex(
1902
- self._api_client, response_dict
1903
- )
1823
+ response_dict = _ListCachedContentsResponse_from_vertex(response_dict)
1904
1824
 
1905
1825
  else:
1906
- response_dict = _ListCachedContentsResponse_from_mldev(
1907
- self._api_client, response_dict
1908
- )
1826
+ response_dict = _ListCachedContentsResponse_from_mldev(response_dict)
1909
1827
 
1910
1828
  return_value = types.ListCachedContentsResponse._from_response(
1911
1829
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -1991,17 +1909,17 @@ class AsyncCaches(_api_module.BaseModule):
1991
1909
  request_dict = _common.convert_to_dict(request_dict)
1992
1910
  request_dict = _common.encode_unserializable_types(request_dict)
1993
1911
 
1994
- response_dict = await self._api_client.async_request(
1912
+ response = await self._api_client.async_request(
1995
1913
  'post', path, request_dict, http_options
1996
1914
  )
1997
1915
 
1916
+ response_dict = '' if not response.body else json.loads(response.body)
1917
+
1998
1918
  if self._api_client.vertexai:
1999
- response_dict = _CachedContent_from_vertex(
2000
- self._api_client, response_dict
2001
- )
1919
+ response_dict = _CachedContent_from_vertex(response_dict)
2002
1920
 
2003
1921
  else:
2004
- response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
1922
+ response_dict = _CachedContent_from_mldev(response_dict)
2005
1923
 
2006
1924
  return_value = types.CachedContent._from_response(
2007
1925
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -2064,17 +1982,17 @@ class AsyncCaches(_api_module.BaseModule):
2064
1982
  request_dict = _common.convert_to_dict(request_dict)
2065
1983
  request_dict = _common.encode_unserializable_types(request_dict)
2066
1984
 
2067
- response_dict = await self._api_client.async_request(
1985
+ response = await self._api_client.async_request(
2068
1986
  'get', path, request_dict, http_options
2069
1987
  )
2070
1988
 
1989
+ response_dict = '' if not response.body else json.loads(response.body)
1990
+
2071
1991
  if self._api_client.vertexai:
2072
- response_dict = _CachedContent_from_vertex(
2073
- self._api_client, response_dict
2074
- )
1992
+ response_dict = _CachedContent_from_vertex(response_dict)
2075
1993
 
2076
1994
  else:
2077
- response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
1995
+ response_dict = _CachedContent_from_mldev(response_dict)
2078
1996
 
2079
1997
  return_value = types.CachedContent._from_response(
2080
1998
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -2139,19 +2057,17 @@ class AsyncCaches(_api_module.BaseModule):
2139
2057
  request_dict = _common.convert_to_dict(request_dict)
2140
2058
  request_dict = _common.encode_unserializable_types(request_dict)
2141
2059
 
2142
- response_dict = await self._api_client.async_request(
2060
+ response = await self._api_client.async_request(
2143
2061
  'delete', path, request_dict, http_options
2144
2062
  )
2145
2063
 
2064
+ response_dict = '' if not response.body else json.loads(response.body)
2065
+
2146
2066
  if self._api_client.vertexai:
2147
- response_dict = _DeleteCachedContentResponse_from_vertex(
2148
- self._api_client, response_dict
2149
- )
2067
+ response_dict = _DeleteCachedContentResponse_from_vertex(response_dict)
2150
2068
 
2151
2069
  else:
2152
- response_dict = _DeleteCachedContentResponse_from_mldev(
2153
- self._api_client, response_dict
2154
- )
2070
+ response_dict = _DeleteCachedContentResponse_from_mldev(response_dict)
2155
2071
 
2156
2072
  return_value = types.DeleteCachedContentResponse._from_response(
2157
2073
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -2218,17 +2134,17 @@ class AsyncCaches(_api_module.BaseModule):
2218
2134
  request_dict = _common.convert_to_dict(request_dict)
2219
2135
  request_dict = _common.encode_unserializable_types(request_dict)
2220
2136
 
2221
- response_dict = await self._api_client.async_request(
2137
+ response = await self._api_client.async_request(
2222
2138
  'patch', path, request_dict, http_options
2223
2139
  )
2224
2140
 
2141
+ response_dict = '' if not response.body else json.loads(response.body)
2142
+
2225
2143
  if self._api_client.vertexai:
2226
- response_dict = _CachedContent_from_vertex(
2227
- self._api_client, response_dict
2228
- )
2144
+ response_dict = _CachedContent_from_vertex(response_dict)
2229
2145
 
2230
2146
  else:
2231
- response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
2147
+ response_dict = _CachedContent_from_mldev(response_dict)
2232
2148
 
2233
2149
  return_value = types.CachedContent._from_response(
2234
2150
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -2255,18 +2171,14 @@ class AsyncCaches(_api_module.BaseModule):
2255
2171
  request_url_dict: Optional[dict[str, str]]
2256
2172
 
2257
2173
  if self._api_client.vertexai:
2258
- request_dict = _ListCachedContentsParameters_to_vertex(
2259
- self._api_client, parameter_model
2260
- )
2174
+ request_dict = _ListCachedContentsParameters_to_vertex(parameter_model)
2261
2175
  request_url_dict = request_dict.get('_url')
2262
2176
  if request_url_dict:
2263
2177
  path = 'cachedContents'.format_map(request_url_dict)
2264
2178
  else:
2265
2179
  path = 'cachedContents'
2266
2180
  else:
2267
- request_dict = _ListCachedContentsParameters_to_mldev(
2268
- self._api_client, parameter_model
2269
- )
2181
+ request_dict = _ListCachedContentsParameters_to_mldev(parameter_model)
2270
2182
  request_url_dict = request_dict.get('_url')
2271
2183
  if request_url_dict:
2272
2184
  path = 'cachedContents'.format_map(request_url_dict)
@@ -2288,19 +2200,17 @@ class AsyncCaches(_api_module.BaseModule):
2288
2200
  request_dict = _common.convert_to_dict(request_dict)
2289
2201
  request_dict = _common.encode_unserializable_types(request_dict)
2290
2202
 
2291
- response_dict = await self._api_client.async_request(
2203
+ response = await self._api_client.async_request(
2292
2204
  'get', path, request_dict, http_options
2293
2205
  )
2294
2206
 
2207
+ response_dict = '' if not response.body else json.loads(response.body)
2208
+
2295
2209
  if self._api_client.vertexai:
2296
- response_dict = _ListCachedContentsResponse_from_vertex(
2297
- self._api_client, response_dict
2298
- )
2210
+ response_dict = _ListCachedContentsResponse_from_vertex(response_dict)
2299
2211
 
2300
2212
  else:
2301
- response_dict = _ListCachedContentsResponse_from_mldev(
2302
- self._api_client, response_dict
2303
- )
2213
+ response_dict = _ListCachedContentsResponse_from_mldev(response_dict)
2304
2214
 
2305
2215
  return_value = types.ListCachedContentsResponse._from_response(
2306
2216
  response=response_dict, kwargs=parameter_model.model_dump()