def accept_control_with_http_info(self, app_id, conversation_id, accept_control_body, **kwargs): # noqa: E501 """Accept Control # noqa: E501 The acceptControl action transfers the control of the conversation to the pending switchboard integration. When using integration auth scope, a 403 is returned if the pending switchboard integration is not the authenticated integration. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.accept_control_with_http_info(app_id, conversation_id, accept_control_body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str app_id: Identifies the app. (required) :param str conversation_id: Identifies the conversation. (required) :param AcceptControlBody accept_control_body: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(object, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['app_id', 'conversation_id', 'accept_control_body'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method accept_control" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'app_id' is set if self.api_client.client_side_validation and ( 'app_id' not in local_var_params or # noqa: E501 local_var_params['app_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `app_id` when calling `accept_control`" ) # noqa: E501 # verify the required parameter 'conversation_id' is set if self.api_client.client_side_validation and ( 'conversation_id' not in local_var_params or # noqa: E501 local_var_params['conversation_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `conversation_id` when calling `accept_control`" ) # noqa: E501 # verify the required parameter 'accept_control_body' is set if self.api_client.client_side_validation and ( 'accept_control_body' not in local_var_params or # noqa: E501 local_var_params['accept_control_body'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `accept_control_body` when calling `accept_control`" ) # noqa: E501 collection_formats = {} path_params = {} if 'app_id' in local_var_params: path_params['appId'] = local_var_params['app_id'] # noqa: E501 if 'conversation_id' in local_var_params: path_params['conversationId'] = local_var_params[ 'conversation_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'accept_control_body' in local_var_params: body_params = local_var_params['accept_control_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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps/{appId}/conversations/{conversationId}/acceptControl', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def create_app_with_http_info(self, app_create_body, **kwargs): # noqa: E501 """Create App # noqa: E501 Creates a new app. When using [service account](#service-accounts) credentials, the service account is automatically granted access to the app. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_app_with_http_info(app_create_body, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param AppCreateBody app_create_body: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(AppResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'app_create_body' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_app" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'app_create_body' is set if self.api_client.client_side_validation and ('app_create_body' not in local_var_params or # noqa: E501 local_var_params['app_create_body'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `app_create_body` when calling `create_app`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'app_create_body' in local_var_params: body_params = local_var_params['app_create_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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='AppResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def list_participants_with_http_info(self, app_id, conversation_id, **kwargs): # noqa: E501 """List Participants # noqa: E501 Lists all the participants of a particular conversation. This API is paginated through [cursor pagination](#section/Introduction/API-pagination-and-records-limits). ```shell /v2/apps/:appId/conversations/:conversationId/participants?page[before]=26508c10541a4b0ff472e5e2 ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_participants_with_http_info(app_id, conversation_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str app_id: Identifies the app. (required) :param str conversation_id: Identifies the conversation. (required) :param Page page: Contains parameters for applying cursor pagination. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(ParticipantListResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'app_id', 'conversation_id', 'page' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_participants" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'app_id' is set if self.api_client.client_side_validation and ('app_id' not in local_var_params or # noqa: E501 local_var_params['app_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `app_id` when calling `list_participants`") # noqa: E501 # verify the required parameter 'conversation_id' is set if self.api_client.client_side_validation and ('conversation_id' not in local_var_params or # noqa: E501 local_var_params['conversation_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `conversation_id` when calling `list_participants`") # noqa: E501 collection_formats = {} path_params = {} if 'app_id' in local_var_params: path_params['appId'] = local_var_params['app_id'] # noqa: E501 if 'conversation_id' in local_var_params: path_params['conversationId'] = local_var_params['conversation_id'] # noqa: E501 query_params = [] if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # 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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps/{appId}/conversations/{conversationId}/participants', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ParticipantListResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def delete_conversation_with_http_info(self, app_id, conversation_id, **kwargs): # noqa: E501 """Delete Conversation # noqa: E501 Delete an entire conversation record, along with its messages and attachments. Note that the default conversation cannot be deleted, but the messages contained [can be](#deleteAllMessages). # 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_conversation_with_http_info(app_id, conversation_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str app_id: Identifies the app. (required) :param str conversation_id: Identifies the conversation. (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(object, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'app_id', 'conversation_id' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_conversation" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'app_id' is set if self.api_client.client_side_validation and ('app_id' not in local_var_params or # noqa: E501 local_var_params['app_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `app_id` when calling `delete_conversation`") # noqa: E501 # verify the required parameter 'conversation_id' is set if self.api_client.client_side_validation and ('conversation_id' not in local_var_params or # noqa: E501 local_var_params['conversation_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `conversation_id` when calling `delete_conversation`") # noqa: E501 collection_formats = {} path_params = {} if 'app_id' in local_var_params: path_params['appId'] = local_var_params['app_id'] # noqa: E501 if 'conversation_id' in local_var_params: path_params['conversationId'] = local_var_params['conversation_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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps/{appId}/conversations/{conversationId}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def list_apps_with_http_info(self, **kwargs): # noqa: E501 """List Apps # noqa: E501 Lists all apps that a user is part of. This API is paginated through [cursor pagination](#section/Introduction/API-pagination-and-records-limits). ```shell /v2/apps?page[after]=5e1606762556d93e9c176f69&page[size]=10 ``` # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_apps_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param Page page: Contains parameters for applying cursor pagination. :param AppListFilter filter: Contains parameters for filtering the results. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(AppListResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'page', 'filter' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method list_apps" % key ) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 query_params.append(('page', local_var_params['page'])) # noqa: E501 if 'filter' in local_var_params and local_var_params['filter'] is not None: # noqa: E501 query_params.append(('filter', local_var_params['filter'])) # 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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='AppListResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def create_client_with_http_info(self, app_id, user_id_or_external_id, client_create, **kwargs): # noqa: E501 """Create Client # noqa: E501 Create a client and link it to a channel specified by the `matchCriteria.type`. Note that the client is initially created with a `pending` status. The status of the linking request can be tracked by listening to the `link:match`, `link:success` and `link:failure` webhooks (only available in v1). For more information, see [link-events](https://docs.smooch.io/rest/v1/#link-events). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_client_with_http_info(app_id, user_id_or_external_id, client_create, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str app_id: Identifies the app. (required) :param str user_id_or_external_id: The user's id or externalId. (required) :param ClientCreate client_create: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(ClientResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['app_id', 'user_id_or_external_id', 'client_create'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create_client" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'app_id' is set if self.api_client.client_side_validation and ( 'app_id' not in local_var_params or # noqa: E501 local_var_params['app_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `app_id` when calling `create_client`" ) # noqa: E501 # verify the required parameter 'user_id_or_external_id' is set if self.api_client.client_side_validation and ( 'user_id_or_external_id' not in local_var_params or # noqa: E501 local_var_params['user_id_or_external_id'] is None ): # noqa: E501 raise ApiValueError( "Missing the required parameter `user_id_or_external_id` when calling `create_client`" ) # noqa: E501 # verify the required parameter 'client_create' is set if self.api_client.client_side_validation and ( 'client_create' not in local_var_params or # noqa: E501 local_var_params['client_create'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `client_create` when calling `create_client`" ) # noqa: E501 collection_formats = {} path_params = {} if 'app_id' in local_var_params: path_params['appId'] = local_var_params['app_id'] # noqa: E501 if 'user_id_or_external_id' in local_var_params: path_params['userIdOrExternalId'] = local_var_params[ 'user_id_or_external_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'client_create' in local_var_params: body_params = local_var_params['client_create'] # 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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps/{appId}/users/{userIdOrExternalId}/clients', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='ClientResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def list_switchboard_integrations_with_http_info(self, app_id, switchboard_id, **kwargs): # noqa: E501 """List Switchboard Integrations # noqa: E501 Lists all switchboard integrations linked to the switchboard. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_switchboard_integrations_with_http_info(app_id, switchboard_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str app_id: Identifies the app. (required) :param str switchboard_id: Identifies the switchboard. (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(SwitchboardIntegrationListResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['app_id', 'switchboard_id'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_switchboard_integrations" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'app_id' is set if self.api_client.client_side_validation and ( 'app_id' not in local_var_params or # noqa: E501 local_var_params['app_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `app_id` when calling `list_switchboard_integrations`" ) # noqa: E501 # verify the required parameter 'switchboard_id' is set if self.api_client.client_side_validation and ( 'switchboard_id' not in local_var_params or # noqa: E501 local_var_params['switchboard_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `switchboard_id` when calling `list_switchboard_integrations`" ) # noqa: E501 collection_formats = {} path_params = {} if 'app_id' in local_var_params: path_params['appId'] = local_var_params['app_id'] # noqa: E501 if 'switchboard_id' in local_var_params: path_params['switchboardId'] = local_var_params[ 'switchboard_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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps/{appId}/switchboards/{switchboardId}/switchboardIntegrations', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='SwitchboardIntegrationListResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def delete_user_personal_information_with_http_info( self, app_id, user_id_or_external_id, **kwargs): # noqa: E501 """Delete User Personal Information # noqa: E501 Delete a user’s personal information. Calling this API will clear `givenName`, `surname`, `email` and `avatarUrl` and every custom property for the specified user. For every client owned by the user, it will also clear `displayName`, `avatarUrl` and any channel specific information stored in the info and raw fields. Calling this API doesn’t delete the user’s conversation history. To fully delete the user, see [Delete User](#operation/deleteUser). # 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_user_personal_information_with_http_info(app_id, user_id_or_external_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str app_id: Identifies the app. (required) :param str user_id_or_external_id: The user's id or externalId. (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(UserResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['app_id', 'user_id_or_external_id'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method delete_user_personal_information" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'app_id' is set if self.api_client.client_side_validation and ( 'app_id' not in local_var_params or # noqa: E501 local_var_params['app_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `app_id` when calling `delete_user_personal_information`" ) # noqa: E501 # verify the required parameter 'user_id_or_external_id' is set if self.api_client.client_side_validation and ( 'user_id_or_external_id' not in local_var_params or # noqa: E501 local_var_params['user_id_or_external_id'] is None ): # noqa: E501 raise ApiValueError( "Missing the required parameter `user_id_or_external_id` when calling `delete_user_personal_information`" ) # noqa: E501 collection_formats = {} path_params = {} if 'app_id' in local_var_params: path_params['appId'] = local_var_params['app_id'] # noqa: E501 if 'user_id_or_external_id' in local_var_params: path_params['userIdOrExternalId'] = local_var_params[ 'user_id_or_external_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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps/{appId}/users/{userIdOrExternalId}/personalinformation', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='UserResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def create_integration_with_http_info(self, app_id, integration, **kwargs): # noqa: E501 """Create Integration # noqa: E501 The Create Integration endpoint allows you to provision apps with front-end messaging channels. Selecting a `custom` integration allows the creation of webhooks. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_integration_with_http_info(app_id, integration, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str app_id: Identifies the app. (required) :param Integration integration: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(IntegrationResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'app_id', 'integration' ] all_params.extend( [ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ] ) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method create_integration" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'app_id' is set if self.api_client.client_side_validation and ('app_id' not in local_var_params or # noqa: E501 local_var_params['app_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `app_id` when calling `create_integration`") # noqa: E501 # verify the required parameter 'integration' is set if self.api_client.client_side_validation and ('integration' not in local_var_params or # noqa: E501 local_var_params['integration'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `integration` when calling `create_integration`") # noqa: E501 collection_formats = {} path_params = {} if 'app_id' in local_var_params: path_params['appId'] = local_var_params['app_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'integration' in local_var_params: body_params = local_var_params['integration'] # 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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/v2/apps/{appId}/integrations', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='IntegrationResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def authorize_with_http_info(self, client_id, response_type, **kwargs): # noqa: E501 """Authorize # noqa: E501 This endpoint begins the OAuth flow. It relies on a browser session for authentication. If the user is not logged in to Sunshine Conversations they will be redirected to the login page. If the user has many apps, they will first be prompted to select the one they wish to integrate with. They will then be presented with an Allow/Deny dialog, describing details of the access your integration is requesting. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.authorize_with_http_info(client_id, response_type, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str client_id: Your integration’s unique identifier (required) :param str response_type: For now the only acceptable value is code. (required) :param str state: You may pass in any arbitrary string value here which will be returned to you along with the code via browser redirect. :param str redirect_uri: You may pass in a redirect_uri to determine which URI the response is redirected to. This URI must be contained in the list configured by your integration. If this option is not passed, the first URI present in the list will be used. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: None If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['client_id', 'response_type', 'state', 'redirect_uri'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method authorize" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'client_id' is set if self.api_client.client_side_validation and ( 'client_id' not in local_var_params or # noqa: E501 local_var_params['client_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `client_id` when calling `authorize`" ) # noqa: E501 # verify the required parameter 'response_type' is set if self.api_client.client_side_validation and ( 'response_type' not in local_var_params or # noqa: E501 local_var_params['response_type'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `response_type` when calling `authorize`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'client_id' in local_var_params and local_var_params[ 'client_id'] is not None: # noqa: E501 query_params.append( ('client_id', local_var_params['client_id'])) # noqa: E501 if 'response_type' in local_var_params and local_var_params[ 'response_type'] is not None: # noqa: E501 query_params.append( ('response_type', local_var_params['response_type'])) # noqa: E501 if 'state' in local_var_params and local_var_params[ 'state'] is not None: # noqa: E501 query_params.append( ('state', local_var_params['state'])) # noqa: E501 if 'redirect_uri' in local_var_params and local_var_params[ 'redirect_uri'] is not None: # noqa: E501 query_params.append( ('redirect_uri', local_var_params['redirect_uri'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/oauth/authorize', 'GET', 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=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def revoke_access_with_http_info(self, **kwargs): # noqa: E501 """Revoke Access # noqa: E501 This endpoint is used to revoke your integration’s access to the user’s Sunshine Conversations app. Revoking access means your integration will no longer be able to interact with the app, and any webhooks the integration had previously configured will be removed. Calling this endpoint is equivalent to the user removing your integration manually in the Sunshine Conversations web app. Your integration’s `removeUrl` (if configured) will also be called when an integration is removed in this way. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.revoke_access_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(object, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method revoke_access" % key) local_var_params[key] = val del local_var_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 = ['basicAuth', 'bearerAuth'] # noqa: E501 return self.api_client.call_api( '/oauth/authorization', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def get_token_with_http_info(self, inline_object, **kwargs): # noqa: E501 """Get Token # noqa: E501 This endpoint is used to exchange an authorization code for an access token. It should only be used in server-to-server calls. # 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_token_with_http_info(inline_object, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param InlineObject inline_object: (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(object, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['inline_object'] all_params.extend([ 'async_req', '_return_http_data_only', '_preload_content', '_request_timeout' ]) for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_token" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'inline_object' is set if self.api_client.client_side_validation and ( 'inline_object' not in local_var_params or # noqa: E501 local_var_params['inline_object'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `inline_object` when calling `get_token`" ) # noqa: E501 collection_formats = {} path_params = {} query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'inline_object' in local_var_params: body_params = local_var_params['inline_object'] # 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( '/oauth/token', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)