Exemplo n.º 1
0
 def __init__(self, api_client=None):
     if api_client is None:
         api_client = ApiClient()
     self.api_client = api_client
     self.test_classname_endpoint = _Endpoint(
         settings={
             'response_type': (Client,),
             'auth': [
                 'api_key_query'
             ],
             'endpoint_path': '/fake_classname_test',
             'operation_id': 'test_classname',
             'http_method': 'PATCH',
             'servers': None,
         },
         params_map={
             'all': [
                 'client',
             ],
             'required': [
                 'client',
             ],
             'nullable': [
             ],
             'enum': [
             ],
             'validation': [
             ]
         },
         root_map={
             'validations': {
             },
             'allowed_values': {
             },
             'openapi_types': {
                 'client':
                     (Client,),
             },
             'attribute_map': {
             },
             'location_map': {
                 'client': 'body',
             },
             'collection_format_map': {
             }
         },
         headers_map={
             'accept': [
                 'application/json'
             ],
             'content_type': [
                 'application/json'
             ]
         },
         api_client=api_client
     )
Exemplo n.º 2
0
 def __init__(self, api_client=None):
     if api_client is None:
         api_client = ApiClient()
     self.api_client = api_client
     self.foo_get_endpoint = _Endpoint(
         settings={
             'response_type': (InlineResponseDefault,),
             'auth': [],
             'endpoint_path': '/foo',
             'operation_id': 'foo_get',
             'http_method': 'GET',
             'servers': None,
         },
         params_map={
             'all': [
             ],
             'required': [],
             'nullable': [
             ],
             'enum': [
             ],
             'validation': [
             ]
         },
         root_map={
             'validations': {
             },
             'allowed_values': {
             },
             'openapi_types': {
             },
             'attribute_map': {
             },
             'location_map': {
             },
             'collection_format_map': {
             }
         },
         headers_map={
             'accept': [
                 'application/json'
             ],
             'content_type': [],
         },
         api_client=api_client
     )
