require "uri" module PureCloud class CallsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get conversations # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [ConversationEntityListing] def get_calls(conversation_id, participant_id, opts = {}) data, status_code, headers = get_calls_with_http_info(conversation_id, participant_id, opts) return data end # Get conversations # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [Array<(ConversationEntityListing, Fixnum, Hash)>] ConversationEntityListing data, response status code and response headers def get_calls_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#get_calls ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling get_calls" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling get_calls" if participant_id.nil? # resource path path = "/api/v2/calls".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ConversationEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#get_calls\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a call conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [CreateCallRequest] :body # @return [CreateCallResponse] def post_calls(conversation_id, participant_id, opts = {}) data, status_code, headers = post_calls_with_http_info(conversation_id, participant_id, opts) return data end # Create a call conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [CreateCallRequest] :body # @return [Array<(CreateCallResponse, Fixnum, Hash)>] CreateCallResponse data, response status code and response headers def post_calls_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#post_calls ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling post_calls" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling post_calls" if participant_id.nil? # resource path path = "/api/v2/calls".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateCallResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#post_calls\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the maximum number of participants that this user can have on a conference # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [MaxParticipants] def get_maximumconferenceparties(conversation_id, participant_id, opts = {}) data, status_code, headers = get_maximumconferenceparties_with_http_info(conversation_id, participant_id, opts) return data end # Get the maximum number of participants that this user can have on a conference # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [Array<(MaxParticipants, Fixnum, Hash)>] MaxParticipants data, response status code and response headers def get_maximumconferenceparties_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#get_maximumconferenceparties ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling get_maximumconferenceparties" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling get_maximumconferenceparties" if participant_id.nil? # resource path path = "/api/v2/calls/maximumconferenceparties".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'MaxParticipants') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#get_maximumconferenceparties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update conversation participant # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [ParticipantRequest] :body # @return [nil] def patch_participants_participant_id(conversation_id, participant_id, opts = {}) patch_participants_participant_id_with_http_info(conversation_id, participant_id, opts) return nil end # Update conversation participant # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [ParticipantRequest] :body # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def patch_participants_participant_id_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#patch_participants_participant_id ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling patch_participants_participant_id" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling patch_participants_participant_id" if participant_id.nil? # resource path path = "/api/v2/calls/participants/{participantId}".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#patch_participants_participant_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update the attributes on a conversation participant. # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [ParticipantAttributes] :body # @return [nil] def patch_participants_participant_id_attributes(conversation_id, participant_id, opts = {}) patch_participants_participant_id_attributes_with_http_info(conversation_id, participant_id, opts) return nil end # Update the attributes on a conversation participant. # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [ParticipantAttributes] :body # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def patch_participants_participant_id_attributes_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#patch_participants_participant_id_attributes ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling patch_participants_participant_id_attributes" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling patch_participants_participant_id_attributes" if participant_id.nil? # resource path path = "/api/v2/calls/participants/{participantId}/attributes".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#patch_participants_participant_id_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Replace this participant with the specified user and/or address # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [TransferRequest] :body # @return [nil] def post_participants_participant_id_replace(conversation_id, participant_id, opts = {}) post_participants_participant_id_replace_with_http_info(conversation_id, participant_id, opts) return nil end # Replace this participant with the specified user and/or address # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [TransferRequest] :body # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def post_participants_participant_id_replace_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#post_participants_participant_id_replace ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling post_participants_participant_id_replace" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling post_participants_participant_id_replace" if participant_id.nil? # resource path path = "/api/v2/calls/participants/{participantId}/replace".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#post_participants_participant_id_replace\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the wrap-up for this conversation participant. # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :provisional Indicates if the wrap-up code is provisional. # @return [WrapupCode] def get_participants_participant_id_wrapup(conversation_id, participant_id, opts = {}) data, status_code, headers = get_participants_participant_id_wrapup_with_http_info(conversation_id, participant_id, opts) return data end # Get the wrap-up for this conversation participant. # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :provisional Indicates if the wrap-up code is provisional. # @return [Array<(WrapupCode, Fixnum, Hash)>] WrapupCode data, response status code and response headers def get_participants_participant_id_wrapup_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#get_participants_participant_id_wrapup ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling get_participants_participant_id_wrapup" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling get_participants_participant_id_wrapup" if participant_id.nil? # resource path path = "/api/v2/calls/participants/{participantId}/wrapup".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} query_params[:'provisional'] = opts[:'provisional'] if opts[:'provisional'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'WrapupCode') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#get_participants_participant_id_wrapup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get list of wrapup codes for this conversation participant # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [WrapupCode] def get_participants_participant_id_wrapupcodes(conversation_id, participant_id, opts = {}) data, status_code, headers = get_participants_participant_id_wrapupcodes_with_http_info(conversation_id, participant_id, opts) return data end # Get list of wrapup codes for this conversation participant # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [Array<(WrapupCode, Fixnum, Hash)>] WrapupCode data, response status code and response headers def get_participants_participant_id_wrapupcodes_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#get_participants_participant_id_wrapupcodes ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling get_participants_participant_id_wrapupcodes" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling get_participants_participant_id_wrapupcodes" if participant_id.nil? # resource path path = "/api/v2/calls/participants/{participantId}/wrapupcodes".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'WrapupCode') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#get_participants_participant_id_wrapupcodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get call conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [CallConversation] def get_conversation_id(conversation_id, participant_id, opts = {}) data, status_code, headers = get_conversation_id_with_http_info(conversation_id, participant_id, opts) return data end # Get call conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [Array<(CallConversation, Fixnum, Hash)>] CallConversation data, response status code and response headers def get_conversation_id_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#get_conversation_id ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling get_conversation_id" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling get_conversation_id" if participant_id.nil? # resource path path = "/api/v2/calls/{conversationId}".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CallConversation') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#get_conversation_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a new call to a conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [CallCommand] :body Conversation # @return [Conversation] def post_conversation_id(conversation_id, participant_id, opts = {}) data, status_code, headers = post_conversation_id_with_http_info(conversation_id, participant_id, opts) return data end # Add a new call to a conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [CallCommand] :body Conversation # @return [Array<(Conversation, Fixnum, Hash)>] Conversation data, response status code and response headers def post_conversation_id_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#post_conversation_id ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling post_conversation_id" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling post_conversation_id" if participant_id.nil? # resource path path = "/api/v2/calls/{conversationId}".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Conversation') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#post_conversation_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [Conversation] :body Conversation # @return [Conversation] def patch_conversation_id(conversation_id, participant_id, opts = {}) data, status_code, headers = patch_conversation_id_with_http_info(conversation_id, participant_id, opts) return data end # Update conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [Conversation] :body Conversation # @return [Array<(Conversation, Fixnum, Hash)>] Conversation data, response status code and response headers def patch_conversation_id_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#patch_conversation_id ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling patch_conversation_id" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling patch_conversation_id" if participant_id.nil? # resource path path = "/api/v2/calls/{conversationId}".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Conversation') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#patch_conversation_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add participants to a conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [Conversation] :body Conversation # @return [Conversation] def post_conversation_id_participants(conversation_id, participant_id, opts = {}) data, status_code, headers = post_conversation_id_participants_with_http_info(conversation_id, participant_id, opts) return data end # Add participants to a conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [Conversation] :body Conversation # @return [Array<(Conversation, Fixnum, Hash)>] Conversation data, response status code and response headers def post_conversation_id_participants_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#post_conversation_id_participants ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling post_conversation_id_participants" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling post_conversation_id_participants" if participant_id.nil? # resource path path = "/api/v2/calls/{conversationId}/participants".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Conversation') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#post_conversation_id_participants\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Initiate and update consult transfer # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [ConsultTransfer] :body Destination address & initial speak to # @return [ConsultTransferResponse] def post_conversation_id_participants_participant_id_consult(conversation_id, participant_id, opts = {}) data, status_code, headers = post_conversation_id_participants_participant_id_consult_with_http_info(conversation_id, participant_id, opts) return data end # Initiate and update consult transfer # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [ConsultTransfer] :body Destination address & initial speak to # @return [Array<(ConsultTransferResponse, Fixnum, Hash)>] ConsultTransferResponse data, response status code and response headers def post_conversation_id_participants_participant_id_consult_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#post_conversation_id_participants_participant_id_consult ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling post_conversation_id_participants_participant_id_consult" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling post_conversation_id_participants_participant_id_consult" if participant_id.nil? # resource path path = "/api/v2/calls/{conversationId}/participants/{participantId}/consult".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ConsultTransferResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#post_conversation_id_participants_participant_id_consult\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Cancel the transfer # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [String] def delete_conversation_id_participants_participant_id_consult(conversation_id, participant_id, opts = {}) data, status_code, headers = delete_conversation_id_participants_participant_id_consult_with_http_info(conversation_id, participant_id, opts) return data end # Cancel the transfer # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers def delete_conversation_id_participants_participant_id_consult_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#delete_conversation_id_participants_participant_id_consult ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling delete_conversation_id_participants_participant_id_consult" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling delete_conversation_id_participants_participant_id_consult" if participant_id.nil? # resource path path = "/api/v2/calls/{conversationId}/participants/{participantId}/consult".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#delete_conversation_id_participants_participant_id_consult\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Change who can speak # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [ConsultTransferUpdate] :body new speak to # @return [ConsultTransferResponse] def patch_conversation_id_participants_participant_id_consult(conversation_id, participant_id, opts = {}) data, status_code, headers = patch_conversation_id_participants_participant_id_consult_with_http_info(conversation_id, participant_id, opts) return data end # Change who can speak # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @option opts [ConsultTransferUpdate] :body new speak to # @return [Array<(ConsultTransferResponse, Fixnum, Hash)>] ConsultTransferResponse data, response status code and response headers def patch_conversation_id_participants_participant_id_consult_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#patch_conversation_id_participants_participant_id_consult ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling patch_conversation_id_participants_participant_id_consult" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling patch_conversation_id_participants_participant_id_consult" if participant_id.nil? # resource path path = "/api/v2/calls/{conversationId}/participants/{participantId}/consult".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ConsultTransferResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#patch_conversation_id_participants_participant_id_consult\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Listen in on the conversation from the point of view of a given participant. # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [nil] def post_conversation_id_participants_participant_id_monitor(conversation_id, participant_id, opts = {}) post_conversation_id_participants_participant_id_monitor_with_http_info(conversation_id, participant_id, opts) return nil end # Listen in on the conversation from the point of view of a given participant. # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def post_conversation_id_participants_participant_id_monitor_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CallsApi#post_conversation_id_participants_participant_id_monitor ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling post_conversation_id_participants_participant_id_monitor" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling post_conversation_id_participants_participant_id_monitor" if participant_id.nil? # resource path path = "/api/v2/calls/{conversationId}/participants/{participantId}/monitor".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: CallsApi#post_conversation_id_participants_participant_id_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end