# 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 LightningappV2ServiceApi(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 lightningapp_v2_service_create_lightningapp_from_gallery(self, body: 'ProjectIdGetappBody', project_id: 'str', **kwargs) -> 'Externalv1LightningappInstance':  # noqa: E501
        """lightningapp_v2_service_create_lightningapp_from_gallery  # noqa: E501

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

        :param async_req bool
        :param ProjectIdGetappBody body: (required)
        :param str project_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.lightningapp_v2_service_create_lightningapp_from_gallery_with_http_info(body, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.lightningapp_v2_service_create_lightningapp_from_gallery_with_http_info(body, project_id, **kwargs)  # noqa: E501
            return data

    def lightningapp_v2_service_create_lightningapp_from_gallery_with_http_info(self, body: 'ProjectIdGetappBody', project_id: 'str', **kwargs) -> 'Externalv1LightningappInstance':  # noqa: E501
        """lightningapp_v2_service_create_lightningapp_from_gallery  # noqa: E501

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

        :param async_req bool
        :param ProjectIdGetappBody body: (required)
        :param str project_id: (required)
        :return: Externalv1LightningappInstance
                 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 lightningapp_v2_service_create_lightningapp_from_gallery" % 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 `lightningapp_v2_service_create_lightningapp_from_gallery`")  # 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 `lightningapp_v2_service_create_lightningapp_from_gallery`")  # 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}/get-app', '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 lightningapp_v2_service_create_lightningapp_release(self, body: 'AppIdReleasesBody', project_id: 'str', app_id: 'str', **kwargs) -> 'V1LightningappRelease':  # noqa: E501
        """lightningapp_v2_service_create_lightningapp_release  # noqa: E501

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

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

    def lightningapp_v2_service_create_lightningapp_release_with_http_info(self, body: 'AppIdReleasesBody', project_id: 'str', app_id: 'str', **kwargs) -> 'V1LightningappRelease':  # noqa: E501
        """lightningapp_v2_service_create_lightningapp_release  # noqa: E501

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

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

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

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'app_id' in params:
            path_params['appId'] = params['app_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}/appsv2/{appId}/releases', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1LightningappRelease',  # 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 lightningapp_v2_service_create_lightningapp_release_instance(self, body: 'IdGetBody', project_id: 'str', app_id: 'str', id: 'str', **kwargs) -> 'Externalv1LightningappInstance':  # noqa: E501
        """lightningapp_v2_service_create_lightningapp_release_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.lightningapp_v2_service_create_lightningapp_release_instance(body, project_id, app_id, id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param IdGetBody body: (required)
        :param str project_id: (required)
        :param str app_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.lightningapp_v2_service_create_lightningapp_release_instance_with_http_info(body, project_id, app_id, id, **kwargs)  # noqa: E501
        else:
            (data) = self.lightningapp_v2_service_create_lightningapp_release_instance_with_http_info(body, project_id, app_id, id, **kwargs)  # noqa: E501
            return data

    def lightningapp_v2_service_create_lightningapp_release_instance_with_http_info(self, body: 'IdGetBody', project_id: 'str', app_id: 'str', id: 'str', **kwargs) -> 'Externalv1LightningappInstance':  # noqa: E501
        """lightningapp_v2_service_create_lightningapp_release_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.lightningapp_v2_service_create_lightningapp_release_instance_with_http_info(body, project_id, app_id, id, async_req=True)
        >>> result = thread.get()

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

        all_params = ['body', 'project_id', 'app_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 lightningapp_v2_service_create_lightningapp_release_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 `lightningapp_v2_service_create_lightningapp_release_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 `lightningapp_v2_service_create_lightningapp_release_instance`")  # noqa: E501
        # verify the required parameter 'app_id' is set
        if ('app_id' not in params or
                params['app_id'] is None):
            raise ValueError("Missing the required parameter `app_id` when calling `lightningapp_v2_service_create_lightningapp_release_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 `lightningapp_v2_service_create_lightningapp_release_instance`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'app_id' in params:
            path_params['appId'] = params['app_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}/appsv2/{appId}/releases/{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 lightningapp_v2_service_create_lightningapp_v2(self, body: 'ProjectIdAppsv2Body', project_id: 'str', **kwargs) -> 'V1LightningappV2':  # noqa: E501
        """lightningapp_v2_service_create_lightningapp_v2  # noqa: E501

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

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

    def lightningapp_v2_service_create_lightningapp_v2_with_http_info(self, body: 'ProjectIdAppsv2Body', project_id: 'str', **kwargs) -> 'V1LightningappV2':  # noqa: E501
        """lightningapp_v2_service_create_lightningapp_v2  # noqa: E501

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

        :param async_req bool
        :param ProjectIdAppsv2Body body: (required)
        :param str project_id: (required)
        :return: V1LightningappV2
                 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 lightningapp_v2_service_create_lightningapp_v2" % 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 `lightningapp_v2_service_create_lightningapp_v2`")  # 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 `lightningapp_v2_service_create_lightningapp_v2`")  # 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}/appsv2', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1LightningappV2',  # 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 lightningapp_v2_service_delete_lightningapp_release(self, project_id: 'str', app_id: 'str', id: 'str', **kwargs) -> 'V1DeleteLightningappReleaseResponse':  # noqa: E501
        """lightningapp_v2_service_delete_lightningapp_release  # noqa: E501

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

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

    def lightningapp_v2_service_delete_lightningapp_release_with_http_info(self, project_id: 'str', app_id: 'str', id: 'str', **kwargs) -> 'V1DeleteLightningappReleaseResponse':  # noqa: E501
        """lightningapp_v2_service_delete_lightningapp_release  # noqa: E501

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

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

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

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'app_id' in params:
            path_params['appId'] = params['app_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}/appsv2/{appId}/releases/{id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1DeleteLightningappReleaseResponse',  # 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 lightningapp_v2_service_delete_lightningapp_v2(self, project_id: 'str', id: 'str', **kwargs) -> 'V1DeleteLightningappV2Response':  # noqa: E501
        """lightningapp_v2_service_delete_lightningapp_v2  # noqa: E501

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

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

    def lightningapp_v2_service_delete_lightningapp_v2_with_http_info(self, project_id: 'str', id: 'str', **kwargs) -> 'V1DeleteLightningappV2Response':  # noqa: E501
        """lightningapp_v2_service_delete_lightningapp_v2  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.lightningapp_v2_service_delete_lightningapp_v2_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: V1DeleteLightningappV2Response
                 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 lightningapp_v2_service_delete_lightningapp_v2" % 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 `lightningapp_v2_service_delete_lightningapp_v2`")  # 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 `lightningapp_v2_service_delete_lightningapp_v2`")  # 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}/appsv2/{id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1DeleteLightningappV2Response',  # 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 lightningapp_v2_service_get_lightningapp_release(self, project_id: 'str', app_id: 'str', id: 'str', **kwargs) -> 'V1LightningappRelease':  # noqa: E501
        """lightningapp_v2_service_get_lightningapp_release  # noqa: E501

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

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

    def lightningapp_v2_service_get_lightningapp_release_with_http_info(self, project_id: 'str', app_id: 'str', id: 'str', **kwargs) -> 'V1LightningappRelease':  # noqa: E501
        """lightningapp_v2_service_get_lightningapp_release  # noqa: E501

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

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

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

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'app_id' in params:
            path_params['appId'] = params['app_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}/appsv2/{appId}/releases/{id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1LightningappRelease',  # 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 lightningapp_v2_service_get_lightningapp_source_code_download_url(self, project_id: 'str', app_id: 'str', release_id: 'str', **kwargs) -> 'V1GetLightningappSourceCodeDownloadUrlResponse':  # noqa: E501
        """lightningapp_v2_service_get_lightningapp_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.lightningapp_v2_service_get_lightningapp_source_code_download_url(project_id, app_id, release_id, async_req=True)
        >>> result = thread.get()

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

    def lightningapp_v2_service_get_lightningapp_source_code_download_url_with_http_info(self, project_id: 'str', app_id: 'str', release_id: 'str', **kwargs) -> 'V1GetLightningappSourceCodeDownloadUrlResponse':  # noqa: E501
        """lightningapp_v2_service_get_lightningapp_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.lightningapp_v2_service_get_lightningapp_source_code_download_url_with_http_info(project_id, app_id, release_id, async_req=True)
        >>> result = thread.get()

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

        all_params = ['project_id', 'app_id', 'release_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 lightningapp_v2_service_get_lightningapp_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 `lightningapp_v2_service_get_lightningapp_source_code_download_url`")  # noqa: E501
        # verify the required parameter 'app_id' is set
        if ('app_id' not in params or
                params['app_id'] is None):
            raise ValueError("Missing the required parameter `app_id` when calling `lightningapp_v2_service_get_lightningapp_source_code_download_url`")  # noqa: E501
        # verify the required parameter 'release_id' is set
        if ('release_id' not in params or
                params['release_id'] is None):
            raise ValueError("Missing the required parameter `release_id` when calling `lightningapp_v2_service_get_lightningapp_source_code_download_url`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501
        if 'app_id' in params:
            path_params['appId'] = params['app_id']  # noqa: E501
        if 'release_id' in params:
            path_params['releaseId'] = params['release_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}/appsv2/{appId}/releases/{releaseId}/source-code', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1GetLightningappSourceCodeDownloadUrlResponse',  # 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 lightningapp_v2_service_get_lightningapp_v2(self, project_id: 'str', id: 'str', **kwargs) -> 'V1LightningappV2':  # noqa: E501
        """lightningapp_v2_service_get_lightningapp_v2  # noqa: E501

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

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

    def lightningapp_v2_service_get_lightningapp_v2_with_http_info(self, project_id: 'str', id: 'str', **kwargs) -> 'V1LightningappV2':  # noqa: E501
        """lightningapp_v2_service_get_lightningapp_v2  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.lightningapp_v2_service_get_lightningapp_v2_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: V1LightningappV2
                 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 lightningapp_v2_service_get_lightningapp_v2" % 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 `lightningapp_v2_service_get_lightningapp_v2`")  # 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 `lightningapp_v2_service_get_lightningapp_v2`")  # 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}/appsv2/{id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1LightningappV2',  # 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 lightningapp_v2_service_list_gallery_components(self, **kwargs) -> 'V1ListGalleryComponentsResponse':  # noqa: E501
        """lightningapp_v2_service_list_gallery_components  # noqa: E501

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

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

    def lightningapp_v2_service_list_gallery_components_with_http_info(self, **kwargs) -> 'V1ListGalleryComponentsResponse':  # noqa: E501
        """lightningapp_v2_service_list_gallery_components  # noqa: E501

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

        :param async_req bool
        :return: V1ListGalleryComponentsResponse
                 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 lightningapp_v2_service_list_gallery_components" % 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

        # Authentication setting
        auth_settings = []  # noqa: E501

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

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

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

    def lightningapp_v2_service_list_gallery_lightningapps_with_http_info(self, **kwargs) -> 'V1ListGalleryLightningappsResponse':  # noqa: E501
        """lightningapp_v2_service_list_gallery_lightningapps  # noqa: E501

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

        :param async_req bool
        :return: V1ListGalleryLightningappsResponse
                 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 lightningapp_v2_service_list_gallery_lightningapps" % 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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/v1/apps', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1ListGalleryLightningappsResponse',  # 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 lightningapp_v2_service_list_lightningapps_v2(self, project_id: 'str', **kwargs) -> 'V1ListLightningappsV2Response':  # noqa: E501
        """lightningapp_v2_service_list_lightningapps_v2  # noqa: E501

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

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

    def lightningapp_v2_service_list_lightningapps_v2_with_http_info(self, project_id: 'str', **kwargs) -> 'V1ListLightningappsV2Response':  # noqa: E501
        """lightningapp_v2_service_list_lightningapps_v2  # noqa: E501

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

        :param async_req bool
        :param str project_id: (required)
        :param str page_token: Pagination.
        :param str limit:
        :param str name: Filters.
        :return: V1ListLightningappsV2Response
                 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 lightningapp_v2_service_list_lightningapps_v2" % 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 `lightningapp_v2_service_list_lightningapps_v2`")  # 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}/appsv2', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1ListLightningappsV2Response',  # 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 lightningapp_v2_service_update_lightningapp_v2(self, body: 'Appsv2IdBody', project_id: 'str', id: 'str', **kwargs) -> 'V1LightningappV2':  # noqa: E501
        """lightningapp_v2_service_update_lightningapp_v2  # noqa: E501

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

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

    def lightningapp_v2_service_update_lightningapp_v2_with_http_info(self, body: 'Appsv2IdBody', project_id: 'str', id: 'str', **kwargs) -> 'V1LightningappV2':  # noqa: E501
        """lightningapp_v2_service_update_lightningapp_v2  # noqa: E501

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

        :param async_req bool
        :param Appsv2IdBody body: (required)
        :param str project_id: (required)
        :param str id: (required)
        :return: V1LightningappV2
                 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 lightningapp_v2_service_update_lightningapp_v2" % 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 `lightningapp_v2_service_update_lightningapp_v2`")  # 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 `lightningapp_v2_service_update_lightningapp_v2`")  # 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 `lightningapp_v2_service_update_lightningapp_v2`")  # 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}/appsv2/{id}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='V1LightningappV2',  # 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)
