@@ -665,11 +665,21 @@ def _create(
665
665
# TODO: remove the hack that pops config.
666
666
request_dict .pop ('config' , None )
667
667
668
- http_options : Optional [types .HttpOptionsOrDict ] = None
668
+ http_options : Optional [types .HttpOptionsDict ] = None
669
669
if isinstance (config , dict ):
670
670
http_options = config .get ('http_options' , None )
671
- elif hasattr (config , 'http_options' ) and config is not None :
672
- http_options = config .http_options
671
+ elif (
672
+ hasattr (config , 'http_options' )
673
+ and config is not None
674
+ and config .http_options is not None
675
+ ):
676
+ http_options_dict = config .http_options .model_dump ()
677
+ http_options = types .HttpOptionsDict (
678
+ base_url = http_options_dict .get ('base_url' ),
679
+ api_version = http_options_dict .get ('api_version' ),
680
+ headers = http_options_dict .get ('headers' ),
681
+ timeout = http_options_dict .get ('timeout' ),
682
+ )
673
683
674
684
request_dict = _common .convert_to_dict (request_dict )
675
685
request_dict = _common .encode_unserializable_types (request_dict )
@@ -734,11 +744,21 @@ def get(
734
744
# TODO: remove the hack that pops config.
735
745
request_dict .pop ('config' , None )
736
746
737
- http_options : Optional [types .HttpOptionsOrDict ] = None
747
+ http_options : Optional [types .HttpOptionsDict ] = None
738
748
if isinstance (config , dict ):
739
749
http_options = config .get ('http_options' , None )
740
- elif hasattr (config , 'http_options' ) and config is not None :
741
- http_options = config .http_options
750
+ elif (
751
+ hasattr (config , 'http_options' )
752
+ and config is not None
753
+ and config .http_options is not None
754
+ ):
755
+ http_options_dict = config .http_options .model_dump ()
756
+ http_options = types .HttpOptionsDict (
757
+ base_url = http_options_dict .get ('base_url' ),
758
+ api_version = http_options_dict .get ('api_version' ),
759
+ headers = http_options_dict .get ('headers' ),
760
+ timeout = http_options_dict .get ('timeout' ),
761
+ )
742
762
743
763
request_dict = _common .convert_to_dict (request_dict )
744
764
request_dict = _common .encode_unserializable_types (request_dict )
@@ -804,11 +824,21 @@ def cancel(
804
824
# TODO: remove the hack that pops config.
805
825
request_dict .pop ('config' , None )
806
826
807
- http_options : Optional [types .HttpOptionsOrDict ] = None
827
+ http_options : Optional [types .HttpOptionsDict ] = None
808
828
if isinstance (config , dict ):
809
829
http_options = config .get ('http_options' , None )
810
- elif hasattr (config , 'http_options' ) and config is not None :
811
- http_options = config .http_options
830
+ elif (
831
+ hasattr (config , 'http_options' )
832
+ and config is not None
833
+ and config .http_options is not None
834
+ ):
835
+ http_options_dict = config .http_options .model_dump ()
836
+ http_options = types .HttpOptionsDict (
837
+ base_url = http_options_dict .get ('base_url' ),
838
+ api_version = http_options_dict .get ('api_version' ),
839
+ headers = http_options_dict .get ('headers' ),
840
+ timeout = http_options_dict .get ('timeout' ),
841
+ )
812
842
813
843
request_dict = _common .convert_to_dict (request_dict )
814
844
request_dict = _common .encode_unserializable_types (request_dict )
@@ -843,11 +873,21 @@ def _list(
843
873
# TODO: remove the hack that pops config.
844
874
request_dict .pop ('config' , None )
845
875
846
- http_options : Optional [types .HttpOptionsOrDict ] = None
876
+ http_options : Optional [types .HttpOptionsDict ] = None
847
877
if isinstance (config , dict ):
848
878
http_options = config .get ('http_options' , None )
849
- elif hasattr (config , 'http_options' ) and config is not None :
850
- http_options = config .http_options
879
+ elif (
880
+ hasattr (config , 'http_options' )
881
+ and config is not None
882
+ and config .http_options is not None
883
+ ):
884
+ http_options_dict = config .http_options .model_dump ()
885
+ http_options = types .HttpOptionsDict (
886
+ base_url = http_options_dict .get ('base_url' ),
887
+ api_version = http_options_dict .get ('api_version' ),
888
+ headers = http_options_dict .get ('headers' ),
889
+ timeout = http_options_dict .get ('timeout' ),
890
+ )
851
891
852
892
request_dict = _common .convert_to_dict (request_dict )
853
893
request_dict = _common .encode_unserializable_types (request_dict )
@@ -918,11 +958,21 @@ def delete(
918
958
# TODO: remove the hack that pops config.
919
959
request_dict .pop ('config' , None )
920
960
921
- http_options : Optional [types .HttpOptionsOrDict ] = None
961
+ http_options : Optional [types .HttpOptionsDict ] = None
922
962
if isinstance (config , dict ):
923
963
http_options = config .get ('http_options' , None )
924
- elif hasattr (config , 'http_options' ) and config is not None :
925
- http_options = config .http_options
964
+ elif (
965
+ hasattr (config , 'http_options' )
966
+ and config is not None
967
+ and config .http_options is not None
968
+ ):
969
+ http_options_dict = config .http_options .model_dump ()
970
+ http_options = types .HttpOptionsDict (
971
+ base_url = http_options_dict .get ('base_url' ),
972
+ api_version = http_options_dict .get ('api_version' ),
973
+ headers = http_options_dict .get ('headers' ),
974
+ timeout = http_options_dict .get ('timeout' ),
975
+ )
926
976
927
977
request_dict = _common .convert_to_dict (request_dict )
928
978
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1042,11 +1092,21 @@ async def _create(
1042
1092
# TODO: remove the hack that pops config.
1043
1093
request_dict .pop ('config' , None )
1044
1094
1045
- http_options : Optional [types .HttpOptionsOrDict ] = None
1095
+ http_options : Optional [types .HttpOptionsDict ] = None
1046
1096
if isinstance (config , dict ):
1047
1097
http_options = config .get ('http_options' , None )
1048
- elif hasattr (config , 'http_options' ) and config is not None :
1049
- http_options = config .http_options
1098
+ elif (
1099
+ hasattr (config , 'http_options' )
1100
+ and config is not None
1101
+ and config .http_options is not None
1102
+ ):
1103
+ http_options_dict = config .http_options .model_dump ()
1104
+ http_options = types .HttpOptionsDict (
1105
+ base_url = http_options_dict .get ('base_url' ),
1106
+ api_version = http_options_dict .get ('api_version' ),
1107
+ headers = http_options_dict .get ('headers' ),
1108
+ timeout = http_options_dict .get ('timeout' ),
1109
+ )
1050
1110
1051
1111
request_dict = _common .convert_to_dict (request_dict )
1052
1112
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1111,11 +1171,21 @@ async def get(
1111
1171
# TODO: remove the hack that pops config.
1112
1172
request_dict .pop ('config' , None )
1113
1173
1114
- http_options : Optional [types .HttpOptionsOrDict ] = None
1174
+ http_options : Optional [types .HttpOptionsDict ] = None
1115
1175
if isinstance (config , dict ):
1116
1176
http_options = config .get ('http_options' , None )
1117
- elif hasattr (config , 'http_options' ) and config is not None :
1118
- http_options = config .http_options
1177
+ elif (
1178
+ hasattr (config , 'http_options' )
1179
+ and config is not None
1180
+ and config .http_options is not None
1181
+ ):
1182
+ http_options_dict = config .http_options .model_dump ()
1183
+ http_options = types .HttpOptionsDict (
1184
+ base_url = http_options_dict .get ('base_url' ),
1185
+ api_version = http_options_dict .get ('api_version' ),
1186
+ headers = http_options_dict .get ('headers' ),
1187
+ timeout = http_options_dict .get ('timeout' ),
1188
+ )
1119
1189
1120
1190
request_dict = _common .convert_to_dict (request_dict )
1121
1191
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1181,11 +1251,21 @@ async def cancel(
1181
1251
# TODO: remove the hack that pops config.
1182
1252
request_dict .pop ('config' , None )
1183
1253
1184
- http_options : Optional [types .HttpOptionsOrDict ] = None
1254
+ http_options : Optional [types .HttpOptionsDict ] = None
1185
1255
if isinstance (config , dict ):
1186
1256
http_options = config .get ('http_options' , None )
1187
- elif hasattr (config , 'http_options' ) and config is not None :
1188
- http_options = config .http_options
1257
+ elif (
1258
+ hasattr (config , 'http_options' )
1259
+ and config is not None
1260
+ and config .http_options is not None
1261
+ ):
1262
+ http_options_dict = config .http_options .model_dump ()
1263
+ http_options = types .HttpOptionsDict (
1264
+ base_url = http_options_dict .get ('base_url' ),
1265
+ api_version = http_options_dict .get ('api_version' ),
1266
+ headers = http_options_dict .get ('headers' ),
1267
+ timeout = http_options_dict .get ('timeout' ),
1268
+ )
1189
1269
1190
1270
request_dict = _common .convert_to_dict (request_dict )
1191
1271
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1220,11 +1300,21 @@ async def _list(
1220
1300
# TODO: remove the hack that pops config.
1221
1301
request_dict .pop ('config' , None )
1222
1302
1223
- http_options : Optional [types .HttpOptionsOrDict ] = None
1303
+ http_options : Optional [types .HttpOptionsDict ] = None
1224
1304
if isinstance (config , dict ):
1225
1305
http_options = config .get ('http_options' , None )
1226
- elif hasattr (config , 'http_options' ) and config is not None :
1227
- http_options = config .http_options
1306
+ elif (
1307
+ hasattr (config , 'http_options' )
1308
+ and config is not None
1309
+ and config .http_options is not None
1310
+ ):
1311
+ http_options_dict = config .http_options .model_dump ()
1312
+ http_options = types .HttpOptionsDict (
1313
+ base_url = http_options_dict .get ('base_url' ),
1314
+ api_version = http_options_dict .get ('api_version' ),
1315
+ headers = http_options_dict .get ('headers' ),
1316
+ timeout = http_options_dict .get ('timeout' ),
1317
+ )
1228
1318
1229
1319
request_dict = _common .convert_to_dict (request_dict )
1230
1320
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1295,11 +1385,21 @@ async def delete(
1295
1385
# TODO: remove the hack that pops config.
1296
1386
request_dict .pop ('config' , None )
1297
1387
1298
- http_options : Optional [types .HttpOptionsOrDict ] = None
1388
+ http_options : Optional [types .HttpOptionsDict ] = None
1299
1389
if isinstance (config , dict ):
1300
1390
http_options = config .get ('http_options' , None )
1301
- elif hasattr (config , 'http_options' ) and config is not None :
1302
- http_options = config .http_options
1391
+ elif (
1392
+ hasattr (config , 'http_options' )
1393
+ and config is not None
1394
+ and config .http_options is not None
1395
+ ):
1396
+ http_options_dict = config .http_options .model_dump ()
1397
+ http_options = types .HttpOptionsDict (
1398
+ base_url = http_options_dict .get ('base_url' ),
1399
+ api_version = http_options_dict .get ('api_version' ),
1400
+ headers = http_options_dict .get ('headers' ),
1401
+ timeout = http_options_dict .get ('timeout' ),
1402
+ )
1303
1403
1304
1404
request_dict = _common .convert_to_dict (request_dict )
1305
1405
request_dict = _common .encode_unserializable_types (request_dict )
0 commit comments