require "uri" module PureCloud class SocialsApi 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 [SocialConversationEntityListing] def get_socials(conversation_id, participant_id, opts = {}) data, status_code, headers = get_socials_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<(SocialConversationEntityListing, Fixnum, Hash)>] SocialConversationEntityListing data, response status code and response headers def get_socials_with_http_info(conversation_id, participant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SocialsApi#get_socials ..." end # verify the required parameter 'conversation_id' is set fail "Missing the required parameter 'conversation_id' when calling get_socials" if conversation_id.nil? # verify the required parameter 'participant_id' is set fail "Missing the required parameter 'participant_id' when calling get_socials" if participant_id.nil? # resource path path = "/api/v2/socials".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 => 'SocialConversationEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: SocialsApi#get_socials\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 [MediaParticipantRequest] :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 [MediaParticipantRequest] :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: SocialsApi#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/socials/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: SocialsApi#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: SocialsApi#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/socials/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: SocialsApi#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: SocialsApi#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/socials/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: SocialsApi#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: SocialsApi#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/socials/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: SocialsApi#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: SocialsApi#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/socials/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: SocialsApi#get_participants_participant_id_wrapupcodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get social conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [SocialConversation] 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 social conversation # # @param conversation_id conversation ID # @param participant_id participant ID # @param [Hash] opts the optional parameters # @return [Array<(SocialConversation, Fixnum, Hash)>] SocialConversation 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: SocialsApi#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/socials/{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 => 'SocialConversation') if @api_client.config.debugging @api_client.config.logger.debug "API called: SocialsApi#get_conversation_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end