=begin #Mailchimp Marketing API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 3.0.5 Contact: apihelp@mailchimp.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'uri' module MailchimpMarketing class CampaignFoldersApi attr_accessor :api_client def initialize(api_client) @api_client = api_client end # Delete campaign folder # Delete a specific campaign folder, and mark all the campaigns in the folder as 'unfiled'. # @param folder_id The unique id for the campaign folder. # @param [Hash] opts the optional parameters # @return [nil] def remove(folder_id = {}, opts = {}) remove_with_http_info(folder_id, opts) nil end # Delete campaign folder # Delete a specific campaign folder, and mark all the campaigns in the folder as 'unfiled'. # @param folder_id The unique id for the campaign folder. # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def remove_with_http_info(folder_id, opts = {}) # resource path local_var_path = '/campaign-folders/{folder_id}'.sub('{' + 'folder_id' + '}', 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', 'application/problem+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 = ['basicAuth'] 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) return data, status_code, headers end # List campaign folders # Get all folders used to organize campaigns. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** (default to 10) # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. (default to 0) # @return [CampaignFolders] def list(opts = {}) data, _status_code, _headers = list_with_http_info(opts) data end # List campaign folders # Get all folders used to organize campaigns. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @option opts [Integer] :count The number of records to return. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **10**. [Maximum value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **1000** # @option opts [Integer] :offset The number of records from a collection to skip. Iterating over large collections with this parameter can be slow. [Default value](/developer/guides/get-started-with-mailchimp-api-3/#Parameters) is **0**. # @return [Array<(CampaignFolders, Fixnum, Hash)>] CampaignFolders data, response status code and response headers def list_with_http_info(opts = {}) # resource path local_var_path = '/campaign-folders' # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].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', 'application/problem+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 = ['basicAuth'] 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 => 'CampaignFolders') return data, status_code, headers end # Get campaign folder # Get information about a specific folder used to organize campaigns. # @param folder_id The unique id for the campaign folder. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [CampaignFolder] def get(folder_id = {}, opts = {}) data, _status_code, _headers = get_with_http_info(folder_id, opts) data end # Get campaign folder # Get information about a specific folder used to organize campaigns. # @param folder_id The unique id for the campaign folder. # @param [Hash] opts the optional parameters # @option opts [Array] :fields A comma-separated list of fields to return. Reference parameters of sub-objects with dot notation. # @option opts [Array] :exclude_fields A comma-separated list of fields to exclude. Reference parameters of sub-objects with dot notation. # @return [Array<(CampaignFolder, Fixnum, Hash)>] CampaignFolder data, response status code and response headers def get_with_http_info(folder_id, opts = {}) # resource path local_var_path = '/campaign-folders/{folder_id}'.sub('{' + 'folder_id' + '}', folder_id.to_s) # query parameters query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+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 = ['basicAuth'] 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 => 'CampaignFolder') return data, status_code, headers end # Update campaign folder # Update a specific folder used to organize campaigns. # @param folder_id The unique id for the campaign folder. # @param body # @param [Hash] opts the optional parameters # @return [CampaignFolder] def update(folder_id = {}, body = {}, opts = {}) data, _status_code, _headers = update_with_http_info(folder_id, body, opts) data end # Update campaign folder # Update a specific folder used to organize campaigns. # @param folder_id The unique id for the campaign folder. # @param body # @param [Hash] opts the optional parameters # @return [Array<(CampaignFolder, Fixnum, Hash)>] CampaignFolder data, response status code and response headers def update_with_http_info(folder_id, body, opts = {}) # resource path local_var_path = '/campaign-folders/{folder_id}'.sub('{' + 'folder_id' + '}', 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', 'application/problem+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(body) auth_names = ['basicAuth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CampaignFolder') return data, status_code, headers end # Add campaign folder # Create a new campaign folder. # @param body # @param [Hash] opts the optional parameters # @return [CampaignFolder] def create(body = {}, opts = {}) data, _status_code, _headers = create_with_http_info(body, opts) data end # Add campaign folder # Create a new campaign folder. # @param body # @param [Hash] opts the optional parameters # @return [Array<(CampaignFolder, Fixnum, Hash)>] CampaignFolder data, response status code and response headers def create_with_http_info(body, opts = {}) # resource path local_var_path = '/campaign-folders' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+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(body) auth_names = ['basicAuth'] 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 => 'CampaignFolder') return data, status_code, headers end end end