# coding: utf-8

"""
    Prompt.io APIs

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

    OpenAPI spec version: 1.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from swagger_client.api_client import ApiClient


class InstantAppsApi(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 add_audit_message(self, instant_app_id, **kwargs):  # noqa: E501
        """Add a new audit message  # noqa: E501

        _in snippets: platform.api.instantApps.addAuditMessage_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_audit_message(instant_app_id, async_req=True)
        >>> result = thread.get()

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

    def add_audit_message_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Add a new audit message  # noqa: E501

        _in snippets: platform.api.instantApps.addAuditMessage_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_audit_message_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :param AuditMessageModel body:
        :return: AuditMessageModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'instant_app_id' in params:
            path_params['instantAppId'] = params['instant_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 = ['org_token']  # noqa: E501

        return self.api_client.call_api(
            '/instant_apps/{instantAppId}/audit_messages', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AuditMessageModel',  # 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 cancel_timers(self, instant_app_id, **kwargs):  # noqa: E501
        """Cancels any outstanding timers matching the params  # noqa: E501

        _in snippets: platform.api.instantApps.cancelTimers_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cancel_timers(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :param InstantAppTimersModel body:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.cancel_timers_with_http_info(instant_app_id, **kwargs)  # noqa: E501
        else:
            (data) = self.cancel_timers_with_http_info(instant_app_id, **kwargs)  # noqa: E501
            return data

    def cancel_timers_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Cancels any outstanding timers matching the params  # noqa: E501

        _in snippets: platform.api.instantApps.cancelTimers_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cancel_timers_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :param InstantAppTimersModel body:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'instant_app_id' in params:
            path_params['instantAppId'] = params['instant_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 `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

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

        return self.api_client.call_api(
            '/instant_apps/{instantAppId}/timers/cancel', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_audit_messages(self, instant_app_id, **kwargs):  # noqa: E501
        """Gets the audit trail messages of an Instant App  # noqa: E501

        _in snippets: platform.api.instantApps.getAuditMessages_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_audit_messages(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :param int first:
        :param int max:
        :param bool desc:
        :return: AuditMessageModelPage
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_audit_messages_with_http_info(instant_app_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_audit_messages_with_http_info(instant_app_id, **kwargs)  # noqa: E501
            return data

    def get_audit_messages_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Gets the audit trail messages of an Instant App  # noqa: E501

        _in snippets: platform.api.instantApps.getAuditMessages_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_audit_messages_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :param int first:
        :param int max:
        :param bool desc:
        :return: AuditMessageModelPage
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['instant_app_id', 'first', 'max', 'desc']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

        query_params = []
        if 'first' in params:
            query_params.append(('first', params['first']))  # noqa: E501
        if 'max' in params:
            query_params.append(('max', params['max']))  # noqa: E501
        if 'desc' in params:
            query_params.append(('desc', params['desc']))  # 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 = ['org_token']  # noqa: E501

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

    def get_data1(self, instant_app_id, **kwargs):  # noqa: E501
        """Gets the value for every element of the Instant App  # noqa: E501

        _in snippets: platform.api.instantApps.getData_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_data1(instant_app_id, async_req=True)
        >>> result = thread.get()

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

    def get_data1_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Gets the value for every element of the Instant App  # noqa: E501

        _in snippets: platform.api.instantApps.getData_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_data1_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :return: InstantAppDataModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'instant_app_id' in params:
            path_params['instantAppId'] = params['instant_app_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 = ['org_token']  # noqa: E501

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

    def get_instant_app(self, instant_app_id, **kwargs):  # noqa: E501
        """Gets the details of a specific Instant App  # noqa: E501

        _in snippets: platform.api.instantApps.getInstantApp_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_instant_app(instant_app_id, async_req=True)
        >>> result = thread.get()

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

    def get_instant_app_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Gets the details of a specific Instant App  # noqa: E501

        _in snippets: platform.api.instantApps.getInstantApp_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_instant_app_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :return: InstantAppModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'instant_app_id' in params:
            path_params['instantAppId'] = params['instant_app_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 = ['org_token']  # noqa: E501

        return self.api_client.call_api(
            '/instant_apps/{instantAppId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InstantAppModel',  # 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 is_instant_app_locked(self, instant_app_id, **kwargs):  # noqa: E501
        """Gets the lock status of an Instant App  # noqa: E501

        _in snippets: platform.api.instantApps.isInstantAppLocked_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.is_instant_app_locked(instant_app_id, async_req=True)
        >>> result = thread.get()

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

    def is_instant_app_locked_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Gets the lock status of an Instant App  # noqa: E501

        _in snippets: platform.api.instantApps.isInstantAppLocked_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.is_instant_app_locked_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'instant_app_id' in params:
            path_params['instantAppId'] = params['instant_app_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 = ['org_token']  # noqa: E501

        return self.api_client.call_api(
            '/instant_apps/{instantAppId}/locked', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='bool',  # 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 save_data(self, instant_app_id, **kwargs):  # noqa: E501
        """Updates the value for every element of the Instant App given  # noqa: E501

        _in snippets: platform.api.instantApps.saveData_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.save_data(instant_app_id, async_req=True)
        >>> result = thread.get()

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

    def save_data_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Updates the value for every element of the Instant App given  # noqa: E501

        _in snippets: platform.api.instantApps.saveData_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.save_data_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :param InstantAppDataModel body:
        :return: InstantAppDataModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'instant_app_id' in params:
            path_params['instantAppId'] = params['instant_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 = ['org_token']  # noqa: E501

        return self.api_client.call_api(
            '/instant_apps/{instantAppId}/elements', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InstantAppDataModel',  # 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 set_icon(self, instant_app_id, **kwargs):  # noqa: E501
        """Updates the icon and icon label for an instant app  # noqa: E501

        _in snippets: platform.api.instantApps.setIcon_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_icon(instant_app_id, async_req=True)
        >>> result = thread.get()

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

    def set_icon_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Updates the icon and icon label for an instant app  # noqa: E501

        _in snippets: platform.api.instantApps.setIcon_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_icon_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :param InstantAppIconModel body:
        :return: InstantAppIconModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'instant_app_id' in params:
            path_params['instantAppId'] = params['instant_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 = ['org_token']  # noqa: E501

        return self.api_client.call_api(
            '/instant_apps/{instantAppId}/icon', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InstantAppIconModel',  # 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 set_instant_app_locked(self, instant_app_id, **kwargs):  # noqa: E501
        """Set whether an Instant App is locked  # noqa: E501

        _in snippets: platform.api.instantApps.setInstantAppLocked_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_instant_app_locked(instant_app_id, async_req=True)
        >>> result = thread.get()

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

    def set_instant_app_locked_with_http_info(self, instant_app_id, **kwargs):  # noqa: E501
        """Set whether an Instant App is locked  # noqa: E501

        _in snippets: platform.api.instantApps.setInstantAppLocked_  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.set_instant_app_locked_with_http_info(instant_app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int instant_app_id: (required)
        :param bool body:
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'instant_app_id' in params:
            path_params['instantAppId'] = params['instant_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 = ['org_token']  # noqa: E501

        return self.api_client.call_api(
            '/instant_apps/{instantAppId}/locked', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='bool',  # 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)
