# coding: utf-8

"""
    Cudo Compute service

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 1.0.0
    
    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 cudo_compute.api_client import ApiClient


class DefaultApi(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_data_center_commitment_schedule(self, data_center_id, start_time, end_time, **kwargs):  # noqa: E501
        """get_data_center_commitment_schedule  # 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_data_center_commitment_schedule(data_center_id, start_time, end_time, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str data_center_id: (required)
        :param datetime start_time: (required)
        :param datetime end_time: (required)
        :return: GetDataCenterCommitmentScheduleResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_data_center_commitment_schedule_with_http_info(data_center_id, start_time, end_time, **kwargs)  # noqa: E501
        else:
            (data) = self.get_data_center_commitment_schedule_with_http_info(data_center_id, start_time, end_time, **kwargs)  # noqa: E501
            return data

    def get_data_center_commitment_schedule_with_http_info(self, data_center_id, start_time, end_time, **kwargs):  # noqa: E501
        """get_data_center_commitment_schedule  # 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_data_center_commitment_schedule_with_http_info(data_center_id, start_time, end_time, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str data_center_id: (required)
        :param datetime start_time: (required)
        :param datetime end_time: (required)
        :return: GetDataCenterCommitmentScheduleResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['data_center_id', 'start_time', 'end_time']  # 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_data_center_commitment_schedule" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'data_center_id' is set
        if self.api_client.client_side_validation and ('data_center_id' not in params or
                                                       params['data_center_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `data_center_id` when calling `get_data_center_commitment_schedule`")  # noqa: E501
        # verify the required parameter 'start_time' is set
        if self.api_client.client_side_validation and ('start_time' not in params or
                                                       params['start_time'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `start_time` when calling `get_data_center_commitment_schedule`")  # noqa: E501
        # verify the required parameter 'end_time' is set
        if self.api_client.client_side_validation and ('end_time' not in params or
                                                       params['end_time'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `end_time` when calling `get_data_center_commitment_schedule`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'start_time' in params:
            query_params.append(('startTime', params['start_time']))  # noqa: E501
        if 'end_time' in params:
            query_params.append(('endTime', params['end_time']))  # 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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/data-centers/{dataCenterId}/commitment-schedule', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetDataCenterCommitmentScheduleResponse',  # 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_data_center_commitment_time_series(self, data_center_id, start_time, end_time, interval, **kwargs):  # noqa: E501
        """get_data_center_commitment_time_series  # 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_data_center_commitment_time_series(data_center_id, start_time, end_time, interval, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str data_center_id: (required)
        :param datetime start_time: (required)
        :param datetime end_time: (required)
        :param str interval: (required)
        :return: GetDataCenterCommitmentTimeSeriesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_data_center_commitment_time_series_with_http_info(data_center_id, start_time, end_time, interval, **kwargs)  # noqa: E501
        else:
            (data) = self.get_data_center_commitment_time_series_with_http_info(data_center_id, start_time, end_time, interval, **kwargs)  # noqa: E501
            return data

    def get_data_center_commitment_time_series_with_http_info(self, data_center_id, start_time, end_time, interval, **kwargs):  # noqa: E501
        """get_data_center_commitment_time_series  # 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_data_center_commitment_time_series_with_http_info(data_center_id, start_time, end_time, interval, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str data_center_id: (required)
        :param datetime start_time: (required)
        :param datetime end_time: (required)
        :param str interval: (required)
        :return: GetDataCenterCommitmentTimeSeriesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['data_center_id', 'start_time', 'end_time', 'interval']  # 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_data_center_commitment_time_series" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'data_center_id' is set
        if self.api_client.client_side_validation and ('data_center_id' not in params or
                                                       params['data_center_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `data_center_id` when calling `get_data_center_commitment_time_series`")  # noqa: E501
        # verify the required parameter 'start_time' is set
        if self.api_client.client_side_validation and ('start_time' not in params or
                                                       params['start_time'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `start_time` when calling `get_data_center_commitment_time_series`")  # noqa: E501
        # verify the required parameter 'end_time' is set
        if self.api_client.client_side_validation and ('end_time' not in params or
                                                       params['end_time'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `end_time` when calling `get_data_center_commitment_time_series`")  # noqa: E501
        # verify the required parameter 'interval' is set
        if self.api_client.client_side_validation and ('interval' not in params or
                                                       params['interval'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `interval` when calling `get_data_center_commitment_time_series`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'start_time' in params:
            query_params.append(('startTime', params['start_time']))  # noqa: E501
        if 'end_time' in params:
            query_params.append(('endTime', params['end_time']))  # noqa: E501
        if 'interval' in params:
            query_params.append(('interval', params['interval']))  # 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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/data-centers/{dataCenterId}/commitment-time-series', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetDataCenterCommitmentTimeSeriesResponse',  # 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_billing_account_projects(self, id, **kwargs):  # noqa: E501
        """list_billing_account_projects  # 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_billing_account_projects(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: string page_token = 2;  int32 page_size = 3; (required)
        :return: ListBillingAccountProjectsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_billing_account_projects_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.list_billing_account_projects_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def list_billing_account_projects_with_http_info(self, id, **kwargs):  # noqa: E501
        """list_billing_account_projects  # 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_billing_account_projects_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: string page_token = 2;  int32 page_size = 3; (required)
        :return: ListBillingAccountProjectsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['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 list_billing_account_projects" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `list_billing_account_projects`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['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'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/billing-accounts/{id}/projects', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ListBillingAccountProjectsResponse',  # 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_data_center_machine_type_prices(self, data_center_id, **kwargs):  # noqa: E501
        """list_data_center_machine_type_prices  # 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_data_center_machine_type_prices(data_center_id, async_req=True)
        >>> result = thread.get()

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

    def list_data_center_machine_type_prices_with_http_info(self, data_center_id, **kwargs):  # noqa: E501
        """list_data_center_machine_type_prices  # 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_data_center_machine_type_prices_with_http_info(data_center_id, async_req=True)
        >>> result = thread.get()

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

        all_params = ['data_center_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 list_data_center_machine_type_prices" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'data_center_id' is set
        if self.api_client.client_side_validation and ('data_center_id' not in params or
                                                       params['data_center_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `data_center_id` when calling `list_data_center_machine_type_prices`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'data_center_id' in params:
            path_params['dataCenterId'] = params['data_center_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'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/data-centers/{dataCenterId}/machine-type-prices', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ListDataCenterMachineTypePricesResponse',  # 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_vm_machine_types(self, **kwargs):  # noqa: E501
        """list_vm_machine_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_vm_machine_types(async_req=True)
        >>> result = thread.get()

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

    def list_vm_machine_types_with_http_info(self, **kwargs):  # noqa: E501
        """list_vm_machine_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_vm_machine_types_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ListVMMachineTypesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # 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_vm_machine_types" % key
                )
            params[key] = val
        del 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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/vms/machine-types', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ListVMMachineTypesResponse',  # 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 search_resources(self, query, **kwargs):  # noqa: E501
        """search_resources  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_resources(query, async_req=True)
        >>> result = thread.get()

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

    def search_resources_with_http_info(self, query, **kwargs):  # noqa: E501
        """search_resources  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_resources_with_http_info(query, async_req=True)
        >>> result = thread.get()

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

        all_params = ['query']  # 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 search_resources" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'query' is set
        if self.api_client.client_side_validation and ('query' not in params or
                                                       params['query'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `query` when calling `search_resources`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'query' in params:
            query_params.append(('query', params['query']))  # 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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/resources/search', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SearchResourcesResponse',  # 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 track(self, track_body, **kwargs):  # noqa: E501
        """track  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.track(track_body, async_req=True)
        >>> result = thread.get()

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

    def track_with_http_info(self, track_body, **kwargs):  # noqa: E501
        """track  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.track_with_http_info(track_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param TrackRequest track_body: (required)
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['track_body']  # 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 track" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'track_body' is set
        if self.api_client.client_side_validation and ('track_body' not in params or
                                                       params['track_body'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `track_body` when calling `track`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'track_body' in params:
            body_params = params['track_body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/auth/track', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  # 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 update_vm_expire_time(self, project_id, id, update_vm_expire_time_body, **kwargs):  # noqa: E501
        """update_vm_expire_time  # 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_vm_expire_time(project_id, id, update_vm_expire_time_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str project_id: (required)
        :param str id: (required)
        :param UpdateVMExpireTimeBody update_vm_expire_time_body: (required)
        :return: UpdateVMExpireTimeResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_vm_expire_time_with_http_info(project_id, id, update_vm_expire_time_body, **kwargs)  # noqa: E501
        else:
            (data) = self.update_vm_expire_time_with_http_info(project_id, id, update_vm_expire_time_body, **kwargs)  # noqa: E501
            return data

    def update_vm_expire_time_with_http_info(self, project_id, id, update_vm_expire_time_body, **kwargs):  # noqa: E501
        """update_vm_expire_time  # 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_vm_expire_time_with_http_info(project_id, id, update_vm_expire_time_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str project_id: (required)
        :param str id: (required)
        :param UpdateVMExpireTimeBody update_vm_expire_time_body: (required)
        :return: UpdateVMExpireTimeResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['project_id', 'id', 'update_vm_expire_time_body']  # 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 update_vm_expire_time" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if self.api_client.client_side_validation and ('project_id' not in params or
                                                       params['project_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `project_id` when calling `update_vm_expire_time`")  # noqa: E501
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `update_vm_expire_time`")  # noqa: E501
        # verify the required parameter 'update_vm_expire_time_body' is set
        if self.api_client.client_side_validation and ('update_vm_expire_time_body' not in params or
                                                       params['update_vm_expire_time_body'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `update_vm_expire_time_body` when calling `update_vm_expire_time`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'update_vm_expire_time_body' in params:
            body_params = params['update_vm_expire_time_body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/projects/{projectId}/vm/{id}/expire-time', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='UpdateVMExpireTimeResponse',  # 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 update_vm_password(self, project_id, id, update_vm_password_body, **kwargs):  # noqa: E501
        """update_vm_password  # 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_vm_password(project_id, id, update_vm_password_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str project_id: (required)
        :param str id: (required)
        :param UpdateVMPasswordBody update_vm_password_body: (required)
        :return: UpdateVMPasswordResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_vm_password_with_http_info(project_id, id, update_vm_password_body, **kwargs)  # noqa: E501
        else:
            (data) = self.update_vm_password_with_http_info(project_id, id, update_vm_password_body, **kwargs)  # noqa: E501
            return data

    def update_vm_password_with_http_info(self, project_id, id, update_vm_password_body, **kwargs):  # noqa: E501
        """update_vm_password  # 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_vm_password_with_http_info(project_id, id, update_vm_password_body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str project_id: (required)
        :param str id: (required)
        :param UpdateVMPasswordBody update_vm_password_body: (required)
        :return: UpdateVMPasswordResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['project_id', 'id', 'update_vm_password_body']  # 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 update_vm_password" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if self.api_client.client_side_validation and ('project_id' not in params or
                                                       params['project_id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `project_id` when calling `update_vm_password`")  # noqa: E501
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `update_vm_password`")  # noqa: E501
        # verify the required parameter 'update_vm_password_body' is set
        if self.api_client.client_side_validation and ('update_vm_password_body' not in params or
                                                       params['update_vm_password_body'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `update_vm_password_body` when calling `update_vm_password`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'update_vm_password_body' in params:
            body_params = params['update_vm_password_body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['Authorization']

        return self.api_client.call_api(
            '/v1/projects/{projectId}/vm/{id}/password', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='UpdateVMPasswordResponse',  # 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)
