require "uri" module PureCloud class ExternalContactsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client 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 [ContactListing] def get_contacts(opts = {}) data, status_code, headers = get_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_contacts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_contacts ..." end # resource path 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) _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 => 'ContactListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create an ExternalContact # # @param [Hash] opts the optional parameters # @option opts [ExternalContact] :body ExternalContact # @return [ExternalContact] def post_contacts(opts = {}) data, status_code, headers = post_contacts_with_http_info(opts) return data end # Create an ExternalContact # # @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_contacts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#post_contacts ..." end # resource path path = "/api/v2/externalcontacts/contacts".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalContact') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch a ExternalContact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand which fields, if any, to expand # @return [ExternalContact] def get_contacts_contact_id(contact_id, opts = {}) data, status_code, headers = get_contacts_contact_id_with_http_info(contact_id, opts) return data end # Fetch a ExternalContact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand which fields, if any, to expand # @return [Array<(ExternalContact, Fixnum, Hash)>] ExternalContact data, response status code and response headers def get_contacts_contact_id_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_contacts_contact_id ..." end # verify the required parameter 'contact_id' is set fail "Missing the required parameter 'contact_id' when calling get_contacts_contact_id" if contact_id.nil? # resource path 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) _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 => 'ExternalContact') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_contacts_contact_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a externalContact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @option opts [ExternalContact] :body ExternalContact # @return [ExternalContact] def put_contacts_contact_id(contact_id, opts = {}) data, status_code, headers = put_contacts_contact_id_with_http_info(contact_id, opts) return data end # Update a externalContact # # @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_contacts_contact_id_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#put_contacts_contact_id ..." end # verify the required parameter 'contact_id' is set fail "Missing the required parameter 'contact_id' when calling put_contacts_contact_id" if contact_id.nil? # resource path 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) _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(:PUT, 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_contacts_contact_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a contact # # @param contact_id ExternalContact ID # @param [Hash] opts the optional parameters # @return [nil] def delete_contacts_contact_id(contact_id, opts = {}) delete_contacts_contact_id_with_http_info(contact_id, opts) return nil end # Delete a 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_contacts_contact_id_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#delete_contacts_contact_id ..." end # verify the required parameter 'contact_id' is set fail "Missing the required parameter 'contact_id' when calling delete_contacts_contact_id" if contact_id.nil? # resource path 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#delete_contacts_contact_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Notes for an ExternalContact # # @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 # @return [NoteListing] def get_contacts_contact_id_notes(contact_id, opts = {}) data, status_code, headers = get_contacts_contact_id_notes_with_http_info(contact_id, opts) return data end # List Notes for an ExternalContact # # @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 # @return [Array<(NoteListing, Fixnum, Hash)>] NoteListing data, response status code and response headers def get_contacts_contact_id_notes_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_contacts_contact_id_notes ..." end # verify the required parameter 'contact_id' is set fail "Missing the required parameter 'contact_id' when calling get_contacts_contact_id_notes" if contact_id.nil? # resource path 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'] # 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 => 'NoteListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_contacts_contact_id_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a Note for an ExternalContact # # @param contact_id ExternalContact Id # @param [Hash] opts the optional parameters # @option opts [Note] :body ExternalContact # @return [Note] def post_contacts_contact_id_notes(contact_id, opts = {}) data, status_code, headers = post_contacts_contact_id_notes_with_http_info(contact_id, opts) return data end # Create a Note for an ExternalContact # # @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_contacts_contact_id_notes_with_http_info(contact_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#post_contacts_contact_id_notes ..." end # verify the required parameter 'contact_id' is set fail "Missing the required parameter 'contact_id' when calling post_contacts_contact_id_notes" if contact_id.nil? # resource path 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_contacts_contact_id_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch a note for a contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [Note] def get_contacts_contact_id_notes_note_id(contact_id, note_id, opts = {}) data, status_code, headers = get_contacts_contact_id_notes_note_id_with_http_info(contact_id, note_id, opts) return data end # Fetch a note for a contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [Array<(Note, Fixnum, Hash)>] Note data, response status code and response headers def get_contacts_contact_id_notes_note_id_with_http_info(contact_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_contacts_contact_id_notes_note_id ..." end # verify the required parameter 'contact_id' is set fail "Missing the required parameter 'contact_id' when calling get_contacts_contact_id_notes_note_id" if contact_id.nil? # verify the required parameter 'note_id' is set fail "Missing the required parameter 'note_id' when calling get_contacts_contact_id_notes_note_id" if note_id.nil? # resource path 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) _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 => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_contacts_contact_id_notes_note_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a note for a 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_contacts_contact_id_notes_note_id(contact_id, note_id, opts = {}) data, status_code, headers = put_contacts_contact_id_notes_note_id_with_http_info(contact_id, note_id, opts) return data end # Update a note for a 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_contacts_contact_id_notes_note_id_with_http_info(contact_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#put_contacts_contact_id_notes_note_id ..." end # verify the required parameter 'contact_id' is set fail "Missing the required parameter 'contact_id' when calling put_contacts_contact_id_notes_note_id" if contact_id.nil? # verify the required parameter 'note_id' is set fail "Missing the required parameter 'note_id' when calling put_contacts_contact_id_notes_note_id" if note_id.nil? # resource path 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) _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(:PUT, 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_contacts_contact_id_notes_note_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a note for a contact # # @param contact_id ExternalContact Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [nil] def delete_contacts_contact_id_notes_note_id(contact_id, note_id, opts = {}) delete_contacts_contact_id_notes_note_id_with_http_info(contact_id, note_id, opts) return nil end # Delete a note for a 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_contacts_contact_id_notes_note_id_with_http_info(contact_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#delete_contacts_contact_id_notes_note_id ..." end # verify the required parameter 'contact_id' is set fail "Missing the required parameter 'contact_id' when calling delete_contacts_contact_id_notes_note_id" if contact_id.nil? # verify the required parameter 'note_id' is set fail "Missing the required parameter 'note_id' when calling delete_contacts_contact_id_notes_note_id" if note_id.nil? # resource path 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#delete_contacts_contact_id_notes_note_id\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 # @option opts [Integer] :page_number Page number # @option opts [String] :q Search query # @option opts [String] :sort_order Sort order # @return [ExternalOrganizationListing] def get_organizations(opts = {}) data, status_code, headers = get_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 [String] :sort_order Sort order # @return [Array<(ExternalOrganizationListing, Fixnum, Hash)>] ExternalOrganizationListing data, response status code and response headers def get_organizations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_organizations ..." end # resource path 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[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # 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 => 'ExternalOrganizationListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_organizations\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_organizations(opts = {}) data, status_code, headers = post_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_organizations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#post_organizations ..." end # resource path path = "/api/v2/externalcontacts/organizations".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ExternalOrganization') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_organizations\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 # @return [ExternalOrganization] def get_organizations_externalorganization_id(external_organization_id, opts = {}) data, status_code, headers = get_organizations_externalorganization_id_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 # @return [Array<(ExternalOrganization, Fixnum, Hash)>] ExternalOrganization data, response status code and response headers def get_organizations_externalorganization_id_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_organizations_externalorganization_id ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling get_organizations_externalorganization_id" if external_organization_id.nil? # resource path 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) _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 => 'ExternalOrganization') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_organizations_externalorganization_id\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_organizations_externalorganization_id(external_organization_id, opts = {}) data, status_code, headers = put_organizations_externalorganization_id_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_organizations_externalorganization_id_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#put_organizations_externalorganization_id ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling put_organizations_externalorganization_id" if external_organization_id.nil? # resource path 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) _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(:PUT, 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_organizations_externalorganization_id\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_organizations_externalorganization_id(external_organization_id, opts = {}) delete_organizations_externalorganization_id_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_organizations_externalorganization_id_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#delete_organizations_externalorganization_id ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling delete_organizations_externalorganization_id" if external_organization_id.nil? # resource path 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#delete_organizations_externalorganization_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search for External Contacts # # @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 [ContactListing] def get_organizations_externalorganization_id_contacts(external_organization_id, opts = {}) data, status_code, headers = get_organizations_externalorganization_id_contacts_with_http_info(external_organization_id, opts) return data end # Search for External Contacts # # @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_organizations_externalorganization_id_contacts_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_organizations_externalorganization_id_contacts ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling get_organizations_externalorganization_id_contacts" if external_organization_id.nil? # resource path 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) _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 => 'ContactListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_organizations_externalorganization_id_contacts\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 # @option opts [Integer] :page_number Page number # @option opts [String] :sort_order Sort order # @return [NoteListing] def get_organizations_externalorganization_id_notes(external_organization_id, opts = {}) data, status_code, headers = get_organizations_externalorganization_id_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 # @return [Array<(NoteListing, Fixnum, Hash)>] NoteListing data, response status code and response headers def get_organizations_externalorganization_id_notes_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_organizations_externalorganization_id_notes ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling get_organizations_externalorganization_id_notes" if external_organization_id.nil? # resource path 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'] # 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 => 'NoteListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_organizations_externalorganization_id_notes\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_organizations_externalorganization_id_notes(external_organization_id, opts = {}) data, status_code, headers = post_organizations_externalorganization_id_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_organizations_externalorganization_id_notes_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#post_organizations_externalorganization_id_notes ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling post_organizations_externalorganization_id_notes" if external_organization_id.nil? # resource path 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_organizations_externalorganization_id_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch a note # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [Note] def get_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id, opts = {}) data, status_code, headers = get_organizations_externalorganization_id_notes_note_id_with_http_info(external_organization_id, note_id, opts) return data end # Fetch a note # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [Array<(Note, Fixnum, Hash)>] Note data, response status code and response headers def get_organizations_externalorganization_id_notes_note_id_with_http_info(external_organization_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_organizations_externalorganization_id_notes_note_id ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling get_organizations_externalorganization_id_notes_note_id" if external_organization_id.nil? # verify the required parameter 'note_id' is set fail "Missing the required parameter 'note_id' when calling get_organizations_externalorganization_id_notes_note_id" if note_id.nil? # resource path 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) _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 => 'Note') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_organizations_externalorganization_id_notes_note_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a note # # @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_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id, opts = {}) data, status_code, headers = put_organizations_externalorganization_id_notes_note_id_with_http_info(external_organization_id, note_id, opts) return data end # Update a note # # @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_organizations_externalorganization_id_notes_note_id_with_http_info(external_organization_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#put_organizations_externalorganization_id_notes_note_id ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling put_organizations_externalorganization_id_notes_note_id" if external_organization_id.nil? # verify the required parameter 'note_id' is set fail "Missing the required parameter 'note_id' when calling put_organizations_externalorganization_id_notes_note_id" if note_id.nil? # resource path 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) _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(:PUT, 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_organizations_externalorganization_id_notes_note_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a note # # @param external_organization_id External Organization Id # @param note_id Note Id # @param [Hash] opts the optional parameters # @return [nil] def delete_organizations_externalorganization_id_notes_note_id(external_organization_id, note_id, opts = {}) delete_organizations_externalorganization_id_notes_note_id_with_http_info(external_organization_id, note_id, opts) return nil end # Delete a note # # @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_organizations_externalorganization_id_notes_note_id_with_http_info(external_organization_id, note_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#delete_organizations_externalorganization_id_notes_note_id ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling delete_organizations_externalorganization_id_notes_note_id" if external_organization_id.nil? # verify the required parameter 'note_id' is set fail "Missing the required parameter 'note_id' when calling delete_organizations_externalorganization_id_notes_note_id" if note_id.nil? # resource path 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#delete_organizations_externalorganization_id_notes_note_id\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 [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_order Sort order # @return [RelationshipListing] def get_organizations_externalorganization_id_relationships(external_organization_id, opts = {}) data, status_code, headers = get_organizations_externalorganization_id_relationships_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 [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_order Sort order # @return [Array<(RelationshipListing, Fixnum, Hash)>] RelationshipListing data, response status code and response headers def get_organizations_externalorganization_id_relationships_with_http_info(external_organization_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_organizations_externalorganization_id_relationships ..." end # verify the required parameter 'external_organization_id' is set fail "Missing the required parameter 'external_organization_id' when calling get_organizations_externalorganization_id_relationships" if external_organization_id.nil? # resource path 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[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # 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 => 'RelationshipListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_organizations_externalorganization_id_relationships\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_relationships(opts = {}) data, status_code, headers = post_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_relationships_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#post_relationships ..." end # resource path path = "/api/v2/externalcontacts/relationships".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Relationship') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#post_relationships\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 # @return [Relationship] def get_relationships_relationship_id(relationship_id, opts = {}) data, status_code, headers = get_relationships_relationship_id_with_http_info(relationship_id, opts) return data end # Fetch a relationship # # @param relationship_id Relationship Id # @param [Hash] opts the optional parameters # @return [Array<(Relationship, Fixnum, Hash)>] Relationship data, response status code and response headers def get_relationships_relationship_id_with_http_info(relationship_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#get_relationships_relationship_id ..." end # verify the required parameter 'relationship_id' is set fail "Missing the required parameter 'relationship_id' when calling get_relationships_relationship_id" if relationship_id.nil? # resource path 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) _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 => 'Relationship') if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#get_relationships_relationship_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_relationships_relationship_id(relationship_id, opts = {}) data, status_code, headers = put_relationships_relationship_id_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_relationships_relationship_id_with_http_info(relationship_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#put_relationships_relationship_id ..." end # verify the required parameter 'relationship_id' is set fail "Missing the required parameter 'relationship_id' when calling put_relationships_relationship_id" if relationship_id.nil? # resource path 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) _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(:PUT, 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_relationships_relationship_id\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_relationships_relationship_id(relationship_id, opts = {}) delete_relationships_relationship_id_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_relationships_relationship_id_with_http_info(relationship_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ExternalContactsApi#delete_relationships_relationship_id ..." end # verify the required parameter 'relationship_id' is set fail "Missing the required parameter 'relationship_id' when calling delete_relationships_relationship_id" if relationship_id.nil? # resource path 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ExternalContactsApi#delete_relationships_relationship_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end