# 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 OrgChannelsApi(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_org_channel1(self, **kwargs):  # noqa: E501
        """Creates an org channel  # noqa: E501

        _in snippets: platform.api.orgChannels.addOrgChannel_  # 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_org_channel1(async_req=True)
        >>> result = thread.get()

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

    def add_org_channel1_with_http_info(self, **kwargs):  # noqa: E501
        """Creates an org channel  # noqa: E501

        _in snippets: platform.api.orgChannels.addOrgChannel_  # 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_org_channel1_with_http_info(async_req=True)
        >>> result = thread.get()

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

        all_params = ['body', 'assign_to_everyone']  # 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_org_channel1" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'assign_to_everyone' in params:
            query_params.append(('assignToEveryone', params['assign_to_everyone']))  # noqa: E501

        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(
            '/org_channels', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgChannelModel',  # 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 delete_org_channel1(self, org_channel_id, **kwargs):  # noqa: E501
        """Delete an org channel  # noqa: E501

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

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :return: DeleteResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_org_channel1_with_http_info(org_channel_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_org_channel1_with_http_info(org_channel_id, **kwargs)  # noqa: E501
            return data

    def delete_org_channel1_with_http_info(self, org_channel_id, **kwargs):  # noqa: E501
        """Delete an org channel  # noqa: E501

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

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :return: DeleteResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'org_channel_id' in params:
            path_params['orgChannelId'] = params['org_channel_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(
            '/org_channels/{orgChannelId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeleteResponse',  # 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_org_channel(self, org_channel_id, **kwargs):  # noqa: E501
        """Gets the details for a specific org channel  # noqa: E501

        _in snippets: platform.api.orgChannels.getOrgChannel_  # 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_org_channel(org_channel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :return: OrgChannelModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_org_channel_with_http_info(org_channel_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_org_channel_with_http_info(org_channel_id, **kwargs)  # noqa: E501
            return data

    def get_org_channel_with_http_info(self, org_channel_id, **kwargs):  # noqa: E501
        """Gets the details for a specific org channel  # noqa: E501

        _in snippets: platform.api.orgChannels.getOrgChannel_  # 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_org_channel_with_http_info(org_channel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :return: OrgChannelModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'org_channel_id' in params:
            path_params['orgChannelId'] = params['org_channel_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(
            '/org_channels/{orgChannelId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgChannelModel',  # 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_org_channel_conversations(self, org_channel_id, **kwargs):  # noqa: E501
        """Gets the conversation details for a specific org channel  # noqa: E501

        _in snippets: platform.api.orgChannels.getOrgChannelConversations_  # 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_org_channel_conversations(org_channel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :return: OrgChannelConversationsModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_org_channel_conversations_with_http_info(org_channel_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_org_channel_conversations_with_http_info(org_channel_id, **kwargs)  # noqa: E501
            return data

    def get_org_channel_conversations_with_http_info(self, org_channel_id, **kwargs):  # noqa: E501
        """Gets the conversation details for a specific org channel  # noqa: E501

        _in snippets: platform.api.orgChannels.getOrgChannelConversations_  # 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_org_channel_conversations_with_http_info(org_channel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :return: OrgChannelConversationsModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'org_channel_id' in params:
            path_params['orgChannelId'] = params['org_channel_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(
            '/org_channels/{orgChannelId}/conversations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgChannelConversationsModel',  # 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_org_channels1(self, **kwargs):  # noqa: E501
        """Gets all the org channels for the org  # noqa: E501

        _in snippets: platform.api.orgChannels.getOrgChannels_  # 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_org_channels1(async_req=True)
        >>> result = thread.get()

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

    def get_org_channels1_with_http_info(self, **kwargs):  # noqa: E501
        """Gets all the org channels for the org  # noqa: E501

        _in snippets: platform.api.orgChannels.getOrgChannels_  # 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_org_channels1_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int first:
        :param int max:
        :param str type:
        :return: OrgChannelModelPage
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['first', 'max', 'type']  # 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_org_channels1" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        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 'type' in params:
            query_params.append(('type', params['type']))  # 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(
            '/org_channels', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgChannelModelPage',  # 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_pool_subchannel(self, org_channel_id, subchannel_id, **kwargs):  # noqa: E501
        """For pool channels, gets the details of a specific subchannel in the pool  # noqa: E501

        _in snippets: platform.api.orgChannels.getPoolSubchannel_  # 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_pool_subchannel(org_channel_id, subchannel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :param int subchannel_id: (required)
        :return: PoolSubchannelModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_pool_subchannel_with_http_info(org_channel_id, subchannel_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pool_subchannel_with_http_info(org_channel_id, subchannel_id, **kwargs)  # noqa: E501
            return data

    def get_pool_subchannel_with_http_info(self, org_channel_id, subchannel_id, **kwargs):  # noqa: E501
        """For pool channels, gets the details of a specific subchannel in the pool  # noqa: E501

        _in snippets: platform.api.orgChannels.getPoolSubchannel_  # 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_pool_subchannel_with_http_info(org_channel_id, subchannel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :param int subchannel_id: (required)
        :return: PoolSubchannelModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'org_channel_id' in params:
            path_params['orgChannelId'] = params['org_channel_id']  # noqa: E501
        if 'subchannel_id' in params:
            path_params['subchannelId'] = params['subchannel_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(
            '/org_channels/{orgChannelId}/subchannels/{subchannelId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolSubchannelModel',  # 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_pool_subchannels(self, org_channel_id, **kwargs):  # noqa: E501
        """For pool channels, gets the subchannels in the pool  # noqa: E501

        _in snippets: platform.api.orgChannels.getPoolSubchannels_  # 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_pool_subchannels(org_channel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :param int first:
        :param int max:
        :return: PoolSubchannelModelPage
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_pool_subchannels_with_http_info(org_channel_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pool_subchannels_with_http_info(org_channel_id, **kwargs)  # noqa: E501
            return data

    def get_pool_subchannels_with_http_info(self, org_channel_id, **kwargs):  # noqa: E501
        """For pool channels, gets the subchannels in the pool  # noqa: E501

        _in snippets: platform.api.orgChannels.getPoolSubchannels_  # 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_pool_subchannels_with_http_info(org_channel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :param int first:
        :param int max:
        :return: PoolSubchannelModelPage
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'org_channel_id' in params:
            path_params['orgChannelId'] = params['org_channel_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

        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(
            '/org_channels/{orgChannelId}/subchannels', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PoolSubchannelModelPage',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_org_channel(self, org_channel_id, **kwargs):  # noqa: E501
        """Updates an org channel  # noqa: E501

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

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :param OrgChannelModel body:
        :return: OrgChannelModel
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_org_channel_with_http_info(org_channel_id, **kwargs)  # noqa: E501
        else:
            (data) = self.update_org_channel_with_http_info(org_channel_id, **kwargs)  # noqa: E501
            return data

    def update_org_channel_with_http_info(self, org_channel_id, **kwargs):  # noqa: E501
        """Updates an org channel  # noqa: E501

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

        :param async_req bool
        :param str org_channel_id: The apiId or internal id (required)
        :param OrgChannelModel body:
        :return: OrgChannelModel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'org_channel_id' in params:
            path_params['orgChannelId'] = params['org_channel_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(
            '/org_channels/{orgChannelId}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgChannelModel',  # 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)
