google-genai 1.3.0__py3-none-any.whl → 1.5.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 +143 -69
- google/genai/_api_module.py +1 -1
- google/genai/_automatic_function_calling_util.py +15 -15
- google/genai/_common.py +6 -3
- google/genai/_extra_utils.py +62 -46
- google/genai/_replay_api_client.py +73 -4
- google/genai/_test_api_client.py +8 -8
- google/genai/_transformers.py +194 -66
- google/genai/batches.py +180 -134
- google/genai/caches.py +316 -216
- google/genai/chats.py +179 -35
- google/genai/client.py +3 -3
- google/genai/errors.py +1 -2
- google/genai/files.py +175 -119
- google/genai/live.py +73 -64
- google/genai/models.py +898 -637
- google/genai/operations.py +96 -66
- google/genai/pagers.py +16 -7
- google/genai/tunings.py +172 -112
- google/genai/types.py +228 -178
- google/genai/version.py +1 -1
- {google_genai-1.3.0.dist-info → google_genai-1.5.0.dist-info}/METADATA +8 -1
- google_genai-1.5.0.dist-info/RECORD +27 -0
- {google_genai-1.3.0.dist-info → google_genai-1.5.0.dist-info}/WHEEL +1 -1
- google_genai-1.3.0.dist-info/RECORD +0 -27
- {google_genai-1.3.0.dist-info → google_genai-1.5.0.dist-info}/LICENSE +0 -0
- {google_genai-1.3.0.dist-info → google_genai-1.5.0.dist-info}/top_level.txt +0 -0
google/genai/caches.py
CHANGED
@@ -16,13 +16,13 @@
|
|
16
16
|
# Code generated by the Google Gen AI SDK generator DO NOT EDIT.
|
17
17
|
|
18
18
|
import logging
|
19
|
-
from typing import Optional, Union
|
19
|
+
from typing import Any, Optional, Union
|
20
20
|
from urllib.parse import urlencode
|
21
21
|
from . import _api_module
|
22
22
|
from . import _common
|
23
23
|
from . import _transformers as t
|
24
24
|
from . import types
|
25
|
-
from ._api_client import
|
25
|
+
from ._api_client import BaseApiClient
|
26
26
|
from ._common import get_value_by_path as getv
|
27
27
|
from ._common import set_value_by_path as setv
|
28
28
|
from .pagers import AsyncPager, Pager
|
@@ -31,11 +31,11 @@ logger = logging.getLogger('google_genai.caches')
|
|
31
31
|
|
32
32
|
|
33
33
|
def _Part_to_mldev(
|
34
|
-
api_client:
|
34
|
+
api_client: BaseApiClient,
|
35
35
|
from_object: Union[dict, object],
|
36
|
-
parent_object: dict = None,
|
36
|
+
parent_object: Optional[dict] = None,
|
37
37
|
) -> dict:
|
38
|
-
to_object = {}
|
38
|
+
to_object: dict[str, Any] = {}
|
39
39
|
if getv(from_object, ['video_metadata']) is not None:
|
40
40
|
raise ValueError('video_metadata parameter is not supported in Gemini API.')
|
41
41
|
|
@@ -75,11 +75,11 @@ def _Part_to_mldev(
|
|
75
75
|
|
76
76
|
|
77
77
|
def _Part_to_vertex(
|
78
|
-
api_client:
|
78
|
+
api_client: BaseApiClient,
|
79
79
|
from_object: Union[dict, object],
|
80
|
-
parent_object: dict = None,
|
80
|
+
parent_object: Optional[dict] = None,
|
81
81
|
) -> dict:
|
82
|
-
to_object = {}
|
82
|
+
to_object: dict[str, Any] = {}
|
83
83
|
if getv(from_object, ['video_metadata']) is not None:
|
84
84
|
setv(to_object, ['videoMetadata'], getv(from_object, ['video_metadata']))
|
85
85
|
|
@@ -119,11 +119,11 @@ def _Part_to_vertex(
|
|
119
119
|
|
120
120
|
|
121
121
|
def _Content_to_mldev(
|
122
|
-
api_client:
|
122
|
+
api_client: BaseApiClient,
|
123
123
|
from_object: Union[dict, object],
|
124
|
-
parent_object: dict = None,
|
124
|
+
parent_object: Optional[dict] = None,
|
125
125
|
) -> dict:
|
126
|
-
to_object = {}
|
126
|
+
to_object: dict[str, Any] = {}
|
127
127
|
if getv(from_object, ['parts']) is not None:
|
128
128
|
setv(
|
129
129
|
to_object,
|
@@ -141,11 +141,11 @@ def _Content_to_mldev(
|
|
141
141
|
|
142
142
|
|
143
143
|
def _Content_to_vertex(
|
144
|
-
api_client:
|
144
|
+
api_client: BaseApiClient,
|
145
145
|
from_object: Union[dict, object],
|
146
|
-
parent_object: dict = None,
|
146
|
+
parent_object: Optional[dict] = None,
|
147
147
|
) -> dict:
|
148
|
-
to_object = {}
|
148
|
+
to_object: dict[str, Any] = {}
|
149
149
|
if getv(from_object, ['parts']) is not None:
|
150
150
|
setv(
|
151
151
|
to_object,
|
@@ -163,24 +163,14 @@ def _Content_to_vertex(
|
|
163
163
|
|
164
164
|
|
165
165
|
def _Schema_to_mldev(
|
166
|
-
api_client:
|
166
|
+
api_client: BaseApiClient,
|
167
167
|
from_object: Union[dict, object],
|
168
|
-
parent_object: dict = None,
|
168
|
+
parent_object: Optional[dict] = None,
|
169
169
|
) -> dict:
|
170
|
-
to_object = {}
|
171
|
-
if getv(from_object, ['min_items']) is not None:
|
172
|
-
raise ValueError('min_items parameter is not supported in Gemini API.')
|
173
|
-
|
170
|
+
to_object: dict[str, Any] = {}
|
174
171
|
if getv(from_object, ['example']) is not None:
|
175
172
|
raise ValueError('example parameter is not supported in Gemini API.')
|
176
173
|
|
177
|
-
if getv(from_object, ['property_ordering']) is not None:
|
178
|
-
setv(
|
179
|
-
to_object,
|
180
|
-
['propertyOrdering'],
|
181
|
-
getv(from_object, ['property_ordering']),
|
182
|
-
)
|
183
|
-
|
184
174
|
if getv(from_object, ['pattern']) is not None:
|
185
175
|
raise ValueError('pattern parameter is not supported in Gemini API.')
|
186
176
|
|
@@ -205,21 +195,12 @@ def _Schema_to_mldev(
|
|
205
195
|
if getv(from_object, ['min_properties']) is not None:
|
206
196
|
raise ValueError('min_properties parameter is not supported in Gemini API.')
|
207
197
|
|
208
|
-
if getv(from_object, ['max_items']) is not None:
|
209
|
-
raise ValueError('max_items parameter is not supported in Gemini API.')
|
210
|
-
|
211
198
|
if getv(from_object, ['maximum']) is not None:
|
212
199
|
raise ValueError('maximum parameter is not supported in Gemini API.')
|
213
200
|
|
214
|
-
if getv(from_object, ['nullable']) is not None:
|
215
|
-
raise ValueError('nullable parameter is not supported in Gemini API.')
|
216
|
-
|
217
201
|
if getv(from_object, ['max_properties']) is not None:
|
218
202
|
raise ValueError('max_properties parameter is not supported in Gemini API.')
|
219
203
|
|
220
|
-
if getv(from_object, ['type']) is not None:
|
221
|
-
setv(to_object, ['type'], getv(from_object, ['type']))
|
222
|
-
|
223
204
|
if getv(from_object, ['description']) is not None:
|
224
205
|
setv(to_object, ['description'], getv(from_object, ['description']))
|
225
206
|
|
@@ -232,34 +213,43 @@ def _Schema_to_mldev(
|
|
232
213
|
if getv(from_object, ['items']) is not None:
|
233
214
|
setv(to_object, ['items'], getv(from_object, ['items']))
|
234
215
|
|
216
|
+
if getv(from_object, ['max_items']) is not None:
|
217
|
+
setv(to_object, ['maxItems'], getv(from_object, ['max_items']))
|
218
|
+
|
219
|
+
if getv(from_object, ['min_items']) is not None:
|
220
|
+
setv(to_object, ['minItems'], getv(from_object, ['min_items']))
|
221
|
+
|
222
|
+
if getv(from_object, ['nullable']) is not None:
|
223
|
+
setv(to_object, ['nullable'], getv(from_object, ['nullable']))
|
224
|
+
|
235
225
|
if getv(from_object, ['properties']) is not None:
|
236
226
|
setv(to_object, ['properties'], getv(from_object, ['properties']))
|
237
227
|
|
228
|
+
if getv(from_object, ['property_ordering']) is not None:
|
229
|
+
setv(
|
230
|
+
to_object,
|
231
|
+
['propertyOrdering'],
|
232
|
+
getv(from_object, ['property_ordering']),
|
233
|
+
)
|
234
|
+
|
238
235
|
if getv(from_object, ['required']) is not None:
|
239
236
|
setv(to_object, ['required'], getv(from_object, ['required']))
|
240
237
|
|
238
|
+
if getv(from_object, ['type']) is not None:
|
239
|
+
setv(to_object, ['type'], getv(from_object, ['type']))
|
240
|
+
|
241
241
|
return to_object
|
242
242
|
|
243
243
|
|
244
244
|
def _Schema_to_vertex(
|
245
|
-
api_client:
|
245
|
+
api_client: BaseApiClient,
|
246
246
|
from_object: Union[dict, object],
|
247
|
-
parent_object: dict = None,
|
247
|
+
parent_object: Optional[dict] = None,
|
248
248
|
) -> dict:
|
249
|
-
to_object = {}
|
250
|
-
if getv(from_object, ['min_items']) is not None:
|
251
|
-
setv(to_object, ['minItems'], getv(from_object, ['min_items']))
|
252
|
-
|
249
|
+
to_object: dict[str, Any] = {}
|
253
250
|
if getv(from_object, ['example']) is not None:
|
254
251
|
setv(to_object, ['example'], getv(from_object, ['example']))
|
255
252
|
|
256
|
-
if getv(from_object, ['property_ordering']) is not None:
|
257
|
-
setv(
|
258
|
-
to_object,
|
259
|
-
['propertyOrdering'],
|
260
|
-
getv(from_object, ['property_ordering']),
|
261
|
-
)
|
262
|
-
|
263
253
|
if getv(from_object, ['pattern']) is not None:
|
264
254
|
setv(to_object, ['pattern'], getv(from_object, ['pattern']))
|
265
255
|
|
@@ -284,21 +274,12 @@ def _Schema_to_vertex(
|
|
284
274
|
if getv(from_object, ['min_properties']) is not None:
|
285
275
|
setv(to_object, ['minProperties'], getv(from_object, ['min_properties']))
|
286
276
|
|
287
|
-
if getv(from_object, ['max_items']) is not None:
|
288
|
-
setv(to_object, ['maxItems'], getv(from_object, ['max_items']))
|
289
|
-
|
290
277
|
if getv(from_object, ['maximum']) is not None:
|
291
278
|
setv(to_object, ['maximum'], getv(from_object, ['maximum']))
|
292
279
|
|
293
|
-
if getv(from_object, ['nullable']) is not None:
|
294
|
-
setv(to_object, ['nullable'], getv(from_object, ['nullable']))
|
295
|
-
|
296
280
|
if getv(from_object, ['max_properties']) is not None:
|
297
281
|
setv(to_object, ['maxProperties'], getv(from_object, ['max_properties']))
|
298
282
|
|
299
|
-
if getv(from_object, ['type']) is not None:
|
300
|
-
setv(to_object, ['type'], getv(from_object, ['type']))
|
301
|
-
|
302
283
|
if getv(from_object, ['description']) is not None:
|
303
284
|
setv(to_object, ['description'], getv(from_object, ['description']))
|
304
285
|
|
@@ -311,21 +292,40 @@ def _Schema_to_vertex(
|
|
311
292
|
if getv(from_object, ['items']) is not None:
|
312
293
|
setv(to_object, ['items'], getv(from_object, ['items']))
|
313
294
|
|
295
|
+
if getv(from_object, ['max_items']) is not None:
|
296
|
+
setv(to_object, ['maxItems'], getv(from_object, ['max_items']))
|
297
|
+
|
298
|
+
if getv(from_object, ['min_items']) is not None:
|
299
|
+
setv(to_object, ['minItems'], getv(from_object, ['min_items']))
|
300
|
+
|
301
|
+
if getv(from_object, ['nullable']) is not None:
|
302
|
+
setv(to_object, ['nullable'], getv(from_object, ['nullable']))
|
303
|
+
|
314
304
|
if getv(from_object, ['properties']) is not None:
|
315
305
|
setv(to_object, ['properties'], getv(from_object, ['properties']))
|
316
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
|
+
|
317
314
|
if getv(from_object, ['required']) is not None:
|
318
315
|
setv(to_object, ['required'], getv(from_object, ['required']))
|
319
316
|
|
317
|
+
if getv(from_object, ['type']) is not None:
|
318
|
+
setv(to_object, ['type'], getv(from_object, ['type']))
|
319
|
+
|
320
320
|
return to_object
|
321
321
|
|
322
322
|
|
323
323
|
def _FunctionDeclaration_to_mldev(
|
324
|
-
api_client:
|
324
|
+
api_client: BaseApiClient,
|
325
325
|
from_object: Union[dict, object],
|
326
|
-
parent_object: dict = None,
|
326
|
+
parent_object: Optional[dict] = None,
|
327
327
|
) -> dict:
|
328
|
-
to_object = {}
|
328
|
+
to_object: dict[str, Any] = {}
|
329
329
|
if getv(from_object, ['response']) is not None:
|
330
330
|
raise ValueError('response parameter is not supported in Gemini API.')
|
331
331
|
|
@@ -342,11 +342,11 @@ def _FunctionDeclaration_to_mldev(
|
|
342
342
|
|
343
343
|
|
344
344
|
def _FunctionDeclaration_to_vertex(
|
345
|
-
api_client:
|
345
|
+
api_client: BaseApiClient,
|
346
346
|
from_object: Union[dict, object],
|
347
|
-
parent_object: dict = None,
|
347
|
+
parent_object: Optional[dict] = None,
|
348
348
|
) -> dict:
|
349
|
-
to_object = {}
|
349
|
+
to_object: dict[str, Any] = {}
|
350
350
|
if getv(from_object, ['response']) is not None:
|
351
351
|
setv(
|
352
352
|
to_object,
|
@@ -369,31 +369,31 @@ def _FunctionDeclaration_to_vertex(
|
|
369
369
|
|
370
370
|
|
371
371
|
def _GoogleSearch_to_mldev(
|
372
|
-
api_client:
|
372
|
+
api_client: BaseApiClient,
|
373
373
|
from_object: Union[dict, object],
|
374
|
-
parent_object: dict = None,
|
374
|
+
parent_object: Optional[dict] = None,
|
375
375
|
) -> dict:
|
376
|
-
to_object = {}
|
376
|
+
to_object: dict[str, Any] = {}
|
377
377
|
|
378
378
|
return to_object
|
379
379
|
|
380
380
|
|
381
381
|
def _GoogleSearch_to_vertex(
|
382
|
-
api_client:
|
382
|
+
api_client: BaseApiClient,
|
383
383
|
from_object: Union[dict, object],
|
384
|
-
parent_object: dict = None,
|
384
|
+
parent_object: Optional[dict] = None,
|
385
385
|
) -> dict:
|
386
|
-
to_object = {}
|
386
|
+
to_object: dict[str, Any] = {}
|
387
387
|
|
388
388
|
return to_object
|
389
389
|
|
390
390
|
|
391
391
|
def _DynamicRetrievalConfig_to_mldev(
|
392
|
-
api_client:
|
392
|
+
api_client: BaseApiClient,
|
393
393
|
from_object: Union[dict, object],
|
394
|
-
parent_object: dict = None,
|
394
|
+
parent_object: Optional[dict] = None,
|
395
395
|
) -> dict:
|
396
|
-
to_object = {}
|
396
|
+
to_object: dict[str, Any] = {}
|
397
397
|
if getv(from_object, ['mode']) is not None:
|
398
398
|
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
399
399
|
|
@@ -408,11 +408,11 @@ def _DynamicRetrievalConfig_to_mldev(
|
|
408
408
|
|
409
409
|
|
410
410
|
def _DynamicRetrievalConfig_to_vertex(
|
411
|
-
api_client:
|
411
|
+
api_client: BaseApiClient,
|
412
412
|
from_object: Union[dict, object],
|
413
|
-
parent_object: dict = None,
|
413
|
+
parent_object: Optional[dict] = None,
|
414
414
|
) -> dict:
|
415
|
-
to_object = {}
|
415
|
+
to_object: dict[str, Any] = {}
|
416
416
|
if getv(from_object, ['mode']) is not None:
|
417
417
|
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
418
418
|
|
@@ -427,11 +427,11 @@ def _DynamicRetrievalConfig_to_vertex(
|
|
427
427
|
|
428
428
|
|
429
429
|
def _GoogleSearchRetrieval_to_mldev(
|
430
|
-
api_client:
|
430
|
+
api_client: BaseApiClient,
|
431
431
|
from_object: Union[dict, object],
|
432
|
-
parent_object: dict = None,
|
432
|
+
parent_object: Optional[dict] = None,
|
433
433
|
) -> dict:
|
434
|
-
to_object = {}
|
434
|
+
to_object: dict[str, Any] = {}
|
435
435
|
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
436
436
|
setv(
|
437
437
|
to_object,
|
@@ -447,11 +447,11 @@ def _GoogleSearchRetrieval_to_mldev(
|
|
447
447
|
|
448
448
|
|
449
449
|
def _GoogleSearchRetrieval_to_vertex(
|
450
|
-
api_client:
|
450
|
+
api_client: BaseApiClient,
|
451
451
|
from_object: Union[dict, object],
|
452
|
-
parent_object: dict = None,
|
452
|
+
parent_object: Optional[dict] = None,
|
453
453
|
) -> dict:
|
454
|
-
to_object = {}
|
454
|
+
to_object: dict[str, Any] = {}
|
455
455
|
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
456
456
|
setv(
|
457
457
|
to_object,
|
@@ -467,11 +467,11 @@ def _GoogleSearchRetrieval_to_vertex(
|
|
467
467
|
|
468
468
|
|
469
469
|
def _Tool_to_mldev(
|
470
|
-
api_client:
|
470
|
+
api_client: BaseApiClient,
|
471
471
|
from_object: Union[dict, object],
|
472
|
-
parent_object: dict = None,
|
472
|
+
parent_object: Optional[dict] = None,
|
473
473
|
) -> dict:
|
474
|
-
to_object = {}
|
474
|
+
to_object: dict[str, Any] = {}
|
475
475
|
if getv(from_object, ['function_declarations']) is not None:
|
476
476
|
setv(
|
477
477
|
to_object,
|
@@ -512,11 +512,11 @@ def _Tool_to_mldev(
|
|
512
512
|
|
513
513
|
|
514
514
|
def _Tool_to_vertex(
|
515
|
-
api_client:
|
515
|
+
api_client: BaseApiClient,
|
516
516
|
from_object: Union[dict, object],
|
517
|
-
parent_object: dict = None,
|
517
|
+
parent_object: Optional[dict] = None,
|
518
518
|
) -> dict:
|
519
|
-
to_object = {}
|
519
|
+
to_object: dict[str, Any] = {}
|
520
520
|
if getv(from_object, ['function_declarations']) is not None:
|
521
521
|
setv(
|
522
522
|
to_object,
|
@@ -557,11 +557,11 @@ def _Tool_to_vertex(
|
|
557
557
|
|
558
558
|
|
559
559
|
def _FunctionCallingConfig_to_mldev(
|
560
|
-
api_client:
|
560
|
+
api_client: BaseApiClient,
|
561
561
|
from_object: Union[dict, object],
|
562
|
-
parent_object: dict = None,
|
562
|
+
parent_object: Optional[dict] = None,
|
563
563
|
) -> dict:
|
564
|
-
to_object = {}
|
564
|
+
to_object: dict[str, Any] = {}
|
565
565
|
if getv(from_object, ['mode']) is not None:
|
566
566
|
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
567
567
|
|
@@ -576,11 +576,11 @@ def _FunctionCallingConfig_to_mldev(
|
|
576
576
|
|
577
577
|
|
578
578
|
def _FunctionCallingConfig_to_vertex(
|
579
|
-
api_client:
|
579
|
+
api_client: BaseApiClient,
|
580
580
|
from_object: Union[dict, object],
|
581
|
-
parent_object: dict = None,
|
581
|
+
parent_object: Optional[dict] = None,
|
582
582
|
) -> dict:
|
583
|
-
to_object = {}
|
583
|
+
to_object: dict[str, Any] = {}
|
584
584
|
if getv(from_object, ['mode']) is not None:
|
585
585
|
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
586
586
|
|
@@ -595,11 +595,11 @@ def _FunctionCallingConfig_to_vertex(
|
|
595
595
|
|
596
596
|
|
597
597
|
def _ToolConfig_to_mldev(
|
598
|
-
api_client:
|
598
|
+
api_client: BaseApiClient,
|
599
599
|
from_object: Union[dict, object],
|
600
|
-
parent_object: dict = None,
|
600
|
+
parent_object: Optional[dict] = None,
|
601
601
|
) -> dict:
|
602
|
-
to_object = {}
|
602
|
+
to_object: dict[str, Any] = {}
|
603
603
|
if getv(from_object, ['function_calling_config']) is not None:
|
604
604
|
setv(
|
605
605
|
to_object,
|
@@ -615,11 +615,11 @@ def _ToolConfig_to_mldev(
|
|
615
615
|
|
616
616
|
|
617
617
|
def _ToolConfig_to_vertex(
|
618
|
-
api_client:
|
618
|
+
api_client: BaseApiClient,
|
619
619
|
from_object: Union[dict, object],
|
620
|
-
parent_object: dict = None,
|
620
|
+
parent_object: Optional[dict] = None,
|
621
621
|
) -> dict:
|
622
|
-
to_object = {}
|
622
|
+
to_object: dict[str, Any] = {}
|
623
623
|
if getv(from_object, ['function_calling_config']) is not None:
|
624
624
|
setv(
|
625
625
|
to_object,
|
@@ -635,11 +635,11 @@ def _ToolConfig_to_vertex(
|
|
635
635
|
|
636
636
|
|
637
637
|
def _CreateCachedContentConfig_to_mldev(
|
638
|
-
api_client:
|
638
|
+
api_client: BaseApiClient,
|
639
639
|
from_object: Union[dict, object],
|
640
|
-
parent_object: dict = None,
|
640
|
+
parent_object: Optional[dict] = None,
|
641
641
|
) -> dict:
|
642
|
-
to_object = {}
|
642
|
+
to_object: dict[str, Any] = {}
|
643
643
|
|
644
644
|
if getv(from_object, ['ttl']) is not None:
|
645
645
|
setv(parent_object, ['ttl'], getv(from_object, ['ttl']))
|
@@ -696,11 +696,11 @@ def _CreateCachedContentConfig_to_mldev(
|
|
696
696
|
|
697
697
|
|
698
698
|
def _CreateCachedContentConfig_to_vertex(
|
699
|
-
api_client:
|
699
|
+
api_client: BaseApiClient,
|
700
700
|
from_object: Union[dict, object],
|
701
|
-
parent_object: dict = None,
|
701
|
+
parent_object: Optional[dict] = None,
|
702
702
|
) -> dict:
|
703
|
-
to_object = {}
|
703
|
+
to_object: dict[str, Any] = {}
|
704
704
|
|
705
705
|
if getv(from_object, ['ttl']) is not None:
|
706
706
|
setv(parent_object, ['ttl'], getv(from_object, ['ttl']))
|
@@ -757,11 +757,11 @@ def _CreateCachedContentConfig_to_vertex(
|
|
757
757
|
|
758
758
|
|
759
759
|
def _CreateCachedContentParameters_to_mldev(
|
760
|
-
api_client:
|
760
|
+
api_client: BaseApiClient,
|
761
761
|
from_object: Union[dict, object],
|
762
|
-
parent_object: dict = None,
|
762
|
+
parent_object: Optional[dict] = None,
|
763
763
|
) -> dict:
|
764
|
-
to_object = {}
|
764
|
+
to_object: dict[str, Any] = {}
|
765
765
|
if getv(from_object, ['model']) is not None:
|
766
766
|
setv(
|
767
767
|
to_object,
|
@@ -782,11 +782,11 @@ def _CreateCachedContentParameters_to_mldev(
|
|
782
782
|
|
783
783
|
|
784
784
|
def _CreateCachedContentParameters_to_vertex(
|
785
|
-
api_client:
|
785
|
+
api_client: BaseApiClient,
|
786
786
|
from_object: Union[dict, object],
|
787
|
-
parent_object: dict = None,
|
787
|
+
parent_object: Optional[dict] = None,
|
788
788
|
) -> dict:
|
789
|
-
to_object = {}
|
789
|
+
to_object: dict[str, Any] = {}
|
790
790
|
if getv(from_object, ['model']) is not None:
|
791
791
|
setv(
|
792
792
|
to_object,
|
@@ -807,11 +807,11 @@ def _CreateCachedContentParameters_to_vertex(
|
|
807
807
|
|
808
808
|
|
809
809
|
def _GetCachedContentParameters_to_mldev(
|
810
|
-
api_client:
|
810
|
+
api_client: BaseApiClient,
|
811
811
|
from_object: Union[dict, object],
|
812
|
-
parent_object: dict = None,
|
812
|
+
parent_object: Optional[dict] = None,
|
813
813
|
) -> dict:
|
814
|
-
to_object = {}
|
814
|
+
to_object: dict[str, Any] = {}
|
815
815
|
if getv(from_object, ['name']) is not None:
|
816
816
|
setv(
|
817
817
|
to_object,
|
@@ -826,11 +826,11 @@ def _GetCachedContentParameters_to_mldev(
|
|
826
826
|
|
827
827
|
|
828
828
|
def _GetCachedContentParameters_to_vertex(
|
829
|
-
api_client:
|
829
|
+
api_client: BaseApiClient,
|
830
830
|
from_object: Union[dict, object],
|
831
|
-
parent_object: dict = None,
|
831
|
+
parent_object: Optional[dict] = None,
|
832
832
|
) -> dict:
|
833
|
-
to_object = {}
|
833
|
+
to_object: dict[str, Any] = {}
|
834
834
|
if getv(from_object, ['name']) is not None:
|
835
835
|
setv(
|
836
836
|
to_object,
|
@@ -845,11 +845,11 @@ def _GetCachedContentParameters_to_vertex(
|
|
845
845
|
|
846
846
|
|
847
847
|
def _DeleteCachedContentParameters_to_mldev(
|
848
|
-
api_client:
|
848
|
+
api_client: BaseApiClient,
|
849
849
|
from_object: Union[dict, object],
|
850
|
-
parent_object: dict = None,
|
850
|
+
parent_object: Optional[dict] = None,
|
851
851
|
) -> dict:
|
852
|
-
to_object = {}
|
852
|
+
to_object: dict[str, Any] = {}
|
853
853
|
if getv(from_object, ['name']) is not None:
|
854
854
|
setv(
|
855
855
|
to_object,
|
@@ -864,11 +864,11 @@ def _DeleteCachedContentParameters_to_mldev(
|
|
864
864
|
|
865
865
|
|
866
866
|
def _DeleteCachedContentParameters_to_vertex(
|
867
|
-
api_client:
|
867
|
+
api_client: BaseApiClient,
|
868
868
|
from_object: Union[dict, object],
|
869
|
-
parent_object: dict = None,
|
869
|
+
parent_object: Optional[dict] = None,
|
870
870
|
) -> dict:
|
871
|
-
to_object = {}
|
871
|
+
to_object: dict[str, Any] = {}
|
872
872
|
if getv(from_object, ['name']) is not None:
|
873
873
|
setv(
|
874
874
|
to_object,
|
@@ -883,11 +883,11 @@ def _DeleteCachedContentParameters_to_vertex(
|
|
883
883
|
|
884
884
|
|
885
885
|
def _UpdateCachedContentConfig_to_mldev(
|
886
|
-
api_client:
|
886
|
+
api_client: BaseApiClient,
|
887
887
|
from_object: Union[dict, object],
|
888
|
-
parent_object: dict = None,
|
888
|
+
parent_object: Optional[dict] = None,
|
889
889
|
) -> dict:
|
890
|
-
to_object = {}
|
890
|
+
to_object: dict[str, Any] = {}
|
891
891
|
|
892
892
|
if getv(from_object, ['ttl']) is not None:
|
893
893
|
setv(parent_object, ['ttl'], getv(from_object, ['ttl']))
|
@@ -899,11 +899,11 @@ def _UpdateCachedContentConfig_to_mldev(
|
|
899
899
|
|
900
900
|
|
901
901
|
def _UpdateCachedContentConfig_to_vertex(
|
902
|
-
api_client:
|
902
|
+
api_client: BaseApiClient,
|
903
903
|
from_object: Union[dict, object],
|
904
|
-
parent_object: dict = None,
|
904
|
+
parent_object: Optional[dict] = None,
|
905
905
|
) -> dict:
|
906
|
-
to_object = {}
|
906
|
+
to_object: dict[str, Any] = {}
|
907
907
|
|
908
908
|
if getv(from_object, ['ttl']) is not None:
|
909
909
|
setv(parent_object, ['ttl'], getv(from_object, ['ttl']))
|
@@ -915,11 +915,11 @@ def _UpdateCachedContentConfig_to_vertex(
|
|
915
915
|
|
916
916
|
|
917
917
|
def _UpdateCachedContentParameters_to_mldev(
|
918
|
-
api_client:
|
918
|
+
api_client: BaseApiClient,
|
919
919
|
from_object: Union[dict, object],
|
920
|
-
parent_object: dict = None,
|
920
|
+
parent_object: Optional[dict] = None,
|
921
921
|
) -> dict:
|
922
|
-
to_object = {}
|
922
|
+
to_object: dict[str, Any] = {}
|
923
923
|
if getv(from_object, ['name']) is not None:
|
924
924
|
setv(
|
925
925
|
to_object,
|
@@ -940,11 +940,11 @@ def _UpdateCachedContentParameters_to_mldev(
|
|
940
940
|
|
941
941
|
|
942
942
|
def _UpdateCachedContentParameters_to_vertex(
|
943
|
-
api_client:
|
943
|
+
api_client: BaseApiClient,
|
944
944
|
from_object: Union[dict, object],
|
945
|
-
parent_object: dict = None,
|
945
|
+
parent_object: Optional[dict] = None,
|
946
946
|
) -> dict:
|
947
|
-
to_object = {}
|
947
|
+
to_object: dict[str, Any] = {}
|
948
948
|
if getv(from_object, ['name']) is not None:
|
949
949
|
setv(
|
950
950
|
to_object,
|
@@ -965,11 +965,11 @@ def _UpdateCachedContentParameters_to_vertex(
|
|
965
965
|
|
966
966
|
|
967
967
|
def _ListCachedContentsConfig_to_mldev(
|
968
|
-
api_client:
|
968
|
+
api_client: BaseApiClient,
|
969
969
|
from_object: Union[dict, object],
|
970
|
-
parent_object: dict = None,
|
970
|
+
parent_object: Optional[dict] = None,
|
971
971
|
) -> dict:
|
972
|
-
to_object = {}
|
972
|
+
to_object: dict[str, Any] = {}
|
973
973
|
|
974
974
|
if getv(from_object, ['page_size']) is not None:
|
975
975
|
setv(
|
@@ -987,11 +987,11 @@ def _ListCachedContentsConfig_to_mldev(
|
|
987
987
|
|
988
988
|
|
989
989
|
def _ListCachedContentsConfig_to_vertex(
|
990
|
-
api_client:
|
990
|
+
api_client: BaseApiClient,
|
991
991
|
from_object: Union[dict, object],
|
992
|
-
parent_object: dict = None,
|
992
|
+
parent_object: Optional[dict] = None,
|
993
993
|
) -> dict:
|
994
|
-
to_object = {}
|
994
|
+
to_object: dict[str, Any] = {}
|
995
995
|
|
996
996
|
if getv(from_object, ['page_size']) is not None:
|
997
997
|
setv(
|
@@ -1009,11 +1009,11 @@ def _ListCachedContentsConfig_to_vertex(
|
|
1009
1009
|
|
1010
1010
|
|
1011
1011
|
def _ListCachedContentsParameters_to_mldev(
|
1012
|
-
api_client:
|
1012
|
+
api_client: BaseApiClient,
|
1013
1013
|
from_object: Union[dict, object],
|
1014
|
-
parent_object: dict = None,
|
1014
|
+
parent_object: Optional[dict] = None,
|
1015
1015
|
) -> dict:
|
1016
|
-
to_object = {}
|
1016
|
+
to_object: dict[str, Any] = {}
|
1017
1017
|
if getv(from_object, ['config']) is not None:
|
1018
1018
|
setv(
|
1019
1019
|
to_object,
|
@@ -1027,11 +1027,11 @@ def _ListCachedContentsParameters_to_mldev(
|
|
1027
1027
|
|
1028
1028
|
|
1029
1029
|
def _ListCachedContentsParameters_to_vertex(
|
1030
|
-
api_client:
|
1030
|
+
api_client: BaseApiClient,
|
1031
1031
|
from_object: Union[dict, object],
|
1032
|
-
parent_object: dict = None,
|
1032
|
+
parent_object: Optional[dict] = None,
|
1033
1033
|
) -> dict:
|
1034
|
-
to_object = {}
|
1034
|
+
to_object: dict[str, Any] = {}
|
1035
1035
|
if getv(from_object, ['config']) is not None:
|
1036
1036
|
setv(
|
1037
1037
|
to_object,
|
@@ -1045,11 +1045,11 @@ def _ListCachedContentsParameters_to_vertex(
|
|
1045
1045
|
|
1046
1046
|
|
1047
1047
|
def _CachedContent_from_mldev(
|
1048
|
-
api_client:
|
1048
|
+
api_client: BaseApiClient,
|
1049
1049
|
from_object: Union[dict, object],
|
1050
|
-
parent_object: dict = None,
|
1050
|
+
parent_object: Optional[dict] = None,
|
1051
1051
|
) -> dict:
|
1052
|
-
to_object = {}
|
1052
|
+
to_object: dict[str, Any] = {}
|
1053
1053
|
if getv(from_object, ['name']) is not None:
|
1054
1054
|
setv(to_object, ['name'], getv(from_object, ['name']))
|
1055
1055
|
|
@@ -1075,11 +1075,11 @@ def _CachedContent_from_mldev(
|
|
1075
1075
|
|
1076
1076
|
|
1077
1077
|
def _CachedContent_from_vertex(
|
1078
|
-
api_client:
|
1078
|
+
api_client: BaseApiClient,
|
1079
1079
|
from_object: Union[dict, object],
|
1080
|
-
parent_object: dict = None,
|
1080
|
+
parent_object: Optional[dict] = None,
|
1081
1081
|
) -> dict:
|
1082
|
-
to_object = {}
|
1082
|
+
to_object: dict[str, Any] = {}
|
1083
1083
|
if getv(from_object, ['name']) is not None:
|
1084
1084
|
setv(to_object, ['name'], getv(from_object, ['name']))
|
1085
1085
|
|
@@ -1105,31 +1105,31 @@ def _CachedContent_from_vertex(
|
|
1105
1105
|
|
1106
1106
|
|
1107
1107
|
def _DeleteCachedContentResponse_from_mldev(
|
1108
|
-
api_client:
|
1108
|
+
api_client: BaseApiClient,
|
1109
1109
|
from_object: Union[dict, object],
|
1110
|
-
parent_object: dict = None,
|
1110
|
+
parent_object: Optional[dict] = None,
|
1111
1111
|
) -> dict:
|
1112
|
-
to_object = {}
|
1112
|
+
to_object: dict[str, Any] = {}
|
1113
1113
|
|
1114
1114
|
return to_object
|
1115
1115
|
|
1116
1116
|
|
1117
1117
|
def _DeleteCachedContentResponse_from_vertex(
|
1118
|
-
api_client:
|
1118
|
+
api_client: BaseApiClient,
|
1119
1119
|
from_object: Union[dict, object],
|
1120
|
-
parent_object: dict = None,
|
1120
|
+
parent_object: Optional[dict] = None,
|
1121
1121
|
) -> dict:
|
1122
|
-
to_object = {}
|
1122
|
+
to_object: dict[str, Any] = {}
|
1123
1123
|
|
1124
1124
|
return to_object
|
1125
1125
|
|
1126
1126
|
|
1127
1127
|
def _ListCachedContentsResponse_from_mldev(
|
1128
|
-
api_client:
|
1128
|
+
api_client: BaseApiClient,
|
1129
1129
|
from_object: Union[dict, object],
|
1130
|
-
parent_object: dict = None,
|
1130
|
+
parent_object: Optional[dict] = None,
|
1131
1131
|
) -> dict:
|
1132
|
-
to_object = {}
|
1132
|
+
to_object: dict[str, Any] = {}
|
1133
1133
|
if getv(from_object, ['nextPageToken']) is not None:
|
1134
1134
|
setv(to_object, ['next_page_token'], getv(from_object, ['nextPageToken']))
|
1135
1135
|
|
@@ -1147,11 +1147,11 @@ def _ListCachedContentsResponse_from_mldev(
|
|
1147
1147
|
|
1148
1148
|
|
1149
1149
|
def _ListCachedContentsResponse_from_vertex(
|
1150
|
-
api_client:
|
1150
|
+
api_client: BaseApiClient,
|
1151
1151
|
from_object: Union[dict, object],
|
1152
|
-
parent_object: dict = None,
|
1152
|
+
parent_object: Optional[dict] = None,
|
1153
1153
|
) -> dict:
|
1154
|
-
to_object = {}
|
1154
|
+
to_object: dict[str, Any] = {}
|
1155
1155
|
if getv(from_object, ['nextPageToken']) is not None:
|
1156
1156
|
setv(to_object, ['next_page_token'], getv(from_object, ['nextPageToken']))
|
1157
1157
|
|
@@ -1202,26 +1202,36 @@ class Caches(_api_module.BaseModule):
|
|
1202
1202
|
config=config,
|
1203
1203
|
)
|
1204
1204
|
|
1205
|
+
request_url_dict: Optional[dict[str, str]]
|
1206
|
+
|
1205
1207
|
if self._api_client.vertexai:
|
1206
1208
|
request_dict = _CreateCachedContentParameters_to_vertex(
|
1207
1209
|
self._api_client, parameter_model
|
1208
1210
|
)
|
1209
|
-
|
1211
|
+
request_url_dict = request_dict.get('_url')
|
1212
|
+
if request_url_dict:
|
1213
|
+
path = 'cachedContents'.format_map(request_url_dict)
|
1214
|
+
else:
|
1215
|
+
path = 'cachedContents'
|
1210
1216
|
else:
|
1211
1217
|
request_dict = _CreateCachedContentParameters_to_mldev(
|
1212
1218
|
self._api_client, parameter_model
|
1213
1219
|
)
|
1214
|
-
|
1220
|
+
request_url_dict = request_dict.get('_url')
|
1221
|
+
if request_url_dict:
|
1222
|
+
path = 'cachedContents'.format_map(request_url_dict)
|
1223
|
+
else:
|
1224
|
+
path = 'cachedContents'
|
1215
1225
|
query_params = request_dict.get('_query')
|
1216
1226
|
if query_params:
|
1217
1227
|
path = f'{path}?{urlencode(query_params)}'
|
1218
1228
|
# TODO: remove the hack that pops config.
|
1219
1229
|
request_dict.pop('config', None)
|
1220
1230
|
|
1221
|
-
http_options = None
|
1231
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1222
1232
|
if isinstance(config, dict):
|
1223
1233
|
http_options = config.get('http_options', None)
|
1224
|
-
elif hasattr(config, 'http_options'):
|
1234
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1225
1235
|
http_options = config.http_options
|
1226
1236
|
|
1227
1237
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1239,7 +1249,7 @@ class Caches(_api_module.BaseModule):
|
|
1239
1249
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1240
1250
|
|
1241
1251
|
return_value = types.CachedContent._from_response(
|
1242
|
-
response=response_dict, kwargs=parameter_model
|
1252
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1243
1253
|
)
|
1244
1254
|
self._api_client._verify_response(return_value)
|
1245
1255
|
return return_value
|
@@ -1262,26 +1272,36 @@ class Caches(_api_module.BaseModule):
|
|
1262
1272
|
config=config,
|
1263
1273
|
)
|
1264
1274
|
|
1275
|
+
request_url_dict: Optional[dict[str, str]]
|
1276
|
+
|
1265
1277
|
if self._api_client.vertexai:
|
1266
1278
|
request_dict = _GetCachedContentParameters_to_vertex(
|
1267
1279
|
self._api_client, parameter_model
|
1268
1280
|
)
|
1269
|
-
|
1281
|
+
request_url_dict = request_dict.get('_url')
|
1282
|
+
if request_url_dict:
|
1283
|
+
path = '{name}'.format_map(request_url_dict)
|
1284
|
+
else:
|
1285
|
+
path = '{name}'
|
1270
1286
|
else:
|
1271
1287
|
request_dict = _GetCachedContentParameters_to_mldev(
|
1272
1288
|
self._api_client, parameter_model
|
1273
1289
|
)
|
1274
|
-
|
1290
|
+
request_url_dict = request_dict.get('_url')
|
1291
|
+
if request_url_dict:
|
1292
|
+
path = '{name}'.format_map(request_url_dict)
|
1293
|
+
else:
|
1294
|
+
path = '{name}'
|
1275
1295
|
query_params = request_dict.get('_query')
|
1276
1296
|
if query_params:
|
1277
1297
|
path = f'{path}?{urlencode(query_params)}'
|
1278
1298
|
# TODO: remove the hack that pops config.
|
1279
1299
|
request_dict.pop('config', None)
|
1280
1300
|
|
1281
|
-
http_options = None
|
1301
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1282
1302
|
if isinstance(config, dict):
|
1283
1303
|
http_options = config.get('http_options', None)
|
1284
|
-
elif hasattr(config, 'http_options'):
|
1304
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1285
1305
|
http_options = config.http_options
|
1286
1306
|
|
1287
1307
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1299,7 +1319,7 @@ class Caches(_api_module.BaseModule):
|
|
1299
1319
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1300
1320
|
|
1301
1321
|
return_value = types.CachedContent._from_response(
|
1302
|
-
response=response_dict, kwargs=parameter_model
|
1322
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1303
1323
|
)
|
1304
1324
|
self._api_client._verify_response(return_value)
|
1305
1325
|
return return_value
|
@@ -1324,26 +1344,36 @@ class Caches(_api_module.BaseModule):
|
|
1324
1344
|
config=config,
|
1325
1345
|
)
|
1326
1346
|
|
1347
|
+
request_url_dict: Optional[dict[str, str]]
|
1348
|
+
|
1327
1349
|
if self._api_client.vertexai:
|
1328
1350
|
request_dict = _DeleteCachedContentParameters_to_vertex(
|
1329
1351
|
self._api_client, parameter_model
|
1330
1352
|
)
|
1331
|
-
|
1353
|
+
request_url_dict = request_dict.get('_url')
|
1354
|
+
if request_url_dict:
|
1355
|
+
path = '{name}'.format_map(request_url_dict)
|
1356
|
+
else:
|
1357
|
+
path = '{name}'
|
1332
1358
|
else:
|
1333
1359
|
request_dict = _DeleteCachedContentParameters_to_mldev(
|
1334
1360
|
self._api_client, parameter_model
|
1335
1361
|
)
|
1336
|
-
|
1362
|
+
request_url_dict = request_dict.get('_url')
|
1363
|
+
if request_url_dict:
|
1364
|
+
path = '{name}'.format_map(request_url_dict)
|
1365
|
+
else:
|
1366
|
+
path = '{name}'
|
1337
1367
|
query_params = request_dict.get('_query')
|
1338
1368
|
if query_params:
|
1339
1369
|
path = f'{path}?{urlencode(query_params)}'
|
1340
1370
|
# TODO: remove the hack that pops config.
|
1341
1371
|
request_dict.pop('config', None)
|
1342
1372
|
|
1343
|
-
http_options = None
|
1373
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1344
1374
|
if isinstance(config, dict):
|
1345
1375
|
http_options = config.get('http_options', None)
|
1346
|
-
elif hasattr(config, 'http_options'):
|
1376
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1347
1377
|
http_options = config.http_options
|
1348
1378
|
|
1349
1379
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1363,7 +1393,7 @@ class Caches(_api_module.BaseModule):
|
|
1363
1393
|
)
|
1364
1394
|
|
1365
1395
|
return_value = types.DeleteCachedContentResponse._from_response(
|
1366
|
-
response=response_dict, kwargs=parameter_model
|
1396
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1367
1397
|
)
|
1368
1398
|
self._api_client._verify_response(return_value)
|
1369
1399
|
return return_value
|
@@ -1391,26 +1421,36 @@ class Caches(_api_module.BaseModule):
|
|
1391
1421
|
config=config,
|
1392
1422
|
)
|
1393
1423
|
|
1424
|
+
request_url_dict: Optional[dict[str, str]]
|
1425
|
+
|
1394
1426
|
if self._api_client.vertexai:
|
1395
1427
|
request_dict = _UpdateCachedContentParameters_to_vertex(
|
1396
1428
|
self._api_client, parameter_model
|
1397
1429
|
)
|
1398
|
-
|
1430
|
+
request_url_dict = request_dict.get('_url')
|
1431
|
+
if request_url_dict:
|
1432
|
+
path = '{name}'.format_map(request_url_dict)
|
1433
|
+
else:
|
1434
|
+
path = '{name}'
|
1399
1435
|
else:
|
1400
1436
|
request_dict = _UpdateCachedContentParameters_to_mldev(
|
1401
1437
|
self._api_client, parameter_model
|
1402
1438
|
)
|
1403
|
-
|
1439
|
+
request_url_dict = request_dict.get('_url')
|
1440
|
+
if request_url_dict:
|
1441
|
+
path = '{name}'.format_map(request_url_dict)
|
1442
|
+
else:
|
1443
|
+
path = '{name}'
|
1404
1444
|
query_params = request_dict.get('_query')
|
1405
1445
|
if query_params:
|
1406
1446
|
path = f'{path}?{urlencode(query_params)}'
|
1407
1447
|
# TODO: remove the hack that pops config.
|
1408
1448
|
request_dict.pop('config', None)
|
1409
1449
|
|
1410
|
-
http_options = None
|
1450
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1411
1451
|
if isinstance(config, dict):
|
1412
1452
|
http_options = config.get('http_options', None)
|
1413
|
-
elif hasattr(config, 'http_options'):
|
1453
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1414
1454
|
http_options = config.http_options
|
1415
1455
|
|
1416
1456
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1428,7 +1468,7 @@ class Caches(_api_module.BaseModule):
|
|
1428
1468
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1429
1469
|
|
1430
1470
|
return_value = types.CachedContent._from_response(
|
1431
|
-
response=response_dict, kwargs=parameter_model
|
1471
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1432
1472
|
)
|
1433
1473
|
self._api_client._verify_response(return_value)
|
1434
1474
|
return return_value
|
@@ -1449,26 +1489,36 @@ class Caches(_api_module.BaseModule):
|
|
1449
1489
|
config=config,
|
1450
1490
|
)
|
1451
1491
|
|
1492
|
+
request_url_dict: Optional[dict[str, str]]
|
1493
|
+
|
1452
1494
|
if self._api_client.vertexai:
|
1453
1495
|
request_dict = _ListCachedContentsParameters_to_vertex(
|
1454
1496
|
self._api_client, parameter_model
|
1455
1497
|
)
|
1456
|
-
|
1498
|
+
request_url_dict = request_dict.get('_url')
|
1499
|
+
if request_url_dict:
|
1500
|
+
path = 'cachedContents'.format_map(request_url_dict)
|
1501
|
+
else:
|
1502
|
+
path = 'cachedContents'
|
1457
1503
|
else:
|
1458
1504
|
request_dict = _ListCachedContentsParameters_to_mldev(
|
1459
1505
|
self._api_client, parameter_model
|
1460
1506
|
)
|
1461
|
-
|
1507
|
+
request_url_dict = request_dict.get('_url')
|
1508
|
+
if request_url_dict:
|
1509
|
+
path = 'cachedContents'.format_map(request_url_dict)
|
1510
|
+
else:
|
1511
|
+
path = 'cachedContents'
|
1462
1512
|
query_params = request_dict.get('_query')
|
1463
1513
|
if query_params:
|
1464
1514
|
path = f'{path}?{urlencode(query_params)}'
|
1465
1515
|
# TODO: remove the hack that pops config.
|
1466
1516
|
request_dict.pop('config', None)
|
1467
1517
|
|
1468
|
-
http_options = None
|
1518
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1469
1519
|
if isinstance(config, dict):
|
1470
1520
|
http_options = config.get('http_options', None)
|
1471
|
-
elif hasattr(config, 'http_options'):
|
1521
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1472
1522
|
http_options = config.http_options
|
1473
1523
|
|
1474
1524
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1488,7 +1538,7 @@ class Caches(_api_module.BaseModule):
|
|
1488
1538
|
)
|
1489
1539
|
|
1490
1540
|
return_value = types.ListCachedContentsResponse._from_response(
|
1491
|
-
response=response_dict, kwargs=parameter_model
|
1541
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1492
1542
|
)
|
1493
1543
|
self._api_client._verify_response(return_value)
|
1494
1544
|
return return_value
|
@@ -1538,26 +1588,36 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1538
1588
|
config=config,
|
1539
1589
|
)
|
1540
1590
|
|
1591
|
+
request_url_dict: Optional[dict[str, str]]
|
1592
|
+
|
1541
1593
|
if self._api_client.vertexai:
|
1542
1594
|
request_dict = _CreateCachedContentParameters_to_vertex(
|
1543
1595
|
self._api_client, parameter_model
|
1544
1596
|
)
|
1545
|
-
|
1597
|
+
request_url_dict = request_dict.get('_url')
|
1598
|
+
if request_url_dict:
|
1599
|
+
path = 'cachedContents'.format_map(request_url_dict)
|
1600
|
+
else:
|
1601
|
+
path = 'cachedContents'
|
1546
1602
|
else:
|
1547
1603
|
request_dict = _CreateCachedContentParameters_to_mldev(
|
1548
1604
|
self._api_client, parameter_model
|
1549
1605
|
)
|
1550
|
-
|
1606
|
+
request_url_dict = request_dict.get('_url')
|
1607
|
+
if request_url_dict:
|
1608
|
+
path = 'cachedContents'.format_map(request_url_dict)
|
1609
|
+
else:
|
1610
|
+
path = 'cachedContents'
|
1551
1611
|
query_params = request_dict.get('_query')
|
1552
1612
|
if query_params:
|
1553
1613
|
path = f'{path}?{urlencode(query_params)}'
|
1554
1614
|
# TODO: remove the hack that pops config.
|
1555
1615
|
request_dict.pop('config', None)
|
1556
1616
|
|
1557
|
-
http_options = None
|
1617
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1558
1618
|
if isinstance(config, dict):
|
1559
1619
|
http_options = config.get('http_options', None)
|
1560
|
-
elif hasattr(config, 'http_options'):
|
1620
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1561
1621
|
http_options = config.http_options
|
1562
1622
|
|
1563
1623
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1575,7 +1635,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1575
1635
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1576
1636
|
|
1577
1637
|
return_value = types.CachedContent._from_response(
|
1578
|
-
response=response_dict, kwargs=parameter_model
|
1638
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1579
1639
|
)
|
1580
1640
|
self._api_client._verify_response(return_value)
|
1581
1641
|
return return_value
|
@@ -1599,26 +1659,36 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1599
1659
|
config=config,
|
1600
1660
|
)
|
1601
1661
|
|
1662
|
+
request_url_dict: Optional[dict[str, str]]
|
1663
|
+
|
1602
1664
|
if self._api_client.vertexai:
|
1603
1665
|
request_dict = _GetCachedContentParameters_to_vertex(
|
1604
1666
|
self._api_client, parameter_model
|
1605
1667
|
)
|
1606
|
-
|
1668
|
+
request_url_dict = request_dict.get('_url')
|
1669
|
+
if request_url_dict:
|
1670
|
+
path = '{name}'.format_map(request_url_dict)
|
1671
|
+
else:
|
1672
|
+
path = '{name}'
|
1607
1673
|
else:
|
1608
1674
|
request_dict = _GetCachedContentParameters_to_mldev(
|
1609
1675
|
self._api_client, parameter_model
|
1610
1676
|
)
|
1611
|
-
|
1677
|
+
request_url_dict = request_dict.get('_url')
|
1678
|
+
if request_url_dict:
|
1679
|
+
path = '{name}'.format_map(request_url_dict)
|
1680
|
+
else:
|
1681
|
+
path = '{name}'
|
1612
1682
|
query_params = request_dict.get('_query')
|
1613
1683
|
if query_params:
|
1614
1684
|
path = f'{path}?{urlencode(query_params)}'
|
1615
1685
|
# TODO: remove the hack that pops config.
|
1616
1686
|
request_dict.pop('config', None)
|
1617
1687
|
|
1618
|
-
http_options = None
|
1688
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1619
1689
|
if isinstance(config, dict):
|
1620
1690
|
http_options = config.get('http_options', None)
|
1621
|
-
elif hasattr(config, 'http_options'):
|
1691
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1622
1692
|
http_options = config.http_options
|
1623
1693
|
|
1624
1694
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1636,7 +1706,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1636
1706
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1637
1707
|
|
1638
1708
|
return_value = types.CachedContent._from_response(
|
1639
|
-
response=response_dict, kwargs=parameter_model
|
1709
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1640
1710
|
)
|
1641
1711
|
self._api_client._verify_response(return_value)
|
1642
1712
|
return return_value
|
@@ -1662,26 +1732,36 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1662
1732
|
config=config,
|
1663
1733
|
)
|
1664
1734
|
|
1735
|
+
request_url_dict: Optional[dict[str, str]]
|
1736
|
+
|
1665
1737
|
if self._api_client.vertexai:
|
1666
1738
|
request_dict = _DeleteCachedContentParameters_to_vertex(
|
1667
1739
|
self._api_client, parameter_model
|
1668
1740
|
)
|
1669
|
-
|
1741
|
+
request_url_dict = request_dict.get('_url')
|
1742
|
+
if request_url_dict:
|
1743
|
+
path = '{name}'.format_map(request_url_dict)
|
1744
|
+
else:
|
1745
|
+
path = '{name}'
|
1670
1746
|
else:
|
1671
1747
|
request_dict = _DeleteCachedContentParameters_to_mldev(
|
1672
1748
|
self._api_client, parameter_model
|
1673
1749
|
)
|
1674
|
-
|
1750
|
+
request_url_dict = request_dict.get('_url')
|
1751
|
+
if request_url_dict:
|
1752
|
+
path = '{name}'.format_map(request_url_dict)
|
1753
|
+
else:
|
1754
|
+
path = '{name}'
|
1675
1755
|
query_params = request_dict.get('_query')
|
1676
1756
|
if query_params:
|
1677
1757
|
path = f'{path}?{urlencode(query_params)}'
|
1678
1758
|
# TODO: remove the hack that pops config.
|
1679
1759
|
request_dict.pop('config', None)
|
1680
1760
|
|
1681
|
-
http_options = None
|
1761
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1682
1762
|
if isinstance(config, dict):
|
1683
1763
|
http_options = config.get('http_options', None)
|
1684
|
-
elif hasattr(config, 'http_options'):
|
1764
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1685
1765
|
http_options = config.http_options
|
1686
1766
|
|
1687
1767
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1701,7 +1781,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1701
1781
|
)
|
1702
1782
|
|
1703
1783
|
return_value = types.DeleteCachedContentResponse._from_response(
|
1704
|
-
response=response_dict, kwargs=parameter_model
|
1784
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1705
1785
|
)
|
1706
1786
|
self._api_client._verify_response(return_value)
|
1707
1787
|
return return_value
|
@@ -1729,26 +1809,36 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1729
1809
|
config=config,
|
1730
1810
|
)
|
1731
1811
|
|
1812
|
+
request_url_dict: Optional[dict[str, str]]
|
1813
|
+
|
1732
1814
|
if self._api_client.vertexai:
|
1733
1815
|
request_dict = _UpdateCachedContentParameters_to_vertex(
|
1734
1816
|
self._api_client, parameter_model
|
1735
1817
|
)
|
1736
|
-
|
1818
|
+
request_url_dict = request_dict.get('_url')
|
1819
|
+
if request_url_dict:
|
1820
|
+
path = '{name}'.format_map(request_url_dict)
|
1821
|
+
else:
|
1822
|
+
path = '{name}'
|
1737
1823
|
else:
|
1738
1824
|
request_dict = _UpdateCachedContentParameters_to_mldev(
|
1739
1825
|
self._api_client, parameter_model
|
1740
1826
|
)
|
1741
|
-
|
1827
|
+
request_url_dict = request_dict.get('_url')
|
1828
|
+
if request_url_dict:
|
1829
|
+
path = '{name}'.format_map(request_url_dict)
|
1830
|
+
else:
|
1831
|
+
path = '{name}'
|
1742
1832
|
query_params = request_dict.get('_query')
|
1743
1833
|
if query_params:
|
1744
1834
|
path = f'{path}?{urlencode(query_params)}'
|
1745
1835
|
# TODO: remove the hack that pops config.
|
1746
1836
|
request_dict.pop('config', None)
|
1747
1837
|
|
1748
|
-
http_options = None
|
1838
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1749
1839
|
if isinstance(config, dict):
|
1750
1840
|
http_options = config.get('http_options', None)
|
1751
|
-
elif hasattr(config, 'http_options'):
|
1841
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1752
1842
|
http_options = config.http_options
|
1753
1843
|
|
1754
1844
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1766,7 +1856,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1766
1856
|
response_dict = _CachedContent_from_mldev(self._api_client, response_dict)
|
1767
1857
|
|
1768
1858
|
return_value = types.CachedContent._from_response(
|
1769
|
-
response=response_dict, kwargs=parameter_model
|
1859
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1770
1860
|
)
|
1771
1861
|
self._api_client._verify_response(return_value)
|
1772
1862
|
return return_value
|
@@ -1787,26 +1877,36 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1787
1877
|
config=config,
|
1788
1878
|
)
|
1789
1879
|
|
1880
|
+
request_url_dict: Optional[dict[str, str]]
|
1881
|
+
|
1790
1882
|
if self._api_client.vertexai:
|
1791
1883
|
request_dict = _ListCachedContentsParameters_to_vertex(
|
1792
1884
|
self._api_client, parameter_model
|
1793
1885
|
)
|
1794
|
-
|
1886
|
+
request_url_dict = request_dict.get('_url')
|
1887
|
+
if request_url_dict:
|
1888
|
+
path = 'cachedContents'.format_map(request_url_dict)
|
1889
|
+
else:
|
1890
|
+
path = 'cachedContents'
|
1795
1891
|
else:
|
1796
1892
|
request_dict = _ListCachedContentsParameters_to_mldev(
|
1797
1893
|
self._api_client, parameter_model
|
1798
1894
|
)
|
1799
|
-
|
1895
|
+
request_url_dict = request_dict.get('_url')
|
1896
|
+
if request_url_dict:
|
1897
|
+
path = 'cachedContents'.format_map(request_url_dict)
|
1898
|
+
else:
|
1899
|
+
path = 'cachedContents'
|
1800
1900
|
query_params = request_dict.get('_query')
|
1801
1901
|
if query_params:
|
1802
1902
|
path = f'{path}?{urlencode(query_params)}'
|
1803
1903
|
# TODO: remove the hack that pops config.
|
1804
1904
|
request_dict.pop('config', None)
|
1805
1905
|
|
1806
|
-
http_options = None
|
1906
|
+
http_options: Optional[types.HttpOptionsOrDict] = None
|
1807
1907
|
if isinstance(config, dict):
|
1808
1908
|
http_options = config.get('http_options', None)
|
1809
|
-
elif hasattr(config, 'http_options'):
|
1909
|
+
elif hasattr(config, 'http_options') and config is not None:
|
1810
1910
|
http_options = config.http_options
|
1811
1911
|
|
1812
1912
|
request_dict = _common.convert_to_dict(request_dict)
|
@@ -1826,7 +1926,7 @@ class AsyncCaches(_api_module.BaseModule):
|
|
1826
1926
|
)
|
1827
1927
|
|
1828
1928
|
return_value = types.ListCachedContentsResponse._from_response(
|
1829
|
-
response=response_dict, kwargs=parameter_model
|
1929
|
+
response=response_dict, kwargs=parameter_model.model_dump()
|
1830
1930
|
)
|
1831
1931
|
self._api_client._verify_response(return_value)
|
1832
1932
|
return return_value
|