Exemplo n.º 3
0
 def __init__(self, api_client=None):
     if api_client is None:
         api_client = ApiClient()
     self.api_client = api_client
     self.create_user_endpoint = _Endpoint(settings={
         'response_type': None,
         'auth': [],
         'endpoint_path': '/user',
         'operation_id': 'create_user',
         'http_method': 'POST',
         'servers': None,
     },
                                           params_map={
                                               'all': [
                                                   'body',
                                               ],
                                               'required': [
                                                   'body',
                                               ],
                                               'nullable': [],
                                               'enum': [],
                                               'validation': []
                                           },
                                           root_map={
                                               'validations': {},
                                               'allowed_values': {},
                                               'openapi_types': {
                                                   'body': (User, ),
                                               },
                                               'attribute_map': {},
                                               'location_map': {
                                                   'body': 'body',
                                               },
                                               'collection_format_map': {}
                                           },
                                           headers_map={
                                               'accept': [],
                                               'content_type': [],
                                           },
                                           api_client=api_client)
     self.create_users_with_array_input_endpoint = _Endpoint(
         settings={
             'response_type': None,
             'auth': [],
             'endpoint_path': '/user/createWithArray',
             'operation_id': 'create_users_with_array_input',
             'http_method': 'POST',
             'servers': None,
         },
         params_map={
             'all': [
                 'body',
             ],
             'required': [
                 'body',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'body': ([User], ),
             },
             'attribute_map': {},
             'location_map': {
                 'body': 'body',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': [],
             'content_type': [],
         },
         api_client=api_client)
     self.create_users_with_list_input_endpoint = _Endpoint(
         settings={
             'response_type': None,
             'auth': [],
             'endpoint_path': '/user/createWithList',
             'operation_id': 'create_users_with_list_input',
             'http_method': 'POST',
             'servers': None,
         },
         params_map={
             'all': [
                 'body',
             ],
             'required': [
                 'body',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'body': ([User], ),
             },
             'attribute_map': {},
             'location_map': {
                 'body': 'body',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': [],
             'content_type': [],
         },
         api_client=api_client)
     self.delete_user_endpoint = _Endpoint(settings={
         'response_type': None,
         'auth': [],
         'endpoint_path': '/user/{username}',
         'operation_id': 'delete_user',
         'http_method': 'DELETE',
         'servers': None,
     },
                                           params_map={
                                               'all': [
                                                   'username',
                                               ],
                                               'required': [
                                                   'username',
                                               ],
                                               'nullable': [],
                                               'enum': [],
                                               'validation': []
                                           },
                                           root_map={
                                               'validations': {},
                                               'allowed_values': {},
                                               'openapi_types': {
                                                   'username': (str, ),
                                               },
                                               'attribute_map': {
                                                   'username': '******',
                                               },
                                               'location_map': {
                                                   'username': '******',
                                               },
                                               'collection_format_map': {}
                                           },
                                           headers_map={
                                               'accept': [],
                                               'content_type': [],
                                           },
                                           api_client=api_client)
     self.get_user_by_name_endpoint = _Endpoint(
         settings={
             'response_type': (User, ),
             'auth': [],
             'endpoint_path': '/user/{username}',
             'operation_id': 'get_user_by_name',
             'http_method': 'GET',
             'servers': None,
         },
         params_map={
             'all': [
                 'username',
             ],
             'required': [
                 'username',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'username': (str, ),
             },
             'attribute_map': {
                 'username': '******',
             },
             'location_map': {
                 'username': '******',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': ['application/xml', 'application/json'],
             'content_type': [],
         },
         api_client=api_client)
     self.login_user_endpoint = _Endpoint(
         settings={
             'response_type': (str, ),
             'auth': [],
             'endpoint_path': '/user/login',
             'operation_id': 'login_user',
             'http_method': 'GET',
             'servers': None,
         },
         params_map={
             'all': [
                 'username',
                 'password',
             ],
             'required': [
                 'username',
                 'password',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'username': (str, ),
                 'password': (str, ),
             },
             'attribute_map': {
                 'username': '******',
                 'password': '******',
             },
             'location_map': {
                 'username': '******',
                 'password': '******',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': ['application/xml', 'application/json'],
             'content_type': [],
         },
         api_client=api_client)
     self.logout_user_endpoint = _Endpoint(settings={
         'response_type': None,
         'auth': [],
         'endpoint_path': '/user/logout',
         'operation_id': 'logout_user',
         'http_method': 'GET',
         'servers': None,
     },
                                           params_map={
                                               'all': [],
                                               'required': [],
                                               'nullable': [],
                                               'enum': [],
                                               'validation': []
                                           },
                                           root_map={
                                               'validations': {},
                                               'allowed_values': {},
                                               'openapi_types': {},
                                               'attribute_map': {},
                                               'location_map': {},
                                               'collection_format_map': {}
                                           },
                                           headers_map={
                                               'accept': [],
                                               'content_type': [],
                                           },
                                           api_client=api_client)
     self.update_user_endpoint = _Endpoint(settings={
         'response_type': None,
         'auth': [],
         'endpoint_path': '/user/{username}',
         'operation_id': 'update_user',
         'http_method': 'PUT',
         'servers': None,
     },
                                           params_map={
                                               'all': [
                                                   'username',
                                                   'body',
                                               ],
                                               'required': [
                                                   'username',
                                                   'body',
                                               ],
                                               'nullable': [],
                                               'enum': [],
                                               'validation': []
                                           },
                                           root_map={
                                               'validations': {},
                                               'allowed_values': {},
                                               'openapi_types': {
                                                   'username': (str, ),
                                                   'body': (User, ),
                                               },
                                               'attribute_map': {
                                                   'username': '******',
                                               },
                                               'location_map': {
                                                   'username': '******',
                                                   'body': 'body',
                                               },
                                               'collection_format_map': {}
                                           },
                                           headers_map={
                                               'accept': [],
                                               'content_type': [],
                                           },
                                           api_client=api_client)
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __create_user(self, user, **kwargs):
            """Create user  # noqa: E501

            This can only be done by the logged in user.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.create_user(user, async_req=True)
            >>> result = thread.get()

            Args:
                user (User): Created user object

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['user'] = \
                user
            return self.call_with_http_info(**kwargs)

        self.create_user = _Endpoint(settings={
            'response_type': None,
            'auth': [],
            'endpoint_path': '/user',
            'operation_id': 'create_user',
            'http_method': 'POST',
            'servers': None,
        },
                                     params_map={
                                         'all': [
                                             'user',
                                         ],
                                         'required': [
                                             'user',
                                         ],
                                         'nullable': [],
                                         'enum': [],
                                         'validation': []
                                     },
                                     root_map={
                                         'validations': {},
                                         'allowed_values': {},
                                         'openapi_types': {
                                             'user': (User, ),
                                         },
                                         'attribute_map': {},
                                         'location_map': {
                                             'user': '******',
                                         },
                                         'collection_format_map': {}
                                     },
                                     headers_map={
                                         'accept': [],
                                         'content_type': ['application/json']
                                     },
                                     api_client=api_client,
                                     callable=__create_user)

        def __create_users_with_array_input(self, user, **kwargs):
            """Creates list of users with given input array  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.create_users_with_array_input(user, async_req=True)
            >>> result = thread.get()

            Args:
                user ([User]): List of user object

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['user'] = \
                user
            return self.call_with_http_info(**kwargs)

        self.create_users_with_array_input = _Endpoint(
            settings={
                'response_type': None,
                'auth': [],
                'endpoint_path': '/user/createWithArray',
                'operation_id': 'create_users_with_array_input',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'user',
                ],
                'required': [
                    'user',
                ],
                'nullable': [],
                'enum': [],
                'validation': []
            },
            root_map={
                'validations': {},
                'allowed_values': {},
                'openapi_types': {
                    'user': ([User], ),
                },
                'attribute_map': {},
                'location_map': {
                    'user': '******',
                },
                'collection_format_map': {}
            },
            headers_map={
                'accept': [],
                'content_type': ['application/json']
            },
            api_client=api_client,
            callable=__create_users_with_array_input)

        def __create_users_with_list_input(self, user, **kwargs):
            """Creates list of users with given input array  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.create_users_with_list_input(user, async_req=True)
            >>> result = thread.get()

            Args:
                user ([User]): List of user object

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['user'] = \
                user
            return self.call_with_http_info(**kwargs)

        self.create_users_with_list_input = _Endpoint(
            settings={
                'response_type': None,
                'auth': [],
                'endpoint_path': '/user/createWithList',
                'operation_id': 'create_users_with_list_input',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'user',
                ],
                'required': [
                    'user',
                ],
                'nullable': [],
                'enum': [],
                'validation': []
            },
            root_map={
                'validations': {},
                'allowed_values': {},
                'openapi_types': {
                    'user': ([User], ),
                },
                'attribute_map': {},
                'location_map': {
                    'user': '******',
                },
                'collection_format_map': {}
            },
            headers_map={
                'accept': [],
                'content_type': ['application/json']
            },
            api_client=api_client,
            callable=__create_users_with_list_input)

        def __delete_user(self, username, **kwargs):
            """Delete user  # noqa: E501

            This can only be done by the logged in user.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.delete_user(username, async_req=True)
            >>> result = thread.get()

            Args:
                username (str): The name that needs to be deleted

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['username'] = \
                username
            return self.call_with_http_info(**kwargs)

        self.delete_user = _Endpoint(settings={
            'response_type': None,
            'auth': [],
            'endpoint_path': '/user/{username}',
            'operation_id': 'delete_user',
            'http_method': 'DELETE',
            'servers': None,
        },
                                     params_map={
                                         'all': [
                                             'username',
                                         ],
                                         'required': [
                                             'username',
                                         ],
                                         'nullable': [],
                                         'enum': [],
                                         'validation': []
                                     },
                                     root_map={
                                         'validations': {},
                                         'allowed_values': {},
                                         'openapi_types': {
                                             'username': (str, ),
                                         },
                                         'attribute_map': {
                                             'username': '******',
                                         },
                                         'location_map': {
                                             'username': '******',
                                         },
                                         'collection_format_map': {}
                                     },
                                     headers_map={
                                         'accept': [],
                                         'content_type': [],
                                     },
                                     api_client=api_client,
                                     callable=__delete_user)

        def __get_user_by_name(self, username, **kwargs):
            """Get user by user name  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_user_by_name(username, async_req=True)
            >>> result = thread.get()

            Args:
                username (str): The name that needs to be fetched. Use user1 for testing.

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                User
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['username'] = \
                username
            return self.call_with_http_info(**kwargs)

        self.get_user_by_name = _Endpoint(
            settings={
                'response_type': (User, ),
                'auth': [],
                'endpoint_path': '/user/{username}',
                'operation_id': 'get_user_by_name',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'username',
                ],
                'required': [
                    'username',
                ],
                'nullable': [],
                'enum': [],
                'validation': []
            },
            root_map={
                'validations': {},
                'allowed_values': {},
                'openapi_types': {
                    'username': (str, ),
                },
                'attribute_map': {
                    'username': '******',
                },
                'location_map': {
                    'username': '******',
                },
                'collection_format_map': {}
            },
            headers_map={
                'accept': ['application/xml', 'application/json'],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_user_by_name)

        def __login_user(self, username, password, **kwargs):
            """Logs user into the system  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.login_user(username, password, async_req=True)
            >>> result = thread.get()

            Args:
                username (str): The user name for login
                password (str): The password for login in clear text

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                str
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['username'] = \
                username
            kwargs['password'] = \
                password
            return self.call_with_http_info(**kwargs)

        self.login_user = _Endpoint(
            settings={
                'response_type': (str, ),
                'auth': [],
                'endpoint_path': '/user/login',
                'operation_id': 'login_user',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'username',
                    'password',
                ],
                'required': [
                    'username',
                    'password',
                ],
                'nullable': [],
                'enum': [],
                'validation': []
            },
            root_map={
                'validations': {},
                'allowed_values': {},
                'openapi_types': {
                    'username': (str, ),
                    'password': (str, ),
                },
                'attribute_map': {
                    'username': '******',
                    'password': '******',
                },
                'location_map': {
                    'username': '******',
                    'password': '******',
                },
                'collection_format_map': {}
            },
            headers_map={
                'accept': ['application/xml', 'application/json'],
                'content_type': [],
            },
            api_client=api_client,
            callable=__login_user)

        def __logout_user(self, **kwargs):
            """Logs out current logged in user session  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.logout_user(async_req=True)
            >>> result = thread.get()


            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            return self.call_with_http_info(**kwargs)

        self.logout_user = _Endpoint(settings={
            'response_type': None,
            'auth': [],
            'endpoint_path': '/user/logout',
            'operation_id': 'logout_user',
            'http_method': 'GET',
            'servers': None,
        },
                                     params_map={
                                         'all': [],
                                         'required': [],
                                         'nullable': [],
                                         'enum': [],
                                         'validation': []
                                     },
                                     root_map={
                                         'validations': {},
                                         'allowed_values': {},
                                         'openapi_types': {},
                                         'attribute_map': {},
                                         'location_map': {},
                                         'collection_format_map': {}
                                     },
                                     headers_map={
                                         'accept': [],
                                         'content_type': [],
                                     },
                                     api_client=api_client,
                                     callable=__logout_user)

        def __update_user(self, username, user, **kwargs):
            """Updated user  # noqa: E501

            This can only be done by the logged in user.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.update_user(username, user, async_req=True)
            >>> result = thread.get()

            Args:
                username (str): name that need to be deleted
                user (User): Updated user object

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['username'] = \
                username
            kwargs['user'] = \
                user
            return self.call_with_http_info(**kwargs)

        self.update_user = _Endpoint(settings={
            'response_type': None,
            'auth': [],
            'endpoint_path': '/user/{username}',
            'operation_id': 'update_user',
            'http_method': 'PUT',
            'servers': None,
        },
                                     params_map={
                                         'all': [
                                             'username',
                                             'user',
                                         ],
                                         'required': [
                                             'username',
                                             'user',
                                         ],
                                         'nullable': [],
                                         'enum': [],
                                         'validation': []
                                     },
                                     root_map={
                                         'validations': {},
                                         'allowed_values': {},
                                         'openapi_types': {
                                             'username': (str, ),
                                             'user': (User, ),
                                         },
                                         'attribute_map': {
                                             'username': '******',
                                         },
                                         'location_map': {
                                             'username': '******',
                                             'user': '******',
                                         },
                                         'collection_format_map': {}
                                     },
                                     headers_map={
                                         'accept': [],
                                         'content_type': ['application/json']
                                     },
                                     api_client=api_client,
                                     callable=__update_user)
Exemplo n.º 5
0
 def __init__(self, api_client=None):
     if api_client is None:
         api_client = ApiClient()
     self.api_client = api_client
     self.delete_order_endpoint = _Endpoint(settings={
         'response_type': None,
         'auth': [],
         'endpoint_path': '/store/order/{order_id}',
         'operation_id': 'delete_order',
         'http_method': 'DELETE',
         'servers': None,
     },
                                            params_map={
                                                'all': [
                                                    'order_id',
                                                ],
                                                'required': [
                                                    'order_id',
                                                ],
                                                'nullable': [],
                                                'enum': [],
                                                'validation': []
                                            },
                                            root_map={
                                                'validations': {},
                                                'allowed_values': {},
                                                'openapi_types': {
                                                    'order_id': (str, ),
                                                },
                                                'attribute_map': {
                                                    'order_id': 'order_id',
                                                },
                                                'location_map': {
                                                    'order_id': 'path',
                                                },
                                                'collection_format_map': {}
                                            },
                                            headers_map={
                                                'accept': [],
                                                'content_type': [],
                                            },
                                            api_client=api_client)
     self.get_inventory_endpoint = _Endpoint(settings={
         'response_type': ({
             str: (int, )
         }, ),
         'auth': ['api_key'],
         'endpoint_path':
         '/store/inventory',
         'operation_id':
         'get_inventory',
         'http_method':
         'GET',
         'servers':
         None,
     },
                                             params_map={
                                                 'all': [],
                                                 'required': [],
                                                 'nullable': [],
                                                 'enum': [],
                                                 'validation': []
                                             },
                                             root_map={
                                                 'validations': {},
                                                 'allowed_values': {},
                                                 'openapi_types': {},
                                                 'attribute_map': {},
                                                 'location_map': {},
                                                 'collection_format_map':
                                                 {}
                                             },
                                             headers_map={
                                                 'accept':
                                                 ['application/json'],
                                                 'content_type': [],
                                             },
                                             api_client=api_client)
     self.get_order_by_id_endpoint = _Endpoint(
         settings={
             'response_type': (Order, ),
             'auth': [],
             'endpoint_path': '/store/order/{order_id}',
             'operation_id': 'get_order_by_id',
             'http_method': 'GET',
             'servers': None,
         },
         params_map={
             'all': [
                 'order_id',
             ],
             'required': [
                 'order_id',
             ],
             'nullable': [],
             'enum': [],
             'validation': [
                 'order_id',
             ]
         },
         root_map={
             'validations': {
                 ('order_id', ): {
                     'inclusive_maximum': 5,
                     'inclusive_minimum': 1,
                 },
             },
             'allowed_values': {},
             'openapi_types': {
                 'order_id': (int, ),
             },
             'attribute_map': {
                 'order_id': 'order_id',
             },
             'location_map': {
                 'order_id': 'path',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': ['application/xml', 'application/json'],
             'content_type': [],
         },
         api_client=api_client)
     self.place_order_endpoint = _Endpoint(
         settings={
             'response_type': (Order, ),
             'auth': [],
             'endpoint_path': '/store/order',
             'operation_id': 'place_order',
             'http_method': 'POST',
             'servers': None,
         },
         params_map={
             'all': [
                 'order',
             ],
             'required': [
                 'order',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'order': (Order, ),
             },
             'attribute_map': {},
             'location_map': {
                 'order': 'body',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': ['application/xml', 'application/json'],
             'content_type': ['application/json']
         },
         api_client=api_client)
Exemplo n.º 6
0
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client
        self.add_pet_endpoint = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'http_signature_test',
                    'petstore_auth'
                ],
                'endpoint_path': '/pet',
                'operation_id': 'add_pet',
                'http_method': 'POST',
                'servers': [
                    {
                        'url': "http://petstore.swagger.io/v2",
                        'description': "No description provided",
                    },
                    {
                        'url': "http://path-server-test.petstore.local/v2",
                        'description': "No description provided",
                    },
                ]
            },
            params_map={
                'all': [
                    'pet',
                ],
                'required': [
                    'pet',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet':
                        (Pet,),
                },
                'attribute_map': {
                },
                'location_map': {
                    'pet': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'application/json',
                    'application/xml'
                ]
            },
            api_client=api_client
        )
        self.delete_pet_endpoint = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/{petId}',
                'operation_id': 'delete_pet',
                'http_method': 'DELETE',
                'servers': None,
            },
            params_map={
                'all': [
                    'pet_id',
                    'api_key',
                ],
                'required': [
                    'pet_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet_id':
                        (int,),
                    'api_key':
                        (str,),
                },
                'attribute_map': {
                    'pet_id': 'petId',
                    'api_key': 'api_key',
                },
                'location_map': {
                    'pet_id': 'path',
                    'api_key': 'header',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client
        )
        self.find_pets_by_status_endpoint = _Endpoint(
            settings={
                'response_type': ([Pet],),
                'auth': [
                    'http_signature_test',
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/findByStatus',
                'operation_id': 'find_pets_by_status',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'status',
                ],
                'required': [
                    'status',
                ],
                'nullable': [
                ],
                'enum': [
                    'status',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('status',): {

                        "AVAILABLE": "available",
                        "PENDING": "pending",
                        "SOLD": "sold"
                    },
                },
                'openapi_types': {
                    'status':
                        ([str],),
                },
                'attribute_map': {
                    'status': 'status',
                },
                'location_map': {
                    'status': 'query',
                },
                'collection_format_map': {
                    'status': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/xml',
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.find_pets_by_tags_endpoint = _Endpoint(
            settings={
                'response_type': ([Pet],),
                'auth': [
                    'http_signature_test',
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/findByTags',
                'operation_id': 'find_pets_by_tags',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'tags',
                ],
                'required': [
                    'tags',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'tags':
                        ([str],),
                },
                'attribute_map': {
                    'tags': 'tags',
                },
                'location_map': {
                    'tags': 'query',
                },
                'collection_format_map': {
                    'tags': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/xml',
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.get_pet_by_id_endpoint = _Endpoint(
            settings={
                'response_type': (Pet,),
                'auth': [
                    'api_key'
                ],
                'endpoint_path': '/pet/{petId}',
                'operation_id': 'get_pet_by_id',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'pet_id',
                ],
                'required': [
                    'pet_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet_id':
                        (int,),
                },
                'attribute_map': {
                    'pet_id': 'petId',
                },
                'location_map': {
                    'pet_id': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/xml',
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.update_pet_endpoint = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'http_signature_test',
                    'petstore_auth'
                ],
                'endpoint_path': '/pet',
                'operation_id': 'update_pet',
                'http_method': 'PUT',
                'servers': [
                    {
                        'url': "http://petstore.swagger.io/v2",
                        'description': "No description provided",
                    },
                    {
                        'url': "http://path-server-test.petstore.local/v2",
                        'description': "No description provided",
                    },
                ]
            },
            params_map={
                'all': [
                    'pet',
                ],
                'required': [
                    'pet',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet':
                        (Pet,),
                },
                'attribute_map': {
                },
                'location_map': {
                    'pet': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'application/json',
                    'application/xml'
                ]
            },
            api_client=api_client
        )
        self.update_pet_with_form_endpoint = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/{petId}',
                'operation_id': 'update_pet_with_form',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'pet_id',
                    'name',
                    'status',
                ],
                'required': [
                    'pet_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet_id':
                        (int,),
                    'name':
                        (str,),
                    'status':
                        (str,),
                },
                'attribute_map': {
                    'pet_id': 'petId',
                    'name': 'name',
                    'status': 'status',
                },
                'location_map': {
                    'pet_id': 'path',
                    'name': 'form',
                    'status': 'form',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'application/x-www-form-urlencoded'
                ]
            },
            api_client=api_client
        )
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __delete_order(self, order_id, **kwargs):
            """Delete purchase order by ID  # noqa: E501

            For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.delete_order(order_id, async_req=True)
            >>> result = thread.get()

            Args:
                order_id (str): ID of the order that needs to be deleted

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['order_id'] = \
                order_id
            return self.call_with_http_info(**kwargs)

        self.delete_order = _Endpoint(settings={
            'response_type': None,
            'auth': [],
            'endpoint_path': '/store/order/{order_id}',
            'operation_id': 'delete_order',
            'http_method': 'DELETE',
            'servers': None,
        },
                                      params_map={
                                          'all': [
                                              'order_id',
                                          ],
                                          'required': [
                                              'order_id',
                                          ],
                                          'nullable': [],
                                          'enum': [],
                                          'validation': []
                                      },
                                      root_map={
                                          'validations': {},
                                          'allowed_values': {},
                                          'openapi_types': {
                                              'order_id': (str, ),
                                          },
                                          'attribute_map': {
                                              'order_id': 'order_id',
                                          },
                                          'location_map': {
                                              'order_id': 'path',
                                          },
                                          'collection_format_map': {}
                                      },
                                      headers_map={
                                          'accept': [],
                                          'content_type': [],
                                      },
                                      api_client=api_client,
                                      callable=__delete_order)

        def __get_inventory(self, **kwargs):
            """Returns pet inventories by status  # noqa: E501

            Returns a map of status codes to quantities  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_inventory(async_req=True)
            >>> result = thread.get()


            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                {str: (int,)}
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            return self.call_with_http_info(**kwargs)

        self.get_inventory = _Endpoint(settings={
            'response_type': ({
                str: (int, )
            }, ),
            'auth': ['api_key'],
            'endpoint_path': '/store/inventory',
            'operation_id': 'get_inventory',
            'http_method': 'GET',
            'servers': None,
        },
                                       params_map={
                                           'all': [],
                                           'required': [],
                                           'nullable': [],
                                           'enum': [],
                                           'validation': []
                                       },
                                       root_map={
                                           'validations': {},
                                           'allowed_values': {},
                                           'openapi_types': {},
                                           'attribute_map': {},
                                           'location_map': {},
                                           'collection_format_map': {}
                                       },
                                       headers_map={
                                           'accept': ['application/json'],
                                           'content_type': [],
                                       },
                                       api_client=api_client,
                                       callable=__get_inventory)

        def __get_order_by_id(self, order_id, **kwargs):
            """Find purchase order by ID  # noqa: E501

            For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_order_by_id(order_id, async_req=True)
            >>> result = thread.get()

            Args:
                order_id (int): ID of pet that needs to be fetched

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                Order
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['order_id'] = \
                order_id
            return self.call_with_http_info(**kwargs)

        self.get_order_by_id = _Endpoint(
            settings={
                'response_type': (Order, ),
                'auth': [],
                'endpoint_path': '/store/order/{order_id}',
                'operation_id': 'get_order_by_id',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'order_id',
                ],
                'required': [
                    'order_id',
                ],
                'nullable': [],
                'enum': [],
                'validation': [
                    'order_id',
                ]
            },
            root_map={
                'validations': {
                    ('order_id', ): {
                        'inclusive_maximum': 5,
                        'inclusive_minimum': 1,
                    },
                },
                'allowed_values': {},
                'openapi_types': {
                    'order_id': (int, ),
                },
                'attribute_map': {
                    'order_id': 'order_id',
                },
                'location_map': {
                    'order_id': 'path',
                },
                'collection_format_map': {}
            },
            headers_map={
                'accept': ['application/xml', 'application/json'],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_order_by_id)

        def __place_order(self, order, **kwargs):
            """Place an order for a pet  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.place_order(order, async_req=True)
            >>> result = thread.get()

            Args:
                order (Order): order placed for purchasing the pet

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                Order
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['order'] = \
                order
            return self.call_with_http_info(**kwargs)

        self.place_order = _Endpoint(
            settings={
                'response_type': (Order, ),
                'auth': [],
                'endpoint_path': '/store/order',
                'operation_id': 'place_order',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'order',
                ],
                'required': [
                    'order',
                ],
                'nullable': [],
                'enum': [],
                'validation': []
            },
            root_map={
                'validations': {},
                'allowed_values': {},
                'openapi_types': {
                    'order': (Order, ),
                },
                'attribute_map': {},
                'location_map': {
                    'order': 'body',
                },
                'collection_format_map': {}
            },
            headers_map={
                'accept': ['application/xml', 'application/json'],
                'content_type': ['application/json']
            },
            api_client=api_client,
            callable=__place_order)
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __foo_get(self, **kwargs):
            """foo_get  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.foo_get(async_req=True)
            >>> result = thread.get()


            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (int/float/tuple): timeout setting for this request. If
                    one number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                InlineResponseDefault
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            return self.call_with_http_info(**kwargs)

        self.foo_get = _Endpoint(settings={
            'response_type': (InlineResponseDefault, ),
            'auth': [],
            'endpoint_path': '/foo',
            'operation_id': 'foo_get',
            'http_method': 'GET',
            'servers': None,
        },
                                 params_map={
                                     'all': [],
                                     'required': [],
                                     'nullable': [],
                                     'enum': [],
                                     'validation': []
                                 },
                                 root_map={
                                     'validations': {},
                                     'allowed_values': {},
                                     'openapi_types': {},
                                     'attribute_map': {},
                                     'location_map': {},
                                     'collection_format_map': {}
                                 },
                                 headers_map={
                                     'accept': ['application/json'],
                                     'content_type': [],
                                 },
                                 api_client=api_client,
                                 callable=__foo_get)
Exemplo n.º 9
0
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __add_pet(
            self,
            body,
            **kwargs
        ):
            """Add a new pet to the store  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.add_pet(body, async_req=True)
            >>> result = thread.get()

            Args:
                body (Pet): Pet object that needs to be added to the store

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['body'] = \
                body
            return self.call_with_http_info(**kwargs)

        self.add_pet = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet',
                'operation_id': 'add_pet',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'body',
                ],
                'required': [
                    'body',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'body':
                        (Pet,),
                },
                'attribute_map': {
                },
                'location_map': {
                    'body': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'application/json',
                    'application/xml'
                ]
            },
            api_client=api_client,
            callable=__add_pet
        )

        def __delete_pet(
            self,
            pet_id,
            **kwargs
        ):
            """Deletes a pet  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.delete_pet(pet_id, async_req=True)
            >>> result = thread.get()

            Args:
                pet_id (int): Pet id to delete

            Keyword Args:
                api_key (str): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['pet_id'] = \
                pet_id
            return self.call_with_http_info(**kwargs)

        self.delete_pet = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/{petId}',
                'operation_id': 'delete_pet',
                'http_method': 'DELETE',
                'servers': None,
            },
            params_map={
                'all': [
                    'pet_id',
                    'api_key',
                ],
                'required': [
                    'pet_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet_id':
                        (int,),
                    'api_key':
                        (str,),
                },
                'attribute_map': {
                    'pet_id': 'petId',
                    'api_key': 'api_key',
                },
                'location_map': {
                    'pet_id': 'path',
                    'api_key': 'header',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [],
            },
            api_client=api_client,
            callable=__delete_pet
        )

        def __find_pets_by_status(
            self,
            status,
            **kwargs
        ):
            """Finds Pets by status  # noqa: E501

            Multiple status values can be provided with comma separated strings  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.find_pets_by_status(status, async_req=True)
            >>> result = thread.get()

            Args:
                status ([str]): Status values that need to be considered for filter

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                [Pet]
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['status'] = \
                status
            return self.call_with_http_info(**kwargs)

        self.find_pets_by_status = _Endpoint(
            settings={
                'response_type': ([Pet],),
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/findByStatus',
                'operation_id': 'find_pets_by_status',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'status',
                ],
                'required': [
                    'status',
                ],
                'nullable': [
                ],
                'enum': [
                    'status',
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                    ('status',): {

                        "AVAILABLE": "available",
                        "PENDING": "pending",
                        "SOLD": "sold"
                    },
                },
                'openapi_types': {
                    'status':
                        ([str],),
                },
                'attribute_map': {
                    'status': 'status',
                },
                'location_map': {
                    'status': 'query',
                },
                'collection_format_map': {
                    'status': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/xml',
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__find_pets_by_status
        )

        def __find_pets_by_tags(
            self,
            tags,
            **kwargs
        ):
            """Finds Pets by tags  # noqa: E501

            Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.find_pets_by_tags(tags, async_req=True)
            >>> result = thread.get()

            Args:
                tags ([str]): Tags to filter by

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                [Pet]
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['tags'] = \
                tags
            return self.call_with_http_info(**kwargs)

        self.find_pets_by_tags = _Endpoint(
            settings={
                'response_type': ([Pet],),
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/findByTags',
                'operation_id': 'find_pets_by_tags',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'tags',
                ],
                'required': [
                    'tags',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'tags':
                        ([str],),
                },
                'attribute_map': {
                    'tags': 'tags',
                },
                'location_map': {
                    'tags': 'query',
                },
                'collection_format_map': {
                    'tags': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/xml',
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__find_pets_by_tags
        )

        def __get_pet_by_id(
            self,
            pet_id,
            **kwargs
        ):
            """Find pet by ID  # noqa: E501

            Returns a single pet  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_pet_by_id(pet_id, async_req=True)
            >>> result = thread.get()

            Args:
                pet_id (int): ID of pet to return

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                Pet
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['pet_id'] = \
                pet_id
            return self.call_with_http_info(**kwargs)

        self.get_pet_by_id = _Endpoint(
            settings={
                'response_type': (Pet,),
                'auth': [
                    'api_key'
                ],
                'endpoint_path': '/pet/{petId}',
                'operation_id': 'get_pet_by_id',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'pet_id',
                ],
                'required': [
                    'pet_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet_id':
                        (int,),
                },
                'attribute_map': {
                    'pet_id': 'petId',
                },
                'location_map': {
                    'pet_id': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/xml',
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_pet_by_id
        )

        def __update_pet(
            self,
            body,
            **kwargs
        ):
            """Update an existing pet  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.update_pet(body, async_req=True)
            >>> result = thread.get()

            Args:
                body (Pet): Pet object that needs to be added to the store

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['body'] = \
                body
            return self.call_with_http_info(**kwargs)

        self.update_pet = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet',
                'operation_id': 'update_pet',
                'http_method': 'PUT',
                'servers': None,
            },
            params_map={
                'all': [
                    'body',
                ],
                'required': [
                    'body',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'body':
                        (Pet,),
                },
                'attribute_map': {
                },
                'location_map': {
                    'body': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'application/json',
                    'application/xml'
                ]
            },
            api_client=api_client,
            callable=__update_pet
        )

        def __update_pet_with_form(
            self,
            pet_id,
            **kwargs
        ):
            """Updates a pet in the store with form data  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.update_pet_with_form(pet_id, async_req=True)
            >>> result = thread.get()

            Args:
                pet_id (int): ID of pet that needs to be updated

            Keyword Args:
                name (str): Updated name of the pet. [optional]
                status (str): Updated status of the pet. [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['pet_id'] = \
                pet_id
            return self.call_with_http_info(**kwargs)

        self.update_pet_with_form = _Endpoint(
            settings={
                'response_type': None,
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/{petId}',
                'operation_id': 'update_pet_with_form',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'pet_id',
                    'name',
                    'status',
                ],
                'required': [
                    'pet_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet_id':
                        (int,),
                    'name':
                        (str,),
                    'status':
                        (str,),
                },
                'attribute_map': {
                    'pet_id': 'petId',
                    'name': 'name',
                    'status': 'status',
                },
                'location_map': {
                    'pet_id': 'path',
                    'name': 'form',
                    'status': 'form',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [],
                'content_type': [
                    'application/x-www-form-urlencoded'
                ]
            },
            api_client=api_client,
            callable=__update_pet_with_form
        )

        def __upload_file(
            self,
            pet_id,
            **kwargs
        ):
            """uploads an image  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.upload_file(pet_id, async_req=True)
            >>> result = thread.get()

            Args:
                pet_id (int): ID of pet to update

            Keyword Args:
                additional_metadata (str): Additional data to pass to server. [optional]
                file (file_type): file to upload. [optional]
                files ([file_type]): files to upload. [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                ApiResponse
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['pet_id'] = \
                pet_id
            return self.call_with_http_info(**kwargs)

        self.upload_file = _Endpoint(
            settings={
                'response_type': (ApiResponse,),
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/pet/{petId}/uploadImage',
                'operation_id': 'upload_file',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'pet_id',
                    'additional_metadata',
                    'file',
                    'files',
                ],
                'required': [
                    'pet_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet_id':
                        (int,),
                    'additional_metadata':
                        (str,),
                    'file':
                        (file_type,),
                    'files':
                        ([file_type],),
                },
                'attribute_map': {
                    'pet_id': 'petId',
                    'additional_metadata': 'additionalMetadata',
                    'file': 'file',
                    'files': 'files',
                },
                'location_map': {
                    'pet_id': 'path',
                    'additional_metadata': 'form',
                    'file': 'form',
                    'files': 'form',
                },
                'collection_format_map': {
                    'files': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'multipart/form-data'
                ]
            },
            api_client=api_client,
            callable=__upload_file
        )

        def __upload_file_with_required_file(
            self,
            pet_id,
            required_file,
            **kwargs
        ):
            """uploads an image (required)  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.upload_file_with_required_file(pet_id, required_file, async_req=True)
            >>> result = thread.get()

            Args:
                pet_id (int): ID of pet to update
                required_file (file_type): file to upload

            Keyword Args:
                additional_metadata (str): Additional data to pass to server. [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                ApiResponse
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['pet_id'] = \
                pet_id
            kwargs['required_file'] = \
                required_file
            return self.call_with_http_info(**kwargs)

        self.upload_file_with_required_file = _Endpoint(
            settings={
                'response_type': (ApiResponse,),
                'auth': [
                    'petstore_auth'
                ],
                'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile',
                'operation_id': 'upload_file_with_required_file',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'pet_id',
                    'required_file',
                    'additional_metadata',
                ],
                'required': [
                    'pet_id',
                    'required_file',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'pet_id':
                        (int,),
                    'required_file':
                        (file_type,),
                    'additional_metadata':
                        (str,),
                },
                'attribute_map': {
                    'pet_id': 'petId',
                    'required_file': 'requiredFile',
                    'additional_metadata': 'additionalMetadata',
                },
                'location_map': {
                    'pet_id': 'path',
                    'required_file': 'form',
                    'additional_metadata': 'form',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'multipart/form-data'
                ]
            },
            api_client=api_client,
            callable=__upload_file_with_required_file
        )
Exemplo n.º 10
0
 def __init__(self, api_client=None):
     if api_client is None:
         api_client = ApiClient()
     self.api_client = api_client
     self.add_pet_endpoint = _Endpoint(
         settings={
             'response_type': None,
             'auth': ['petstore_auth'],
             'endpoint_path': '/pet',
             'operation_id': 'add_pet',
             'http_method': 'POST',
             'servers': None,
         },
         params_map={
             'all': [
                 'body',
             ],
             'required': [
                 'body',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'body': (Pet, ),
             },
             'attribute_map': {},
             'location_map': {
                 'body': 'body',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': [],
             'content_type': ['application/json', 'application/xml']
         },
         api_client=api_client)
     self.delete_pet_endpoint = _Endpoint(settings={
         'response_type': None,
         'auth': ['petstore_auth'],
         'endpoint_path': '/pet/{petId}',
         'operation_id': 'delete_pet',
         'http_method': 'DELETE',
         'servers': None,
     },
                                          params_map={
                                              'all': [
                                                  'pet_id',
                                                  'api_key',
                                              ],
                                              'required': [
                                                  'pet_id',
                                              ],
                                              'nullable': [],
                                              'enum': [],
                                              'validation': []
                                          },
                                          root_map={
                                              'validations': {},
                                              'allowed_values': {},
                                              'openapi_types': {
                                                  'pet_id': (int, ),
                                                  'api_key': (str, ),
                                              },
                                              'attribute_map': {
                                                  'pet_id': 'petId',
                                                  'api_key': 'api_key',
                                              },
                                              'location_map': {
                                                  'pet_id': 'path',
                                                  'api_key': 'header',
                                              },
                                              'collection_format_map': {}
                                          },
                                          headers_map={
                                              'accept': [],
                                              'content_type': [],
                                          },
                                          api_client=api_client)
     self.find_pets_by_status_endpoint = _Endpoint(
         settings={
             'response_type': ([Pet], ),
             'auth': ['petstore_auth'],
             'endpoint_path': '/pet/findByStatus',
             'operation_id': 'find_pets_by_status',
             'http_method': 'GET',
             'servers': None,
         },
         params_map={
             'all': [
                 'status',
             ],
             'required': [
                 'status',
             ],
             'nullable': [],
             'enum': [
                 'status',
             ],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {
                 ('status', ): {
                     "AVAILABLE": "available",
                     "PENDING": "pending",
                     "SOLD": "sold"
                 },
             },
             'openapi_types': {
                 'status': ([str], ),
             },
             'attribute_map': {
                 'status': 'status',
             },
             'location_map': {
                 'status': 'query',
             },
             'collection_format_map': {
                 'status': 'csv',
             }
         },
         headers_map={
             'accept': ['application/xml', 'application/json'],
             'content_type': [],
         },
         api_client=api_client)
     self.find_pets_by_tags_endpoint = _Endpoint(
         settings={
             'response_type': ([Pet], ),
             'auth': ['petstore_auth'],
             'endpoint_path': '/pet/findByTags',
             'operation_id': 'find_pets_by_tags',
             'http_method': 'GET',
             'servers': None,
         },
         params_map={
             'all': [
                 'tags',
             ],
             'required': [
                 'tags',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'tags': ([str], ),
             },
             'attribute_map': {
                 'tags': 'tags',
             },
             'location_map': {
                 'tags': 'query',
             },
             'collection_format_map': {
                 'tags': 'csv',
             }
         },
         headers_map={
             'accept': ['application/xml', 'application/json'],
             'content_type': [],
         },
         api_client=api_client)
     self.get_pet_by_id_endpoint = _Endpoint(
         settings={
             'response_type': (Pet, ),
             'auth': ['api_key'],
             'endpoint_path': '/pet/{petId}',
             'operation_id': 'get_pet_by_id',
             'http_method': 'GET',
             'servers': None,
         },
         params_map={
             'all': [
                 'pet_id',
             ],
             'required': [
                 'pet_id',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'pet_id': (int, ),
             },
             'attribute_map': {
                 'pet_id': 'petId',
             },
             'location_map': {
                 'pet_id': 'path',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': ['application/xml', 'application/json'],
             'content_type': [],
         },
         api_client=api_client)
     self.update_pet_endpoint = _Endpoint(
         settings={
             'response_type': None,
             'auth': ['petstore_auth'],
             'endpoint_path': '/pet',
             'operation_id': 'update_pet',
             'http_method': 'PUT',
             'servers': None,
         },
         params_map={
             'all': [
                 'body',
             ],
             'required': [
                 'body',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'body': (Pet, ),
             },
             'attribute_map': {},
             'location_map': {
                 'body': 'body',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': [],
             'content_type': ['application/json', 'application/xml']
         },
         api_client=api_client)
     self.update_pet_with_form_endpoint = _Endpoint(
         settings={
             'response_type': None,
             'auth': ['petstore_auth'],
             'endpoint_path': '/pet/{petId}',
             'operation_id': 'update_pet_with_form',
             'http_method': 'POST',
             'servers': None,
         },
         params_map={
             'all': [
                 'pet_id',
                 'name',
                 'status',
             ],
             'required': [
                 'pet_id',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'pet_id': (int, ),
                 'name': (str, ),
                 'status': (str, ),
             },
             'attribute_map': {
                 'pet_id': 'petId',
                 'name': 'name',
                 'status': 'status',
             },
             'location_map': {
                 'pet_id': 'path',
                 'name': 'form',
                 'status': 'form',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': [],
             'content_type': ['application/x-www-form-urlencoded']
         },
         api_client=api_client)
     self.upload_file_endpoint = _Endpoint(settings={
         'response_type': (ApiResponse, ),
         'auth': ['petstore_auth'],
         'endpoint_path': '/pet/{petId}/uploadImage',
         'operation_id': 'upload_file',
         'http_method': 'POST',
         'servers': None,
     },
                                           params_map={
                                               'all': [
                                                   'pet_id',
                                                   'additional_metadata',
                                                   'file',
                                                   'files',
                                               ],
                                               'required': [
                                                   'pet_id',
                                               ],
                                               'nullable': [],
                                               'enum': [],
                                               'validation': []
                                           },
                                           root_map={
                                               'validations': {},
                                               'allowed_values': {},
                                               'openapi_types': {
                                                   'pet_id': (int, ),
                                                   'additional_metadata':
                                                   (str, ),
                                                   'file': (file_type, ),
                                                   'files': ([file_type], ),
                                               },
                                               'attribute_map': {
                                                   'pet_id': 'petId',
                                                   'additional_metadata':
                                                   'additionalMetadata',
                                                   'file': 'file',
                                                   'files': 'files',
                                               },
                                               'location_map': {
                                                   'pet_id': 'path',
                                                   'additional_metadata':
                                                   'form',
                                                   'file': 'form',
                                                   'files': 'form',
                                               },
                                               'collection_format_map': {
                                                   'files': 'csv',
                                               }
                                           },
                                           headers_map={
                                               'accept':
                                               ['application/json'],
                                               'content_type':
                                               ['multipart/form-data']
                                           },
                                           api_client=api_client)
     self.upload_file_with_required_file_endpoint = _Endpoint(
         settings={
             'response_type': (ApiResponse, ),
             'auth': ['petstore_auth'],
             'endpoint_path': '/fake/{petId}/uploadImageWithRequiredFile',
             'operation_id': 'upload_file_with_required_file',
             'http_method': 'POST',
             'servers': None,
         },
         params_map={
             'all': [
                 'pet_id',
                 'required_file',
                 'additional_metadata',
             ],
             'required': [
                 'pet_id',
                 'required_file',
             ],
             'nullable': [],
             'enum': [],
             'validation': []
         },
         root_map={
             'validations': {},
             'allowed_values': {},
             'openapi_types': {
                 'pet_id': (int, ),
                 'required_file': (file_type, ),
                 'additional_metadata': (str, ),
             },
             'attribute_map': {
                 'pet_id': 'petId',
                 'required_file': 'requiredFile',
                 'additional_metadata': 'additionalMetadata',
             },
             'location_map': {
                 'pet_id': 'path',
                 'required_file': 'form',
                 'additional_metadata': 'form',
             },
             'collection_format_map': {}
         },
         headers_map={
             'accept': ['application/json'],
             'content_type': ['multipart/form-data']
         },
         api_client=api_client)