=begin #SendinBlue API #SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | OpenAPI spec version: 3.0.0 Contact: contact@sendinblue.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.3.1 =end require "uri" module SibApiV3Sdk class ContactsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Add existing contacts to a list # # @param list_id Id of the list # @param contact_emails Emails addresses of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def add_contact_to_list(list_id, contact_emails, opts = {}) data, _status_code, _headers = add_contact_to_list_with_http_info(list_id, contact_emails, opts) return data end # Add existing contacts to a list # # @param list_id Id of the list # @param contact_emails Emails addresses of the contacts # @param [Hash] opts the optional parameters # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.add_contact_to_list ..." end # verify the required parameter 'list_id' is set if @api_client.config.client_side_validation && list_id.nil? fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.add_contact_to_list" end # verify the required parameter 'contact_emails' is set if @api_client.config.client_side_validation && contact_emails.nil? fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ContactsApi.add_contact_to_list" end # resource path local_var_path = "/contacts/lists/{listId}/contacts/add".sub('{' + 'listId' + '}', list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(contact_emails) auth_names = ['api-key'] 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 => 'PostContactInfo') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#add_contact_to_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates contact attribute # # @param attribute_category Category of the attribute # @param attribute_name Name of the attribute # @param create_attribute Values to create an attribute # @param [Hash] opts the optional parameters # @return [nil] def create_attribute(attribute_category, attribute_name, create_attribute, opts = {}) create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts) return nil end # Creates contact attribute # # @param attribute_category Category of the attribute # @param attribute_name Name of the attribute # @param create_attribute Values to create an attribute # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.create_attribute ..." end # verify the required parameter 'attribute_category' is set if @api_client.config.client_side_validation && attribute_category.nil? fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.create_attribute" end # verify enum value if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category) fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.create_attribute" end # verify the required parameter 'create_attribute' is set if @api_client.config.client_side_validation && create_attribute.nil? fail ArgumentError, "Missing the required parameter 'create_attribute' when calling ContactsApi.create_attribute" end # resource path local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(create_attribute) auth_names = ['api-key'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a contact # # @param create_contact Values to create a contact # @param [Hash] opts the optional parameters # @return [CreateUpdateContactModel] def create_contact(create_contact, opts = {}) data, _status_code, _headers = create_contact_with_http_info(create_contact, opts) return data end # Create a contact # # @param create_contact Values to create a contact # @param [Hash] opts the optional parameters # @return [Array<(CreateUpdateContactModel, Fixnum, Hash)>] CreateUpdateContactModel data, response status code and response headers def create_contact_with_http_info(create_contact, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.create_contact ..." end # verify the required parameter 'create_contact' is set if @api_client.config.client_side_validation && create_contact.nil? fail ArgumentError, "Missing the required parameter 'create_contact' when calling ContactsApi.create_contact" end # resource path local_var_path = "/contacts" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(create_contact) auth_names = ['api-key'] 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 => 'CreateUpdateContactModel') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a folder # # @param create_folder Name of the folder # @param [Hash] opts the optional parameters # @return [CreateModel] def create_folder(create_folder, opts = {}) data, _status_code, _headers = create_folder_with_http_info(create_folder, opts) return data end # Create a folder # # @param create_folder Name of the folder # @param [Hash] opts the optional parameters # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers def create_folder_with_http_info(create_folder, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.create_folder ..." end # verify the required parameter 'create_folder' is set if @api_client.config.client_side_validation && create_folder.nil? fail ArgumentError, "Missing the required parameter 'create_folder' when calling ContactsApi.create_folder" end # resource path local_var_path = "/contacts/folders" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(create_folder) auth_names = ['api-key'] 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 => 'CreateModel') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a list # # @param create_list Values to create a list # @param [Hash] opts the optional parameters # @return [CreateModel] def create_list(create_list, opts = {}) data, _status_code, _headers = create_list_with_http_info(create_list, opts) return data end # Create a list # # @param create_list Values to create a list # @param [Hash] opts the optional parameters # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers def create_list_with_http_info(create_list, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.create_list ..." end # verify the required parameter 'create_list' is set if @api_client.config.client_side_validation && create_list.nil? fail ArgumentError, "Missing the required parameter 'create_list' when calling ContactsApi.create_list" end # resource path local_var_path = "/contacts/lists" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(create_list) auth_names = ['api-key'] 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 => 'CreateModel') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes an attribute # # @param attribute_category Category of the attribute # @param attribute_name Name of the existing attribute # @param [Hash] opts the optional parameters # @return [nil] def delete_attribute(attribute_category, attribute_name, opts = {}) delete_attribute_with_http_info(attribute_category, attribute_name, opts) return nil end # Deletes an attribute # # @param attribute_category Category of the attribute # @param attribute_name Name of the existing attribute # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.delete_attribute ..." end # verify the required parameter 'attribute_category' is set if @api_client.config.client_side_validation && attribute_category.nil? fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.delete_attribute" end # verify enum value if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category) fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.delete_attribute" end # resource path local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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: ContactsApi#delete_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes a contact # # @param email Email (urlencoded) of the contact # @param [Hash] opts the optional parameters # @return [nil] def delete_contact(email, opts = {}) delete_contact_with_http_info(email, opts) return nil end # Deletes a contact # # @param email Email (urlencoded) of the contact # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_contact_with_http_info(email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.delete_contact ..." end # verify the required parameter 'email' is set if @api_client.config.client_side_validation && email.nil? fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.delete_contact" end # resource path local_var_path = "/contacts/{email}".sub('{' + 'email' + '}', email.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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: ContactsApi#delete_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a folder (and all its lists) # # @param folder_id Id of the folder # @param [Hash] opts the optional parameters # @return [nil] def delete_folder(folder_id, opts = {}) delete_folder_with_http_info(folder_id, opts) return nil end # Delete a folder (and all its lists) # # @param folder_id Id of the folder # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_folder_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.delete_folder ..." end # verify the required parameter 'folder_id' is set if @api_client.config.client_side_validation && folder_id.nil? fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.delete_folder" end # resource path local_var_path = "/contacts/folders/{folderId}".sub('{' + 'folderId' + '}', folder_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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: ContactsApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a list # # @param list_id Id of the list # @param [Hash] opts the optional parameters # @return [nil] def delete_list(list_id, opts = {}) delete_list_with_http_info(list_id, opts) return nil end # Delete a list # # @param list_id Id of the list # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.delete_list ..." end # verify the required parameter 'list_id' is set if @api_client.config.client_side_validation && list_id.nil? fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.delete_list" end # resource path local_var_path = "/contacts/lists/{listId}".sub('{' + 'listId' + '}', list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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: ContactsApi#delete_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lists all attributes # # @param [Hash] opts the optional parameters # @return [GetAttributes] def get_attributes(opts = {}) data, _status_code, _headers = get_attributes_with_http_info(opts) return data end # Lists all attributes # # @param [Hash] opts the optional parameters # @return [Array<(GetAttributes, Fixnum, Hash)>] GetAttributes data, response status code and response headers def get_attributes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_attributes ..." end # resource path local_var_path = "/contacts/attributes" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetAttributes') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieves contact informations # # @param email Email (urlencoded) of the contact # @param [Hash] opts the optional parameters # @return [GetExtendedContactDetails] def get_contact_info(email, opts = {}) data, _status_code, _headers = get_contact_info_with_http_info(email, opts) return data end # Retrieves contact informations # # @param email Email (urlencoded) of the contact # @param [Hash] opts the optional parameters # @return [Array<(GetExtendedContactDetails, Fixnum, Hash)>] GetExtendedContactDetails data, response status code and response headers def get_contact_info_with_http_info(email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_contact_info ..." end # verify the required parameter 'email' is set if @api_client.config.client_side_validation && email.nil? fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.get_contact_info" end # resource path local_var_path = "/contacts/{email}".sub('{' + 'email' + '}', email.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetExtendedContactDetails') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contact_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the campaigns statistics for a contact # # @param email Email address (urlencoded) of the contact # @param [Hash] opts the optional parameters # @return [GetContactCampaignStats] def get_contact_stats(email, opts = {}) data, _status_code, _headers = get_contact_stats_with_http_info(email, opts) return data end # Get the campaigns statistics for a contact # # @param email Email address (urlencoded) of the contact # @param [Hash] opts the optional parameters # @return [Array<(GetContactCampaignStats, Fixnum, Hash)>] GetContactCampaignStats data, response status code and response headers def get_contact_stats_with_http_info(email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_contact_stats ..." end # verify the required parameter 'email' is set if @api_client.config.client_side_validation && email.nil? fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.get_contact_stats" end # resource path local_var_path = "/contacts/{email}/campaignStats".sub('{' + 'email' + '}', email.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetContactCampaignStats') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contact_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all the contacts # # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 50) # @option opts [Integer] :offset Index of the first document of the page (default to 0) # @option opts [DateTime] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @return [GetContacts] def get_contacts(opts = {}) data, _status_code, _headers = get_contacts_with_http_info(opts) return data end # Get all the contacts # # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @option opts [DateTime] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @return [Array<(GetContacts, Fixnum, Hash)>] GetContacts 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: ContactsApi.get_contacts ..." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_contacts, must be smaller than or equal to 1000.' end # resource path local_var_path = "/contacts" # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetContacts') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the contacts in a list # # @param list_id Id of the list # @param [Hash] opts the optional parameters # @option opts [DateTime] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @option opts [Integer] :limit Number of documents per page (default to 50) # @option opts [Integer] :offset Index of the first document of the page (default to 0) # @return [GetContacts] def get_contacts_from_list(list_id, opts = {}) data, _status_code, _headers = get_contacts_from_list_with_http_info(list_id, opts) return data end # Get the contacts in a list # # @param list_id Id of the list # @param [Hash] opts the optional parameters # @option opts [DateTime] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @return [Array<(GetContacts, Fixnum, Hash)>] GetContacts data, response status code and response headers def get_contacts_from_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_contacts_from_list ..." end # verify the required parameter 'list_id' is set if @api_client.config.client_side_validation && list_id.nil? fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.get_contacts_from_list" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 500 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_contacts_from_list, must be smaller than or equal to 500.' end # resource path local_var_path = "/contacts/lists/{listId}/contacts".sub('{' + 'listId' + '}', list_id.to_s) # query parameters query_params = {} query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetContacts') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contacts_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns folder details # # @param folder_id id of the folder # @param [Hash] opts the optional parameters # @return [GetFolder] def get_folder(folder_id, opts = {}) data, _status_code, _headers = get_folder_with_http_info(folder_id, opts) return data end # Returns folder details # # @param folder_id id of the folder # @param [Hash] opts the optional parameters # @return [Array<(GetFolder, Fixnum, Hash)>] GetFolder data, response status code and response headers def get_folder_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_folder ..." end # verify the required parameter 'folder_id' is set if @api_client.config.client_side_validation && folder_id.nil? fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.get_folder" end # resource path local_var_path = "/contacts/folders/{folderId}".sub('{' + 'folderId' + '}', folder_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetFolder') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the lists in a folder # # @param folder_id Id of the folder # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 10) # @option opts [Integer] :offset Index of the first document of the page (default to 0) # @return [GetFolderLists] def get_folder_lists(folder_id, opts = {}) data, _status_code, _headers = get_folder_lists_with_http_info(folder_id, opts) return data end # Get the lists in a folder # # @param folder_id Id of the folder # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @return [Array<(GetFolderLists, Fixnum, Hash)>] GetFolderLists data, response status code and response headers def get_folder_lists_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_folder_lists ..." end # verify the required parameter 'folder_id' is set if @api_client.config.client_side_validation && folder_id.nil? fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.get_folder_lists" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_folder_lists, must be smaller than or equal to 50.' end # resource path local_var_path = "/contacts/folders/{folderId}/lists".sub('{' + 'folderId' + '}', folder_id.to_s) # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetFolderLists') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_folder_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all the folders # # @param limit Number of documents per page # @param offset Index of the first document of the page # @param [Hash] opts the optional parameters # @return [GetFolders] def get_folders(limit, offset, opts = {}) data, _status_code, _headers = get_folders_with_http_info(limit, offset, opts) return data end # Get all the folders # # @param limit Number of documents per page # @param offset Index of the first document of the page # @param [Hash] opts the optional parameters # @return [Array<(GetFolders, Fixnum, Hash)>] GetFolders data, response status code and response headers def get_folders_with_http_info(limit, offset, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_folders ..." end # verify the required parameter 'limit' is set if @api_client.config.client_side_validation && limit.nil? fail ArgumentError, "Missing the required parameter 'limit' when calling ContactsApi.get_folders" end if @api_client.config.client_side_validation && limit > 50 fail ArgumentError, 'invalid value for "limit" when calling ContactsApi.get_folders, must be smaller than or equal to 50.' end # verify the required parameter 'offset' is set if @api_client.config.client_side_validation && offset.nil? fail ArgumentError, "Missing the required parameter 'offset' when calling ContactsApi.get_folders" end # resource path local_var_path = "/contacts/folders" # query parameters query_params = {} query_params[:'limit'] = limit query_params[:'offset'] = offset # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetFolders') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the details of a list # # @param list_id Id of the list # @param [Hash] opts the optional parameters # @return [GetExtendedList] def get_list(list_id, opts = {}) data, _status_code, _headers = get_list_with_http_info(list_id, opts) return data end # Get the details of a list # # @param list_id Id of the list # @param [Hash] opts the optional parameters # @return [Array<(GetExtendedList, Fixnum, Hash)>] GetExtendedList data, response status code and response headers def get_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_list ..." end # verify the required parameter 'list_id' is set if @api_client.config.client_side_validation && list_id.nil? fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.get_list" end # resource path local_var_path = "/contacts/lists/{listId}".sub('{' + 'listId' + '}', list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetExtendedList') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all the lists # # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 10) # @option opts [Integer] :offset Index of the first document of the page (default to 0) # @return [GetLists] def get_lists(opts = {}) data, _status_code, _headers = get_lists_with_http_info(opts) return data end # Get all the lists # # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @return [Array<(GetLists, Fixnum, Hash)>] GetLists data, response status code and response headers def get_lists_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.get_lists ..." end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_lists, must be smaller than or equal to 50.' end # resource path local_var_path = "/contacts/lists" # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api-key'] 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 => 'GetLists') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Import contacts # It returns the background process ID which on completion calls the notify URL that you have set in the input. # @param request_contact_import Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` # @param [Hash] opts the optional parameters # @return [CreatedProcessId] def import_contacts(request_contact_import, opts = {}) data, _status_code, _headers = import_contacts_with_http_info(request_contact_import, opts) return data end # Import contacts # It returns the background process ID which on completion calls the notify URL that you have set in the input. # @param request_contact_import Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` # @param [Hash] opts the optional parameters # @return [Array<(CreatedProcessId, Fixnum, Hash)>] CreatedProcessId data, response status code and response headers def import_contacts_with_http_info(request_contact_import, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.import_contacts ..." end # verify the required parameter 'request_contact_import' is set if @api_client.config.client_side_validation && request_contact_import.nil? fail ArgumentError, "Missing the required parameter 'request_contact_import' when calling ContactsApi.import_contacts" end # resource path local_var_path = "/contacts/import" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_contact_import) auth_names = ['api-key'] 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 => 'CreatedProcessId') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#import_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Remove existing contacts from a list # # @param list_id Id of the list # @param contact_emails Emails adresses of the contact # @param [Hash] opts the optional parameters # @return [PostContactInfo] def remove_contact_from_list(list_id, contact_emails, opts = {}) data, _status_code, _headers = remove_contact_from_list_with_http_info(list_id, contact_emails, opts) return data end # Remove existing contacts from a list # # @param list_id Id of the list # @param contact_emails Emails adresses of the contact # @param [Hash] opts the optional parameters # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.remove_contact_from_list ..." end # verify the required parameter 'list_id' is set if @api_client.config.client_side_validation && list_id.nil? fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.remove_contact_from_list" end # verify the required parameter 'contact_emails' is set if @api_client.config.client_side_validation && contact_emails.nil? fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ContactsApi.remove_contact_from_list" end # resource path local_var_path = "/contacts/lists/{listId}/contacts/remove".sub('{' + 'listId' + '}', list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(contact_emails) auth_names = ['api-key'] 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 => 'PostContactInfo') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#remove_contact_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Export contacts # It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. # @param request_contact_export Values to request a contact export # @param [Hash] opts the optional parameters # @return [CreatedProcessId] def request_contact_export(request_contact_export, opts = {}) data, _status_code, _headers = request_contact_export_with_http_info(request_contact_export, opts) return data end # Export contacts # It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. # @param request_contact_export Values to request a contact export # @param [Hash] opts the optional parameters # @return [Array<(CreatedProcessId, Fixnum, Hash)>] CreatedProcessId data, response status code and response headers def request_contact_export_with_http_info(request_contact_export, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.request_contact_export ..." end # verify the required parameter 'request_contact_export' is set if @api_client.config.client_side_validation && request_contact_export.nil? fail ArgumentError, "Missing the required parameter 'request_contact_export' when calling ContactsApi.request_contact_export" end # resource path local_var_path = "/contacts/export" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_contact_export) auth_names = ['api-key'] 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 => 'CreatedProcessId') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#request_contact_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates contact attribute # # @param attribute_category Category of the attribute # @param attribute_name Name of the existing attribute # @param update_attribute Values to update an attribute # @param [Hash] opts the optional parameters # @return [nil] def update_attribute(attribute_category, attribute_name, update_attribute, opts = {}) update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts) return nil end # Updates contact attribute # # @param attribute_category Category of the attribute # @param attribute_name Name of the existing attribute # @param update_attribute Values to update an attribute # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.update_attribute ..." end # verify the required parameter 'attribute_category' is set if @api_client.config.client_side_validation && attribute_category.nil? fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.update_attribute" end # verify enum value if @api_client.config.client_side_validation && !['category', 'calculated', 'global'].include?(attribute_category) fail ArgumentError, "invalid value for 'attribute_category', must be one of category, calculated, global" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.update_attribute" end # verify the required parameter 'update_attribute' is set if @api_client.config.client_side_validation && update_attribute.nil? fail ArgumentError, "Missing the required parameter 'update_attribute' when calling ContactsApi.update_attribute" end # resource path local_var_path = "/contacts/attributes/{attributeCategory}/{attributeName}".sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(update_attribute) auth_names = ['api-key'] 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: ContactsApi#update_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates a contact # # @param email Email (urlencoded) of the contact # @param update_contact Values to update a contact # @param [Hash] opts the optional parameters # @return [nil] def update_contact(email, update_contact, opts = {}) update_contact_with_http_info(email, update_contact, opts) return nil end # Updates a contact # # @param email Email (urlencoded) of the contact # @param update_contact Values to update a contact # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_contact_with_http_info(email, update_contact, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.update_contact ..." end # verify the required parameter 'email' is set if @api_client.config.client_side_validation && email.nil? fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.update_contact" end # verify the required parameter 'update_contact' is set if @api_client.config.client_side_validation && update_contact.nil? fail ArgumentError, "Missing the required parameter 'update_contact' when calling ContactsApi.update_contact" end # resource path local_var_path = "/contacts/{email}".sub('{' + 'email' + '}', email.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(update_contact) auth_names = ['api-key'] 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: ContactsApi#update_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a contact folder # # @param folder_id Id of the folder # @param update_folder Name of the folder # @param [Hash] opts the optional parameters # @return [nil] def update_folder(folder_id, update_folder, opts = {}) update_folder_with_http_info(folder_id, update_folder, opts) return nil end # Update a contact folder # # @param folder_id Id of the folder # @param update_folder Name of the folder # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_folder_with_http_info(folder_id, update_folder, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.update_folder ..." end # verify the required parameter 'folder_id' is set if @api_client.config.client_side_validation && folder_id.nil? fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.update_folder" end # verify the required parameter 'update_folder' is set if @api_client.config.client_side_validation && update_folder.nil? fail ArgumentError, "Missing the required parameter 'update_folder' when calling ContactsApi.update_folder" end # resource path local_var_path = "/contacts/folders/{folderId}".sub('{' + 'folderId' + '}', folder_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(update_folder) auth_names = ['api-key'] 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: ContactsApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a list # # @param list_id Id of the list # @param update_list Values to update a list # @param [Hash] opts the optional parameters # @return [nil] def update_list(list_id, update_list, opts = {}) update_list_with_http_info(list_id, update_list, opts) return nil end # Update a list # # @param list_id Id of the list # @param update_list Values to update a list # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def update_list_with_http_info(list_id, update_list, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContactsApi.update_list ..." end # verify the required parameter 'list_id' is set if @api_client.config.client_side_validation && list_id.nil? fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.update_list" end # verify the required parameter 'update_list' is set if @api_client.config.client_side_validation && update_list.nil? fail ArgumentError, "Missing the required parameter 'update_list' when calling ContactsApi.update_list" end # resource path local_var_path = "/contacts/lists/{listId}".sub('{' + 'listId' + '}', list_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(update_list) auth_names = ['api-key'] 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: ContactsApi#update_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end