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