# coding: utf-8
"""
    external/v1/auth_service.proto

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

    OpenAPI spec version: version not set

    Generated by: https://github.com/swagger-api/swagger-codegen.git

    NOTE
    ----
    standard swagger-codegen-cli for this python client has been modified
    by custom templates. The purpose of these templates is to include
    typing information in the API and Model code. Please refer to the
    main grid repository for more info
"""

from __future__ import absolute_import

import re  # noqa: F401
from typing import TYPE_CHECKING, Any

# python 2 and python 3 compatibility library
import six

from lightning_cloud.openapi.api_client import ApiClient

if TYPE_CHECKING:
    from datetime import datetime
    from lightning_cloud.openapi.models import *


class CloudSpaceServiceApi(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 cloud_space_service_cancel_cloud_space_instance_switch(
            self, project_id: 'str', id: 'str', **kwargs
    ) -> 'V1CancelCloudSpaceInstanceSwitchResponse':  # noqa: E501
        """cloud_space_service_cancel_cloud_space_instance_switch  # noqa: E501

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

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

    def cloud_space_service_cancel_cloud_space_instance_switch_with_http_info(
            self, project_id: 'str', id: 'str', **kwargs
    ) -> 'V1CancelCloudSpaceInstanceSwitchResponse':  # noqa: E501
        """cloud_space_service_cancel_cloud_space_instance_switch  # noqa: E501

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

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

        all_params = ['project_id', '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 cloud_space_service_cancel_cloud_space_instance_switch"
                    % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_cancel_cloud_space_instance_switch`"
            )  # noqa: E501
        # verify the required parameter 'id' is set
        if ('id' not in params or params['id'] is None):
            raise ValueError(
                "Missing the required parameter `id` when calling `cloud_space_service_cancel_cloud_space_instance_switch`"
            )  # 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
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{id}/switch-cancel',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=
            'V1CancelCloudSpaceInstanceSwitchResponse',  # 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 cloud_space_service_create_cloud_space(
            self, body: 'ProjectIdCloudspacesBody', project_id: 'str',
            **kwargs) -> 'V1CloudSpace':  # noqa: E501
        """cloud_space_service_create_cloud_space  # noqa: E501

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

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

    def cloud_space_service_create_cloud_space_with_http_info(
            self, body: 'ProjectIdCloudspacesBody', project_id: 'str',
            **kwargs) -> 'V1CloudSpace':  # noqa: E501
        """cloud_space_service_create_cloud_space  # noqa: E501

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

        :param async_req bool
        :param ProjectIdCloudspacesBody body: (required)
        :param str project_id: (required)
        :return: V1CloudSpace
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1CloudSpace',  # 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 cloud_space_service_create_lightning_run(
            self, body: 'CloudspaceIdRunsBody', project_id: 'str',
            cloudspace_id: 'str', **kwargs) -> 'V1LightningRun':  # noqa: E501
        """cloud_space_service_create_lightning_run  # noqa: E501

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

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

    def cloud_space_service_create_lightning_run_with_http_info(
            self, body: 'CloudspaceIdRunsBody', project_id: 'str',
            cloudspace_id: 'str', **kwargs) -> 'V1LightningRun':  # noqa: E501
        """cloud_space_service_create_lightning_run  # noqa: E501

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

        :param async_req bool
        :param CloudspaceIdRunsBody body: (required)
        :param str project_id: (required)
        :param str cloudspace_id: (required)
        :return: V1LightningRun
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'project_id', 'cloudspace_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 cloud_space_service_create_lightning_run" %
                    key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or params['body'] is None):
            raise ValueError(
                "Missing the required parameter `body` when calling `cloud_space_service_create_lightning_run`"
            )  # noqa: E501
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_create_lightning_run`"
            )  # noqa: E501
        # verify the required parameter 'cloudspace_id' is set
        if ('cloudspace_id' not in params or params['cloudspace_id'] is None):
            raise ValueError(
                "Missing the required parameter `cloudspace_id` when calling `cloud_space_service_create_lightning_run`"
            )  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{cloudspaceId}/runs',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1LightningRun',  # 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 cloud_space_service_create_lightning_run_instance(
            self, body: 'IdGetBody1', project_id: 'str', cloudspace_id: 'str',
            id: 'str',
            **kwargs) -> 'Externalv1LightningappInstance':  # noqa: E501
        """cloud_space_service_create_lightning_run_instance  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cloud_space_service_create_lightning_run_instance(body, project_id, cloudspace_id, id, async_req=True)
        >>> result = thread.get()

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

    def cloud_space_service_create_lightning_run_instance_with_http_info(
            self, body: 'IdGetBody1', project_id: 'str', cloudspace_id: 'str',
            id: 'str',
            **kwargs) -> 'Externalv1LightningappInstance':  # noqa: E501
        """cloud_space_service_create_lightning_run_instance  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cloud_space_service_create_lightning_run_instance_with_http_info(body, project_id, cloudspace_id, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param IdGetBody1 body: (required)
        :param str project_id: (required)
        :param str cloudspace_id: (required)
        :param str id: (required)
        :return: Externalv1LightningappInstance
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'cloudspace_id' in params:
            path_params['cloudspaceId'] = params['cloudspace_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 'body' in params:
            body_params = params['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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{cloudspaceId}/runs/{id}/get',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Externalv1LightningappInstance',  # 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 cloud_space_service_delete_cloud_space(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1DeleteCloudSpaceResponse':  # noqa: E501
        """cloud_space_service_delete_cloud_space  # noqa: E501

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

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

    def cloud_space_service_delete_cloud_space_with_http_info(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1DeleteCloudSpaceResponse':  # noqa: E501
        """cloud_space_service_delete_cloud_space  # noqa: E501

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

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

        all_params = ['project_id', '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 cloud_space_service_delete_cloud_space" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_delete_cloud_space`"
            )  # noqa: E501
        # verify the required parameter 'id' is set
        if ('id' not in params or params['id'] is None):
            raise ValueError(
                "Missing the required parameter `id` when calling `cloud_space_service_delete_cloud_space`"
            )  # 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
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{id}',
            'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1DeleteCloudSpaceResponse',  # 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 cloud_space_service_delete_lightning_run(
            self, project_id: 'str', cloudspace_id: 'str', id: 'str',
            **kwargs) -> 'V1DeleteLightningRunResponse':  # noqa: E501
        """cloud_space_service_delete_lightning_run  # noqa: E501

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

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

    def cloud_space_service_delete_lightning_run_with_http_info(
            self, project_id: 'str', cloudspace_id: 'str', id: 'str',
            **kwargs) -> 'V1DeleteLightningRunResponse':  # noqa: E501
        """cloud_space_service_delete_lightning_run  # noqa: E501

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

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

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

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'cloudspace_id' in params:
            path_params['cloudspaceId'] = params['cloudspace_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
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{cloudspaceId}/runs/{id}',
            'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1DeleteLightningRunResponse',  # 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 cloud_space_service_get_cloud_space(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1CloudSpace':  # noqa: E501
        """cloud_space_service_get_cloud_space  # noqa: E501

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

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

    def cloud_space_service_get_cloud_space_with_http_info(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1CloudSpace':  # noqa: E501
        """cloud_space_service_get_cloud_space  # noqa: E501

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

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

        all_params = ['project_id', '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 cloud_space_service_get_cloud_space" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_get_cloud_space`"
            )  # noqa: E501
        # verify the required parameter 'id' is set
        if ('id' not in params or params['id'] is None):
            raise ValueError(
                "Missing the required parameter `id` when calling `cloud_space_service_get_cloud_space`"
            )  # 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
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{id}',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1CloudSpace',  # 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 cloud_space_service_get_cloud_space_instance_config(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1CloudSpaceInstanceConfig':  # noqa: E501
        """cloud_space_service_get_cloud_space_instance_config  # noqa: E501

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

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

    def cloud_space_service_get_cloud_space_instance_config_with_http_info(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1CloudSpaceInstanceConfig':  # noqa: E501
        """cloud_space_service_get_cloud_space_instance_config  # noqa: E501

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

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

        all_params = ['project_id', '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 cloud_space_service_get_cloud_space_instance_config"
                    % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_get_cloud_space_instance_config`"
            )  # noqa: E501
        # verify the required parameter 'id' is set
        if ('id' not in params or params['id'] is None):
            raise ValueError(
                "Missing the required parameter `id` when calling `cloud_space_service_get_cloud_space_instance_config`"
            )  # 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
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{id}/codeconfig',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1CloudSpaceInstanceConfig',  # 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 cloud_space_service_get_cloud_space_instance_status(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1GetCloudSpaceInstanceStatusResponse':  # noqa: E501
        """cloud_space_service_get_cloud_space_instance_status  # noqa: E501

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

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

    def cloud_space_service_get_cloud_space_instance_status_with_http_info(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1GetCloudSpaceInstanceStatusResponse':  # noqa: E501
        """cloud_space_service_get_cloud_space_instance_status  # noqa: E501

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

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

        all_params = ['project_id', '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 cloud_space_service_get_cloud_space_instance_status"
                    % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_get_cloud_space_instance_status`"
            )  # noqa: E501
        # verify the required parameter 'id' is set
        if ('id' not in params or params['id'] is None):
            raise ValueError(
                "Missing the required parameter `id` when calling `cloud_space_service_get_cloud_space_instance_status`"
            )  # 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
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{id}/codestatus',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1GetCloudSpaceInstanceStatusResponse',  # 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 cloud_space_service_get_lightning_run(
            self, project_id: 'str', cloudspace_id: 'str', id: 'str',
            **kwargs) -> 'V1LightningRun':  # noqa: E501
        """cloud_space_service_get_lightning_run  # noqa: E501

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

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

    def cloud_space_service_get_lightning_run_with_http_info(
            self, project_id: 'str', cloudspace_id: 'str', id: 'str',
            **kwargs) -> 'V1LightningRun':  # noqa: E501
        """cloud_space_service_get_lightning_run  # noqa: E501

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

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

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

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'cloudspace_id' in params:
            path_params['cloudspaceId'] = params['cloudspace_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
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{cloudspaceId}/runs/{id}',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1LightningRun',  # 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 cloud_space_service_get_lightning_run_source_code_download_url(
        self, project_id: 'str', cloudspace_id: 'str', run_id: 'str', **kwargs
    ) -> 'V1GetLightningRunSourceCodeDownloadUrlResponse':  # noqa: E501
        """cloud_space_service_get_lightning_run_source_code_download_url  # noqa: E501

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

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

    def cloud_space_service_get_lightning_run_source_code_download_url_with_http_info(
        self, project_id: 'str', cloudspace_id: 'str', run_id: 'str', **kwargs
    ) -> 'V1GetLightningRunSourceCodeDownloadUrlResponse':  # noqa: E501
        """cloud_space_service_get_lightning_run_source_code_download_url  # noqa: E501

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

        :param async_req bool
        :param str project_id: (required)
        :param str cloudspace_id: (required)
        :param str run_id: (required)
        :return: V1GetLightningRunSourceCodeDownloadUrlResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['project_id', 'cloudspace_id', 'run_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 cloud_space_service_get_lightning_run_source_code_download_url"
                    % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_get_lightning_run_source_code_download_url`"
            )  # noqa: E501
        # verify the required parameter 'cloudspace_id' is set
        if ('cloudspace_id' not in params or params['cloudspace_id'] is None):
            raise ValueError(
                "Missing the required parameter `cloudspace_id` when calling `cloud_space_service_get_lightning_run_source_code_download_url`"
            )  # noqa: E501
        # verify the required parameter 'run_id' is set
        if ('run_id' not in params or params['run_id'] is None):
            raise ValueError(
                "Missing the required parameter `run_id` when calling `cloud_space_service_get_lightning_run_source_code_download_url`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'cloudspace_id' in params:
            path_params['cloudspaceId'] = params['cloudspace_id']  # noqa: E501
        if 'run_id' in params:
            path_params['runId'] = params['run_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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{cloudspaceId}/runs/{runId}/source-code',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=
            'V1GetLightningRunSourceCodeDownloadUrlResponse',  # 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 cloud_space_service_list_cloud_spaces(
            self, project_id: 'str',
            **kwargs) -> 'V1ListCloudSpacesResponse':  # noqa: E501
        """cloud_space_service_list_cloud_spaces  # noqa: E501

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

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

    def cloud_space_service_list_cloud_spaces_with_http_info(
            self, project_id: 'str',
            **kwargs) -> 'V1ListCloudSpacesResponse':  # noqa: E501
        """cloud_space_service_list_cloud_spaces  # noqa: E501

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

        :param async_req bool
        :param str project_id: (required)
        :param str page_token:
        :param str limit:
        :param str name:
        :return: V1ListCloudSpacesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['project_id', 'page_token', 'limit',
                      'name']  # 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 cloud_space_service_list_cloud_spaces" % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_list_cloud_spaces`"
            )  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'page_token' in params:
            query_params.append(
                ('pageToken', params['page_token']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'name' in params:
            query_params.append(('name', params['name']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1ListCloudSpacesResponse',  # 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 cloud_space_service_switch_cloud_space_instance(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1SwitchCloudSpaceInstanceResponse':  # noqa: E501
        """cloud_space_service_switch_cloud_space_instance  # noqa: E501

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

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

    def cloud_space_service_switch_cloud_space_instance_with_http_info(
            self, project_id: 'str', id: 'str',
            **kwargs) -> 'V1SwitchCloudSpaceInstanceResponse':  # noqa: E501
        """cloud_space_service_switch_cloud_space_instance  # noqa: E501

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

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

        all_params = ['project_id', '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 cloud_space_service_switch_cloud_space_instance"
                    % key)
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or params['project_id'] is None):
            raise ValueError(
                "Missing the required parameter `project_id` when calling `cloud_space_service_switch_cloud_space_instance`"
            )  # noqa: E501
        # verify the required parameter 'id' is set
        if ('id' not in params or params['id'] is None):
            raise ValueError(
                "Missing the required parameter `id` when calling `cloud_space_service_switch_cloud_space_instance`"
            )  # 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
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{id}/switch-confirm',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1SwitchCloudSpaceInstanceResponse',  # 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 cloud_space_service_update_cloud_space(
            self, body: 'CloudspacesIdBody', project_id: 'str', id: 'str',
            **kwargs) -> 'V1CloudSpace':  # noqa: E501
        """cloud_space_service_update_cloud_space  # noqa: E501

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

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

    def cloud_space_service_update_cloud_space_with_http_info(
            self, body: 'CloudspacesIdBody', project_id: 'str', id: 'str',
            **kwargs) -> 'V1CloudSpace':  # noqa: E501
        """cloud_space_service_update_cloud_space  # noqa: E501

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

        :param async_req bool
        :param CloudspacesIdBody body: (required)
        :param str project_id: (required)
        :param str id: (required)
        :return: V1CloudSpace
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        return self.api_client.call_api(
            '/v1/projects/{projectId}/cloudspaces/{id}',
            'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1CloudSpace',  # 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 cloud_space_service_update_cloud_space_instance_config(
            self, body: 'IdCodeconfigBody', project_id: 'str', id: 'str',
            **kwargs) -> 'V1CloudSpaceInstanceConfig':  # noqa: E501
        """cloud_space_service_update_cloud_space_instance_config  # noqa: E501

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

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

    def cloud_space_service_update_cloud_space_instance_config_with_http_info(
            self, body: 'IdCodeconfigBody', project_id: 'str', id: 'str',
            **kwargs) -> 'V1CloudSpaceInstanceConfig':  # noqa: E501
        """cloud_space_service_update_cloud_space_instance_config  # noqa: E501

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

        :param async_req bool
        :param IdCodeconfigBody body: (required)
        :param str project_id: (required)
        :param str id: (required)
        :return: V1CloudSpaceInstanceConfig
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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