# coding: utf-8

"""
    Command Center operations

    Command Center operations  # noqa: E501

    OpenAPI spec version: 23.09-sp2
    Contact: support@zadarastorage.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from CommandCenter.api_client import ApiClient


class EngineTypesApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def get_app_engine(self, cloud_name, name, **kwargs):  # noqa: E501
        """get_app_engine  # noqa: E501

        Returns a single APP engine type details.  # 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_app_engine(cloud_name, name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param str name: (required)
        :param int page: The page number to start from.
        :param int per_page: The total number of records to return.
        :return: InlineResponse20032
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_app_engine_with_http_info(cloud_name, name, **kwargs)  # noqa: E501
        else:
            (data) = self.get_app_engine_with_http_info(cloud_name, name, **kwargs)  # noqa: E501
            return data

    def get_app_engine_with_http_info(self, cloud_name, name, **kwargs):  # noqa: E501
        """get_app_engine  # noqa: E501

        Returns a single APP engine type details.  # 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_app_engine_with_http_info(cloud_name, name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param str name: (required)
        :param int page: The page number to start from.
        :param int per_page: The total number of records to return.
        :return: InlineResponse20032
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'name', 'page', 'per_page']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_app_engine" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `get_app_engine`")  # noqa: E501
        # verify the required parameter 'name' is set
        if self.api_client.client_side_validation and ('name' not in params or
                                                       params['name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `name` when calling `get_app_engine`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501
        if 'name' in params:
            path_params['name'] = params['name']  # noqa: E501

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'per_page' in params:
            query_params.append(('per_page', params['per_page']))  # 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/app_engine_types/{name}.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20032',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_io_engine(self, cloud_name, internal_id, **kwargs):  # noqa: E501
        """get_io_engine  # noqa: E501

        Returns a single IO engine type details.  # 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_io_engine(cloud_name, internal_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param str internal_id: (required)
        :return: InlineResponse20030
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_io_engine_with_http_info(cloud_name, internal_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_io_engine_with_http_info(cloud_name, internal_id, **kwargs)  # noqa: E501
            return data

    def get_io_engine_with_http_info(self, cloud_name, internal_id, **kwargs):  # noqa: E501
        """get_io_engine  # noqa: E501

        Returns a single IO engine type details.  # 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_io_engine_with_http_info(cloud_name, internal_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param str internal_id: (required)
        :return: InlineResponse20030
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'internal_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_io_engine" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `get_io_engine`")  # noqa: E501
        # verify the required parameter 'internal_id' is set
        if self.api_client.client_side_validation and ('internal_id' not in params or
                                                       params['internal_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `internal_id` when calling `get_io_engine`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501
        if 'internal_id' in params:
            path_params['internal_id'] = params['internal_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/json', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/engine_types/{internal_id}.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20030',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_cloud_io_engine_types(self, cloud_name, **kwargs):  # noqa: E501
        """list_cloud_io_engine_types  # noqa: E501

        Returns a list of Cloud's IO engine types.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_cloud_io_engine_types(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param int page: The page number to start from.
        :param int per_page: The total number of records to return.
        :return: InlineResponse20029
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_cloud_io_engine_types_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.list_cloud_io_engine_types_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

    def list_cloud_io_engine_types_with_http_info(self, cloud_name, **kwargs):  # noqa: E501
        """list_cloud_io_engine_types  # noqa: E501

        Returns a list of Cloud's IO engine types.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_cloud_io_engine_types_with_http_info(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param int page: The page number to start from.
        :param int per_page: The total number of records to return.
        :return: InlineResponse20029
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'page', 'per_page']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_cloud_io_engine_types" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `list_cloud_io_engine_types`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'per_page' in params:
            query_params.append(('per_page', params['per_page']))  # 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/engine_types.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20029',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_clouds_app_engine_types(self, cloud_name, **kwargs):  # noqa: E501
        """list_clouds_app_engine_types  # noqa: E501

        Returns a list of Cloud's APP engine types.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_clouds_app_engine_types(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param int page: The page number to start from.
        :param int per_page: The total number of records to return.
        :return: InlineResponse20031
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_clouds_app_engine_types_with_http_info(cloud_name, **kwargs)  # noqa: E501
        else:
            (data) = self.list_clouds_app_engine_types_with_http_info(cloud_name, **kwargs)  # noqa: E501
            return data

    def list_clouds_app_engine_types_with_http_info(self, cloud_name, **kwargs):  # noqa: E501
        """list_clouds_app_engine_types  # noqa: E501

        Returns a list of Cloud's APP engine types.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_clouds_app_engine_types_with_http_info(cloud_name, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cloud_name: (required)
        :param int page: The page number to start from.
        :param int per_page: The total number of records to return.
        :return: InlineResponse20031
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['cloud_name', 'page', 'per_page']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_clouds_app_engine_types" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'cloud_name' is set
        if self.api_client.client_side_validation and ('cloud_name' not in params or
                                                       params['cloud_name'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `cloud_name` when calling `list_clouds_app_engine_types`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'cloud_name' in params:
            path_params['cloud_name'] = params['cloud_name']  # noqa: E501

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'per_page' in params:
            query_params.append(('per_page', params['per_page']))  # 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = ['api_key']  # noqa: E501

        return self.api_client.call_api(
            '/clouds/{cloud_name}/app_engine_types.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20031',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
