text: # coding: utf-8
  
  """
      Metal API
  
      This is the API for Equinix Metal. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account.  The official API docs are hosted at <https://metal.equinix.com/developers/api>.   # noqa: E501
  
      The version of the OpenAPI document: 1.0.0
      Contact: support@equinixmetal.com
      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 metal.api_client import ApiClient
  from metal.exceptions import (  # noqa: F401
      ApiTypeError,
      ApiValueError
  )
  
  
  class PlansApi(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 find_plans(self, **kwargs):  # noqa: E501
          """Retrieve all plans  # noqa: E501
  
          Provides a listing of available plans to provision your device on.  # 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_plans(async_req=True)
          >>> result = thread.get()
  
          :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.
          :type include: list[str]
          :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.
          :type exclude: list[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: PlanList
          """
          kwargs['_return_http_data_only'] = True
          return self.find_plans_with_http_info(**kwargs)  # noqa: E501
  
      def find_plans_with_http_info(self, **kwargs):  # noqa: E501
          """Retrieve all plans  # noqa: E501
  
          Provides a listing of available plans to provision your device on.  # 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_plans_with_http_info(async_req=True)
          >>> result = thread.get()
  
          :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.
          :type include: list[str]
          :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.
          :type exclude: list[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: tuple(PlanList, status_code(int), headers(HTTPHeaderDict))
          """
  
          local_var_params = locals()
  
          all_params = [
              'include',
              'exclude'
          ]
          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 find_plans" % key
                  )
              local_var_params[key] = val
          del local_var_params['kwargs']
  
          collection_formats = {}
  
          path_params = {}
  
          query_params = []
          if 'include' in local_var_params and local_var_params['include'] is not None:  # noqa: E501
              query_params.append(('include', local_var_params['include']))  # noqa: E501
              collection_formats['include'] = 'csv'  # noqa: E501
          if 'exclude' in local_var_params and local_var_params['exclude'] is not None:  # noqa: E501
              query_params.append(('exclude', local_var_params['exclude']))  # noqa: E501
              collection_formats['exclude'] = 'csv'  # noqa: E501
  
          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 = ['x_auth_token']  # noqa: E501
  
          response_types_map = {
              200: "PlanList",
              401: "Error",
          }
  
          return self.api_client.call_api(
              '/plans', 'GET',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_types_map=response_types_map,
              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 find_plans_by_organization(self, id, **kwargs):  # noqa: E501
          """Retrieve all plans visible by the organization  # noqa: E501
  
          Returns a listing of available plans for the given organization  # 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_plans_by_organization(id, async_req=True)
          >>> result = thread.get()
  
          :param id: Organization UUID (required)
          :type id: str
          :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.
          :type include: list[str]
          :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.
          :type exclude: list[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: PlanList
          """
          kwargs['_return_http_data_only'] = True
          return self.find_plans_by_organization_with_http_info(id, **kwargs)  # noqa: E501
  
      def find_plans_by_organization_with_http_info(self, id, **kwargs):  # noqa: E501
          """Retrieve all plans visible by the organization  # noqa: E501
  
          Returns a listing of available plans for the given organization  # 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_plans_by_organization_with_http_info(id, async_req=True)
          >>> result = thread.get()
  
          :param id: Organization UUID (required)
          :type id: str
          :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.
          :type include: list[str]
          :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.
          :type exclude: list[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: tuple(PlanList, status_code(int), headers(HTTPHeaderDict))
          """
  
          local_var_params = locals()
  
          all_params = [
              'id',
              'include',
              'exclude'
          ]
          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 find_plans_by_organization" % key
                  )
              local_var_params[key] = val
          del local_var_params['kwargs']
          # verify the required parameter 'id' is set
          if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                          local_var_params['id'] is None):  # noqa: E501
              raise ApiValueError("Missing the required parameter `id` when calling `find_plans_by_organization`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
          if 'id' in local_var_params:
              path_params['id'] = local_var_params['id']  # noqa: E501
  
          query_params = []
          if 'include' in local_var_params and local_var_params['include'] is not None:  # noqa: E501
              query_params.append(('include', local_var_params['include']))  # noqa: E501
              collection_formats['include'] = 'csv'  # noqa: E501
          if 'exclude' in local_var_params and local_var_params['exclude'] is not None:  # noqa: E501
              query_params.append(('exclude', local_var_params['exclude']))  # noqa: E501
              collection_formats['exclude'] = 'csv'  # noqa: E501
  
          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 = ['x_auth_token']  # noqa: E501
  
          response_types_map = {
              200: "PlanList",
              401: "Error",
              403: "Error",
              404: "Error",
          }
  
          return self.api_client.call_api(
              '/organizations/{id}/plans', 'GET',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_types_map=response_types_map,
              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 find_plans_by_project(self, id, **kwargs):  # noqa: E501
          """Retrieve all plans visible by the project  # noqa: E501
  
          Returns a listing of available plans for the given project  # 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_plans_by_project(id, async_req=True)
          >>> result = thread.get()
  
          :param id: Project UUID (required)
          :type id: str
          :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.
          :type include: list[str]
          :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.
          :type exclude: list[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: PlanList
          """
          kwargs['_return_http_data_only'] = True
          return self.find_plans_by_project_with_http_info(id, **kwargs)  # noqa: E501
  
      def find_plans_by_project_with_http_info(self, id, **kwargs):  # noqa: E501
          """Retrieve all plans visible by the project  # noqa: E501
  
          Returns a listing of available plans for the given project  # 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_plans_by_project_with_http_info(id, async_req=True)
          >>> result = thread.get()
  
          :param id: Project UUID (required)
          :type id: str
          :param include: Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects.
          :type include: list[str]
          :param exclude: Nested attributes to exclude. Excluded objects will return only the href attribute. Attribute names can be dotted (up to 3 levels) to exclude deeply nested objects.
          :type exclude: list[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: tuple(PlanList, status_code(int), headers(HTTPHeaderDict))
          """
  
          local_var_params = locals()
  
          all_params = [
              'id',
              'include',
              'exclude'
          ]
          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 find_plans_by_project" % key
                  )
              local_var_params[key] = val
          del local_var_params['kwargs']
          # verify the required parameter 'id' is set
          if self.api_client.client_side_validation and ('id' not in local_var_params or  # noqa: E501
                                                          local_var_params['id'] is None):  # noqa: E501
              raise ApiValueError("Missing the required parameter `id` when calling `find_plans_by_project`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
          if 'id' in local_var_params:
              path_params['id'] = local_var_params['id']  # noqa: E501
  
          query_params = []
          if 'include' in local_var_params and local_var_params['include'] is not None:  # noqa: E501
              query_params.append(('include', local_var_params['include']))  # noqa: E501
              collection_formats['include'] = 'csv'  # noqa: E501
          if 'exclude' in local_var_params and local_var_params['exclude'] is not None:  # noqa: E501
              query_params.append(('exclude', local_var_params['exclude']))  # noqa: E501
              collection_formats['exclude'] = 'csv'  # noqa: E501
  
          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 = ['x_auth_token']  # noqa: E501
  
          response_types_map = {
              200: "PlanList",
              401: "Error",
              403: "Error",
              404: "Error",
          }
  
          return self.api_client.call_api(
              '/projects/{id}/plans', 'GET',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_types_map=response_types_map,
              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'))
  