=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-api/swagger-codegen.git License: ININ http://www.inin.com Terms of Service: https://developer.mypurecloud.com/tos =end require "uri" module PureCloud class ExternalContactsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Delete an external contact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @return [nil] def delete_externalcontacts_contact(contact_id, opts = {}) delete_externalcontacts_contact_with_http_info(contact_id, opts) return nil end # Delete an external contact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_externalcontacts_contact_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.delete_externalcontacts_contact ..." end # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling ExternalContactsApi.delete_externalcontacts_contact" if contact_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/contacts/{contactId}".sub('{format}','json').sub('{' + 'contactId' + '}', contact_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_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: ExternalContactsApi#delete_externalcontacts_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a note for an external contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [nil] def delete_externalcontacts_contact_note(contact_id, note_id, opts = {}) delete_externalcontacts_contact_note_with_http_info(contact_id, note_id, opts) return nil end # Delete a note for an external contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_externalcontacts_contact_note_with_http_info(contact_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.delete_externalcontacts_contact_note ..." end # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling ExternalContactsApi.delete_externalcontacts_contact_note" if contact_id.nil? # verify the required parameter 'note_id' is set fail ArgumentError, "Missing the required parameter 'note_id' when calling ExternalContactsApi.delete_externalcontacts_contact_note" if note_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/contacts/{contactId}/notes/{noteId}".sub('{format}','json').sub('{' + 'contactId' + '}', contact_id.to_s).sub('{' + 'noteId' + '}', note_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_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: ExternalContactsApi#delete_externalcontacts_contact_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @return [nil] def delete_externalcontacts_organization(external_organization_id, opts = {}) delete_externalcontacts_organization_with_http_info(external_organization_id, opts) return nil end # Delete an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_externalcontacts_organization_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.delete_externalcontacts_organization ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.delete_externalcontacts_organization" if external_organization_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_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: ExternalContactsApi#delete_externalcontacts_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a note for an external organization # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [nil] def delete_externalcontacts_organization_note(external_organization_id, note_id, opts = {}) delete_externalcontacts_organization_note_with_http_info(external_organization_id, note_id, opts) return nil end # Delete a note for an external organization # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_externalcontacts_organization_note_with_http_info(external_organization_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.delete_externalcontacts_organization_note ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.delete_externalcontacts_organization_note" if external_organization_id.nil? # verify the required parameter 'note_id' is set fail ArgumentError, "Missing the required parameter 'note_id' when calling ExternalContactsApi.delete_externalcontacts_organization_note" if note_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/notes/{noteId}".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s).sub('{' + 'noteId' + '}', note_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_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: ExternalContactsApi#delete_externalcontacts_organization_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Unlink the Trustor for this External Organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @return [nil] def delete_externalcontacts_organization_trustor(external_organization_id, opts = {}) delete_externalcontacts_organization_trustor_with_http_info(external_organization_id, opts) return nil end # Unlink the Trustor for this External Organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_externalcontacts_organization_trustor_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.delete_externalcontacts_organization_trustor ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.delete_externalcontacts_organization_trustor" if external_organization_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/trustor".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_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: ExternalContactsApi#delete_externalcontacts_organization_trustor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a relationship # # @param relationship_id Relationship Id # @param [Hash] opts the optional parameters # @return [nil] def delete_externalcontacts_relationship(relationship_id, opts = {}) delete_externalcontacts_relationship_with_http_info(relationship_id, opts) return nil end # Delete a relationship # # @param relationship_id Relationship Id # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_externalcontacts_relationship_with_http_info(relationship_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.delete_externalcontacts_relationship ..." end # verify the required parameter 'relationship_id' is set fail ArgumentError, "Missing the required parameter 'relationship_id' when calling ExternalContactsApi.delete_externalcontacts_relationship" if relationship_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/relationships/{relationshipId}".sub('{format}','json').sub('{' + 'relationshipId' + '}', relationship_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_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: ExternalContactsApi#delete_externalcontacts_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch an external contact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand which fields, if any, to expand (externalOrganization,externalDataSources) # @return [ExternalContact] def get_externalcontacts_contact(contact_id, opts = {}) data, _status_code, _headers = get_externalcontacts_contact_with_http_info(contact_id, opts) return data end # Fetch an external contact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand which fields, if any, to expand (externalOrganization,externalDataSources) # @return [Array<(ExternalContact, Fixnum, Hash)>] ExternalContact data, response status code and response headers def get_externalcontacts_contact_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_contact ..." end # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling ExternalContactsApi.get_externalcontacts_contact" if contact_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/contacts/{contactId}".sub('{format}','json').sub('{' + 'contactId' + '}', contact_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalContact') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch a note for an external contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @option opts [Array] :expand which fields, if any, to expand # @return [Note] def get_externalcontacts_contact_note(contact_id, note_id, opts = {}) data, _status_code, _headers = get_externalcontacts_contact_note_with_http_info(contact_id, note_id, opts) return data end # Fetch a note for an external contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @option opts [Array] :expand which fields, if any, to expand # @return [Array<(Note, Fixnum, Hash)>] Note data, response status code and response headers def get_externalcontacts_contact_note_with_http_info(contact_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_contact_note ..." end # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling ExternalContactsApi.get_externalcontacts_contact_note" if contact_id.nil? # verify the required parameter 'note_id' is set fail ArgumentError, "Missing the required parameter 'note_id' when calling ExternalContactsApi.get_externalcontacts_contact_note" if note_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/contacts/{contactId}/notes/{noteId}".sub('{format}','json').sub('{' + 'contactId' + '}', contact_id.to_s).sub('{' + 'noteId' + '}', note_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_contact_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List notes for an external contact # # @param contact_id ExternalContact Id # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 20) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @return [NoteListing] def get_externalcontacts_contact_notes(contact_id, opts = {}) data, _status_code, _headers = get_externalcontacts_contact_notes_with_http_info(contact_id, opts) return data end # List notes for an external contact # # @param contact_id ExternalContact Id # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @return [Array<(NoteListing, Fixnum, Hash)>] NoteListing data, response status code and response headers def get_externalcontacts_contact_notes_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_contact_notes ..." end # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling ExternalContactsApi.get_externalcontacts_contact_notes" if contact_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/contacts/{contactId}/notes".sub('{format}','json').sub('{' + 'contactId' + '}', contact_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NoteListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_contact_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search for external contacts # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 20) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :q User supplied search keywords (no special syntax is currently supported) # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @return [ContactListing] def get_externalcontacts_contacts(opts = {}) data, _status_code, _headers = get_externalcontacts_contacts_with_http_info(opts) return data end # Search for external contacts # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :q User supplied search keywords (no special syntax is currently supported) # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @return [Array<(ContactListing, Fixnum, Hash)>] ContactListing data, response status code and response headers def get_externalcontacts_contacts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_contacts ..." end # resource path local_var_path = "/api/v2/externalcontacts/contacts".sub('{format}','json') # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'q'] = opts[:'q'] if opts[:'q'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ContactListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @option opts [String] :expand which fields, if any, to expand (externalDataSources) # @option opts [BOOLEAN] :include_trustors (true or false) whether or not to include trustor information embedded in the externalOrganization # @return [ExternalOrganization] def get_externalcontacts_organization(external_organization_id, opts = {}) data, _status_code, _headers = get_externalcontacts_organization_with_http_info(external_organization_id, opts) return data end # Fetch an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @option opts [String] :expand which fields, if any, to expand (externalDataSources) # @option opts [BOOLEAN] :include_trustors (true or false) whether or not to include trustor information embedded in the externalOrganization # @return [Array<(ExternalOrganization, Fixnum, Hash)>] ExternalOrganization data, response status code and response headers def get_externalcontacts_organization_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_organization ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.get_externalcontacts_organization" if external_organization_id.nil? if opts[:'expand'] && !['externalDataSources'].include?(opts[:'expand']) fail ArgumentError, 'invalid value for "expand", must be one of externalDataSources' end # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] query_params[:'includeTrustors'] = opts[:'include_trustors'] if opts[:'include_trustors'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalOrganization') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search for external contacts in an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 20) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :q User supplied search keywords (no special syntax is currently supported) # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @return [ContactListing] def get_externalcontacts_organization_contacts(external_organization_id, opts = {}) data, _status_code, _headers = get_externalcontacts_organization_contacts_with_http_info(external_organization_id, opts) return data end # Search for external contacts in an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :q User supplied search keywords (no special syntax is currently supported) # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @return [Array<(ContactListing, Fixnum, Hash)>] ContactListing data, response status code and response headers def get_externalcontacts_organization_contacts_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_organization_contacts ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.get_externalcontacts_organization_contacts" if external_organization_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/contacts".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'q'] = opts[:'q'] if opts[:'q'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ContactListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_organization_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch a note for an external organization # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @option opts [Array] :expand which fields, if any, to expand # @return [Note] def get_externalcontacts_organization_note(external_organization_id, note_id, opts = {}) data, _status_code, _headers = get_externalcontacts_organization_note_with_http_info(external_organization_id, note_id, opts) return data end # Fetch a note for an external organization # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @option opts [Array] :expand which fields, if any, to expand # @return [Array<(Note, Fixnum, Hash)>] Note data, response status code and response headers def get_externalcontacts_organization_note_with_http_info(external_organization_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_organization_note ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.get_externalcontacts_organization_note" if external_organization_id.nil? # verify the required parameter 'note_id' is set fail ArgumentError, "Missing the required parameter 'note_id' when calling ExternalContactsApi.get_externalcontacts_organization_note" if note_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/notes/{noteId}".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s).sub('{' + 'noteId' + '}', note_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_organization_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List notes for an external organization # # @param external_organization_id External Organization Id # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 20) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @return [NoteListing] def get_externalcontacts_organization_notes(external_organization_id, opts = {}) data, _status_code, _headers = get_externalcontacts_organization_notes_with_http_info(external_organization_id, opts) return data end # List notes for an external organization # # @param external_organization_id External Organization Id # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @return [Array<(NoteListing, Fixnum, Hash)>] NoteListing data, response status code and response headers def get_externalcontacts_organization_notes_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_organization_notes ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.get_externalcontacts_organization_notes" if external_organization_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/notes".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'NoteListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_organization_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch a relationship for an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 20) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :expand which fields, if any, to expand # @option opts [String] :sort_order Sort order # @return [RelationshipListing] def get_externalcontacts_organization_relationships(external_organization_id, opts = {}) data, _status_code, _headers = get_externalcontacts_organization_relationships_with_http_info(external_organization_id, opts) return data end # Fetch a relationship for an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :expand which fields, if any, to expand # @option opts [String] :sort_order Sort order # @return [Array<(RelationshipListing, Fixnum, Hash)>] RelationshipListing data, response status code and response headers def get_externalcontacts_organization_relationships_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_organization_relationships ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.get_externalcontacts_organization_relationships" if external_organization_id.nil? if opts[:'expand'] && !['externalDataSources'].include?(opts[:'expand']) fail ArgumentError, 'invalid value for "expand", must be one of externalDataSources' end # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/relationships".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'RelationshipListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_organization_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search for external organizations # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 20) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :q Search query # @option opts [Array] :trustor_id Search for external organizations by trustorIds (limit 25). If supplied, the 'q' parameters is ignored. Items are returned in the order requested # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @option opts [BOOLEAN] :include_trustors (true or false) whether or not to include trustor information embedded in the externalOrganization # @return [ExternalOrganizationListing] def get_externalcontacts_organizations(opts = {}) data, _status_code, _headers = get_externalcontacts_organizations_with_http_info(opts) return data end # Search for external organizations # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :q Search query # @option opts [Array] :trustor_id Search for external organizations by trustorIds (limit 25). If supplied, the 'q' parameters is ignored. Items are returned in the order requested # @option opts [String] :sort_order Sort order # @option opts [Array] :expand which fields, if any, to expand # @option opts [BOOLEAN] :include_trustors (true or false) whether or not to include trustor information embedded in the externalOrganization # @return [Array<(ExternalOrganizationListing, Fixnum, Hash)>] ExternalOrganizationListing data, response status code and response headers def get_externalcontacts_organizations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_organizations ..." end # resource path local_var_path = "/api/v2/externalcontacts/organizations".sub('{format}','json') # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'q'] = opts[:'q'] if opts[:'q'] query_params[:'trustorId'] = @api_client.build_collection_param(opts[:'trustor_id'], :multi) if opts[:'trustor_id'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] query_params[:'includeTrustors'] = opts[:'include_trustors'] if opts[:'include_trustors'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalOrganizationListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch a relationship # # @param relationship_id Relationship Id # @param [Hash] opts the optional parameters # @option opts [String] :expand which fields, if any, to expand # @return [Relationship] def get_externalcontacts_relationship(relationship_id, opts = {}) data, _status_code, _headers = get_externalcontacts_relationship_with_http_info(relationship_id, opts) return data end # Fetch a relationship # # @param relationship_id Relationship Id # @param [Hash] opts the optional parameters # @option opts [String] :expand which fields, if any, to expand # @return [Array<(Relationship, Fixnum, Hash)>] Relationship data, response status code and response headers def get_externalcontacts_relationship_with_http_info(relationship_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_relationship ..." end # verify the required parameter 'relationship_id' is set fail ArgumentError, "Missing the required parameter 'relationship_id' when calling ExternalContactsApi.get_externalcontacts_relationship" if relationship_id.nil? if opts[:'expand'] && !['externalDataSources'].include?(opts[:'expand']) fail ArgumentError, 'invalid value for "expand", must be one of externalDataSources' end # resource path local_var_path = "/api/v2/externalcontacts/relationships/{relationshipId}".sub('{format}','json').sub('{' + 'relationshipId' + '}', relationship_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Relationship') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lookup contacts and externalOrganizations based on an attribute # # @param lookup_val User supplied value to lookup contacts/externalOrganizations (supports email addresses, e164 phone numbers, Twitter screen names) # @param [Hash] opts the optional parameters # @option opts [Array] :expand which field, if any, to expand # @return [ReverseWhitepagesLookupResult] def get_externalcontacts_reversewhitepageslookup(lookup_val, opts = {}) data, _status_code, _headers = get_externalcontacts_reversewhitepageslookup_with_http_info(lookup_val, opts) return data end # Lookup contacts and externalOrganizations based on an attribute # # @param lookup_val User supplied value to lookup contacts/externalOrganizations (supports email addresses, e164 phone numbers, Twitter screen names) # @param [Hash] opts the optional parameters # @option opts [Array] :expand which field, if any, to expand # @return [Array<(ReverseWhitepagesLookupResult, Fixnum, Hash)>] ReverseWhitepagesLookupResult data, response status code and response headers def get_externalcontacts_reversewhitepageslookup_with_http_info(lookup_val, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.get_externalcontacts_reversewhitepageslookup ..." end # verify the required parameter 'lookup_val' is set fail ArgumentError, "Missing the required parameter 'lookup_val' when calling ExternalContactsApi.get_externalcontacts_reversewhitepageslookup" if lookup_val.nil? # resource path local_var_path = "/api/v2/externalcontacts/reversewhitepageslookup".sub('{format}','json') # query parameters query_params = {} query_params[:'lookupVal'] = lookup_val query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReverseWhitepagesLookupResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_externalcontacts_reversewhitepageslookup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a note for an external contact # # @param contact_id ExternalContact Id # @param [Hash] opts the optional parameters # @option opts [Note] :body ExternalContact # @return [Note] def post_externalcontacts_contact_notes(contact_id, opts = {}) data, _status_code, _headers = post_externalcontacts_contact_notes_with_http_info(contact_id, opts) return data end # Create a note for an external contact # # @param contact_id ExternalContact Id # @param [Hash] opts the optional parameters # @option opts [Note] :body ExternalContact # @return [Array<(Note, Fixnum, Hash)>] Note data, response status code and response headers def post_externalcontacts_contact_notes_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.post_externalcontacts_contact_notes ..." end # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling ExternalContactsApi.post_externalcontacts_contact_notes" if contact_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/contacts/{contactId}/notes".sub('{format}','json').sub('{' + 'contactId' + '}', contact_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_externalcontacts_contact_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an external contact # # @param [Hash] opts the optional parameters # @option opts [ExternalContact] :body ExternalContact # @return [ExternalContact] def post_externalcontacts_contacts(opts = {}) data, _status_code, _headers = post_externalcontacts_contacts_with_http_info(opts) return data end # Create an external contact # # @param [Hash] opts the optional parameters # @option opts [ExternalContact] :body ExternalContact # @return [Array<(ExternalContact, Fixnum, Hash)>] ExternalContact data, response status code and response headers def post_externalcontacts_contacts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.post_externalcontacts_contacts ..." end # resource path local_var_path = "/api/v2/externalcontacts/contacts".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalContact') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_externalcontacts_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a note for an external organization # # @param external_organization_id External Organization Id # @param [Hash] opts the optional parameters # @option opts [Note] :body ExternalContact # @return [Note] def post_externalcontacts_organization_notes(external_organization_id, opts = {}) data, _status_code, _headers = post_externalcontacts_organization_notes_with_http_info(external_organization_id, opts) return data end # Create a note for an external organization # # @param external_organization_id External Organization Id # @param [Hash] opts the optional parameters # @option opts [Note] :body ExternalContact # @return [Array<(Note, Fixnum, Hash)>] Note data, response status code and response headers def post_externalcontacts_organization_notes_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.post_externalcontacts_organization_notes ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.post_externalcontacts_organization_notes" if external_organization_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/notes".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_externalcontacts_organization_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an external organization # # @param [Hash] opts the optional parameters # @option opts [ExternalOrganization] :body ExternalOrganization # @return [ExternalOrganization] def post_externalcontacts_organizations(opts = {}) data, _status_code, _headers = post_externalcontacts_organizations_with_http_info(opts) return data end # Create an external organization # # @param [Hash] opts the optional parameters # @option opts [ExternalOrganization] :body ExternalOrganization # @return [Array<(ExternalOrganization, Fixnum, Hash)>] ExternalOrganization data, response status code and response headers def post_externalcontacts_organizations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.post_externalcontacts_organizations ..." end # resource path local_var_path = "/api/v2/externalcontacts/organizations".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalOrganization') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_externalcontacts_organizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a relationship # # @param [Hash] opts the optional parameters # @option opts [Relationship] :body Relationship # @return [Relationship] def post_externalcontacts_relationships(opts = {}) data, _status_code, _headers = post_externalcontacts_relationships_with_http_info(opts) return data end # Create a relationship # # @param [Hash] opts the optional parameters # @option opts [Relationship] :body Relationship # @return [Array<(Relationship, Fixnum, Hash)>] Relationship data, response status code and response headers def post_externalcontacts_relationships_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.post_externalcontacts_relationships ..." end # resource path local_var_path = "/api/v2/externalcontacts/relationships".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Relationship') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_externalcontacts_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an external contact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @option opts [ExternalContact] :body ExternalContact # @return [ExternalContact] def put_externalcontacts_contact(contact_id, opts = {}) data, _status_code, _headers = put_externalcontacts_contact_with_http_info(contact_id, opts) return data end # Update an external contact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @option opts [ExternalContact] :body ExternalContact # @return [Array<(ExternalContact, Fixnum, Hash)>] ExternalContact data, response status code and response headers def put_externalcontacts_contact_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.put_externalcontacts_contact ..." end # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling ExternalContactsApi.put_externalcontacts_contact" if contact_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/contacts/{contactId}".sub('{format}','json').sub('{' + 'contactId' + '}', contact_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalContact') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#put_externalcontacts_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a note for an external contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @option opts [Note] :body Note # @return [Note] def put_externalcontacts_contact_note(contact_id, note_id, opts = {}) data, _status_code, _headers = put_externalcontacts_contact_note_with_http_info(contact_id, note_id, opts) return data end # Update a note for an external contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @option opts [Note] :body Note # @return [Array<(Note, Fixnum, Hash)>] Note data, response status code and response headers def put_externalcontacts_contact_note_with_http_info(contact_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.put_externalcontacts_contact_note ..." end # verify the required parameter 'contact_id' is set fail ArgumentError, "Missing the required parameter 'contact_id' when calling ExternalContactsApi.put_externalcontacts_contact_note" if contact_id.nil? # verify the required parameter 'note_id' is set fail ArgumentError, "Missing the required parameter 'note_id' when calling ExternalContactsApi.put_externalcontacts_contact_note" if note_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/contacts/{contactId}/notes/{noteId}".sub('{format}','json').sub('{' + 'contactId' + '}', contact_id.to_s).sub('{' + 'noteId' + '}', note_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#put_externalcontacts_contact_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Associate an external contact with a conversation # # @param conversation_id Conversation ID # @param [Hash] opts the optional parameters # @option opts [ConversationAssociation] :body ConversationAssociation # @return [nil] def put_externalcontacts_conversation(conversation_id, opts = {}) put_externalcontacts_conversation_with_http_info(conversation_id, opts) return nil end # Associate an external contact with a conversation # # @param conversation_id Conversation ID # @param [Hash] opts the optional parameters # @option opts [ConversationAssociation] :body ConversationAssociation # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def put_externalcontacts_conversation_with_http_info(conversation_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.put_externalcontacts_conversation ..." end # verify the required parameter 'conversation_id' is set fail ArgumentError, "Missing the required parameter 'conversation_id' when calling ExternalContactsApi.put_externalcontacts_conversation" if conversation_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/conversations/{conversationId}".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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(:PUT, local_var_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: ExternalContactsApi#put_externalcontacts_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @option opts [ExternalOrganization] :body ExternalOrganization # @return [ExternalOrganization] def put_externalcontacts_organization(external_organization_id, opts = {}) data, _status_code, _headers = put_externalcontacts_organization_with_http_info(external_organization_id, opts) return data end # Update an external organization # # @param external_organization_id External Organization ID # @param [Hash] opts the optional parameters # @option opts [ExternalOrganization] :body ExternalOrganization # @return [Array<(ExternalOrganization, Fixnum, Hash)>] ExternalOrganization data, response status code and response headers def put_externalcontacts_organization_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.put_externalcontacts_organization ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.put_externalcontacts_organization" if external_organization_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalOrganization') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#put_externalcontacts_organization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a note for an external organization # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @option opts [Note] :body Note # @return [Note] def put_externalcontacts_organization_note(external_organization_id, note_id, opts = {}) data, _status_code, _headers = put_externalcontacts_organization_note_with_http_info(external_organization_id, note_id, opts) return data end # Update a note for an external organization # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @option opts [Note] :body Note # @return [Array<(Note, Fixnum, Hash)>] Note data, response status code and response headers def put_externalcontacts_organization_note_with_http_info(external_organization_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.put_externalcontacts_organization_note ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.put_externalcontacts_organization_note" if external_organization_id.nil? # verify the required parameter 'note_id' is set fail ArgumentError, "Missing the required parameter 'note_id' when calling ExternalContactsApi.put_externalcontacts_organization_note" if note_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/notes/{noteId}".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s).sub('{' + 'noteId' + '}', note_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#put_externalcontacts_organization_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Links a Trustor with an Extenral Organization # # @param external_organization_id External Organization ID # @param trustor_id Trustor ID # @param [Hash] opts the optional parameters # @return [ExternalOrganization] def put_externalcontacts_organization_trustor_trustor_id(external_organization_id, trustor_id, opts = {}) data, _status_code, _headers = put_externalcontacts_organization_trustor_trustor_id_with_http_info(external_organization_id, trustor_id, opts) return data end # Links a Trustor with an Extenral Organization # # @param external_organization_id External Organization ID # @param trustor_id Trustor ID # @param [Hash] opts the optional parameters # @return [Array<(ExternalOrganization, Fixnum, Hash)>] ExternalOrganization data, response status code and response headers def put_externalcontacts_organization_trustor_trustor_id_with_http_info(external_organization_id, trustor_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.put_externalcontacts_organization_trustor_trustor_id ..." end # verify the required parameter 'external_organization_id' is set fail ArgumentError, "Missing the required parameter 'external_organization_id' when calling ExternalContactsApi.put_externalcontacts_organization_trustor_trustor_id" if external_organization_id.nil? # verify the required parameter 'trustor_id' is set fail ArgumentError, "Missing the required parameter 'trustor_id' when calling ExternalContactsApi.put_externalcontacts_organization_trustor_trustor_id" if trustor_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/organizations/{externalOrganizationId}/trustor/{trustorId}".sub('{format}','json').sub('{' + 'externalOrganizationId' + '}', external_organization_id.to_s).sub('{' + 'trustorId' + '}', trustor_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalOrganization') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#put_externalcontacts_organization_trustor_trustor_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a relationship # # @param relationship_id Relationship Id # @param [Hash] opts the optional parameters # @option opts [Relationship] :body Relationship # @return [Relationship] def put_externalcontacts_relationship(relationship_id, opts = {}) data, _status_code, _headers = put_externalcontacts_relationship_with_http_info(relationship_id, opts) return data end # Update a relationship # # @param relationship_id Relationship Id # @param [Hash] opts the optional parameters # @option opts [Relationship] :body Relationship # @return [Array<(Relationship, Fixnum, Hash)>] Relationship data, response status code and response headers def put_externalcontacts_relationship_with_http_info(relationship_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi.put_externalcontacts_relationship ..." end # verify the required parameter 'relationship_id' is set fail ArgumentError, "Missing the required parameter 'relationship_id' when calling ExternalContactsApi.put_externalcontacts_relationship" if relationship_id.nil? # resource path local_var_path = "/api/v2/externalcontacts/relationships/{relationshipId}".sub('{format}','json').sub('{' + 'relationshipId' + '}', relationship_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_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(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Relationship') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#put_externalcontacts_relationship\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end