text: # coding: utf-8
  
  """
      OpenAPI Petstore
  
      This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\  # noqa: E501
  
      The version of the OpenAPI document: 1.0.0
      Generated by: https://openapi-generator.tech
  """
  
  
  from __future__ import absolute_import
  
  import re  # noqa: F401
  
  # python 2 and python 3 compatibility library
  import six
  
  from petstore_api.api_client import ApiClient
  from petstore_api.exceptions import (  # noqa: F401
      ApiTypeError,
      ApiValueError
  )
  
  
  class StoreApi(object):
      """NOTE: This class is auto generated by OpenAPI Generator
      Ref: https://openapi-generator.tech
  
      Do not edit the class manually.
      """
  
      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):  # noqa: E501
          """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()
  
          :param order_id: ID of the order that needs to be deleted (required)
          :type order_id: str
          :param async_req: Whether to execute the request asynchronously.
          :type async_req: bool, optional
          :param _preload_content: if False, the urllib3.HTTPResponse object will
                                   be returned without reading/decoding response
                                   data. Default is True.
          :type _preload_content: bool, optional
          :param _request_timeout: 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.
          :return: Returns the result object.
                   If the method is called asynchronously,
                   returns the request thread.
          :rtype: None
          """
          kwargs['_return_http_data_only'] = True
          return self.delete_order_with_http_info(order_id, **kwargs)  # noqa: E501
  
      def delete_order_with_http_info(self, order_id, **kwargs):  # noqa: E501
          """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_with_http_info(order_id, async_req=True)
          >>> result = thread.get()
  
          :param order_id: ID of the order that needs to be deleted (required)
          :type order_id: str
          :param async_req: Whether to execute the request asynchronously.
          :type async_req: bool, optional
          :param _return_http_data_only: response data without head status code
                                         and headers
          :type _return_http_data_only: bool, optional
          :param _preload_content: if False, the urllib3.HTTPResponse object will
                                   be returned without reading/decoding response
                                   data. Default is True.
          :type _preload_content: bool, optional
          :param _request_timeout: 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.
          :param _request_auth: set to override the auth_settings for an a single
                                request; this effectively ignores the authentication
                                in the spec for a single request.
          :type _request_auth: dict, optional
          :return: Returns the result object.
                   If the method is called asynchronously,
                   returns the request thread.
          :rtype: None
          """
  
          local_var_params = locals()
  
          all_params = [
              'order_id'
          ]
          all_params.extend(
              [
                  'async_req',
                  '_return_http_data_only',
                  '_preload_content',
                  '_request_timeout',
                  '_request_auth'
              ]
          )
  
          for key, val in six.iteritems(local_var_params['kwargs']):
              if key not in all_params:
                  raise ApiTypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method delete_order" % key
                  )
              local_var_params[key] = val
          del local_var_params['kwargs']
          # verify the required parameter 'order_id' is set
          if self.api_client.client_side_validation and ('order_id' not in local_var_params or  # noqa: E501
                                                          local_var_params['order_id'] is None):  # noqa: E501
              raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
          if 'order_id' in local_var_params:
              path_params['order_id'] = local_var_params['order_id']  # noqa: E501
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # Authentication setting
          auth_settings = []  # noqa: E501
  
          return self.api_client.call_api(
              '/store/order/{order_id}', 'DELETE',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type=None,  # noqa: E501
              auth_settings=auth_settings,
              async_req=local_var_params.get('async_req'),
              _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
              _preload_content=local_var_params.get('_preload_content', True),
              _request_timeout=local_var_params.get('_request_timeout'),
              collection_formats=collection_formats,
              _request_auth=local_var_params.get('_request_auth'))
  
      def get_inventory(self, **kwargs):  # noqa: E501
          """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()
  
          :param async_req: Whether to execute the request asynchronously.
          :type async_req: bool, optional
          :param _preload_content: if False, the urllib3.HTTPResponse object will
                                   be returned without reading/decoding response
                                   data. Default is True.
          :type _preload_content: bool, optional
          :param _request_timeout: 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.
          :return: Returns the result object.
                   If the method is called asynchronously,
                   returns the request thread.
          :rtype: dict(str, int)
          """
          kwargs['_return_http_data_only'] = True
          return self.get_inventory_with_http_info(**kwargs)  # noqa: E501
  
      def get_inventory_with_http_info(self, **kwargs):  # noqa: E501
          """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_with_http_info(async_req=True)
          >>> result = thread.get()
  
          :param async_req: Whether to execute the request asynchronously.
          :type async_req: bool, optional
          :param _return_http_data_only: response data without head status code
                                         and headers
          :type _return_http_data_only: bool, optional
          :param _preload_content: if False, the urllib3.HTTPResponse object will
                                   be returned without reading/decoding response
                                   data. Default is True.
          :type _preload_content: bool, optional
          :param _request_timeout: 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.
          :param _request_auth: set to override the auth_settings for an a single
                                request; this effectively ignores the authentication
                                in the spec for a single request.
          :type _request_auth: dict, optional
          :return: Returns the result object.
                   If the method is called asynchronously,
                   returns the request thread.
          :rtype: tuple(dict(str, int), status_code(int), headers(HTTPHeaderDict))
          """
  
          local_var_params = locals()
  
          all_params = [
          ]
          all_params.extend(
              [
                  'async_req',
                  '_return_http_data_only',
                  '_preload_content',
                  '_request_timeout',
                  '_request_auth'
              ]
          )
  
          for key, val in six.iteritems(local_var_params['kwargs']):
              if key not in all_params:
                  raise ApiTypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method get_inventory" % key
                  )
              local_var_params[key] = val
          del local_var_params['kwargs']
  
          collection_formats = {}
  
          path_params = {}
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = ['api_key']  # noqa: E501
  
          return self.api_client.call_api(
              '/store/inventory', 'GET',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='dict(str, int)',  # noqa: E501
              auth_settings=auth_settings,
              async_req=local_var_params.get('async_req'),
              _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
              _preload_content=local_var_params.get('_preload_content', True),
              _request_timeout=local_var_params.get('_request_timeout'),
              collection_formats=collection_formats,
              _request_auth=local_var_params.get('_request_auth'))
  
      def get_order_by_id(self, order_id, **kwargs):  # noqa: E501
          """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()
  
          :param order_id: ID of pet that needs to be fetched (required)
          :type order_id: int
          :param async_req: Whether to execute the request asynchronously.
          :type async_req: bool, optional
          :param _preload_content: if False, the urllib3.HTTPResponse object will
                                   be returned without reading/decoding response
                                   data. Default is True.
          :type _preload_content: bool, optional
          :param _request_timeout: 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.
          :return: Returns the result object.
                   If the method is called asynchronously,
                   returns the request thread.
          :rtype: Order
          """
          kwargs['_return_http_data_only'] = True
          return self.get_order_by_id_with_http_info(order_id, **kwargs)  # noqa: E501
  
      def get_order_by_id_with_http_info(self, order_id, **kwargs):  # noqa: E501
          """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_with_http_info(order_id, async_req=True)
          >>> result = thread.get()
  
          :param order_id: ID of pet that needs to be fetched (required)
          :type order_id: int
          :param async_req: Whether to execute the request asynchronously.
          :type async_req: bool, optional
          :param _return_http_data_only: response data without head status code
                                         and headers
          :type _return_http_data_only: bool, optional
          :param _preload_content: if False, the urllib3.HTTPResponse object will
                                   be returned without reading/decoding response
                                   data. Default is True.
          :type _preload_content: bool, optional
          :param _request_timeout: 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.
          :param _request_auth: set to override the auth_settings for an a single
                                request; this effectively ignores the authentication
                                in the spec for a single request.
          :type _request_auth: dict, optional
          :return: Returns the result object.
                   If the method is called asynchronously,
                   returns the request thread.
          :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
          """
  
          local_var_params = locals()
  
          all_params = [
              'order_id'
          ]
          all_params.extend(
              [
                  'async_req',
                  '_return_http_data_only',
                  '_preload_content',
                  '_request_timeout',
                  '_request_auth'
              ]
          )
  
          for key, val in six.iteritems(local_var_params['kwargs']):
              if key not in all_params:
                  raise ApiTypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method get_order_by_id" % key
                  )
              local_var_params[key] = val
          del local_var_params['kwargs']
          # verify the required parameter 'order_id' is set
          if self.api_client.client_side_validation and ('order_id' not in local_var_params or  # noqa: E501
                                                          local_var_params['order_id'] is None):  # noqa: E501
              raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`")  # noqa: E501
  
          if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5:  # noqa: E501
              raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`")  # noqa: E501
          if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] < 1:  # noqa: E501
              raise ApiValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`")  # noqa: E501
          collection_formats = {}
  
          path_params = {}
          if 'order_id' in local_var_params:
              path_params['order_id'] = local_var_params['order_id']  # noqa: E501
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/xml', 'application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = []  # noqa: E501
  
          return self.api_client.call_api(
              '/store/order/{order_id}', 'GET',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='Order',  # noqa: E501
              auth_settings=auth_settings,
              async_req=local_var_params.get('async_req'),
              _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
              _preload_content=local_var_params.get('_preload_content', True),
              _request_timeout=local_var_params.get('_request_timeout'),
              collection_formats=collection_formats,
              _request_auth=local_var_params.get('_request_auth'))
  
      def place_order(self, body, **kwargs):  # noqa: E501
          """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(body, async_req=True)
          >>> result = thread.get()
  
          :param body: order placed for purchasing the pet (required)
          :type body: Order
          :param async_req: Whether to execute the request asynchronously.
          :type async_req: bool, optional
          :param _preload_content: if False, the urllib3.HTTPResponse object will
                                   be returned without reading/decoding response
                                   data. Default is True.
          :type _preload_content: bool, optional
          :param _request_timeout: 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.
          :return: Returns the result object.
                   If the method is called asynchronously,
                   returns the request thread.
          :rtype: Order
          """
          kwargs['_return_http_data_only'] = True
          return self.place_order_with_http_info(body, **kwargs)  # noqa: E501
  
      def place_order_with_http_info(self, body, **kwargs):  # noqa: E501
          """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_with_http_info(body, async_req=True)
          >>> result = thread.get()
  
          :param body: order placed for purchasing the pet (required)
          :type body: Order
          :param async_req: Whether to execute the request asynchronously.
          :type async_req: bool, optional
          :param _return_http_data_only: response data without head status code
                                         and headers
          :type _return_http_data_only: bool, optional
          :param _preload_content: if False, the urllib3.HTTPResponse object will
                                   be returned without reading/decoding response
                                   data. Default is True.
          :type _preload_content: bool, optional
          :param _request_timeout: 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.
          :param _request_auth: set to override the auth_settings for an a single
                                request; this effectively ignores the authentication
                                in the spec for a single request.
          :type _request_auth: dict, optional
          :return: Returns the result object.
                   If the method is called asynchronously,
                   returns the request thread.
          :rtype: tuple(Order, status_code(int), headers(HTTPHeaderDict))
          """
  
          local_var_params = locals()
  
          all_params = [
              'body'
          ]
          all_params.extend(
              [
                  'async_req',
                  '_return_http_data_only',
                  '_preload_content',
                  '_request_timeout',
                  '_request_auth'
              ]
          )
  
          for key, val in six.iteritems(local_var_params['kwargs']):
              if key not in all_params:
                  raise ApiTypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method place_order" % key
                  )
              local_var_params[key] = val
          del local_var_params['kwargs']
          # verify the required parameter 'body' is set
          if self.api_client.client_side_validation and ('body' not in local_var_params or  # noqa: E501
                                                          local_var_params['body'] is None):  # noqa: E501
              raise ApiValueError("Missing the required parameter `body` when calling `place_order`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'body' in local_var_params:
              body_params = local_var_params['body']
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/xml', 'application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = []  # noqa: E501
  
          return self.api_client.call_api(
              '/store/order', 'POST',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='Order',  # noqa: E501
              auth_settings=auth_settings,
              async_req=local_var_params.get('async_req'),
              _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
              _preload_content=local_var_params.get('_preload_content', True),
              _request_timeout=local_var_params.get('_request_timeout'),
              collection_formats=collection_formats,
              _request_auth=local_var_params.get('_request_auth'))
  