@@ -665,11 +665,12 @@ 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
669
- if isinstance (config , dict ):
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
668
+ http_options : Optional [types .HttpOptions ] = None
669
+ if (
670
+ parameter_model .config is not None
671
+ and parameter_model .config .http_options is not None
672
+ ):
673
+ http_options = parameter_model .config .http_options
673
674
674
675
request_dict = _common .convert_to_dict (request_dict )
675
676
request_dict = _common .encode_unserializable_types (request_dict )
@@ -734,11 +735,12 @@ def get(
734
735
# TODO: remove the hack that pops config.
735
736
request_dict .pop ('config' , None )
736
737
737
- http_options : Optional [types .HttpOptionsOrDict ] = None
738
- if isinstance (config , dict ):
739
- http_options = config .get ('http_options' , None )
740
- elif hasattr (config , 'http_options' ) and config is not None :
741
- http_options = config .http_options
738
+ http_options : Optional [types .HttpOptions ] = None
739
+ if (
740
+ parameter_model .config is not None
741
+ and parameter_model .config .http_options is not None
742
+ ):
743
+ http_options = parameter_model .config .http_options
742
744
743
745
request_dict = _common .convert_to_dict (request_dict )
744
746
request_dict = _common .encode_unserializable_types (request_dict )
@@ -804,11 +806,12 @@ def cancel(
804
806
# TODO: remove the hack that pops config.
805
807
request_dict .pop ('config' , None )
806
808
807
- http_options : Optional [types .HttpOptionsOrDict ] = None
808
- if isinstance (config , dict ):
809
- http_options = config .get ('http_options' , None )
810
- elif hasattr (config , 'http_options' ) and config is not None :
811
- http_options = config .http_options
809
+ http_options : Optional [types .HttpOptions ] = None
810
+ if (
811
+ parameter_model .config is not None
812
+ and parameter_model .config .http_options is not None
813
+ ):
814
+ http_options = parameter_model .config .http_options
812
815
813
816
request_dict = _common .convert_to_dict (request_dict )
814
817
request_dict = _common .encode_unserializable_types (request_dict )
@@ -843,11 +846,12 @@ def _list(
843
846
# TODO: remove the hack that pops config.
844
847
request_dict .pop ('config' , None )
845
848
846
- http_options : Optional [types .HttpOptionsOrDict ] = None
847
- if isinstance (config , dict ):
848
- http_options = config .get ('http_options' , None )
849
- elif hasattr (config , 'http_options' ) and config is not None :
850
- http_options = config .http_options
849
+ http_options : Optional [types .HttpOptions ] = None
850
+ if (
851
+ parameter_model .config is not None
852
+ and parameter_model .config .http_options is not None
853
+ ):
854
+ http_options = parameter_model .config .http_options
851
855
852
856
request_dict = _common .convert_to_dict (request_dict )
853
857
request_dict = _common .encode_unserializable_types (request_dict )
@@ -918,11 +922,12 @@ def delete(
918
922
# TODO: remove the hack that pops config.
919
923
request_dict .pop ('config' , None )
920
924
921
- http_options : Optional [types .HttpOptionsOrDict ] = None
922
- if isinstance (config , dict ):
923
- http_options = config .get ('http_options' , None )
924
- elif hasattr (config , 'http_options' ) and config is not None :
925
- http_options = config .http_options
925
+ http_options : Optional [types .HttpOptions ] = None
926
+ if (
927
+ parameter_model .config is not None
928
+ and parameter_model .config .http_options is not None
929
+ ):
930
+ http_options = parameter_model .config .http_options
926
931
927
932
request_dict = _common .convert_to_dict (request_dict )
928
933
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1042,11 +1047,12 @@ async def _create(
1042
1047
# TODO: remove the hack that pops config.
1043
1048
request_dict .pop ('config' , None )
1044
1049
1045
- http_options : Optional [types .HttpOptionsOrDict ] = None
1046
- if isinstance (config , dict ):
1047
- http_options = config .get ('http_options' , None )
1048
- elif hasattr (config , 'http_options' ) and config is not None :
1049
- http_options = config .http_options
1050
+ http_options : Optional [types .HttpOptions ] = None
1051
+ if (
1052
+ parameter_model .config is not None
1053
+ and parameter_model .config .http_options is not None
1054
+ ):
1055
+ http_options = parameter_model .config .http_options
1050
1056
1051
1057
request_dict = _common .convert_to_dict (request_dict )
1052
1058
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1111,11 +1117,12 @@ async def get(
1111
1117
# TODO: remove the hack that pops config.
1112
1118
request_dict .pop ('config' , None )
1113
1119
1114
- http_options : Optional [types .HttpOptionsOrDict ] = None
1115
- if isinstance (config , dict ):
1116
- http_options = config .get ('http_options' , None )
1117
- elif hasattr (config , 'http_options' ) and config is not None :
1118
- http_options = config .http_options
1120
+ http_options : Optional [types .HttpOptions ] = None
1121
+ if (
1122
+ parameter_model .config is not None
1123
+ and parameter_model .config .http_options is not None
1124
+ ):
1125
+ http_options = parameter_model .config .http_options
1119
1126
1120
1127
request_dict = _common .convert_to_dict (request_dict )
1121
1128
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1181,11 +1188,12 @@ async def cancel(
1181
1188
# TODO: remove the hack that pops config.
1182
1189
request_dict .pop ('config' , None )
1183
1190
1184
- http_options : Optional [types .HttpOptionsOrDict ] = None
1185
- if isinstance (config , dict ):
1186
- http_options = config .get ('http_options' , None )
1187
- elif hasattr (config , 'http_options' ) and config is not None :
1188
- http_options = config .http_options
1191
+ http_options : Optional [types .HttpOptions ] = None
1192
+ if (
1193
+ parameter_model .config is not None
1194
+ and parameter_model .config .http_options is not None
1195
+ ):
1196
+ http_options = parameter_model .config .http_options
1189
1197
1190
1198
request_dict = _common .convert_to_dict (request_dict )
1191
1199
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1220,11 +1228,12 @@ async def _list(
1220
1228
# TODO: remove the hack that pops config.
1221
1229
request_dict .pop ('config' , None )
1222
1230
1223
- http_options : Optional [types .HttpOptionsOrDict ] = None
1224
- if isinstance (config , dict ):
1225
- http_options = config .get ('http_options' , None )
1226
- elif hasattr (config , 'http_options' ) and config is not None :
1227
- http_options = config .http_options
1231
+ http_options : Optional [types .HttpOptions ] = None
1232
+ if (
1233
+ parameter_model .config is not None
1234
+ and parameter_model .config .http_options is not None
1235
+ ):
1236
+ http_options = parameter_model .config .http_options
1228
1237
1229
1238
request_dict = _common .convert_to_dict (request_dict )
1230
1239
request_dict = _common .encode_unserializable_types (request_dict )
@@ -1295,11 +1304,12 @@ async def delete(
1295
1304
# TODO: remove the hack that pops config.
1296
1305
request_dict .pop ('config' , None )
1297
1306
1298
- http_options : Optional [types .HttpOptionsOrDict ] = None
1299
- if isinstance (config , dict ):
1300
- http_options = config .get ('http_options' , None )
1301
- elif hasattr (config , 'http_options' ) and config is not None :
1302
- http_options = config .http_options
1307
+ http_options : Optional [types .HttpOptions ] = None
1308
+ if (
1309
+ parameter_model .config is not None
1310
+ and parameter_model .config .http_options is not None
1311
+ ):
1312
+ http_options = parameter_model .config .http_options
1303
1313
1304
1314
request_dict = _common .convert_to_dict (request_dict )
1305
1315
request_dict = _common .encode_unserializable_types (request_dict )
0 commit comments