From 16aae99273cfb1fe048dadf1f0b75fec3a9c6b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Tue, 11 Jan 2022 16:19:15 +0100 Subject: [PATCH 01/11] LDS-2166 : add request auth to api client and api call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Can now overwrite request auth by request Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../src/main/resources/python/api.mustache | 5 ++ .../main/resources/python/api_client.mustache | 72 ++++++++++++------- 2 files changed, 50 insertions(+), 27 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 3406400b4b57..44c26404501a 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -280,6 +280,10 @@ class {{classname}}(object): _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -311,6 +315,7 @@ class {{classname}}(object): kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) {{#requiredParams}} kwargs['{{paramName}}'] = \ {{paramName}} diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 39f33aee0b39..42b0d2f893c3 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -130,7 +130,8 @@ class ApiClient(object): _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None + _content_type: typing.Optional[str] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): config = self.configuration @@ -180,7 +181,8 @@ class ApiClient(object): # auth setting self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + auth_settings, resource_path, method, body, + request_auth=_request_auth) # request url if _host is None: @@ -362,7 +364,8 @@ class ApiClient(object): _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -410,6 +413,10 @@ class ApiClient(object): :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -424,7 +431,7 @@ class ApiClient(object): response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type) + _check_type, _request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -437,7 +444,7 @@ class ApiClient(object): collection_formats, _preload_content, _request_timeout, - _host, _check_type)) + _host, _check_type, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -609,7 +616,7 @@ class ApiClient(object): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + resource_path, method, body, request_auth=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -619,34 +626,42 @@ class ApiClient(object): :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] {{#hasHttpSignatureMethods}} - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, queries) - headers.update(auth_headers) + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, queries) + headers.update(auth_headers) {{/hasHttpSignatureMethods}} - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, @@ -695,7 +710,8 @@ class Endpoint(object): '_check_input_type', '_check_return_type', '_content_type', - '_spec_property_naming' + '_spec_property_naming', + '_request_auth' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -710,7 +726,8 @@ class Endpoint(object): '_check_input_type': (bool,), '_check_return_type': (bool,), '_spec_property_naming': (bool,), - '_content_type': (none_type, str) + '_content_type': (none_type, str), + '_request_auth': (none_type, dict) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -884,4 +901,5 @@ class Endpoint(object): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, + _request_auth=kwargs['_request_auth'], collection_formats=params['collection_format']) From 326ce80cef471e751347d6b2cf782db7648710d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Tue, 11 Jan 2022 17:04:43 +0100 Subject: [PATCH 02/11] LDS-2166 : Add samples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../petstore_api/api/another_fake_api.py | 5 + .../python/petstore_api/api/fake_api.py | 80 ++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../python/petstore_api/api/pet_api.py | 45 ++++++ .../python/petstore_api/api/store_api.py | 20 +++ .../python/petstore_api/api/user_api.py | 40 +++++ .../python/petstore_api/api_client.py | 58 +++++--- .../petstore_api/api/another_fake_api.py | 5 + .../petstore_api/api/fake_api.py | 80 ++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../petstore_api/api/pet_api.py | 45 ++++++ .../petstore_api/api/store_api.py | 20 +++ .../petstore_api/api/user_api.py | 40 +++++ .../petstore_api/api_client.py | 58 +++++--- .../python/x_auth_id_alias/api/usage_api.py | 20 +++ .../python/x_auth_id_alias/api_client.py | 58 +++++--- .../python/dynamic_servers/api/usage_api.py | 10 ++ .../python/dynamic_servers/api_client.py | 58 +++++--- .../petstore_api/api/another_fake_api.py | 5 + .../python/petstore_api/api/default_api.py | 5 + .../python/petstore_api/api/fake_api.py | 140 ++++++++++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../python/petstore_api/api/pet_api.py | 35 +++++ .../python/petstore_api/api/store_api.py | 20 +++ .../python/petstore_api/api/user_api.py | 40 +++++ .../python/petstore_api/api_client.py | 72 +++++---- 26 files changed, 867 insertions(+), 107 deletions(-) diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index 093a4ca6a337..2fb0838c7393 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -129,6 +129,10 @@ def call_123_test_special_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -160,6 +164,7 @@ def call_123_test_special_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index f630549347fc..dfc39d66e87c 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1142,6 +1142,10 @@ def array_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1173,6 +1177,7 @@ def array_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.array_model_endpoint.call_with_http_info(**kwargs) def boolean( @@ -1216,6 +1221,10 @@ def boolean( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1247,6 +1256,7 @@ def boolean( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.boolean_endpoint.call_with_http_info(**kwargs) def create_xml_item( @@ -1292,6 +1302,10 @@ def create_xml_item( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1323,6 +1337,7 @@ def create_xml_item( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['xml_item'] = \ xml_item return self.create_xml_item_endpoint.call_with_http_info(**kwargs) @@ -1368,6 +1383,10 @@ def number_with_validations( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1399,6 +1418,7 @@ def number_with_validations( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.number_with_validations_endpoint.call_with_http_info(**kwargs) def object_model_with_ref_props( @@ -1442,6 +1462,10 @@ def object_model_with_ref_props( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1473,6 +1497,7 @@ def object_model_with_ref_props( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) def string( @@ -1516,6 +1541,10 @@ def string( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1547,6 +1576,7 @@ def string( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.string_endpoint.call_with_http_info(**kwargs) def string_enum( @@ -1590,6 +1620,10 @@ def string_enum( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1621,6 +1655,7 @@ def string_enum( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.string_enum_endpoint.call_with_http_info(**kwargs) def test_body_with_file_schema( @@ -1666,6 +1701,10 @@ def test_body_with_file_schema( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1697,6 +1736,7 @@ def test_body_with_file_schema( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) @@ -1745,6 +1785,10 @@ def test_body_with_query_params( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1776,6 +1820,7 @@ def test_body_with_query_params( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['query'] = \ query kwargs['body'] = \ @@ -1825,6 +1870,10 @@ def test_client_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1856,6 +1905,7 @@ def test_client_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.test_client_model_endpoint.call_with_http_info(**kwargs) @@ -1911,6 +1961,10 @@ def test_endpoint_enums_length_one( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1942,6 +1996,7 @@ def test_endpoint_enums_length_one( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['query_integer'] = \ query_integer kwargs['query_string'] = \ @@ -2013,6 +2068,10 @@ def test_endpoint_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2044,6 +2103,7 @@ def test_endpoint_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['number'] = \ number kwargs['double'] = \ @@ -2102,6 +2162,10 @@ def test_enum_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2133,6 +2197,7 @@ def test_enum_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) def test_group_parameters( @@ -2185,6 +2250,10 @@ def test_group_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2216,6 +2285,7 @@ def test_group_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['required_string_group'] = \ required_string_group kwargs['required_boolean_group'] = \ @@ -2266,6 +2336,10 @@ def test_inline_additional_properties( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2297,6 +2371,7 @@ def test_inline_additional_properties( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['param'] = \ param return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) @@ -2345,6 +2420,10 @@ def test_json_form_data( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2376,6 +2455,7 @@ def test_json_form_data( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['param'] = \ param kwargs['param2'] = \ diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 70b4a535a815..69537296f488 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -131,6 +131,10 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -162,6 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.test_classname_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index 290bf04cf1ee..5a927728c44d 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -594,6 +594,10 @@ def add_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -625,6 +629,7 @@ def add_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.add_pet_endpoint.call_with_http_info(**kwargs) @@ -672,6 +677,10 @@ def delete_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -703,6 +712,7 @@ def delete_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.delete_pet_endpoint.call_with_http_info(**kwargs) @@ -750,6 +760,10 @@ def find_pets_by_status( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -781,6 +795,7 @@ def find_pets_by_status( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['status'] = \ status return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) @@ -828,6 +843,10 @@ def find_pets_by_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -859,6 +878,7 @@ def find_pets_by_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['tags'] = \ tags return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) @@ -906,6 +926,10 @@ def get_pet_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -937,6 +961,7 @@ def get_pet_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) @@ -983,6 +1008,10 @@ def update_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1014,6 +1043,7 @@ def update_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.update_pet_endpoint.call_with_http_info(**kwargs) @@ -1062,6 +1092,10 @@ def update_pet_with_form( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1093,6 +1127,7 @@ def update_pet_with_form( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) @@ -1142,6 +1177,10 @@ def upload_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1173,6 +1212,7 @@ def upload_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.upload_file_endpoint.call_with_http_info(**kwargs) @@ -1222,6 +1262,10 @@ def upload_file_with_required_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1253,6 +1297,7 @@ def upload_file_with_required_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id kwargs['required_file'] = \ diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index a1172b1f10e5..cab6296939f0 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -275,6 +275,10 @@ def delete_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -306,6 +310,7 @@ def delete_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['order_id'] = \ order_id return self.delete_order_endpoint.call_with_http_info(**kwargs) @@ -350,6 +355,10 @@ def get_inventory( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -381,6 +390,7 @@ def get_inventory( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.get_inventory_endpoint.call_with_http_info(**kwargs) def get_order_by_id( @@ -426,6 +436,10 @@ def get_order_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -457,6 +471,7 @@ def get_order_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['order_id'] = \ order_id return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) @@ -503,6 +518,10 @@ def place_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -534,6 +553,7 @@ def place_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.place_order_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 6eabc2a0a015..6b8eb81faffe 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -462,6 +462,10 @@ def create_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -493,6 +497,7 @@ def create_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.create_user_endpoint.call_with_http_info(**kwargs) @@ -539,6 +544,10 @@ def create_users_with_array_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -570,6 +579,7 @@ def create_users_with_array_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) @@ -616,6 +626,10 @@ def create_users_with_list_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -647,6 +661,7 @@ def create_users_with_list_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) @@ -694,6 +709,10 @@ def delete_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -725,6 +744,7 @@ def delete_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username return self.delete_user_endpoint.call_with_http_info(**kwargs) @@ -771,6 +791,10 @@ def get_user_by_name( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -802,6 +826,7 @@ def get_user_by_name( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) @@ -850,6 +875,10 @@ def login_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -881,6 +910,7 @@ def login_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username kwargs['password'] = \ @@ -926,6 +956,10 @@ def logout_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -957,6 +991,7 @@ def logout_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.logout_user_endpoint.call_with_http_info(**kwargs) def update_user( @@ -1004,6 +1039,10 @@ def update_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1035,6 +1074,7 @@ def update_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username kwargs['body'] = \ diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 664cf1c917b7..80f9d405e845 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -132,7 +132,8 @@ def __call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None + _content_type: typing.Optional[str] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): config = self.configuration @@ -182,7 +183,8 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + auth_settings, resource_path, method, body, + request_auth=_request_auth) # request url if _host is None: @@ -350,7 +352,8 @@ def call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -398,6 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -412,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type) + _check_type, _request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -425,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type)) + _host, _check_type, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -597,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + resource_path, method, body, request_auth=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -607,25 +614,33 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, @@ -674,7 +689,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type', '_check_return_type', '_content_type', - '_spec_property_naming' + '_spec_property_naming', + '_request_auth' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -689,7 +705,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type': (bool,), '_check_return_type': (bool,), '_spec_property_naming': (bool,), - '_content_type': (none_type, str) + '_content_type': (none_type, str), + '_request_auth': (none_type, dict) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -863,4 +880,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, + _request_auth=kwargs['_request_auth'], collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py index 093a4ca6a337..2fb0838c7393 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py @@ -129,6 +129,10 @@ def call_123_test_special_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -160,6 +164,7 @@ def call_123_test_special_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py index f630549347fc..dfc39d66e87c 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py @@ -1142,6 +1142,10 @@ def array_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1173,6 +1177,7 @@ def array_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.array_model_endpoint.call_with_http_info(**kwargs) def boolean( @@ -1216,6 +1221,10 @@ def boolean( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1247,6 +1256,7 @@ def boolean( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.boolean_endpoint.call_with_http_info(**kwargs) def create_xml_item( @@ -1292,6 +1302,10 @@ def create_xml_item( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1323,6 +1337,7 @@ def create_xml_item( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['xml_item'] = \ xml_item return self.create_xml_item_endpoint.call_with_http_info(**kwargs) @@ -1368,6 +1383,10 @@ def number_with_validations( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1399,6 +1418,7 @@ def number_with_validations( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.number_with_validations_endpoint.call_with_http_info(**kwargs) def object_model_with_ref_props( @@ -1442,6 +1462,10 @@ def object_model_with_ref_props( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1473,6 +1497,7 @@ def object_model_with_ref_props( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) def string( @@ -1516,6 +1541,10 @@ def string( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1547,6 +1576,7 @@ def string( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.string_endpoint.call_with_http_info(**kwargs) def string_enum( @@ -1590,6 +1620,10 @@ def string_enum( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1621,6 +1655,7 @@ def string_enum( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.string_enum_endpoint.call_with_http_info(**kwargs) def test_body_with_file_schema( @@ -1666,6 +1701,10 @@ def test_body_with_file_schema( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1697,6 +1736,7 @@ def test_body_with_file_schema( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) @@ -1745,6 +1785,10 @@ def test_body_with_query_params( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1776,6 +1820,7 @@ def test_body_with_query_params( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['query'] = \ query kwargs['body'] = \ @@ -1825,6 +1870,10 @@ def test_client_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1856,6 +1905,7 @@ def test_client_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.test_client_model_endpoint.call_with_http_info(**kwargs) @@ -1911,6 +1961,10 @@ def test_endpoint_enums_length_one( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1942,6 +1996,7 @@ def test_endpoint_enums_length_one( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['query_integer'] = \ query_integer kwargs['query_string'] = \ @@ -2013,6 +2068,10 @@ def test_endpoint_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2044,6 +2103,7 @@ def test_endpoint_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['number'] = \ number kwargs['double'] = \ @@ -2102,6 +2162,10 @@ def test_enum_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2133,6 +2197,7 @@ def test_enum_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) def test_group_parameters( @@ -2185,6 +2250,10 @@ def test_group_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2216,6 +2285,7 @@ def test_group_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['required_string_group'] = \ required_string_group kwargs['required_boolean_group'] = \ @@ -2266,6 +2336,10 @@ def test_inline_additional_properties( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2297,6 +2371,7 @@ def test_inline_additional_properties( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['param'] = \ param return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) @@ -2345,6 +2420,10 @@ def test_json_form_data( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2376,6 +2455,7 @@ def test_json_form_data( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['param'] = \ param kwargs['param2'] = \ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py index 70b4a535a815..69537296f488 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py @@ -131,6 +131,10 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -162,6 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.test_classname_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py index 290bf04cf1ee..5a927728c44d 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py @@ -594,6 +594,10 @@ def add_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -625,6 +629,7 @@ def add_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.add_pet_endpoint.call_with_http_info(**kwargs) @@ -672,6 +677,10 @@ def delete_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -703,6 +712,7 @@ def delete_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.delete_pet_endpoint.call_with_http_info(**kwargs) @@ -750,6 +760,10 @@ def find_pets_by_status( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -781,6 +795,7 @@ def find_pets_by_status( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['status'] = \ status return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) @@ -828,6 +843,10 @@ def find_pets_by_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -859,6 +878,7 @@ def find_pets_by_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['tags'] = \ tags return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) @@ -906,6 +926,10 @@ def get_pet_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -937,6 +961,7 @@ def get_pet_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) @@ -983,6 +1008,10 @@ def update_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1014,6 +1043,7 @@ def update_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.update_pet_endpoint.call_with_http_info(**kwargs) @@ -1062,6 +1092,10 @@ def update_pet_with_form( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1093,6 +1127,7 @@ def update_pet_with_form( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) @@ -1142,6 +1177,10 @@ def upload_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1173,6 +1212,7 @@ def upload_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.upload_file_endpoint.call_with_http_info(**kwargs) @@ -1222,6 +1262,10 @@ def upload_file_with_required_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1253,6 +1297,7 @@ def upload_file_with_required_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id kwargs['required_file'] = \ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py index a1172b1f10e5..cab6296939f0 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py @@ -275,6 +275,10 @@ def delete_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -306,6 +310,7 @@ def delete_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['order_id'] = \ order_id return self.delete_order_endpoint.call_with_http_info(**kwargs) @@ -350,6 +355,10 @@ def get_inventory( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -381,6 +390,7 @@ def get_inventory( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.get_inventory_endpoint.call_with_http_info(**kwargs) def get_order_by_id( @@ -426,6 +436,10 @@ def get_order_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -457,6 +471,7 @@ def get_order_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['order_id'] = \ order_id return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) @@ -503,6 +518,10 @@ def place_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -534,6 +553,7 @@ def place_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.place_order_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py index 6eabc2a0a015..6b8eb81faffe 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py @@ -462,6 +462,10 @@ def create_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -493,6 +497,7 @@ def create_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.create_user_endpoint.call_with_http_info(**kwargs) @@ -539,6 +544,10 @@ def create_users_with_array_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -570,6 +579,7 @@ def create_users_with_array_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) @@ -616,6 +626,10 @@ def create_users_with_list_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -647,6 +661,7 @@ def create_users_with_list_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) @@ -694,6 +709,10 @@ def delete_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -725,6 +744,7 @@ def delete_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username return self.delete_user_endpoint.call_with_http_info(**kwargs) @@ -771,6 +791,10 @@ def get_user_by_name( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -802,6 +826,7 @@ def get_user_by_name( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) @@ -850,6 +875,10 @@ def login_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -881,6 +910,7 @@ def login_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username kwargs['password'] = \ @@ -926,6 +956,10 @@ def logout_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -957,6 +991,7 @@ def logout_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.logout_user_endpoint.call_with_http_info(**kwargs) def update_user( @@ -1004,6 +1039,10 @@ def update_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1035,6 +1074,7 @@ def update_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username kwargs['body'] = \ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index 664cf1c917b7..80f9d405e845 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -132,7 +132,8 @@ def __call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None + _content_type: typing.Optional[str] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): config = self.configuration @@ -182,7 +183,8 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + auth_settings, resource_path, method, body, + request_auth=_request_auth) # request url if _host is None: @@ -350,7 +352,8 @@ def call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -398,6 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -412,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type) + _check_type, _request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -425,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type)) + _host, _check_type, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -597,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + resource_path, method, body, request_auth=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -607,25 +614,33 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, @@ -674,7 +689,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type', '_check_return_type', '_content_type', - '_spec_property_naming' + '_spec_property_naming', + '_request_auth' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -689,7 +705,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type': (bool,), '_check_return_type': (bool,), '_spec_property_naming': (bool,), - '_content_type': (none_type, str) + '_content_type': (none_type, str), + '_request_auth': (none_type, dict) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -863,4 +880,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, + _request_auth=kwargs['_request_auth'], collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py index 9f3775456e04..7f9a413ac1b0 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py @@ -253,6 +253,10 @@ def any_key( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -284,6 +288,7 @@ def any_key( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.any_key_endpoint.call_with_http_info(**kwargs) def both_keys( @@ -326,6 +331,10 @@ def both_keys( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -357,6 +366,7 @@ def both_keys( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.both_keys_endpoint.call_with_http_info(**kwargs) def key_in_header( @@ -399,6 +409,10 @@ def key_in_header( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -430,6 +444,7 @@ def key_in_header( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.key_in_header_endpoint.call_with_http_info(**kwargs) def key_in_query( @@ -472,6 +487,10 @@ def key_in_query( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -503,5 +522,6 @@ def key_in_query( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.key_in_query_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index e77be7a5319d..3453589e1311 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -132,7 +132,8 @@ def __call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None + _content_type: typing.Optional[str] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): config = self.configuration @@ -182,7 +183,8 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + auth_settings, resource_path, method, body, + request_auth=_request_auth) # request url if _host is None: @@ -350,7 +352,8 @@ def call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -398,6 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -412,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type) + _check_type, _request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -425,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type)) + _host, _check_type, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -597,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + resource_path, method, body, request_auth=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -607,25 +614,33 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, @@ -674,7 +689,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type', '_check_return_type', '_content_type', - '_spec_property_naming' + '_spec_property_naming', + '_request_auth' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -689,7 +705,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type': (bool,), '_check_return_type': (bool,), '_spec_property_naming': (bool,), - '_content_type': (none_type, str) + '_content_type': (none_type, str), + '_request_auth': (none_type, dict) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -863,4 +880,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, + _request_auth=kwargs['_request_auth'], collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py index f71f533ceeca..9ca32f2ed141 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py @@ -208,6 +208,10 @@ def custom_server( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -239,6 +243,7 @@ def custom_server( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.custom_server_endpoint.call_with_http_info(**kwargs) def default_server( @@ -281,6 +286,10 @@ def default_server( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -312,5 +321,6 @@ def default_server( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.default_server_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index e38f7442f7bf..ffc693976438 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -132,7 +132,8 @@ def __call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None + _content_type: typing.Optional[str] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): config = self.configuration @@ -182,7 +183,8 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + auth_settings, resource_path, method, body, + request_auth=_request_auth) # request url if _host is None: @@ -350,7 +352,8 @@ def call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -398,6 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -412,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type) + _check_type, _request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -425,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type)) + _host, _check_type, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -597,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + resource_path, method, body, request_auth=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -607,25 +614,33 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, @@ -674,7 +689,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type', '_check_return_type', '_content_type', - '_spec_property_naming' + '_spec_property_naming', + '_request_auth' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -689,7 +705,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type': (bool,), '_check_return_type': (bool,), '_spec_property_naming': (bool,), - '_content_type': (none_type, str) + '_content_type': (none_type, str), + '_request_auth': (none_type, dict) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -863,4 +880,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, + _request_auth=kwargs['_request_auth'], collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index 503decf303f1..1ae7ba1b000f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -129,6 +129,10 @@ def call_123_test_special_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -160,6 +164,7 @@ def call_123_test_special_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['client'] = \ client return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 8ba49f05e760..7b9fe8e220d9 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -117,6 +117,10 @@ def foo_get( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -148,5 +152,6 @@ def foo_get( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.foo_get_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 9ebd02954cfa..4d2f9adae2b6 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -1730,6 +1730,10 @@ def additional_properties_with_array_of_enums( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1761,6 +1765,7 @@ def additional_properties_with_array_of_enums( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.additional_properties_with_array_of_enums_endpoint.call_with_http_info(**kwargs) def array_model( @@ -1804,6 +1809,10 @@ def array_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1835,6 +1844,7 @@ def array_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.array_model_endpoint.call_with_http_info(**kwargs) def array_of_enums( @@ -1877,6 +1887,10 @@ def array_of_enums( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1908,6 +1922,7 @@ def array_of_enums( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.array_of_enums_endpoint.call_with_http_info(**kwargs) def boolean( @@ -1951,6 +1966,10 @@ def boolean( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1982,6 +2001,7 @@ def boolean( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.boolean_endpoint.call_with_http_info(**kwargs) def composed_one_of_number_with_validations( @@ -2025,6 +2045,10 @@ def composed_one_of_number_with_validations( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2056,6 +2080,7 @@ def composed_one_of_number_with_validations( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.composed_one_of_number_with_validations_endpoint.call_with_http_info(**kwargs) def download_attachment( @@ -2100,6 +2125,10 @@ def download_attachment( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2131,6 +2160,7 @@ def download_attachment( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['file_name'] = \ file_name return self.download_attachment_endpoint.call_with_http_info(**kwargs) @@ -2175,6 +2205,10 @@ def enum_test( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2206,6 +2240,7 @@ def enum_test( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.enum_test_endpoint.call_with_http_info(**kwargs) def fake_health_get( @@ -2247,6 +2282,10 @@ def fake_health_get( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2278,6 +2317,7 @@ def fake_health_get( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.fake_health_get_endpoint.call_with_http_info(**kwargs) def mammal( @@ -2323,6 +2363,10 @@ def mammal( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2354,6 +2398,7 @@ def mammal( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['mammal'] = \ mammal return self.mammal_endpoint.call_with_http_info(**kwargs) @@ -2399,6 +2444,10 @@ def number_with_validations( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2430,6 +2479,7 @@ def number_with_validations( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.number_with_validations_endpoint.call_with_http_info(**kwargs) def object_model_with_ref_props( @@ -2473,6 +2523,10 @@ def object_model_with_ref_props( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2504,6 +2558,7 @@ def object_model_with_ref_props( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) def post_inline_additional_properties_payload( @@ -2546,6 +2601,10 @@ def post_inline_additional_properties_payload( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2577,6 +2636,7 @@ def post_inline_additional_properties_payload( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.post_inline_additional_properties_payload_endpoint.call_with_http_info(**kwargs) def post_inline_additional_properties_ref_payload( @@ -2619,6 +2679,10 @@ def post_inline_additional_properties_ref_payload( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2650,6 +2714,7 @@ def post_inline_additional_properties_ref_payload( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.post_inline_additional_properties_ref_payload_endpoint.call_with_http_info(**kwargs) def string( @@ -2693,6 +2758,10 @@ def string( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2724,6 +2793,7 @@ def string( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.string_endpoint.call_with_http_info(**kwargs) def string_enum( @@ -2767,6 +2837,10 @@ def string_enum( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2798,6 +2872,7 @@ def string_enum( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.string_enum_endpoint.call_with_http_info(**kwargs) def test_body_with_file_schema( @@ -2843,6 +2918,10 @@ def test_body_with_file_schema( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2874,6 +2953,7 @@ def test_body_with_file_schema( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['file_schema_test_class'] = \ file_schema_test_class return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) @@ -2922,6 +3002,10 @@ def test_body_with_query_params( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -2953,6 +3037,7 @@ def test_body_with_query_params( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['query'] = \ query kwargs['user'] = \ @@ -3002,6 +3087,10 @@ def test_client_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3033,6 +3122,7 @@ def test_client_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['client'] = \ client return self.test_client_model_endpoint.call_with_http_info(**kwargs) @@ -3096,6 +3186,10 @@ def test_endpoint_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3127,6 +3221,7 @@ def test_endpoint_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['number'] = \ number kwargs['double'] = \ @@ -3185,6 +3280,10 @@ def test_enum_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3216,6 +3315,7 @@ def test_enum_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) def test_group_parameters( @@ -3268,6 +3368,10 @@ def test_group_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3299,6 +3403,7 @@ def test_group_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['required_string_group'] = \ required_string_group kwargs['required_boolean_group'] = \ @@ -3349,6 +3454,10 @@ def test_inline_additional_properties( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3380,6 +3489,7 @@ def test_inline_additional_properties( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['request_body'] = \ request_body return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) @@ -3428,6 +3538,10 @@ def test_json_form_data( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3459,6 +3573,7 @@ def test_json_form_data( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['param'] = \ param kwargs['param2'] = \ @@ -3516,6 +3631,10 @@ def test_query_parameter_collection_format( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3547,6 +3666,7 @@ def test_query_parameter_collection_format( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pipe'] = \ pipe kwargs['ioutil'] = \ @@ -3599,6 +3719,10 @@ def tx_rx_any_of_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3630,6 +3754,7 @@ def tx_rx_any_of_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.tx_rx_any_of_model_endpoint.call_with_http_info(**kwargs) def upload_download_file( @@ -3674,6 +3799,10 @@ def upload_download_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3705,6 +3834,7 @@ def upload_download_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.upload_download_file_endpoint.call_with_http_info(**kwargs) @@ -3752,6 +3882,10 @@ def upload_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3783,6 +3917,7 @@ def upload_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['file'] = \ file return self.upload_file_endpoint.call_with_http_info(**kwargs) @@ -3827,6 +3962,10 @@ def upload_files( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -3858,5 +3997,6 @@ def upload_files( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.upload_files_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index a6c187b02518..bc79105589de 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -131,6 +131,10 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -162,6 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['client'] = \ client return self.test_classname_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index 2f87475abf7c..2f66857e2945 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -482,6 +482,10 @@ def add_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -513,6 +517,7 @@ def add_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet'] = \ pet return self.add_pet_endpoint.call_with_http_info(**kwargs) @@ -560,6 +565,10 @@ def delete_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -591,6 +600,7 @@ def delete_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.delete_pet_endpoint.call_with_http_info(**kwargs) @@ -638,6 +648,10 @@ def find_pets_by_status( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -669,6 +683,7 @@ def find_pets_by_status( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['status'] = \ status return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) @@ -716,6 +731,10 @@ def find_pets_by_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -747,6 +766,7 @@ def find_pets_by_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['tags'] = \ tags return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) @@ -794,6 +814,10 @@ def get_pet_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -825,6 +849,7 @@ def get_pet_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) @@ -871,6 +896,10 @@ def update_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -902,6 +931,7 @@ def update_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet'] = \ pet return self.update_pet_endpoint.call_with_http_info(**kwargs) @@ -950,6 +980,10 @@ def update_pet_with_form( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -981,6 +1015,7 @@ def update_pet_with_form( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['pet_id'] = \ pet_id return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index f5f1d16cbeed..92f96d3909b8 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -277,6 +277,10 @@ def delete_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -308,6 +312,7 @@ def delete_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['order_id'] = \ order_id return self.delete_order_endpoint.call_with_http_info(**kwargs) @@ -352,6 +357,10 @@ def get_inventory( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -383,6 +392,7 @@ def get_inventory( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.get_inventory_endpoint.call_with_http_info(**kwargs) def get_order_by_id( @@ -428,6 +438,10 @@ def get_order_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -459,6 +473,7 @@ def get_order_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['order_id'] = \ order_id return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) @@ -505,6 +520,10 @@ def place_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -536,6 +555,7 @@ def place_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['order'] = \ order return self.place_order_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 81bcdeb6d867..5c64874fb787 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -470,6 +470,10 @@ def create_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -501,6 +505,7 @@ def create_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['user'] = \ user return self.create_user_endpoint.call_with_http_info(**kwargs) @@ -547,6 +552,10 @@ def create_users_with_array_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -578,6 +587,7 @@ def create_users_with_array_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['user'] = \ user return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) @@ -624,6 +634,10 @@ def create_users_with_list_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -655,6 +669,7 @@ def create_users_with_list_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['user'] = \ user return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) @@ -702,6 +717,10 @@ def delete_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -733,6 +752,7 @@ def delete_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username return self.delete_user_endpoint.call_with_http_info(**kwargs) @@ -779,6 +799,10 @@ def get_user_by_name( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -810,6 +834,7 @@ def get_user_by_name( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) @@ -858,6 +883,10 @@ def login_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -889,6 +918,7 @@ def login_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username kwargs['password'] = \ @@ -934,6 +964,10 @@ def logout_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -965,6 +999,7 @@ def logout_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) return self.logout_user_endpoint.call_with_http_info(**kwargs) def update_user( @@ -1012,6 +1047,10 @@ def update_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -1043,6 +1082,7 @@ def update_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['username'] = \ username kwargs['user'] = \ diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index f29efaa1ce14..707227b0a996 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -132,7 +132,8 @@ def __call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _content_type: typing.Optional[str] = None + _content_type: typing.Optional[str] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): config = self.configuration @@ -182,7 +183,8 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + auth_settings, resource_path, method, body, + request_auth=_request_auth) # request url if _host is None: @@ -350,7 +352,8 @@ def call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -398,6 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :type _request_auth: dict, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -412,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type) + _check_type, _request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -425,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type)) + _host, _check_type, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -597,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body): + resource_path, method, body, request_auth=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -607,32 +614,40 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return + if request_auth: + self._apply_auth_params(headers, queries, request_auth) + return + for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, queries) - headers.update(auth_headers) - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - + self._apply_auth_params(headers, queries, auth_setting) + + def _apply_auth_params(self, headers, queries, auth_setting): + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, queries) + headers.update(auth_headers) + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, @@ -681,7 +696,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type', '_check_return_type', '_content_type', - '_spec_property_naming' + '_spec_property_naming', + '_request_auth' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -696,7 +712,8 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_input_type': (bool,), '_check_return_type': (bool,), '_spec_property_naming': (bool,), - '_content_type': (none_type, str) + '_content_type': (none_type, str), + '_request_auth': (none_type, dict) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -870,4 +887,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, + _request_auth=kwargs['_request_auth'], collection_formats=params['collection_format']) From 5407c96f2e64ba58ca302498991cc89e8fcadbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Wed, 12 Jan 2022 09:38:53 +0100 Subject: [PATCH 03/11] LDS-2166 : fix test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- samples/client/petstore/python/test/test_fake_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index d17375a994d5..f0c45b65130b 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -127,6 +127,7 @@ def test_test_endpoint_enums_length_one(self): _request_timeout=None, _return_http_data_only=True, _spec_property_naming=False, + _request_auth=None, async_req=False, header_number=1.234, path_integer=34, From 3ae1e7aa8a3f5ed95e85ae7e39e9887f3a91ab62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Wed, 12 Jan 2022 09:58:04 +0100 Subject: [PATCH 04/11] LDS-2166 : Fixing test in python_disallowAdditionalPropertiesIfNotPresent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../test/test_fake_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py index d17375a994d5..f0c45b65130b 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py @@ -127,6 +127,7 @@ def test_test_endpoint_enums_length_one(self): _request_timeout=None, _return_http_data_only=True, _spec_property_naming=False, + _request_auth=None, async_req=False, header_number=1.234, path_integer=34, From d28099921dc0a1049c4a17a019f8738413560379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Wed, 12 Jan 2022 15:42:17 +0100 Subject: [PATCH 05/11] LDS-2166 : add removed line break MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../src/main/resources/python/api_client.mustache | 1 + samples/client/petstore/python/petstore_api/api_client.py | 1 + .../petstore_api/api_client.py | 1 + .../x-auth-id-alias/python/x_auth_id_alias/api_client.py | 1 + .../dynamic-servers/python/dynamic_servers/api_client.py | 1 + .../openapi3/client/petstore/python/petstore_api/api_client.py | 1 + 6 files changed, 6 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 42b0d2f893c3..82c3c00ddc38 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -663,6 +663,7 @@ class ApiClient(object): 'Authentication token must be in `query` or `header`' ) + class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 80f9d405e845..955a438279da 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -642,6 +642,7 @@ def _apply_auth_params(self, headers, queries, auth_setting): 'Authentication token must be in `query` or `header`' ) + class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index 80f9d405e845..955a438279da 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -642,6 +642,7 @@ def _apply_auth_params(self, headers, queries, auth_setting): 'Authentication token must be in `query` or `header`' ) + class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index 3453589e1311..50aaa2baccb6 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -642,6 +642,7 @@ def _apply_auth_params(self, headers, queries, auth_setting): 'Authentication token must be in `query` or `header`' ) + class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index ffc693976438..4a980f1c54bb 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -642,6 +642,7 @@ def _apply_auth_params(self, headers, queries, auth_setting): 'Authentication token must be in `query` or `header`' ) + class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 707227b0a996..9939290bab00 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -649,6 +649,7 @@ def _apply_auth_params(self, headers, queries, auth_setting): 'Authentication token must be in `query` or `header`' ) + class Endpoint(object): def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): From b9b52c902be0813015650bd8abbc7369d700c0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Tue, 25 Jan 2022 11:01:02 +0100 Subject: [PATCH 06/11] LDS-2166 : add name for _request_auth params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add None when _content_type is not set Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../src/main/resources/python/api_client.mustache | 4 ++-- samples/client/petstore/python/petstore_api/api_client.py | 4 ++-- .../petstore_api/api_client.py | 4 ++-- .../x-auth-id-alias/python/x_auth_id_alias/api_client.py | 4 ++-- .../dynamic-servers/python/dynamic_servers/api_client.py | 4 ++-- .../client/petstore/python/petstore_api/api_client.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 82c3c00ddc38..dc6e098ebba4 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -431,7 +431,7 @@ class ApiClient(object): response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth) + _check_type, _request_auth=_request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -444,7 +444,7 @@ class ApiClient(object): collection_formats, _preload_content, _request_timeout, - _host, _check_type, _request_auth)) + _host, _check_type, None, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 955a438279da..a866f0e36da2 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth) + _check_type, _request_auth=_request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, _request_auth)) + _host, _check_type, None, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index 955a438279da..a866f0e36da2 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth) + _check_type, _request_auth=_request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, _request_auth)) + _host, _check_type, None, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index 50aaa2baccb6..3bc7fb7ebe69 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth) + _check_type, _request_auth=_request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, _request_auth)) + _host, _check_type, None, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index 4a980f1c54bb..6fc940151c58 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth) + _check_type, _request_auth=_request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, _request_auth)) + _host, _check_type, None, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 9939290bab00..affa4b916967 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth) + _check_type, _request_auth=_request_auth) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, _request_auth)) + _host, _check_type, None, _request_auth)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, From 89fe8788ed9c82d7b4771496eee96db096bfad20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Fri, 28 Jan 2022 10:44:22 +0100 Subject: [PATCH 07/11] LDS-2166 : add tabulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../src/main/resources/python/api_client.mustache | 12 ++++++------ .../petstore/python/petstore_api/api_client.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index dc6e098ebba4..88bbcd22ddc0 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -649,12 +649,12 @@ class ApiClient(object): headers[auth_setting['key']] = auth_setting['value'] {{#hasHttpSignatureMethods}} else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, queries) - headers.update(auth_headers) + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, queries) + headers.update(auth_headers) {{/hasHttpSignatureMethods}} elif auth_setting['in'] == 'query': queries.append((auth_setting['key'], auth_setting['value'])) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index affa4b916967..75fa22f17c02 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -636,12 +636,12 @@ def _apply_auth_params(self, headers, queries, auth_setting): if auth_setting['type'] != 'http-signature': headers[auth_setting['key']] = auth_setting['value'] else: - # The HTTP signature scheme requires multiple HTTP headers - # that are calculated dynamically. - signing_info = self.configuration.signing_info - auth_headers = signing_info.get_http_signature_headers( - resource_path, method, headers, body, queries) - headers.update(auth_headers) + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, queries) + headers.update(auth_headers) elif auth_setting['in'] == 'query': queries.append((auth_setting['key'], auth_setting['value'])) else: From 09b46766452d7e9cd57c92f545b9fdf725e26e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Fri, 28 Jan 2022 11:06:03 +0100 Subject: [PATCH 08/11] LDS-2166 : fix missing values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../src/main/resources/python/api_client.mustache | 6 +++--- samples/client/petstore/python/petstore_api/api_client.py | 6 +++--- .../petstore_api/api_client.py | 6 +++--- .../x-auth-id-alias/python/x_auth_id_alias/api_client.py | 6 +++--- .../dynamic-servers/python/dynamic_servers/api_client.py | 6 +++--- .../client/petstore/python/petstore_api/api_client.py | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 88bbcd22ddc0..909f4d384dee 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -633,15 +633,15 @@ class ApiClient(object): return if request_auth: - self._apply_auth_params(headers, queries, request_auth) + self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) return for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) - def _apply_auth_params(self, headers, queries, auth_setting): + def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index a866f0e36da2..2790ede67779 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -621,15 +621,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, request_auth) + self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) return for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) - def _apply_auth_params(self, headers, queries, auth_setting): + def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index a866f0e36da2..2790ede67779 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -621,15 +621,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, request_auth) + self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) return for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) - def _apply_auth_params(self, headers, queries, auth_setting): + def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index 3bc7fb7ebe69..abaf1824fa96 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -621,15 +621,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, request_auth) + self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) return for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) - def _apply_auth_params(self, headers, queries, auth_setting): + def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index 6fc940151c58..63f8dfb5af08 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -621,15 +621,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, request_auth) + self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) return for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) - def _apply_auth_params(self, headers, queries, auth_setting): + def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 75fa22f17c02..4675a6c1d2a1 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -621,15 +621,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, request_auth) + self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) return for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - self._apply_auth_params(headers, queries, auth_setting) + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) - def _apply_auth_params(self, headers, queries, auth_setting): + def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting): if auth_setting['in'] == 'cookie': headers['Cookie'] = auth_setting['value'] elif auth_setting['in'] == 'header': From 9e8483f351c9f477446899ab5d72c5fd73b1dec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Tue, 1 Mar 2022 11:15:31 +0100 Subject: [PATCH 09/11] LDS-2166 : generate sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add _request_auth in sample Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../python/petstore_api/api/fake_classname_tags123_api.py | 5 +++++ .../petstore_api/api/fake_classname_tags123_api.py | 5 +++++ .../python/petstore_api/api/fake_classname_tags123_api.py | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index 70b4a535a815..69537296f488 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -131,6 +131,10 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -162,6 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.test_classname_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py index 70b4a535a815..69537296f488 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py @@ -131,6 +131,10 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -162,6 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['body'] = \ body return self.test_classname_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index a6c187b02518..bc79105589de 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -131,6 +131,10 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. + _request_auth (dict): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None async_req (bool): execute request asynchronously Returns: @@ -162,6 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auth'] = kwargs.get('_request_auth', None) kwargs['client'] = \ client return self.test_classname_endpoint.call_with_http_info(**kwargs) From 4b9d1ec4c586ffed7a67a36a6b32308f82a5dbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Wed, 9 Mar 2022 11:20:08 +0100 Subject: [PATCH 10/11] Request auth can now use multiple auth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Request auth is now a list of dict Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- .../src/main/resources/python/api.mustache | 4 +- .../main/resources/python/api_client.mustache | 29 ++--- .../petstore_api/api/another_fake_api.py | 4 +- .../python/petstore_api/api/fake_api.py | 64 +++++----- .../api/fake_classname_tags123_api.py | 4 +- .../python/petstore_api/api/pet_api.py | 36 +++--- .../python/petstore_api/api/store_api.py | 16 +-- .../python/petstore_api/api/user_api.py | 32 ++--- .../python/petstore_api/api_client.py | 29 ++--- .../petstore_api/api/another_fake_api.py | 4 +- .../petstore_api/api/fake_api.py | 64 +++++----- .../api/fake_classname_tags123_api.py | 4 +- .../petstore_api/api/pet_api.py | 36 +++--- .../petstore_api/api/store_api.py | 16 +-- .../petstore_api/api/user_api.py | 32 ++--- .../petstore_api/api_client.py | 29 ++--- .../python/x_auth_id_alias/api/usage_api.py | 16 +-- .../python/x_auth_id_alias/api_client.py | 29 ++--- .../python/dynamic_servers/api/usage_api.py | 8 +- .../python/dynamic_servers/api_client.py | 29 ++--- .../petstore_api/api/another_fake_api.py | 4 +- .../python/petstore_api/api/default_api.py | 4 +- .../python/petstore_api/api/fake_api.py | 112 +++++++++--------- .../api/fake_classname_tags123_api.py | 4 +- .../python/petstore_api/api/pet_api.py | 28 ++--- .../python/petstore_api/api/store_api.py | 16 +-- .../python/petstore_api/api/user_api.py | 32 ++--- .../python/petstore_api/api_client.py | 29 ++--- 28 files changed, 360 insertions(+), 354 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 44c26404501a..a9021cff5aa1 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -280,7 +280,7 @@ class {{classname}}(object): _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -315,7 +315,7 @@ class {{classname}}(object): kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) {{#requiredParams}} kwargs['{{paramName}}'] = \ {{paramName}} diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 4722787aa135..890e813beee4 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -131,7 +131,7 @@ class ApiClient(object): _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, _content_type: typing.Optional[str] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): config = self.configuration @@ -182,7 +182,7 @@ class ApiClient(object): # auth setting self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body, - request_auth=_request_auth) + request_auths=_request_auths) # request url if _host is None: @@ -365,7 +365,7 @@ class ApiClient(object): _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -413,10 +413,10 @@ class ApiClient(object): :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional - :param _request_auth: set to override the auth_settings for an a single + :param _request_auths: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. - :type _request_auth: dict, optional + :type _request_auths: list, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -431,7 +431,7 @@ class ApiClient(object): response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth=_request_auth) + _check_type, _request_auths=_request_auths) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -444,7 +444,7 @@ class ApiClient(object): collection_formats, _preload_content, _request_timeout, - _host, _check_type, None, _request_auth)) + _host, _check_type, None, _request_auths)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -616,7 +616,7 @@ class ApiClient(object): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auth=None): + resource_path, method, body, request_auths=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -626,14 +626,15 @@ class ApiClient(object): :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). - :param request_auth: if set, the provided settings will + :param request_auths: if set, the provided settings will override the token in the configuration. """ if not auth_settings: return - if request_auth: - self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) + if request_auths: + for auth_setting in request_auths: + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) return for auth in auth_settings: @@ -712,7 +713,7 @@ class Endpoint(object): '_check_return_type', '_content_type', '_spec_property_naming', - '_request_auth' + '_request_auths' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -728,7 +729,7 @@ class Endpoint(object): '_check_return_type': (bool,), '_spec_property_naming': (bool,), '_content_type': (none_type, str), - '_request_auth': (none_type, dict) + '_request_auths': (none_type, list) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -903,5 +904,5 @@ class Endpoint(object): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, - _request_auth=kwargs['_request_auth'], + _request_auths=kwargs['_request_auths'], collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index 2fb0838c7393..d54ded04e311 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -129,7 +129,7 @@ def call_123_test_special_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -164,7 +164,7 @@ def call_123_test_special_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index dfc39d66e87c..98536575b077 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1142,7 +1142,7 @@ def array_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1177,7 +1177,7 @@ def array_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.array_model_endpoint.call_with_http_info(**kwargs) def boolean( @@ -1221,7 +1221,7 @@ def boolean( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1256,7 +1256,7 @@ def boolean( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.boolean_endpoint.call_with_http_info(**kwargs) def create_xml_item( @@ -1302,7 +1302,7 @@ def create_xml_item( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1337,7 +1337,7 @@ def create_xml_item( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['xml_item'] = \ xml_item return self.create_xml_item_endpoint.call_with_http_info(**kwargs) @@ -1383,7 +1383,7 @@ def number_with_validations( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1418,7 +1418,7 @@ def number_with_validations( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.number_with_validations_endpoint.call_with_http_info(**kwargs) def object_model_with_ref_props( @@ -1462,7 +1462,7 @@ def object_model_with_ref_props( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1497,7 +1497,7 @@ def object_model_with_ref_props( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) def string( @@ -1541,7 +1541,7 @@ def string( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1576,7 +1576,7 @@ def string( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.string_endpoint.call_with_http_info(**kwargs) def string_enum( @@ -1620,7 +1620,7 @@ def string_enum( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1655,7 +1655,7 @@ def string_enum( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.string_enum_endpoint.call_with_http_info(**kwargs) def test_body_with_file_schema( @@ -1701,7 +1701,7 @@ def test_body_with_file_schema( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1736,7 +1736,7 @@ def test_body_with_file_schema( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) @@ -1785,7 +1785,7 @@ def test_body_with_query_params( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1820,7 +1820,7 @@ def test_body_with_query_params( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['query'] = \ query kwargs['body'] = \ @@ -1870,7 +1870,7 @@ def test_client_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1905,7 +1905,7 @@ def test_client_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.test_client_model_endpoint.call_with_http_info(**kwargs) @@ -1961,7 +1961,7 @@ def test_endpoint_enums_length_one( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1996,7 +1996,7 @@ def test_endpoint_enums_length_one( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['query_integer'] = \ query_integer kwargs['query_string'] = \ @@ -2068,7 +2068,7 @@ def test_endpoint_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2103,7 +2103,7 @@ def test_endpoint_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['number'] = \ number kwargs['double'] = \ @@ -2162,7 +2162,7 @@ def test_enum_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2197,7 +2197,7 @@ def test_enum_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) def test_group_parameters( @@ -2250,7 +2250,7 @@ def test_group_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2285,7 +2285,7 @@ def test_group_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['required_string_group'] = \ required_string_group kwargs['required_boolean_group'] = \ @@ -2336,7 +2336,7 @@ def test_inline_additional_properties( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2371,7 +2371,7 @@ def test_inline_additional_properties( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['param'] = \ param return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) @@ -2420,7 +2420,7 @@ def test_json_form_data( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2455,7 +2455,7 @@ def test_json_form_data( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['param'] = \ param kwargs['param2'] = \ diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index 69537296f488..e6abced84092 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -131,7 +131,7 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -166,7 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.test_classname_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index 5a927728c44d..af164a6ce79c 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -594,7 +594,7 @@ def add_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -629,7 +629,7 @@ def add_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.add_pet_endpoint.call_with_http_info(**kwargs) @@ -677,7 +677,7 @@ def delete_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -712,7 +712,7 @@ def delete_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.delete_pet_endpoint.call_with_http_info(**kwargs) @@ -760,7 +760,7 @@ def find_pets_by_status( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -795,7 +795,7 @@ def find_pets_by_status( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['status'] = \ status return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) @@ -843,7 +843,7 @@ def find_pets_by_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -878,7 +878,7 @@ def find_pets_by_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['tags'] = \ tags return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) @@ -926,7 +926,7 @@ def get_pet_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -961,7 +961,7 @@ def get_pet_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) @@ -1008,7 +1008,7 @@ def update_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1043,7 +1043,7 @@ def update_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.update_pet_endpoint.call_with_http_info(**kwargs) @@ -1092,7 +1092,7 @@ def update_pet_with_form( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1127,7 +1127,7 @@ def update_pet_with_form( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) @@ -1177,7 +1177,7 @@ def upload_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1212,7 +1212,7 @@ def upload_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.upload_file_endpoint.call_with_http_info(**kwargs) @@ -1262,7 +1262,7 @@ def upload_file_with_required_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1297,7 +1297,7 @@ def upload_file_with_required_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id kwargs['required_file'] = \ diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index cab6296939f0..98e47ccdf869 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -275,7 +275,7 @@ def delete_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -310,7 +310,7 @@ def delete_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['order_id'] = \ order_id return self.delete_order_endpoint.call_with_http_info(**kwargs) @@ -355,7 +355,7 @@ def get_inventory( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -390,7 +390,7 @@ def get_inventory( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.get_inventory_endpoint.call_with_http_info(**kwargs) def get_order_by_id( @@ -436,7 +436,7 @@ def get_order_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -471,7 +471,7 @@ def get_order_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['order_id'] = \ order_id return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) @@ -518,7 +518,7 @@ def place_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -553,7 +553,7 @@ def place_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.place_order_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 6b8eb81faffe..5f3964342921 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -462,7 +462,7 @@ def create_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -497,7 +497,7 @@ def create_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.create_user_endpoint.call_with_http_info(**kwargs) @@ -544,7 +544,7 @@ def create_users_with_array_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -579,7 +579,7 @@ def create_users_with_array_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) @@ -626,7 +626,7 @@ def create_users_with_list_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -661,7 +661,7 @@ def create_users_with_list_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) @@ -709,7 +709,7 @@ def delete_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -744,7 +744,7 @@ def delete_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username return self.delete_user_endpoint.call_with_http_info(**kwargs) @@ -791,7 +791,7 @@ def get_user_by_name( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -826,7 +826,7 @@ def get_user_by_name( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) @@ -875,7 +875,7 @@ def login_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -910,7 +910,7 @@ def login_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username kwargs['password'] = \ @@ -956,7 +956,7 @@ def logout_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -991,7 +991,7 @@ def logout_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.logout_user_endpoint.call_with_http_info(**kwargs) def update_user( @@ -1039,7 +1039,7 @@ def update_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1074,7 +1074,7 @@ def update_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username kwargs['body'] = \ diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index f2c927ff5bbf..e283cf092d71 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -133,7 +133,7 @@ def __call_api( _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, _content_type: typing.Optional[str] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): config = self.configuration @@ -184,7 +184,7 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body, - request_auth=_request_auth) + request_auths=_request_auths) # request url if _host is None: @@ -353,7 +353,7 @@ def call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -401,10 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional - :param _request_auth: set to override the auth_settings for an a single + :param _request_auths: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. - :type _request_auth: dict, optional + :type _request_auths: list, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth=_request_auth) + _check_type, _request_auths=_request_auths) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, None, _request_auth)) + _host, _check_type, None, _request_auths)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -604,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auth=None): + resource_path, method, body, request_auths=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -614,14 +614,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). - :param request_auth: if set, the provided settings will + :param request_auths: if set, the provided settings will override the token in the configuration. """ if not auth_settings: return - if request_auth: - self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) + if request_auths: + for auth_setting in request_auths: + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) return for auth in auth_settings: @@ -691,7 +692,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type', '_content_type', '_spec_property_naming', - '_request_auth' + '_request_auths' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -707,7 +708,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type': (bool,), '_spec_property_naming': (bool,), '_content_type': (none_type, str), - '_request_auth': (none_type, dict) + '_request_auths': (none_type, list) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -882,5 +883,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, - _request_auth=kwargs['_request_auth'], + _request_auths=kwargs['_request_auths'], collection_formats=params['collection_format']) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py index 2fb0838c7393..d54ded04e311 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py @@ -129,7 +129,7 @@ def call_123_test_special_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -164,7 +164,7 @@ def call_123_test_special_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py index dfc39d66e87c..98536575b077 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py @@ -1142,7 +1142,7 @@ def array_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1177,7 +1177,7 @@ def array_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.array_model_endpoint.call_with_http_info(**kwargs) def boolean( @@ -1221,7 +1221,7 @@ def boolean( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1256,7 +1256,7 @@ def boolean( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.boolean_endpoint.call_with_http_info(**kwargs) def create_xml_item( @@ -1302,7 +1302,7 @@ def create_xml_item( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1337,7 +1337,7 @@ def create_xml_item( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['xml_item'] = \ xml_item return self.create_xml_item_endpoint.call_with_http_info(**kwargs) @@ -1383,7 +1383,7 @@ def number_with_validations( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1418,7 +1418,7 @@ def number_with_validations( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.number_with_validations_endpoint.call_with_http_info(**kwargs) def object_model_with_ref_props( @@ -1462,7 +1462,7 @@ def object_model_with_ref_props( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1497,7 +1497,7 @@ def object_model_with_ref_props( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) def string( @@ -1541,7 +1541,7 @@ def string( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1576,7 +1576,7 @@ def string( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.string_endpoint.call_with_http_info(**kwargs) def string_enum( @@ -1620,7 +1620,7 @@ def string_enum( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1655,7 +1655,7 @@ def string_enum( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.string_enum_endpoint.call_with_http_info(**kwargs) def test_body_with_file_schema( @@ -1701,7 +1701,7 @@ def test_body_with_file_schema( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1736,7 +1736,7 @@ def test_body_with_file_schema( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) @@ -1785,7 +1785,7 @@ def test_body_with_query_params( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1820,7 +1820,7 @@ def test_body_with_query_params( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['query'] = \ query kwargs['body'] = \ @@ -1870,7 +1870,7 @@ def test_client_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1905,7 +1905,7 @@ def test_client_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.test_client_model_endpoint.call_with_http_info(**kwargs) @@ -1961,7 +1961,7 @@ def test_endpoint_enums_length_one( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1996,7 +1996,7 @@ def test_endpoint_enums_length_one( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['query_integer'] = \ query_integer kwargs['query_string'] = \ @@ -2068,7 +2068,7 @@ def test_endpoint_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2103,7 +2103,7 @@ def test_endpoint_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['number'] = \ number kwargs['double'] = \ @@ -2162,7 +2162,7 @@ def test_enum_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2197,7 +2197,7 @@ def test_enum_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) def test_group_parameters( @@ -2250,7 +2250,7 @@ def test_group_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2285,7 +2285,7 @@ def test_group_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['required_string_group'] = \ required_string_group kwargs['required_boolean_group'] = \ @@ -2336,7 +2336,7 @@ def test_inline_additional_properties( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2371,7 +2371,7 @@ def test_inline_additional_properties( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['param'] = \ param return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) @@ -2420,7 +2420,7 @@ def test_json_form_data( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2455,7 +2455,7 @@ def test_json_form_data( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['param'] = \ param kwargs['param2'] = \ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py index 69537296f488..e6abced84092 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags123_api.py @@ -131,7 +131,7 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -166,7 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.test_classname_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py index 5a927728c44d..af164a6ce79c 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py @@ -594,7 +594,7 @@ def add_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -629,7 +629,7 @@ def add_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.add_pet_endpoint.call_with_http_info(**kwargs) @@ -677,7 +677,7 @@ def delete_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -712,7 +712,7 @@ def delete_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.delete_pet_endpoint.call_with_http_info(**kwargs) @@ -760,7 +760,7 @@ def find_pets_by_status( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -795,7 +795,7 @@ def find_pets_by_status( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['status'] = \ status return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) @@ -843,7 +843,7 @@ def find_pets_by_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -878,7 +878,7 @@ def find_pets_by_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['tags'] = \ tags return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) @@ -926,7 +926,7 @@ def get_pet_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -961,7 +961,7 @@ def get_pet_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) @@ -1008,7 +1008,7 @@ def update_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1043,7 +1043,7 @@ def update_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.update_pet_endpoint.call_with_http_info(**kwargs) @@ -1092,7 +1092,7 @@ def update_pet_with_form( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1127,7 +1127,7 @@ def update_pet_with_form( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) @@ -1177,7 +1177,7 @@ def upload_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1212,7 +1212,7 @@ def upload_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.upload_file_endpoint.call_with_http_info(**kwargs) @@ -1262,7 +1262,7 @@ def upload_file_with_required_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1297,7 +1297,7 @@ def upload_file_with_required_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id kwargs['required_file'] = \ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py index cab6296939f0..98e47ccdf869 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py @@ -275,7 +275,7 @@ def delete_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -310,7 +310,7 @@ def delete_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['order_id'] = \ order_id return self.delete_order_endpoint.call_with_http_info(**kwargs) @@ -355,7 +355,7 @@ def get_inventory( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -390,7 +390,7 @@ def get_inventory( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.get_inventory_endpoint.call_with_http_info(**kwargs) def get_order_by_id( @@ -436,7 +436,7 @@ def get_order_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -471,7 +471,7 @@ def get_order_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['order_id'] = \ order_id return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) @@ -518,7 +518,7 @@ def place_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -553,7 +553,7 @@ def place_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.place_order_endpoint.call_with_http_info(**kwargs) diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py index 6b8eb81faffe..5f3964342921 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py @@ -462,7 +462,7 @@ def create_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -497,7 +497,7 @@ def create_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.create_user_endpoint.call_with_http_info(**kwargs) @@ -544,7 +544,7 @@ def create_users_with_array_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -579,7 +579,7 @@ def create_users_with_array_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) @@ -626,7 +626,7 @@ def create_users_with_list_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -661,7 +661,7 @@ def create_users_with_list_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) @@ -709,7 +709,7 @@ def delete_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -744,7 +744,7 @@ def delete_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username return self.delete_user_endpoint.call_with_http_info(**kwargs) @@ -791,7 +791,7 @@ def get_user_by_name( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -826,7 +826,7 @@ def get_user_by_name( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) @@ -875,7 +875,7 @@ def login_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -910,7 +910,7 @@ def login_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username kwargs['password'] = \ @@ -956,7 +956,7 @@ def logout_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -991,7 +991,7 @@ def logout_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.logout_user_endpoint.call_with_http_info(**kwargs) def update_user( @@ -1039,7 +1039,7 @@ def update_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1074,7 +1074,7 @@ def update_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username kwargs['body'] = \ diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index f2c927ff5bbf..e283cf092d71 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -133,7 +133,7 @@ def __call_api( _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, _content_type: typing.Optional[str] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): config = self.configuration @@ -184,7 +184,7 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body, - request_auth=_request_auth) + request_auths=_request_auths) # request url if _host is None: @@ -353,7 +353,7 @@ def call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -401,10 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional - :param _request_auth: set to override the auth_settings for an a single + :param _request_auths: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. - :type _request_auth: dict, optional + :type _request_auths: list, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth=_request_auth) + _check_type, _request_auths=_request_auths) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, None, _request_auth)) + _host, _check_type, None, _request_auths)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -604,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auth=None): + resource_path, method, body, request_auths=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -614,14 +614,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). - :param request_auth: if set, the provided settings will + :param request_auths: if set, the provided settings will override the token in the configuration. """ if not auth_settings: return - if request_auth: - self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) + if request_auths: + for auth_setting in request_auths: + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) return for auth in auth_settings: @@ -691,7 +692,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type', '_content_type', '_spec_property_naming', - '_request_auth' + '_request_auths' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -707,7 +708,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type': (bool,), '_spec_property_naming': (bool,), '_content_type': (none_type, str), - '_request_auth': (none_type, dict) + '_request_auths': (none_type, list) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -882,5 +883,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, - _request_auth=kwargs['_request_auth'], + _request_auths=kwargs['_request_auths'], collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py index 7f9a413ac1b0..7307adb01c07 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py @@ -253,7 +253,7 @@ def any_key( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -288,7 +288,7 @@ def any_key( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.any_key_endpoint.call_with_http_info(**kwargs) def both_keys( @@ -331,7 +331,7 @@ def both_keys( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -366,7 +366,7 @@ def both_keys( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.both_keys_endpoint.call_with_http_info(**kwargs) def key_in_header( @@ -409,7 +409,7 @@ def key_in_header( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -444,7 +444,7 @@ def key_in_header( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.key_in_header_endpoint.call_with_http_info(**kwargs) def key_in_query( @@ -487,7 +487,7 @@ def key_in_query( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -522,6 +522,6 @@ def key_in_query( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.key_in_query_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index 7ea2f036f176..eb7268814fa9 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -133,7 +133,7 @@ def __call_api( _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, _content_type: typing.Optional[str] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): config = self.configuration @@ -184,7 +184,7 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body, - request_auth=_request_auth) + request_auths=_request_auths) # request url if _host is None: @@ -353,7 +353,7 @@ def call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -401,10 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional - :param _request_auth: set to override the auth_settings for an a single + :param _request_auths: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. - :type _request_auth: dict, optional + :type _request_auths: list, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth=_request_auth) + _check_type, _request_auths=_request_auths) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, None, _request_auth)) + _host, _check_type, None, _request_auths)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -604,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auth=None): + resource_path, method, body, request_auths=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -614,14 +614,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). - :param request_auth: if set, the provided settings will + :param request_auths: if set, the provided settings will override the token in the configuration. """ if not auth_settings: return - if request_auth: - self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) + if request_auths: + for auth_setting in request_auths: + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) return for auth in auth_settings: @@ -691,7 +692,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type', '_content_type', '_spec_property_naming', - '_request_auth' + '_request_auths' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -707,7 +708,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type': (bool,), '_spec_property_naming': (bool,), '_content_type': (none_type, str), - '_request_auth': (none_type, dict) + '_request_auths': (none_type, list) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -882,5 +883,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, - _request_auth=kwargs['_request_auth'], + _request_auths=kwargs['_request_auths'], collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py index 9ca32f2ed141..d634bce7b5a7 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py @@ -208,7 +208,7 @@ def custom_server( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -243,7 +243,7 @@ def custom_server( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.custom_server_endpoint.call_with_http_info(**kwargs) def default_server( @@ -286,7 +286,7 @@ def default_server( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -321,6 +321,6 @@ def default_server( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.default_server_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index cc5a777f77aa..61d33ce421c7 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -133,7 +133,7 @@ def __call_api( _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, _content_type: typing.Optional[str] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): config = self.configuration @@ -184,7 +184,7 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body, - request_auth=_request_auth) + request_auths=_request_auths) # request url if _host is None: @@ -353,7 +353,7 @@ def call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -401,10 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional - :param _request_auth: set to override the auth_settings for an a single + :param _request_auths: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. - :type _request_auth: dict, optional + :type _request_auths: list, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth=_request_auth) + _check_type, _request_auths=_request_auths) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, None, _request_auth)) + _host, _check_type, None, _request_auths)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -604,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auth=None): + resource_path, method, body, request_auths=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -614,14 +614,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). - :param request_auth: if set, the provided settings will + :param request_auths: if set, the provided settings will override the token in the configuration. """ if not auth_settings: return - if request_auth: - self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) + if request_auths: + for auth_setting in request_auths: + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) return for auth in auth_settings: @@ -691,7 +692,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type', '_content_type', '_spec_property_naming', - '_request_auth' + '_request_auths' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -707,7 +708,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type': (bool,), '_spec_property_naming': (bool,), '_content_type': (none_type, str), - '_request_auth': (none_type, dict) + '_request_auths': (none_type, list) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -882,5 +883,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, - _request_auth=kwargs['_request_auth'], + _request_auths=kwargs['_request_auths'], collection_formats=params['collection_format']) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index 1ae7ba1b000f..9945fc1ee9b7 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -129,7 +129,7 @@ def call_123_test_special_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -164,7 +164,7 @@ def call_123_test_special_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['client'] = \ client return self.call_123_test_special_tags_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 7b9fe8e220d9..c3515258b952 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -117,7 +117,7 @@ def foo_get( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -152,6 +152,6 @@ def foo_get( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.foo_get_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 3a81e9f2c504..e36e3b013121 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -1730,7 +1730,7 @@ def additional_properties_with_array_of_enums( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1765,7 +1765,7 @@ def additional_properties_with_array_of_enums( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.additional_properties_with_array_of_enums_endpoint.call_with_http_info(**kwargs) def array_model( @@ -1809,7 +1809,7 @@ def array_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1844,7 +1844,7 @@ def array_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.array_model_endpoint.call_with_http_info(**kwargs) def array_of_enums( @@ -1887,7 +1887,7 @@ def array_of_enums( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1922,7 +1922,7 @@ def array_of_enums( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.array_of_enums_endpoint.call_with_http_info(**kwargs) def boolean( @@ -1966,7 +1966,7 @@ def boolean( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2001,7 +2001,7 @@ def boolean( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.boolean_endpoint.call_with_http_info(**kwargs) def composed_one_of_number_with_validations( @@ -2045,7 +2045,7 @@ def composed_one_of_number_with_validations( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2080,7 +2080,7 @@ def composed_one_of_number_with_validations( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.composed_one_of_number_with_validations_endpoint.call_with_http_info(**kwargs) def download_attachment( @@ -2125,7 +2125,7 @@ def download_attachment( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2160,7 +2160,7 @@ def download_attachment( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['file_name'] = \ file_name return self.download_attachment_endpoint.call_with_http_info(**kwargs) @@ -2205,7 +2205,7 @@ def enum_test( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2240,7 +2240,7 @@ def enum_test( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.enum_test_endpoint.call_with_http_info(**kwargs) def fake_health_get( @@ -2282,7 +2282,7 @@ def fake_health_get( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2317,7 +2317,7 @@ def fake_health_get( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.fake_health_get_endpoint.call_with_http_info(**kwargs) def mammal( @@ -2363,7 +2363,7 @@ def mammal( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2398,7 +2398,7 @@ def mammal( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['mammal'] = \ mammal return self.mammal_endpoint.call_with_http_info(**kwargs) @@ -2444,7 +2444,7 @@ def number_with_validations( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2479,7 +2479,7 @@ def number_with_validations( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.number_with_validations_endpoint.call_with_http_info(**kwargs) def object_model_with_ref_props( @@ -2523,7 +2523,7 @@ def object_model_with_ref_props( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2558,7 +2558,7 @@ def object_model_with_ref_props( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) def post_inline_additional_properties_payload( @@ -2601,7 +2601,7 @@ def post_inline_additional_properties_payload( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2636,7 +2636,7 @@ def post_inline_additional_properties_payload( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.post_inline_additional_properties_payload_endpoint.call_with_http_info(**kwargs) def post_inline_additional_properties_ref_payload( @@ -2679,7 +2679,7 @@ def post_inline_additional_properties_ref_payload( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2714,7 +2714,7 @@ def post_inline_additional_properties_ref_payload( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.post_inline_additional_properties_ref_payload_endpoint.call_with_http_info(**kwargs) def string( @@ -2758,7 +2758,7 @@ def string( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2793,7 +2793,7 @@ def string( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.string_endpoint.call_with_http_info(**kwargs) def string_enum( @@ -2837,7 +2837,7 @@ def string_enum( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2872,7 +2872,7 @@ def string_enum( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.string_enum_endpoint.call_with_http_info(**kwargs) def test_body_with_file_schema( @@ -2918,7 +2918,7 @@ def test_body_with_file_schema( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -2953,7 +2953,7 @@ def test_body_with_file_schema( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['file_schema_test_class'] = \ file_schema_test_class return self.test_body_with_file_schema_endpoint.call_with_http_info(**kwargs) @@ -3002,7 +3002,7 @@ def test_body_with_query_params( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3037,7 +3037,7 @@ def test_body_with_query_params( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['query'] = \ query kwargs['user'] = \ @@ -3087,7 +3087,7 @@ def test_client_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3122,7 +3122,7 @@ def test_client_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['client'] = \ client return self.test_client_model_endpoint.call_with_http_info(**kwargs) @@ -3186,7 +3186,7 @@ def test_endpoint_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3221,7 +3221,7 @@ def test_endpoint_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['number'] = \ number kwargs['double'] = \ @@ -3280,7 +3280,7 @@ def test_enum_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3315,7 +3315,7 @@ def test_enum_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) def test_group_parameters( @@ -3368,7 +3368,7 @@ def test_group_parameters( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3403,7 +3403,7 @@ def test_group_parameters( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['required_string_group'] = \ required_string_group kwargs['required_boolean_group'] = \ @@ -3455,7 +3455,7 @@ def test_inline_additional_properties( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3490,7 +3490,7 @@ def test_inline_additional_properties( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['request_body'] = \ request_body return self.test_inline_additional_properties_endpoint.call_with_http_info(**kwargs) @@ -3540,7 +3540,7 @@ def test_json_form_data( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3575,7 +3575,7 @@ def test_json_form_data( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['param'] = \ param kwargs['param2'] = \ @@ -3633,7 +3633,7 @@ def test_query_parameter_collection_format( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3668,7 +3668,7 @@ def test_query_parameter_collection_format( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pipe'] = \ pipe kwargs['ioutil'] = \ @@ -3721,7 +3721,7 @@ def tx_rx_any_of_model( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3756,7 +3756,7 @@ def tx_rx_any_of_model( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.tx_rx_any_of_model_endpoint.call_with_http_info(**kwargs) def upload_download_file( @@ -3802,7 +3802,7 @@ def upload_download_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3837,7 +3837,7 @@ def upload_download_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['body'] = \ body return self.upload_download_file_endpoint.call_with_http_info(**kwargs) @@ -3886,7 +3886,7 @@ def upload_file( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -3921,7 +3921,7 @@ def upload_file( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['file'] = \ file return self.upload_file_endpoint.call_with_http_info(**kwargs) @@ -3967,7 +3967,7 @@ def upload_files( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -4002,6 +4002,6 @@ def upload_files( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.upload_files_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py index bc79105589de..95f69b706e09 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags123_api.py @@ -131,7 +131,7 @@ def test_classname( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -166,7 +166,7 @@ def test_classname( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['client'] = \ client return self.test_classname_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index eb38329aea63..562acfd41223 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -483,7 +483,7 @@ def add_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -518,7 +518,7 @@ def add_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet'] = \ pet return self.add_pet_endpoint.call_with_http_info(**kwargs) @@ -567,7 +567,7 @@ def delete_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -602,7 +602,7 @@ def delete_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.delete_pet_endpoint.call_with_http_info(**kwargs) @@ -650,7 +650,7 @@ def find_pets_by_status( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -685,7 +685,7 @@ def find_pets_by_status( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['status'] = \ status return self.find_pets_by_status_endpoint.call_with_http_info(**kwargs) @@ -733,7 +733,7 @@ def find_pets_by_tags( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -768,7 +768,7 @@ def find_pets_by_tags( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['tags'] = \ tags return self.find_pets_by_tags_endpoint.call_with_http_info(**kwargs) @@ -816,7 +816,7 @@ def get_pet_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -851,7 +851,7 @@ def get_pet_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.get_pet_by_id_endpoint.call_with_http_info(**kwargs) @@ -899,7 +899,7 @@ def update_pet( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -934,7 +934,7 @@ def update_pet( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet'] = \ pet return self.update_pet_endpoint.call_with_http_info(**kwargs) @@ -984,7 +984,7 @@ def update_pet_with_form( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1019,7 +1019,7 @@ def update_pet_with_form( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['pet_id'] = \ pet_id return self.update_pet_with_form_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index 661971144cdb..1e63e3bef307 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -277,7 +277,7 @@ def delete_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -312,7 +312,7 @@ def delete_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['order_id'] = \ order_id return self.delete_order_endpoint.call_with_http_info(**kwargs) @@ -357,7 +357,7 @@ def get_inventory( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -392,7 +392,7 @@ def get_inventory( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.get_inventory_endpoint.call_with_http_info(**kwargs) def get_order_by_id( @@ -438,7 +438,7 @@ def get_order_by_id( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -473,7 +473,7 @@ def get_order_by_id( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['order_id'] = \ order_id return self.get_order_by_id_endpoint.call_with_http_info(**kwargs) @@ -521,7 +521,7 @@ def place_order( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -556,7 +556,7 @@ def place_order( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['order'] = \ order return self.place_order_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 1f3cd40899a9..38c7f659bddb 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -470,7 +470,7 @@ def create_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -505,7 +505,7 @@ def create_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['user'] = \ user return self.create_user_endpoint.call_with_http_info(**kwargs) @@ -553,7 +553,7 @@ def create_users_with_array_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -588,7 +588,7 @@ def create_users_with_array_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['user'] = \ user return self.create_users_with_array_input_endpoint.call_with_http_info(**kwargs) @@ -636,7 +636,7 @@ def create_users_with_list_input( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -671,7 +671,7 @@ def create_users_with_list_input( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['user'] = \ user return self.create_users_with_list_input_endpoint.call_with_http_info(**kwargs) @@ -719,7 +719,7 @@ def delete_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -754,7 +754,7 @@ def delete_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username return self.delete_user_endpoint.call_with_http_info(**kwargs) @@ -802,7 +802,7 @@ def get_user_by_name( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -837,7 +837,7 @@ def get_user_by_name( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username return self.get_user_by_name_endpoint.call_with_http_info(**kwargs) @@ -887,7 +887,7 @@ def login_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -922,7 +922,7 @@ def login_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username kwargs['password'] = \ @@ -969,7 +969,7 @@ def logout_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1004,7 +1004,7 @@ def logout_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) return self.logout_user_endpoint.call_with_http_info(**kwargs) def update_user( @@ -1052,7 +1052,7 @@ def update_user( _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. - _request_auth (dict): set to override the auth_settings for an a single + _request_auths (list): set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. Default is None @@ -1087,7 +1087,7 @@ def update_user( kwargs['_content_type'] = kwargs.get( '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['_request_auth'] = kwargs.get('_request_auth', None) + kwargs['_request_auths'] = kwargs.get('_request_auths', None) kwargs['username'] = \ username kwargs['user'] = \ diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 8c243b4f55a7..eb1abcf5cc35 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -133,7 +133,7 @@ def __call_api( _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, _content_type: typing.Optional[str] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): config = self.configuration @@ -184,7 +184,7 @@ def __call_api( # auth setting self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body, - request_auth=_request_auth) + request_auths=_request_auths) # request url if _host is None: @@ -353,7 +353,7 @@ def call_api( _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, - _request_auth: typing.Optional[typing.Dict[str, typing.Any]] = None + _request_auths: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = None ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -401,10 +401,10 @@ def call_api( :param _check_type: boolean describing if the data back from the server should have its type checked. :type _check_type: bool, optional - :param _request_auth: set to override the auth_settings for an a single + :param _request_auths: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request. - :type _request_auth: dict, optional + :type _request_auths: list, optional :return: If async_req parameter is True, the request will be called asynchronously. @@ -419,7 +419,7 @@ def call_api( response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host, - _check_type, _request_auth=_request_auth) + _check_type, _request_auths=_request_auths) return self.pool.apply_async(self.__call_api, (resource_path, method, path_params, @@ -432,7 +432,7 @@ def call_api( collection_formats, _preload_content, _request_timeout, - _host, _check_type, None, _request_auth)) + _host, _check_type, None, _request_auths)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, @@ -604,7 +604,7 @@ def select_header_content_type(self, content_types, method=None, body=None): return content_types[0] def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, request_auth=None): + resource_path, method, body, request_auths=None): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -614,14 +614,15 @@ def update_params_for_auth(self, headers, queries, auth_settings, :param method: A string representation of the HTTP request method. :param body: A object representing the body of the HTTP request. The object type is the return value of _encoder.default(). - :param request_auth: if set, the provided settings will + :param request_auths: if set, the provided settings will override the token in the configuration. """ if not auth_settings: return - if request_auth: - self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) + if request_auths: + for auth_setting in request_auths: + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) return for auth in auth_settings: @@ -698,7 +699,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type', '_content_type', '_spec_property_naming', - '_request_auth' + '_request_auths' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -714,7 +715,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_check_return_type': (bool,), '_spec_property_naming': (bool,), '_content_type': (none_type, str), - '_request_auth': (none_type, dict) + '_request_auths': (none_type, list) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -889,5 +890,5 @@ def call_with_http_info(self, **kwargs): _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, - _request_auth=kwargs['_request_auth'], + _request_auths=kwargs['_request_auths'], collection_formats=params['collection_format']) From 577e2720b34e30efa74112a011da8483a114e115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ge=CC=81ry=20THRASIBULE?= Date: Thu, 10 Mar 2022 14:21:42 +0100 Subject: [PATCH 11/11] Add request_auths in test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Envoyé depuis mon iPhone. P.S. : Ce commit est certifié sans gluten --- samples/client/petstore/python/test/test_fake_api.py | 2 +- .../test/test_fake_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index f0c45b65130b..d5ea58566103 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -127,7 +127,7 @@ def test_test_endpoint_enums_length_one(self): _request_timeout=None, _return_http_data_only=True, _spec_property_naming=False, - _request_auth=None, + _request_auths=None, async_req=False, header_number=1.234, path_integer=34, diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py index f0c45b65130b..d5ea58566103 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py @@ -127,7 +127,7 @@ def test_test_endpoint_enums_length_one(self): _request_timeout=None, _return_http_data_only=True, _spec_property_naming=False, - _request_auth=None, + _request_auths=None, async_req=False, header_number=1.234, path_integer=34,