=begin #Talon.One API #The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 =end require 'cgi' module TalonOne class ManagementApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Add points in a certain loyalty program for the specified customer # @param program_id [String] # @param integration_id [String] # @param body [LoyaltyPoints] # @param [Hash] opts the optional parameters # @return [nil] def add_loyalty_points(program_id, integration_id, body, opts = {}) add_loyalty_points_with_http_info(program_id, integration_id, body, opts) nil end # Add points in a certain loyalty program for the specified customer # @param program_id [String] # @param integration_id [String] # @param body [LoyaltyPoints] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def add_loyalty_points_with_http_info(program_id, integration_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.add_loyalty_points ...' end # verify the required parameter 'program_id' is set if @api_client.config.client_side_validation && program_id.nil? fail ArgumentError, "Missing the required parameter 'program_id' when calling ManagementApi.add_loyalty_points" end # verify the required parameter 'integration_id' is set if @api_client.config.client_side_validation && integration_id.nil? fail ArgumentError, "Missing the required parameter 'integration_id' when calling ManagementApi.add_loyalty_points" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.add_loyalty_points" end # resource path local_var_path = '/v1/loyalty_programs/{programID}/profile/{integrationID}/add_points'.sub('{' + 'programID' + '}', CGI.escape(program_id.to_s)).sub('{' + 'integrationID' + '}', CGI.escape(integration_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#add_loyalty_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Copy the campaign into every specified application # Copy the campaign into every specified application. # @param application_id [Integer] # @param campaign_id [Integer] # @param body [CampaignCopy] # @param [Hash] opts the optional parameters # @return [InlineResponse2002] def copy_campaign_to_applications(application_id, campaign_id, body, opts = {}) data, _status_code, _headers = copy_campaign_to_applications_with_http_info(application_id, campaign_id, body, opts) data end # Copy the campaign into every specified application # Copy the campaign into every specified application. # @param application_id [Integer] # @param campaign_id [Integer] # @param body [CampaignCopy] # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse2002, Integer, Hash)>] InlineResponse2002 data, response status code and response headers def copy_campaign_to_applications_with_http_info(application_id, campaign_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.copy_campaign_to_applications ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.copy_campaign_to_applications" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.copy_campaign_to_applications" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.copy_campaign_to_applications" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/copy'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2002' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#copy_campaign_to_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Define a new additional cost # Defines a new _additional cost_ in this account. These additional costs are shared across all applications in your account, and are never required. # @param body [NewAdditionalCost] # @param [Hash] opts the optional parameters # @return [AccountAdditionalCost] def create_additional_cost(body, opts = {}) data, _status_code, _headers = create_additional_cost_with_http_info(body, opts) data end # Define a new additional cost # Defines a new _additional cost_ in this account. These additional costs are shared across all applications in your account, and are never required. # @param body [NewAdditionalCost] # @param [Hash] opts the optional parameters # @return [Array<(AccountAdditionalCost, Integer, Hash)>] AccountAdditionalCost data, response status code and response headers def create_additional_cost_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.create_additional_cost ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.create_additional_cost" end # resource path local_var_path = '/v1/additional_costs' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'AccountAdditionalCost' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#create_additional_cost\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Define a new custom attribute # Defines a new _custom attribute_ in this account. Custom attributes allow you to attach new fields to Talon.One domain objects like campaigns, coupons, customers and so on. These attributes can then be given values when creating / updating these objects, and these values can be used in your campaign rules. For example, you could define a `zipCode` field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes. These attributes are shared across all applications in your account, and are never required. # @param body [NewAttribute] # @param [Hash] opts the optional parameters # @return [Attribute] def create_attribute(body, opts = {}) data, _status_code, _headers = create_attribute_with_http_info(body, opts) data end # Define a new custom attribute # Defines a new _custom attribute_ in this account. Custom attributes allow you to attach new fields to Talon.One domain objects like campaigns, coupons, customers and so on. These attributes can then be given values when creating / updating these objects, and these values can be used in your campaign rules. For example, you could define a `zipCode` field for customer sessions, and add a rule to your campaign that only allows certain ZIP codes. These attributes are shared across all applications in your account, and are never required. # @param body [NewAttribute] # @param [Hash] opts the optional parameters # @return [Array<(Attribute, Integer, Hash)>] Attribute data, response status code and response headers def create_attribute_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.create_attribute ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.create_attribute" end # resource path local_var_path = '/v1/attributes' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Attribute' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a Campaign # @param application_id [Integer] # @param body [NewCampaign] # @param [Hash] opts the optional parameters # @return [Campaign] def create_campaign(application_id, body, opts = {}) data, _status_code, _headers = create_campaign_with_http_info(application_id, body, opts) data end # Create a Campaign # @param application_id [Integer] # @param body [NewCampaign] # @param [Hash] opts the optional parameters # @return [Array<(Campaign, Integer, Hash)>] Campaign data, response status code and response headers def create_campaign_with_http_info(application_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.create_campaign ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.create_campaign" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.create_campaign" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Campaign' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#create_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Coupons # Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupons can be created. # @param application_id [Integer] # @param campaign_id [Integer] # @param body [NewCoupons] # @param [Hash] opts the optional parameters # @option opts [String] :silent If set to 'yes', response will be an empty 204, otherwise a list of the coupons generated (to to 1000). # @return [InlineResponse2004] def create_coupons(application_id, campaign_id, body, opts = {}) data, _status_code, _headers = create_coupons_with_http_info(application_id, campaign_id, body, opts) data end # Create Coupons # Create coupons according to some pattern. Up to 20.000 coupons can be created without a unique prefix. When a unique prefix is provided, up to 200.000 coupons can be created. # @param application_id [Integer] # @param campaign_id [Integer] # @param body [NewCoupons] # @param [Hash] opts the optional parameters # @option opts [String] :silent If set to 'yes', response will be an empty 204, otherwise a list of the coupons generated (to to 1000). # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers def create_coupons_with_http_info(application_id, campaign_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.create_coupons ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.create_coupons" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.create_coupons" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.create_coupons" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'silent'] = opts[:'silent'] if !opts[:'silent'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2004' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#create_coupons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Request a password reset # Sends an email with a password recovery link to the email of an existing account. # @param body [NewPasswordEmail] # @param [Hash] opts the optional parameters # @return [NewPasswordEmail] def create_password_recovery_email(body, opts = {}) data, _status_code, _headers = create_password_recovery_email_with_http_info(body, opts) data end # Request a password reset # Sends an email with a password recovery link to the email of an existing account. # @param body [NewPasswordEmail] # @param [Hash] opts the optional parameters # @return [Array<(NewPasswordEmail, Integer, Hash)>] NewPasswordEmail data, response status code and response headers def create_password_recovery_email_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.create_password_recovery_email ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.create_password_recovery_email" end # resource path local_var_path = '/v1/password_recovery_emails' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'NewPasswordEmail' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#create_password_recovery_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a Ruleset # @param application_id [Integer] # @param campaign_id [Integer] # @param body [NewRuleset] # @param [Hash] opts the optional parameters # @return [Ruleset] def create_ruleset(application_id, campaign_id, body, opts = {}) data, _status_code, _headers = create_ruleset_with_http_info(application_id, campaign_id, body, opts) data end # Create a Ruleset # @param application_id [Integer] # @param campaign_id [Integer] # @param body [NewRuleset] # @param [Hash] opts the optional parameters # @return [Array<(Ruleset, Integer, Hash)>] Ruleset data, response status code and response headers def create_ruleset_with_http_info(application_id, campaign_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.create_ruleset ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.create_ruleset" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.create_ruleset" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.create_ruleset" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Ruleset' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#create_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a Session # @param body [LoginParams] # @param [Hash] opts the optional parameters # @return [Session] def create_session(body, opts = {}) data, _status_code, _headers = create_session_with_http_info(body, opts) data end # Create a Session # @param body [LoginParams] # @param [Hash] opts the optional parameters # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers def create_session_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.create_session ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.create_session" end # resource path local_var_path = '/v1/sessions' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Session' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Campaign # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @return [nil] def delete_campaign(application_id, campaign_id, opts = {}) delete_campaign_with_http_info(application_id, campaign_id, opts) nil end # Delete a Campaign # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_campaign_with_http_info(application_id, campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.delete_campaign ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.delete_campaign" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.delete_campaign" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#delete_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete one Coupon # @param application_id [Integer] # @param campaign_id [Integer] # @param coupon_id [String] The ID of the coupon code to delete # @param [Hash] opts the optional parameters # @return [nil] def delete_coupon(application_id, campaign_id, coupon_id, opts = {}) delete_coupon_with_http_info(application_id, campaign_id, coupon_id, opts) nil end # Delete one Coupon # @param application_id [Integer] # @param campaign_id [Integer] # @param coupon_id [String] The ID of the coupon code to delete # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_coupon_with_http_info(application_id, campaign_id, coupon_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.delete_coupon ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.delete_coupon" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.delete_coupon" end # verify the required parameter 'coupon_id' is set if @api_client.config.client_side_validation && coupon_id.nil? fail ArgumentError, "Missing the required parameter 'coupon_id' when calling ManagementApi.delete_coupon" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'couponId' + '}', CGI.escape(coupon_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#delete_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete Coupons # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :starts_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :starts_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :expires_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :expires_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @return [nil] def delete_coupons(application_id, campaign_id, opts = {}) delete_coupons_with_http_info(application_id, campaign_id, opts) nil end # Delete Coupons # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :starts_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :starts_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :expires_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :expires_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_coupons_with_http_info(application_id, campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.delete_coupons ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.delete_coupons" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.delete_coupons" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'startsAfter'] = opts[:'starts_after'] if !opts[:'starts_after'].nil? query_params[:'startsBefore'] = opts[:'starts_before'] if !opts[:'starts_before'].nil? query_params[:'expiresAfter'] = opts[:'expires_after'] if !opts[:'expires_after'].nil? query_params[:'expiresBefore'] = opts[:'expires_before'] if !opts[:'expires_before'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#delete_coupons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete one Referral # @param application_id [Integer] # @param campaign_id [Integer] # @param referral_id [String] The ID of the referral code to delete # @param [Hash] opts the optional parameters # @return [nil] def delete_referral(application_id, campaign_id, referral_id, opts = {}) delete_referral_with_http_info(application_id, campaign_id, referral_id, opts) nil end # Delete one Referral # @param application_id [Integer] # @param campaign_id [Integer] # @param referral_id [String] The ID of the referral code to delete # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_referral_with_http_info(application_id, campaign_id, referral_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.delete_referral ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.delete_referral" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.delete_referral" end # verify the required parameter 'referral_id' is set if @api_client.config.client_side_validation && referral_id.nil? fail ArgumentError, "Missing the required parameter 'referral_id' when calling ManagementApi.delete_referral" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/{referralId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'referralId' + '}', CGI.escape(referral_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#delete_referral\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Ruleset # @param application_id [Integer] # @param campaign_id [Integer] # @param ruleset_id [Integer] # @param [Hash] opts the optional parameters # @return [nil] def delete_ruleset(application_id, campaign_id, ruleset_id, opts = {}) delete_ruleset_with_http_info(application_id, campaign_id, ruleset_id, opts) nil end # Delete a Ruleset # @param application_id [Integer] # @param campaign_id [Integer] # @param ruleset_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_ruleset_with_http_info(application_id, campaign_id, ruleset_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.delete_ruleset ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.delete_ruleset" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.delete_ruleset" end # verify the required parameter 'ruleset_id' is set if @api_client.config.client_side_validation && ruleset_id.nil? fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling ManagementApi.delete_ruleset" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'rulesetId' + '}', CGI.escape(ruleset_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#delete_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get access logs for application (with total count) # @param application_id [Integer] # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param [Hash] opts the optional parameters # @option opts [String] :path Only return results where the request path matches the given regular expression. # @option opts [String] :method Only return results where the request method matches the given regular expression. # @option opts [String] :status Filter results by HTTP status codes. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse2009] def get_access_logs(application_id, range_start, range_end, opts = {}) data, _status_code, _headers = get_access_logs_with_http_info(application_id, range_start, range_end, opts) data end # Get access logs for application (with total count) # @param application_id [Integer] # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param [Hash] opts the optional parameters # @option opts [String] :path Only return results where the request path matches the given regular expression. # @option opts [String] :method Only return results where the request method matches the given regular expression. # @option opts [String] :status Filter results by HTTP status codes. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers def get_access_logs_with_http_info(application_id, range_start, range_end, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_access_logs ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_access_logs" end # verify the required parameter 'range_start' is set if @api_client.config.client_side_validation && range_start.nil? fail ArgumentError, "Missing the required parameter 'range_start' when calling ManagementApi.get_access_logs" end # verify the required parameter 'range_end' is set if @api_client.config.client_side_validation && range_end.nil? fail ArgumentError, "Missing the required parameter 'range_end' when calling ManagementApi.get_access_logs" end allowable_values = ["get", "put", "post", "delete", "patch"] if @api_client.config.client_side_validation && opts[:'method'] && !allowable_values.include?(opts[:'method']) fail ArgumentError, "invalid value for \"method\", must be one of #{allowable_values}" end allowable_values = ["success", "error"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/access_logs'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'rangeStart'] = range_start query_params[:'rangeEnd'] = range_end query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil? query_params[:'method'] = opts[:'method'] if !opts[:'method'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2009' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_access_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get access logs for application # @param application_id [Integer] # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param [Hash] opts the optional parameters # @option opts [String] :path Only return results where the request path matches the given regular expression. # @option opts [String] :method Only return results where the request method matches the given regular expression. # @option opts [String] :status Filter results by HTTP status codes. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse20010] def get_access_logs_without_total_count(application_id, range_start, range_end, opts = {}) data, _status_code, _headers = get_access_logs_without_total_count_with_http_info(application_id, range_start, range_end, opts) data end # Get access logs for application # @param application_id [Integer] # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param [Hash] opts the optional parameters # @option opts [String] :path Only return results where the request path matches the given regular expression. # @option opts [String] :method Only return results where the request method matches the given regular expression. # @option opts [String] :status Filter results by HTTP status codes. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse20010, Integer, Hash)>] InlineResponse20010 data, response status code and response headers def get_access_logs_without_total_count_with_http_info(application_id, range_start, range_end, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_access_logs_without_total_count ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_access_logs_without_total_count" end # verify the required parameter 'range_start' is set if @api_client.config.client_side_validation && range_start.nil? fail ArgumentError, "Missing the required parameter 'range_start' when calling ManagementApi.get_access_logs_without_total_count" end # verify the required parameter 'range_end' is set if @api_client.config.client_side_validation && range_end.nil? fail ArgumentError, "Missing the required parameter 'range_end' when calling ManagementApi.get_access_logs_without_total_count" end allowable_values = ["get", "put", "post", "delete", "patch"] if @api_client.config.client_side_validation && opts[:'method'] && !allowable_values.include?(opts[:'method']) fail ArgumentError, "invalid value for \"method\", must be one of #{allowable_values}" end allowable_values = ["success", "error"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/access_logs/no_total'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'rangeStart'] = range_start query_params[:'rangeEnd'] = range_end query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil? query_params[:'method'] = opts[:'method'] if !opts[:'method'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20010' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_access_logs_without_total_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Account Details # Return the details of your companies Talon.One account. # @param account_id [Integer] # @param [Hash] opts the optional parameters # @return [Account] def get_account(account_id, opts = {}) data, _status_code, _headers = get_account_with_http_info(account_id, opts) data end # Get Account Details # Return the details of your companies Talon.One account. # @param account_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(Account, Integer, Hash)>] Account data, response status code and response headers def get_account_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_account ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling ManagementApi.get_account" end # resource path local_var_path = '/v1/accounts/{accountId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Account' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Account Analytics # Return the analytics of your companies Talon.One account. # @param account_id [Integer] # @param [Hash] opts the optional parameters # @return [AccountAnalytics] def get_account_analytics(account_id, opts = {}) data, _status_code, _headers = get_account_analytics_with_http_info(account_id, opts) data end # Get Account Analytics # Return the analytics of your companies Talon.One account. # @param account_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(AccountAnalytics, Integer, Hash)>] AccountAnalytics data, response status code and response headers def get_account_analytics_with_http_info(account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_account_analytics ...' end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling ManagementApi.get_account_analytics" end # resource path local_var_path = '/v1/accounts/{accountId}/analytics'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'AccountAnalytics' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_account_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get an additional cost # Returns additional cost for the account by its id. # @param additional_cost_id [Integer] # @param [Hash] opts the optional parameters # @return [AccountAdditionalCost] def get_additional_cost(additional_cost_id, opts = {}) data, _status_code, _headers = get_additional_cost_with_http_info(additional_cost_id, opts) data end # Get an additional cost # Returns additional cost for the account by its id. # @param additional_cost_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(AccountAdditionalCost, Integer, Hash)>] AccountAdditionalCost data, response status code and response headers def get_additional_cost_with_http_info(additional_cost_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_additional_cost ...' end # verify the required parameter 'additional_cost_id' is set if @api_client.config.client_side_validation && additional_cost_id.nil? fail ArgumentError, "Missing the required parameter 'additional_cost_id' when calling ManagementApi.get_additional_cost" end # resource path local_var_path = '/v1/additional_costs/{additionalCostId}'.sub('{' + 'additionalCostId' + '}', CGI.escape(additional_cost_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'AccountAdditionalCost' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_additional_cost\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List additional costs # Returns all the defined additional costs for the account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse20021] def get_additional_costs(opts = {}) data, _status_code, _headers = get_additional_costs_with_http_info(opts) data end # List additional costs # Returns all the defined additional costs for the account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse20021, Integer, Hash)>] InlineResponse20021 data, response status code and response headers def get_additional_costs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_additional_costs ...' end # resource path local_var_path = '/v1/additional_costs' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20021' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_additional_costs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all access logs # Fetches the access logs for the entire account. Sensitive requests (logins) are _always_ filtered from the logs. # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param [Hash] opts the optional parameters # @option opts [String] :path Only return results where the request path matches the given regular expression. # @option opts [String] :method Only return results where the request method matches the given regular expression. # @option opts [String] :status Filter results by HTTP status codes. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse2009] def get_all_access_logs(range_start, range_end, opts = {}) data, _status_code, _headers = get_all_access_logs_with_http_info(range_start, range_end, opts) data end # Get all access logs # Fetches the access logs for the entire account. Sensitive requests (logins) are _always_ filtered from the logs. # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param [Hash] opts the optional parameters # @option opts [String] :path Only return results where the request path matches the given regular expression. # @option opts [String] :method Only return results where the request method matches the given regular expression. # @option opts [String] :status Filter results by HTTP status codes. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers def get_all_access_logs_with_http_info(range_start, range_end, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_all_access_logs ...' end # verify the required parameter 'range_start' is set if @api_client.config.client_side_validation && range_start.nil? fail ArgumentError, "Missing the required parameter 'range_start' when calling ManagementApi.get_all_access_logs" end # verify the required parameter 'range_end' is set if @api_client.config.client_side_validation && range_end.nil? fail ArgumentError, "Missing the required parameter 'range_end' when calling ManagementApi.get_all_access_logs" end allowable_values = ["get", "put", "post", "delete", "patch"] if @api_client.config.client_side_validation && opts[:'method'] && !allowable_values.include?(opts[:'method']) fail ArgumentError, "invalid value for \"method\", must be one of #{allowable_values}" end allowable_values = ["success", "error"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/access_logs' # query parameters query_params = opts[:query_params] || {} query_params[:'rangeStart'] = range_start query_params[:'rangeEnd'] = range_end query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil? query_params[:'method'] = opts[:'method'] if !opts[:'method'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2009' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_all_access_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all roles. # @param [Hash] opts the optional parameters # @return [InlineResponse20030] def get_all_roles(opts = {}) data, _status_code, _headers = get_all_roles_with_http_info(opts) data end # Get all roles. # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20030, Integer, Hash)>] InlineResponse20030 data, response status code and response headers def get_all_roles_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_all_roles ...' end # resource path local_var_path = '/v1/roles' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20030' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_all_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Application # Get the application specified by the ID. # @param application_id [Integer] # @param [Hash] opts the optional parameters # @return [Application] def get_application(application_id, opts = {}) data, _status_code, _headers = get_application_with_http_info(application_id, opts) data end # Get Application # Get the application specified by the ID. # @param application_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(Application, Integer, Hash)>] Application data, response status code and response headers def get_application_with_http_info(application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application" end # resource path local_var_path = '/v1/applications/{applicationId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Application' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get report of health of application API # @param application_id [Integer] # @param [Hash] opts the optional parameters # @return [ApplicationApiHealth] def get_application_api_health(application_id, opts = {}) data, _status_code, _headers = get_application_api_health_with_http_info(application_id, opts) data end # Get report of health of application API # @param application_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(ApplicationApiHealth, Integer, Hash)>] ApplicationApiHealth data, response status code and response headers def get_application_api_health_with_http_info(application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_api_health ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application_api_health" end # resource path local_var_path = '/v1/applications/{applicationId}/health_report'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'ApplicationApiHealth' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_api_health\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Application Customer # @param application_id [Integer] # @param customer_id [Integer] # @param [Hash] opts the optional parameters # @return [ApplicationCustomer] def get_application_customer(application_id, customer_id, opts = {}) data, _status_code, _headers = get_application_customer_with_http_info(application_id, customer_id, opts) data end # Get Application Customer # @param application_id [Integer] # @param customer_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(ApplicationCustomer, Integer, Hash)>] ApplicationCustomer data, response status code and response headers def get_application_customer_with_http_info(application_id, customer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_customer ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application_customer" end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling ManagementApi.get_application_customer" end # resource path local_var_path = '/v1/applications/{applicationId}/customers/{customerId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'ApplicationCustomer' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Application Customers # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [String] :integration_id Filter results performing an exact matching against the profile integration identifier. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [Boolean] :with_total_result_size When this flag is set, the result will include the total size of the result, across all pages. This might decrease performance on large data sets. With this flag set to true, hasMore will be be true whenever there is a next page. totalResultSize will always be zero. With this flag set to false, hasMore will always be set to false. totalResultSize will contain the total number of results for this query. # @return [InlineResponse20012] def get_application_customers(application_id, opts = {}) data, _status_code, _headers = get_application_customers_with_http_info(application_id, opts) data end # List Application Customers # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [String] :integration_id Filter results performing an exact matching against the profile integration identifier. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [Boolean] :with_total_result_size When this flag is set, the result will include the total size of the result, across all pages. This might decrease performance on large data sets. With this flag set to true, hasMore will be be true whenever there is a next page. totalResultSize will always be zero. With this flag set to false, hasMore will always be set to false. totalResultSize will contain the total number of results for this query. # @return [Array<(InlineResponse20012, Integer, Hash)>] InlineResponse20012 data, response status code and response headers def get_application_customers_with_http_info(application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_customers ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application_customers" end # resource path local_var_path = '/v1/applications/{applicationId}/customers'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'integrationId'] = opts[:'integration_id'] if !opts[:'integration_id'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'withTotalResultSize'] = opts[:'with_total_result_size'] if !opts[:'with_total_result_size'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20012' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of the customer profiles that match the given attributes (with total count) # Gets a list of all the customer profiles for the account that exactly match a set of attributes. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. [Customer Profile]: https://help.talon.one/hc/en-us/articles/360005130739-Data-Model#CustomerProfile # @param body [ApplicationCustomerSearch] # @param [Hash] opts the optional parameters # @return [InlineResponse20013] def get_application_customers_by_attributes(body, opts = {}) data, _status_code, _headers = get_application_customers_by_attributes_with_http_info(body, opts) data end # Get a list of the customer profiles that match the given attributes (with total count) # Gets a list of all the customer profiles for the account that exactly match a set of attributes. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. [Customer Profile]: https://help.talon.one/hc/en-us/articles/360005130739-Data-Model#CustomerProfile # @param body [ApplicationCustomerSearch] # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse20013, Integer, Hash)>] InlineResponse20013 data, response status code and response headers def get_application_customers_by_attributes_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_customers_by_attributes ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.get_application_customers_by_attributes" end # resource path local_var_path = '/v1/application_customer_search' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse20013' # auth_names auth_names = opts[:auth_names] || ['integration_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_customers_by_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Applications Event Types # Get all of the distinct values of the Event `type` property for events recorded in the application. See also: [Track an event](/integration-api/reference/#trackEvent) # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse20019] def get_application_event_types(application_id, opts = {}) data, _status_code, _headers = get_application_event_types_with_http_info(application_id, opts) data end # List Applications Event Types # Get all of the distinct values of the Event `type` property for events recorded in the application. See also: [Track an event](/integration-api/reference/#trackEvent) # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse20019, Integer, Hash)>] InlineResponse20019 data, response status code and response headers def get_application_event_types_with_http_info(application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_event_types ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application_event_types" end # resource path local_var_path = '/v1/applications/{applicationId}/event_types'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20019' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_event_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Applications Events (with total count) # Lists all events recorded for an application. # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :type Comma-separated list of types by which to filter events. Must be exact match(es). # @option opts [DateTime] :created_before Only return events created before this date # @option opts [DateTime] :created_after Only return events created after this date # @option opts [String] :session Session integration ID filter for events. Must be exact match. # @option opts [String] :profile Profile integration ID filter for events. Must be exact match. # @option opts [String] :customer_name Customer name filter for events. Will match substrings case-insensitively. # @option opts [String] :customer_email Customer e-mail address filter for events. Will match substrings case-insensitively. # @option opts [String] :coupon_code Coupon code # @option opts [String] :referral_code Referral code # @option opts [String] :rule_query Rule name filter for events # @option opts [String] :campaign_query Campaign name filter for events # @return [InlineResponse20017] def get_application_events(application_id, opts = {}) data, _status_code, _headers = get_application_events_with_http_info(application_id, opts) data end # List Applications Events (with total count) # Lists all events recorded for an application. # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :type Comma-separated list of types by which to filter events. Must be exact match(es). # @option opts [DateTime] :created_before Only return events created before this date # @option opts [DateTime] :created_after Only return events created after this date # @option opts [String] :session Session integration ID filter for events. Must be exact match. # @option opts [String] :profile Profile integration ID filter for events. Must be exact match. # @option opts [String] :customer_name Customer name filter for events. Will match substrings case-insensitively. # @option opts [String] :customer_email Customer e-mail address filter for events. Will match substrings case-insensitively. # @option opts [String] :coupon_code Coupon code # @option opts [String] :referral_code Referral code # @option opts [String] :rule_query Rule name filter for events # @option opts [String] :campaign_query Campaign name filter for events # @return [Array<(InlineResponse20017, Integer, Hash)>] InlineResponse20017 data, response status code and response headers def get_application_events_with_http_info(application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_events ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application_events" end if @api_client.config.client_side_validation && !opts[:'customer_name'].nil? && opts[:'customer_name'].to_s.length < 2 fail ArgumentError, 'invalid value for "opts[:"customer_name"]" when calling ManagementApi.get_application_events, the character length must be great than or equal to 2.' end if @api_client.config.client_side_validation && !opts[:'customer_email'].nil? && opts[:'customer_email'].to_s.length < 2 fail ArgumentError, 'invalid value for "opts[:"customer_email"]" when calling ManagementApi.get_application_events, the character length must be great than or equal to 2.' end # resource path local_var_path = '/v1/applications/{applicationId}/events'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'session'] = opts[:'session'] if !opts[:'session'].nil? query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil? query_params[:'customerName'] = opts[:'customer_name'] if !opts[:'customer_name'].nil? query_params[:'customerEmail'] = opts[:'customer_email'] if !opts[:'customer_email'].nil? query_params[:'couponCode'] = opts[:'coupon_code'] if !opts[:'coupon_code'].nil? query_params[:'referralCode'] = opts[:'referral_code'] if !opts[:'referral_code'].nil? query_params[:'ruleQuery'] = opts[:'rule_query'] if !opts[:'rule_query'].nil? query_params[:'campaignQuery'] = opts[:'campaign_query'] if !opts[:'campaign_query'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20017' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Applications Events # Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only if there are more results. # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :type Comma-separated list of types by which to filter events. Must be exact match(es). # @option opts [DateTime] :created_before Only return events created before this date # @option opts [DateTime] :created_after Only return events created after this date # @option opts [String] :session Session integration ID filter for events. Must be exact match. # @option opts [String] :profile Profile integration ID filter for events. Must be exact match. # @option opts [String] :customer_name Customer name filter for events. Will match substrings case-insensitively. # @option opts [String] :customer_email Customer e-mail address filter for events. Will match substrings case-insensitively. # @option opts [String] :coupon_code Coupon code # @option opts [String] :referral_code Referral code # @option opts [String] :rule_query Rule name filter for events # @option opts [String] :campaign_query Campaign name filter for events # @return [InlineResponse20018] def get_application_events_without_total_count(application_id, opts = {}) data, _status_code, _headers = get_application_events_without_total_count_with_http_info(application_id, opts) data end # List Applications Events # Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only if there are more results. # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :type Comma-separated list of types by which to filter events. Must be exact match(es). # @option opts [DateTime] :created_before Only return events created before this date # @option opts [DateTime] :created_after Only return events created after this date # @option opts [String] :session Session integration ID filter for events. Must be exact match. # @option opts [String] :profile Profile integration ID filter for events. Must be exact match. # @option opts [String] :customer_name Customer name filter for events. Will match substrings case-insensitively. # @option opts [String] :customer_email Customer e-mail address filter for events. Will match substrings case-insensitively. # @option opts [String] :coupon_code Coupon code # @option opts [String] :referral_code Referral code # @option opts [String] :rule_query Rule name filter for events # @option opts [String] :campaign_query Campaign name filter for events # @return [Array<(InlineResponse20018, Integer, Hash)>] InlineResponse20018 data, response status code and response headers def get_application_events_without_total_count_with_http_info(application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_events_without_total_count ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application_events_without_total_count" end if @api_client.config.client_side_validation && !opts[:'customer_name'].nil? && opts[:'customer_name'].to_s.length < 2 fail ArgumentError, 'invalid value for "opts[:"customer_name"]" when calling ManagementApi.get_application_events_without_total_count, the character length must be great than or equal to 2.' end if @api_client.config.client_side_validation && !opts[:'customer_email'].nil? && opts[:'customer_email'].to_s.length < 2 fail ArgumentError, 'invalid value for "opts[:"customer_email"]" when calling ManagementApi.get_application_events_without_total_count, the character length must be great than or equal to 2.' end # resource path local_var_path = '/v1/applications/{applicationId}/events/no_total'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'session'] = opts[:'session'] if !opts[:'session'].nil? query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil? query_params[:'customerName'] = opts[:'customer_name'] if !opts[:'customer_name'].nil? query_params[:'customerEmail'] = opts[:'customer_email'] if !opts[:'customer_email'].nil? query_params[:'couponCode'] = opts[:'coupon_code'] if !opts[:'coupon_code'].nil? query_params[:'referralCode'] = opts[:'referral_code'] if !opts[:'referral_code'].nil? query_params[:'ruleQuery'] = opts[:'rule_query'] if !opts[:'rule_query'].nil? query_params[:'campaignQuery'] = opts[:'campaign_query'] if !opts[:'campaign_query'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20018' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_events_without_total_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Application Session # @param application_id [Integer] # @param session_id [Integer] # @param [Hash] opts the optional parameters # @return [ApplicationSession] def get_application_session(application_id, session_id, opts = {}) data, _status_code, _headers = get_application_session_with_http_info(application_id, session_id, opts) data end # Get Application Session # @param application_id [Integer] # @param session_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(ApplicationSession, Integer, Hash)>] ApplicationSession data, response status code and response headers def get_application_session_with_http_info(application_id, session_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_session ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application_session" end # verify the required parameter 'session_id' is set if @api_client.config.client_side_validation && session_id.nil? fail ArgumentError, "Missing the required parameter 'session_id' when calling ManagementApi.get_application_session" end # resource path local_var_path = '/v1/applications/{applicationId}/sessions/{sessionId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'ApplicationSession' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Application Sessions # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :profile Profile integration ID filter for sessions. Must be exact match. # @option opts [String] :state Filter by sessions with this state. Must be exact match. # @option opts [DateTime] :created_before Only return events created before this date # @option opts [DateTime] :created_after Only return events created after this date # @option opts [String] :coupon Filter by sessions with this coupon. Must be exact match. # @option opts [String] :referral Filter by sessions with this referral. Must be exact match. # @option opts [String] :integration_id Filter by sessions with this integrationId. Must be exact match. # @return [InlineResponse20016] def get_application_sessions(application_id, opts = {}) data, _status_code, _headers = get_application_sessions_with_http_info(application_id, opts) data end # List Application Sessions # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :profile Profile integration ID filter for sessions. Must be exact match. # @option opts [String] :state Filter by sessions with this state. Must be exact match. # @option opts [DateTime] :created_before Only return events created before this date # @option opts [DateTime] :created_after Only return events created after this date # @option opts [String] :coupon Filter by sessions with this coupon. Must be exact match. # @option opts [String] :referral Filter by sessions with this referral. Must be exact match. # @option opts [String] :integration_id Filter by sessions with this integrationId. Must be exact match. # @return [Array<(InlineResponse20016, Integer, Hash)>] InlineResponse20016 data, response status code and response headers def get_application_sessions_with_http_info(application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_application_sessions ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_application_sessions" end allowable_values = ["open", "closed", "cancelled"] if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state']) fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/sessions'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil? query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'coupon'] = opts[:'coupon'] if !opts[:'coupon'].nil? query_params[:'referral'] = opts[:'referral'] if !opts[:'referral'].nil? query_params[:'integrationId'] = opts[:'integration_id'] if !opts[:'integration_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20016' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_application_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Applications # List all application in the current account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse2001] def get_applications(opts = {}) data, _status_code, _headers = get_applications_with_http_info(opts) data end # List Applications # List all application in the current account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers def get_applications_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_applications ...' end # resource path local_var_path = '/v1/applications' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2001' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a custom attribute # Returns custom attribute for the account by its id. # @param attribute_id [Integer] # @param [Hash] opts the optional parameters # @return [Attribute] def get_attribute(attribute_id, opts = {}) data, _status_code, _headers = get_attribute_with_http_info(attribute_id, opts) data end # Get a custom attribute # Returns custom attribute for the account by its id. # @param attribute_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(Attribute, Integer, Hash)>] Attribute data, response status code and response headers def get_attribute_with_http_info(attribute_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_attribute ...' end # verify the required parameter 'attribute_id' is set if @api_client.config.client_side_validation && attribute_id.nil? fail ArgumentError, "Missing the required parameter 'attribute_id' when calling ManagementApi.get_attribute" end # resource path local_var_path = '/v1/attributes/{attributeId}'.sub('{' + 'attributeId' + '}', CGI.escape(attribute_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Attribute' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List custom attributes # Returns all the defined custom attributes for the account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse20020] def get_attributes(opts = {}) data, _status_code, _headers = get_attributes_with_http_info(opts) data end # List custom attributes # Returns all the defined custom attributes for the account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse20020, Integer, Hash)>] InlineResponse20020 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: ManagementApi.get_attributes ...' end # resource path local_var_path = '/v1/attributes' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20020' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a Campaign # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @return [Campaign] def get_campaign(application_id, campaign_id, opts = {}) data, _status_code, _headers = get_campaign_with_http_info(application_id, campaign_id, opts) data end # Get a Campaign # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(Campaign, Integer, Hash)>] Campaign data, response status code and response headers def get_campaign_with_http_info(application_id, campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_campaign ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_campaign" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_campaign" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Campaign' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get analytics of campaigns # @param application_id [Integer] # @param campaign_id [Integer] # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param [Hash] opts the optional parameters # @option opts [String] :granularity The time interval between the results in the returned time-series. # @return [InlineResponse20011] def get_campaign_analytics(application_id, campaign_id, range_start, range_end, opts = {}) data, _status_code, _headers = get_campaign_analytics_with_http_info(application_id, campaign_id, range_start, range_end, opts) data end # Get analytics of campaigns # @param application_id [Integer] # @param campaign_id [Integer] # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param [Hash] opts the optional parameters # @option opts [String] :granularity The time interval between the results in the returned time-series. # @return [Array<(InlineResponse20011, Integer, Hash)>] InlineResponse20011 data, response status code and response headers def get_campaign_analytics_with_http_info(application_id, campaign_id, range_start, range_end, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_campaign_analytics ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_campaign_analytics" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_campaign_analytics" end # verify the required parameter 'range_start' is set if @api_client.config.client_side_validation && range_start.nil? fail ArgumentError, "Missing the required parameter 'range_start' when calling ManagementApi.get_campaign_analytics" end # verify the required parameter 'range_end' is set if @api_client.config.client_side_validation && range_end.nil? fail ArgumentError, "Missing the required parameter 'range_end' when calling ManagementApi.get_campaign_analytics" end allowable_values = ["1 hour", "1 day", "1 week", "1 month", "1 year"] if @api_client.config.client_side_validation && opts[:'granularity'] && !allowable_values.include?(opts[:'granularity']) fail ArgumentError, "invalid value for \"granularity\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/analytics'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'rangeStart'] = range_start query_params[:'rangeEnd'] = range_end query_params[:'granularity'] = opts[:'granularity'] if !opts[:'granularity'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20011' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_campaign_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of all campaigns that match the given attributes # Gets a list of all the campaigns that exactly match a set of attributes. # @param application_id [Integer] # @param body [CampaignSearch] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :campaign_state Filter results by the state of the campaign. # @return [InlineResponse2002] def get_campaign_by_attributes(application_id, body, opts = {}) data, _status_code, _headers = get_campaign_by_attributes_with_http_info(application_id, body, opts) data end # Get a list of all campaigns that match the given attributes # Gets a list of all the campaigns that exactly match a set of attributes. # @param application_id [Integer] # @param body [CampaignSearch] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :campaign_state Filter results by the state of the campaign. # @return [Array<(InlineResponse2002, Integer, Hash)>] InlineResponse2002 data, response status code and response headers def get_campaign_by_attributes_with_http_info(application_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_campaign_by_attributes ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_campaign_by_attributes" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.get_campaign_by_attributes" end allowable_values = ["enabled", "disabled", "archived", "draft", "scheduled", "running", "expired"] if @api_client.config.client_side_validation && opts[:'campaign_state'] && !allowable_values.include?(opts[:'campaign_state']) fail ArgumentError, "invalid value for \"campaign_state\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns_search'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'campaignState'] = opts[:'campaign_state'] if !opts[:'campaign_state'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2002' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_campaign_by_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List your Campaigns # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :campaign_state Filter results by the state of the campaign. # @option opts [String] :name Filter results performing case-insensitive matching against the name of the campaign. # @option opts [String] :tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. # @option opts [Integer] :campaign_group_id Filter results to campaigns owned by the specified campaign group ID. # @return [InlineResponse2002] def get_campaigns(application_id, opts = {}) data, _status_code, _headers = get_campaigns_with_http_info(application_id, opts) data end # List your Campaigns # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :campaign_state Filter results by the state of the campaign. # @option opts [String] :name Filter results performing case-insensitive matching against the name of the campaign. # @option opts [String] :tags Filter results performing case-insensitive matching against the tags of the campaign. When used in conjunction with the \"name\" query parameter, a logical OR will be performed to search both tags and name for the provided values # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. # @option opts [Integer] :campaign_group_id Filter results to campaigns owned by the specified campaign group ID. # @return [Array<(InlineResponse2002, Integer, Hash)>] InlineResponse2002 data, response status code and response headers def get_campaigns_with_http_info(application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_campaigns ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_campaigns" end allowable_values = ["enabled", "disabled", "archived", "draft", "scheduled", "running", "expired"] if @api_client.config.client_side_validation && opts[:'campaign_state'] && !allowable_values.include?(opts[:'campaign_state']) fail ArgumentError, "invalid value for \"campaign_state\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'campaignState'] = opts[:'campaign_state'] if !opts[:'campaign_state'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'campaignGroupId'] = opts[:'campaign_group_id'] if !opts[:'campaign_group_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2002' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get audit log for an account # Get list of changes caused by API calls for an account. Only accessible for admins. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [Integer] :application_id # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. # @option opts [Boolean] :with_total_result_size When this flag is set, the result will include the total size of the result, across all pages. This might decrease performance on large data sets. With this flag set to true, hasMore will be be true whenever there is a next page. totalResultSize will always be zero. With this flag set to false, hasMore will always be set to false. totalResultSize will contain the total number of results for this query. # @option opts [Boolean] :include_old When this flag is set to false, the state without the change will not be returned. The default value is true. # @return [InlineResponse20027] def get_changes(opts = {}) data, _status_code, _headers = get_changes_with_http_info(opts) data end # Get audit log for an account # Get list of changes caused by API calls for an account. Only accessible for admins. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [Integer] :application_id # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. # @option opts [Boolean] :with_total_result_size When this flag is set, the result will include the total size of the result, across all pages. This might decrease performance on large data sets. With this flag set to true, hasMore will be be true whenever there is a next page. totalResultSize will always be zero. With this flag set to false, hasMore will always be set to false. totalResultSize will contain the total number of results for this query. # @option opts [Boolean] :include_old When this flag is set to false, the state without the change will not be returned. The default value is true. # @return [Array<(InlineResponse20027, Integer, Hash)>] InlineResponse20027 data, response status code and response headers def get_changes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_changes ...' end # resource path local_var_path = '/v1/changes' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'applicationId'] = opts[:'application_id'] if !opts[:'application_id'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'withTotalResultSize'] = opts[:'with_total_result_size'] if !opts[:'with_total_result_size'].nil? query_params[:'includeOld'] = opts[:'include_old'] if !opts[:'include_old'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20027' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_changes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Coupons (with total count) # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :starts_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :starts_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :expires_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :expires_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @return [InlineResponse2004] def get_coupons(application_id, campaign_id, opts = {}) data, _status_code, _headers = get_coupons_with_http_info(application_id, campaign_id, opts) data end # List Coupons (with total count) # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :starts_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :starts_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :expires_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :expires_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers def get_coupons_with_http_info(application_id, campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_coupons ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_coupons" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_coupons" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'startsAfter'] = opts[:'starts_after'] if !opts[:'starts_after'].nil? query_params[:'startsBefore'] = opts[:'starts_before'] if !opts[:'starts_before'].nil? query_params[:'expiresAfter'] = opts[:'expires_after'] if !opts[:'expires_after'].nil? query_params[:'expiresBefore'] = opts[:'expires_before'] if !opts[:'expires_before'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2004' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_coupons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of the coupons that match the given attributes # Gets a list of all the coupons that exactly match a set of attributes. The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request. # @param application_id [Integer] # @param campaign_id [Integer] # @param body [CouponSearch] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @option opts [String] :batch_id Filter results by batches of coupons # @return [InlineResponse2004] def get_coupons_by_attributes(application_id, campaign_id, body, opts = {}) data, _status_code, _headers = get_coupons_by_attributes_with_http_info(application_id, campaign_id, body, opts) data end # Get a list of the coupons that match the given attributes # Gets a list of all the coupons that exactly match a set of attributes. The match is successful if all the attributes of the request are found in a coupon, even if the coupon has more attributes that are not present on the request. # @param application_id [Integer] # @param campaign_id [Integer] # @param body [CouponSearch] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @option opts [String] :batch_id Filter results by batches of coupons # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers def get_coupons_by_attributes_with_http_info(application_id, campaign_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_coupons_by_attributes ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_coupons_by_attributes" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_coupons_by_attributes" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.get_coupons_by_attributes" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2004' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_coupons_by_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of the coupons that match the given attributes in all active campaigns of an application (with total count) # Gets a list of all the coupons with attributes matching the query criteria Application wide # @param application_id [Integer] # @param body [CouponSearch] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @option opts [String] :campaign_state Filter results by the state of the campaign. # @return [InlineResponse2004] def get_coupons_by_attributes_application_wide(application_id, body, opts = {}) data, _status_code, _headers = get_coupons_by_attributes_application_wide_with_http_info(application_id, body, opts) data end # Get a list of the coupons that match the given attributes in all active campaigns of an application (with total count) # Gets a list of all the coupons with attributes matching the query criteria Application wide # @param application_id [Integer] # @param body [CouponSearch] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @option opts [String] :campaign_state Filter results by the state of the campaign. # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers def get_coupons_by_attributes_application_wide_with_http_info(application_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_coupons_by_attributes_application_wide ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_coupons_by_attributes_application_wide" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.get_coupons_by_attributes_application_wide" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end allowable_values = ["enabled", "disabled", "archived", "draft", "scheduled", "running", "expired"] if @api_client.config.client_side_validation && opts[:'campaign_state'] && !allowable_values.include?(opts[:'campaign_state']) fail ArgumentError, "invalid value for \"campaign_state\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/coupons_search'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'campaignState'] = opts[:'campaign_state'] if !opts[:'campaign_state'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2004' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_coupons_by_attributes_application_wide\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Coupons # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @return [InlineResponse2005] def get_coupons_without_total_count(application_id, campaign_id, opts = {}) data, _status_code, _headers = get_coupons_without_total_count_with_http_info(application_id, campaign_id, opts) data end # List Coupons # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers def get_coupons_without_total_count_with_http_info(application_id, campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_coupons_without_total_count ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_coupons_without_total_count" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_coupons_without_total_count" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/no_total'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2005' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_coupons_without_total_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Activity Report for Single Customer # Fetch summary report for single application customer based on a time range # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param application_id [Integer] # @param customer_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [CustomerActivityReport] def get_customer_activity_report(range_start, range_end, application_id, customer_id, opts = {}) data, _status_code, _headers = get_customer_activity_report_with_http_info(range_start, range_end, application_id, customer_id, opts) data end # Get Activity Report for Single Customer # Fetch summary report for single application customer based on a time range # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param application_id [Integer] # @param customer_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [Array<(CustomerActivityReport, Integer, Hash)>] CustomerActivityReport data, response status code and response headers def get_customer_activity_report_with_http_info(range_start, range_end, application_id, customer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_customer_activity_report ...' end # verify the required parameter 'range_start' is set if @api_client.config.client_side_validation && range_start.nil? fail ArgumentError, "Missing the required parameter 'range_start' when calling ManagementApi.get_customer_activity_report" end # verify the required parameter 'range_end' is set if @api_client.config.client_side_validation && range_end.nil? fail ArgumentError, "Missing the required parameter 'range_end' when calling ManagementApi.get_customer_activity_report" end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_customer_activity_report" end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling ManagementApi.get_customer_activity_report" end # resource path local_var_path = '/v1/applications/{applicationId}/customer_activity_reports/{customerId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'rangeStart'] = range_start query_params[:'rangeEnd'] = range_end query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'CustomerActivityReport' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_customer_activity_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Activity Reports for Application Customers (with total count) # Fetch summary reports for all application customers based on a time range # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :name Only return reports matching the customer name # @option opts [String] :integration_id Only return reports matching the integrationId # @option opts [String] :campaign_name Only return reports matching the campaignName # @option opts [String] :advocate_name Only return reports matching the current customer referrer name # @return [InlineResponse20014] def get_customer_activity_reports(range_start, range_end, application_id, opts = {}) data, _status_code, _headers = get_customer_activity_reports_with_http_info(range_start, range_end, application_id, opts) data end # Get Activity Reports for Application Customers (with total count) # Fetch summary reports for all application customers based on a time range # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :name Only return reports matching the customer name # @option opts [String] :integration_id Only return reports matching the integrationId # @option opts [String] :campaign_name Only return reports matching the campaignName # @option opts [String] :advocate_name Only return reports matching the current customer referrer name # @return [Array<(InlineResponse20014, Integer, Hash)>] InlineResponse20014 data, response status code and response headers def get_customer_activity_reports_with_http_info(range_start, range_end, application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_customer_activity_reports ...' end # verify the required parameter 'range_start' is set if @api_client.config.client_side_validation && range_start.nil? fail ArgumentError, "Missing the required parameter 'range_start' when calling ManagementApi.get_customer_activity_reports" end # verify the required parameter 'range_end' is set if @api_client.config.client_side_validation && range_end.nil? fail ArgumentError, "Missing the required parameter 'range_end' when calling ManagementApi.get_customer_activity_reports" end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_customer_activity_reports" end # resource path local_var_path = '/v1/applications/{applicationId}/customer_activity_reports'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'rangeStart'] = range_start query_params[:'rangeEnd'] = range_end query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'integrationId'] = opts[:'integration_id'] if !opts[:'integration_id'].nil? query_params[:'campaignName'] = opts[:'campaign_name'] if !opts[:'campaign_name'].nil? query_params[:'advocateName'] = opts[:'advocate_name'] if !opts[:'advocate_name'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20014' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_customer_activity_reports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Activity Reports for Application Customers # Fetch summary reports for all application customers based on a time range. Instead of having the total number of results in the response, this endpoint only if there are more results. # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :name Only return reports matching the customer name # @option opts [String] :integration_id Only return reports matching the integrationId # @option opts [String] :campaign_name Only return reports matching the campaignName # @option opts [String] :advocate_name Only return reports matching the current customer referrer name # @return [InlineResponse20015] def get_customer_activity_reports_without_total_count(range_start, range_end, application_id, opts = {}) data, _status_code, _headers = get_customer_activity_reports_without_total_count_with_http_info(range_start, range_end, application_id, opts) data end # Get Activity Reports for Application Customers # Fetch summary reports for all application customers based on a time range. Instead of having the total number of results in the response, this endpoint only if there are more results. # @param range_start [DateTime] Only return results from after this timestamp, must be an RFC3339 timestamp string # @param range_end [DateTime] Only return results from before this timestamp, must be an RFC3339 timestamp string # @param application_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :name Only return reports matching the customer name # @option opts [String] :integration_id Only return reports matching the integrationId # @option opts [String] :campaign_name Only return reports matching the campaignName # @option opts [String] :advocate_name Only return reports matching the current customer referrer name # @return [Array<(InlineResponse20015, Integer, Hash)>] InlineResponse20015 data, response status code and response headers def get_customer_activity_reports_without_total_count_with_http_info(range_start, range_end, application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_customer_activity_reports_without_total_count ...' end # verify the required parameter 'range_start' is set if @api_client.config.client_side_validation && range_start.nil? fail ArgumentError, "Missing the required parameter 'range_start' when calling ManagementApi.get_customer_activity_reports_without_total_count" end # verify the required parameter 'range_end' is set if @api_client.config.client_side_validation && range_end.nil? fail ArgumentError, "Missing the required parameter 'range_end' when calling ManagementApi.get_customer_activity_reports_without_total_count" end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_customer_activity_reports_without_total_count" end # resource path local_var_path = '/v1/applications/{applicationId}/customer_activity_reports/no_total'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'rangeStart'] = range_start query_params[:'rangeEnd'] = range_end query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'integrationId'] = opts[:'integration_id'] if !opts[:'integration_id'].nil? query_params[:'campaignName'] = opts[:'campaign_name'] if !opts[:'campaign_name'].nil? query_params[:'advocateName'] = opts[:'advocate_name'] if !opts[:'advocate_name'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20015' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_customer_activity_reports_without_total_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Analytics Report for a Customer # Fetch analytics for single application customer # @param application_id [Integer] # @param customer_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [CustomerAnalytics] def get_customer_analytics(application_id, customer_id, opts = {}) data, _status_code, _headers = get_customer_analytics_with_http_info(application_id, customer_id, opts) data end # Get Analytics Report for a Customer # Fetch analytics for single application customer # @param application_id [Integer] # @param customer_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(CustomerAnalytics, Integer, Hash)>] CustomerAnalytics data, response status code and response headers def get_customer_analytics_with_http_info(application_id, customer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_customer_analytics ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_customer_analytics" end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling ManagementApi.get_customer_analytics" end # resource path local_var_path = '/v1/applications/{applicationId}/customers/{customerId}/analytics'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'CustomerAnalytics' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_customer_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Customer Profile # @param customer_id [Integer] # @param [Hash] opts the optional parameters # @return [ApplicationCustomer] def get_customer_profile(customer_id, opts = {}) data, _status_code, _headers = get_customer_profile_with_http_info(customer_id, opts) data end # Get Customer Profile # @param customer_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(ApplicationCustomer, Integer, Hash)>] ApplicationCustomer data, response status code and response headers def get_customer_profile_with_http_info(customer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_customer_profile ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling ManagementApi.get_customer_profile" end # resource path local_var_path = '/v1/customers/{customerId}'.sub('{' + 'customerId' + '}', CGI.escape(customer_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'ApplicationCustomer' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_customer_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Customer Profiles # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [InlineResponse20013] def get_customer_profiles(opts = {}) data, _status_code, _headers = get_customer_profiles_with_http_info(opts) data end # List Customer Profiles # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [Array<(InlineResponse20013, Integer, Hash)>] InlineResponse20013 data, response status code and response headers def get_customer_profiles_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_customer_profiles ...' end # resource path local_var_path = '/v1/customers/no_total' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20013' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_customer_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of the customer profiles that match the given attributes # Gets a list of all the customer profiles for the account that exactly match a set of attributes. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. [Customer Profile]: https://help.talon.one/hc/en-us/articles/360005130739-Data-Model#CustomerProfile # @param body [ApplicationCustomerSearch] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [InlineResponse20013] def get_customers_by_attributes(body, opts = {}) data, _status_code, _headers = get_customers_by_attributes_with_http_info(body, opts) data end # Get a list of the customer profiles that match the given attributes # Gets a list of all the customer profiles for the account that exactly match a set of attributes. The match is successful if all the attributes of the request are found in a profile, even if the profile has more attributes that are not present on the request. [Customer Profile]: https://help.talon.one/hc/en-us/articles/360005130739-Data-Model#CustomerProfile # @param body [ApplicationCustomerSearch] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [Array<(InlineResponse20013, Integer, Hash)>] InlineResponse20013 data, response status code and response headers def get_customers_by_attributes_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_customers_by_attributes ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.get_customers_by_attributes" end # resource path local_var_path = '/v1/customer_search/no_total' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse20013' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_customers_by_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Event Types # Fetch all event type definitions for your account. Each event type can be # @param [Hash] opts the optional parameters # @option opts [String] :application_ids Filter by one or more application ids separated by comma # @option opts [String] :name Filter results to event types with the given name. This parameter implies `includeOldVersions`. # @option opts [Boolean] :include_old_versions Include all versions of every event type. (default to false) # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse20025] def get_event_types(opts = {}) data, _status_code, _headers = get_event_types_with_http_info(opts) data end # List Event Types # Fetch all event type definitions for your account. Each event type can be # @param [Hash] opts the optional parameters # @option opts [String] :application_ids Filter by one or more application ids separated by comma # @option opts [String] :name Filter results to event types with the given name. This parameter implies `includeOldVersions`. # @option opts [Boolean] :include_old_versions Include all versions of every event type. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse20025, Integer, Hash)>] InlineResponse20025 data, response status code and response headers def get_event_types_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_event_types ...' end # resource path local_var_path = '/v1/event_types' # query parameters query_params = opts[:query_params] || {} query_params[:'applicationIds'] = opts[:'application_ids'] if !opts[:'application_ids'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'includeOldVersions'] = opts[:'include_old_versions'] if !opts[:'include_old_versions'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20025' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_event_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Exports # Get a list of all past exports # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [Integer] :application_id # @option opts [Integer] :campaign_id # @option opts [String] :entity The name of the entity type that was exported. # @return [InlineResponse20028] def get_exports(opts = {}) data, _status_code, _headers = get_exports_with_http_info(opts) data end # Get Exports # Get a list of all past exports # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [Integer] :application_id # @option opts [Integer] :campaign_id # @option opts [String] :entity The name of the entity type that was exported. # @return [Array<(InlineResponse20028, Integer, Hash)>] InlineResponse20028 data, response status code and response headers def get_exports_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_exports ...' end allowable_values = ["Coupon", "Effect", "CustomerSession"] if @api_client.config.client_side_validation && opts[:'entity'] && !allowable_values.include?(opts[:'entity']) fail ArgumentError, "invalid value for \"entity\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/exports' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'applicationId'] = opts[:'application_id'] if !opts[:'application_id'].nil? query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'entity'] = opts[:'entity'] if !opts[:'entity'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20028' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_exports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Imports # Get a list of all past imports # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [InlineResponse20029] def get_imports(opts = {}) data, _status_code, _headers = get_imports_with_http_info(opts) data end # Get Imports # Get a list of all past imports # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [Array<(InlineResponse20029, Integer, Hash)>] InlineResponse20029 data, response status code and response headers def get_imports_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_imports ...' end # resource path local_var_path = '/v1/imports' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20029' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_imports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # get the Loyalty Ledger for this integrationID # Get the Loyalty Ledger for this profile integration ID. # @param program_id [String] The identifier for the application, must be unique within the account. # @param integration_id [String] The identifier for the application, must be unique within the account. # @param [Hash] opts the optional parameters # @return [LoyaltyLedger] def get_loyalty_points(program_id, integration_id, opts = {}) data, _status_code, _headers = get_loyalty_points_with_http_info(program_id, integration_id, opts) data end # get the Loyalty Ledger for this integrationID # Get the Loyalty Ledger for this profile integration ID. # @param program_id [String] The identifier for the application, must be unique within the account. # @param integration_id [String] The identifier for the application, must be unique within the account. # @param [Hash] opts the optional parameters # @return [Array<(LoyaltyLedger, Integer, Hash)>] LoyaltyLedger data, response status code and response headers def get_loyalty_points_with_http_info(program_id, integration_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_points ...' end # verify the required parameter 'program_id' is set if @api_client.config.client_side_validation && program_id.nil? fail ArgumentError, "Missing the required parameter 'program_id' when calling ManagementApi.get_loyalty_points" end # verify the required parameter 'integration_id' is set if @api_client.config.client_side_validation && integration_id.nil? fail ArgumentError, "Missing the required parameter 'integration_id' when calling ManagementApi.get_loyalty_points" end # resource path local_var_path = '/v1/loyalty_programs/{programID}/profile/{integrationID}'.sub('{' + 'programID' + '}', CGI.escape(program_id.to_s)).sub('{' + 'integrationID' + '}', CGI.escape(integration_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'LoyaltyLedger' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_loyalty_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a loyalty program # @param program_id [String] # @param [Hash] opts the optional parameters # @return [LoyaltyProgram] def get_loyalty_program(program_id, opts = {}) data, _status_code, _headers = get_loyalty_program_with_http_info(program_id, opts) data end # Get a loyalty program # @param program_id [String] # @param [Hash] opts the optional parameters # @return [Array<(LoyaltyProgram, Integer, Hash)>] LoyaltyProgram data, response status code and response headers def get_loyalty_program_with_http_info(program_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_program ...' end # verify the required parameter 'program_id' is set if @api_client.config.client_side_validation && program_id.nil? fail ArgumentError, "Missing the required parameter 'program_id' when calling ManagementApi.get_loyalty_program" end # resource path local_var_path = '/v1/loyalty_programs/{programID}'.sub('{' + 'programID' + '}', CGI.escape(program_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'LoyaltyProgram' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_loyalty_program\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List all loyalty Programs # @param [Hash] opts the optional parameters # @return [InlineResponse2008] def get_loyalty_programs(opts = {}) data, _status_code, _headers = get_loyalty_programs_with_http_info(opts) data end # List all loyalty Programs # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse2008, Integer, Hash)>] InlineResponse2008 data, response status code and response headers def get_loyalty_programs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_programs ...' end # resource path local_var_path = '/v1/loyalty_programs' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2008' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_loyalty_programs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get loyalty program statistics by loyalty program ID # @param program_id [String] # @param [Hash] opts the optional parameters # @return [LoyaltyStatistics] def get_loyalty_statistics(program_id, opts = {}) data, _status_code, _headers = get_loyalty_statistics_with_http_info(program_id, opts) data end # Get loyalty program statistics by loyalty program ID # @param program_id [String] # @param [Hash] opts the optional parameters # @return [Array<(LoyaltyStatistics, Integer, Hash)>] LoyaltyStatistics data, response status code and response headers def get_loyalty_statistics_with_http_info(program_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_statistics ...' end # verify the required parameter 'program_id' is set if @api_client.config.client_side_validation && program_id.nil? fail ArgumentError, "Missing the required parameter 'program_id' when calling ManagementApi.get_loyalty_statistics" end # resource path local_var_path = '/v1/loyalty_programs/{programID}/statistics'.sub('{' + 'programID' + '}', CGI.escape(program_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'LoyaltyStatistics' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_loyalty_statistics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Referrals (with total count) # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiry date is set and in the past. The second matches referrals in which start date is null or in the past and expiry date is null or in the future, the third matches referrals in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. # @option opts [String] :advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field # @return [InlineResponse2006] def get_referrals(application_id, campaign_id, opts = {}) data, _status_code, _headers = get_referrals_with_http_info(application_id, campaign_id, opts) data end # List Referrals (with total count) # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiry date is set and in the past. The second matches referrals in which start date is null or in the past and expiry date is null or in the future, the third matches referrals in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. # @option opts [String] :advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field # @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers def get_referrals_with_http_info(application_id, campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_referrals ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_referrals" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_referrals" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'code'] = opts[:'code'] if !opts[:'code'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'advocate'] = opts[:'advocate'] if !opts[:'advocate'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2006' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_referrals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Referrals # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiry date is set and in the past. The second matches referrals in which start date is null or in the past and expiry date is null or in the future, the third matches referrals in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. # @option opts [String] :advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field # @return [InlineResponse2007] def get_referrals_without_total_count(application_id, campaign_id, opts = {}) data, _status_code, _headers = get_referrals_without_total_count_with_http_info(application_id, campaign_id, opts) data end # List Referrals # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :code Filter results performing case-insensitive matching against the referral code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiry date is set and in the past. The second matches referrals in which start date is null or in the past and expiry date is null or in the future, the third matches referrals in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only referrals where `usageCounter < usageLimit` will be returned, \"false\" will return only referrals where `usageCounter >= usageLimit`. # @option opts [String] :advocate Filter results by match with a profile id specified in the referral's AdvocateProfileIntegrationId field # @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers def get_referrals_without_total_count_with_http_info(application_id, campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_referrals_without_total_count ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_referrals_without_total_count" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_referrals_without_total_count" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/referrals/no_total'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'code'] = opts[:'code'] if !opts[:'code'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'advocate'] = opts[:'advocate'] if !opts[:'advocate'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2007' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_referrals_without_total_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get information for the specified role. # @param role_id [Integer] # @param [Hash] opts the optional parameters # @return [Role] def get_role(role_id, opts = {}) data, _status_code, _headers = get_role_with_http_info(role_id, opts) data end # Get information for the specified role. # @param role_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(Role, Integer, Hash)>] Role data, response status code and response headers def get_role_with_http_info(role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_role ...' end # verify the required parameter 'role_id' is set if @api_client.config.client_side_validation && role_id.nil? fail ArgumentError, "Missing the required parameter 'role_id' when calling ManagementApi.get_role" end # resource path local_var_path = '/v1/roles/{roleId}'.sub('{' + 'roleId' + '}', CGI.escape(role_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Role' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a Ruleset # @param application_id [Integer] # @param campaign_id [Integer] # @param ruleset_id [Integer] # @param [Hash] opts the optional parameters # @return [Ruleset] def get_ruleset(application_id, campaign_id, ruleset_id, opts = {}) data, _status_code, _headers = get_ruleset_with_http_info(application_id, campaign_id, ruleset_id, opts) data end # Get a Ruleset # @param application_id [Integer] # @param campaign_id [Integer] # @param ruleset_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(Ruleset, Integer, Hash)>] Ruleset data, response status code and response headers def get_ruleset_with_http_info(application_id, campaign_id, ruleset_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_ruleset ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_ruleset" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_ruleset" end # verify the required parameter 'ruleset_id' is set if @api_client.config.client_side_validation && ruleset_id.nil? fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling ManagementApi.get_ruleset" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'rulesetId' + '}', CGI.escape(ruleset_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Ruleset' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Campaign Rulesets # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse2003] def get_rulesets(application_id, campaign_id, opts = {}) data, _status_code, _headers = get_rulesets_with_http_info(application_id, campaign_id, opts) data end # List Campaign Rulesets # @param application_id [Integer] # @param campaign_id [Integer] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers def get_rulesets_with_http_info(application_id, campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_rulesets ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.get_rulesets" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.get_rulesets" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse2003' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a single User # Retrieves the data (including an invitation code) for a user. Non-admin users can only get themselves. # @param user_id [Integer] # @param [Hash] opts the optional parameters # @return [User] def get_user(user_id, opts = {}) data, _status_code, _headers = get_user_with_http_info(user_id, opts) data end # Get a single User # Retrieves the data (including an invitation code) for a user. Non-admin users can only get themselves. # @param user_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers def get_user_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_user ...' end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling ManagementApi.get_user" end # resource path local_var_path = '/v1/users/{userId}'.sub('{' + 'userId' + '}', CGI.escape(user_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'User' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Users in your account # Retrieve all users in your account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [InlineResponse20026] def get_users(opts = {}) data, _status_code, _headers = get_users_with_http_info(opts) data end # List Users in your account # Retrieve all users in your account. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @return [Array<(InlineResponse20026, Integer, Hash)>] InlineResponse20026 data, response status code and response headers def get_users_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_users ...' end # resource path local_var_path = '/v1/users' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20026' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Webhook # Returns an webhook by its id. # @param webhook_id [Integer] # @param [Hash] opts the optional parameters # @return [Webhook] def get_webhook(webhook_id, opts = {}) data, _status_code, _headers = get_webhook_with_http_info(webhook_id, opts) data end # Get Webhook # Returns an webhook by its id. # @param webhook_id [Integer] # @param [Hash] opts the optional parameters # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers def get_webhook_with_http_info(webhook_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_webhook ...' end # verify the required parameter 'webhook_id' is set if @api_client.config.client_side_validation && webhook_id.nil? fail ArgumentError, "Missing the required parameter 'webhook_id' when calling ManagementApi.get_webhook" end # resource path local_var_path = '/v1/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Webhook' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Webhook activation Log Entries # Webhook activation log entries would be created as soon as an integration request triggered an effect with a webhook # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :integration_request_uuid Filter results by integration request UUID. # @option opts [Float] :webhook_id Filter results by Webhook. # @option opts [Float] :application_id # @option opts [Float] :campaign_id Filter results by campaign. # @option opts [DateTime] :created_before Only return events created before this date. # @option opts [DateTime] :created_after Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. # @return [InlineResponse20023] def get_webhook_activation_logs(opts = {}) data, _status_code, _headers = get_webhook_activation_logs_with_http_info(opts) data end # List Webhook activation Log Entries # Webhook activation log entries would be created as soon as an integration request triggered an effect with a webhook # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :integration_request_uuid Filter results by integration request UUID. # @option opts [Float] :webhook_id Filter results by Webhook. # @option opts [Float] :application_id # @option opts [Float] :campaign_id Filter results by campaign. # @option opts [DateTime] :created_before Only return events created before this date. # @option opts [DateTime] :created_after Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. # @return [Array<(InlineResponse20023, Integer, Hash)>] InlineResponse20023 data, response status code and response headers def get_webhook_activation_logs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_webhook_activation_logs ...' end # resource path local_var_path = '/v1/webhook_activation_logs' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'integrationRequestUuid'] = opts[:'integration_request_uuid'] if !opts[:'integration_request_uuid'].nil? query_params[:'webhookId'] = opts[:'webhook_id'] if !opts[:'webhook_id'].nil? query_params[:'applicationId'] = opts[:'application_id'] if !opts[:'application_id'].nil? query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20023' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_webhook_activation_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Webhook Log Entries # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :status Filter results by HTTP status codes. # @option opts [Float] :webhook_id Filter results by Webhook. # @option opts [Float] :application_id # @option opts [Float] :campaign_id Filter results by campaign. # @option opts [String] :request_uuid Filter results by request UUID. # @option opts [DateTime] :created_before Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. # @option opts [DateTime] :created_after Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. # @return [InlineResponse20024] def get_webhook_logs(opts = {}) data, _status_code, _headers = get_webhook_logs_with_http_info(opts) data end # List Webhook Log Entries # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :status Filter results by HTTP status codes. # @option opts [Float] :webhook_id Filter results by Webhook. # @option opts [Float] :application_id # @option opts [Float] :campaign_id Filter results by campaign. # @option opts [String] :request_uuid Filter results by request UUID. # @option opts [DateTime] :created_before Filter results where request and response times to return entries before parameter value, expected to be an RFC3339 timestamp string. # @option opts [DateTime] :created_after Filter results where request and response times to return entries after parameter value, expected to be an RFC3339 timestamp string. # @return [Array<(InlineResponse20024, Integer, Hash)>] InlineResponse20024 data, response status code and response headers def get_webhook_logs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_webhook_logs ...' end allowable_values = ["success", "error"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/webhook_logs' # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'webhookId'] = opts[:'webhook_id'] if !opts[:'webhook_id'].nil? query_params[:'applicationId'] = opts[:'application_id'] if !opts[:'application_id'].nil? query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil? query_params[:'requestUuid'] = opts[:'request_uuid'] if !opts[:'request_uuid'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20024' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_webhook_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Webhooks # @param [Hash] opts the optional parameters # @option opts [String] :application_ids Filter by one or more application ids separated by comma # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [InlineResponse20022] def get_webhooks(opts = {}) data, _status_code, _headers = get_webhooks_with_http_info(opts) data end # List Webhooks # @param [Hash] opts the optional parameters # @option opts [String] :application_ids Filter by one or more application ids separated by comma # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @return [Array<(InlineResponse20022, Integer, Hash)>] InlineResponse20022 data, response status code and response headers def get_webhooks_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.get_webhooks ...' end # resource path local_var_path = '/v1/webhooks' # query parameters query_params = opts[:query_params] || {} query_params[:'applicationIds'] = opts[:'application_ids'] if !opts[:'application_ids'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'InlineResponse20022' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#get_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deduct points in a certain loyalty program for the specified customer # @param program_id [String] # @param integration_id [String] # @param body [LoyaltyPoints] # @param [Hash] opts the optional parameters # @return [nil] def remove_loyalty_points(program_id, integration_id, body, opts = {}) remove_loyalty_points_with_http_info(program_id, integration_id, body, opts) nil end # Deduct points in a certain loyalty program for the specified customer # @param program_id [String] # @param integration_id [String] # @param body [LoyaltyPoints] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def remove_loyalty_points_with_http_info(program_id, integration_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.remove_loyalty_points ...' end # verify the required parameter 'program_id' is set if @api_client.config.client_side_validation && program_id.nil? fail ArgumentError, "Missing the required parameter 'program_id' when calling ManagementApi.remove_loyalty_points" end # verify the required parameter 'integration_id' is set if @api_client.config.client_side_validation && integration_id.nil? fail ArgumentError, "Missing the required parameter 'integration_id' when calling ManagementApi.remove_loyalty_points" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.remove_loyalty_points" end # resource path local_var_path = '/v1/loyalty_programs/{programID}/profile/{integrationID}/deduct_points'.sub('{' + 'programID' + '}', CGI.escape(program_id.to_s)).sub('{' + 'integrationID' + '}', CGI.escape(integration_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#remove_loyalty_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reset password # Consumes the supplied password reset token and updates the password for the associated account. # @param body [NewPassword] # @param [Hash] opts the optional parameters # @return [NewPassword] def reset_password(body, opts = {}) data, _status_code, _headers = reset_password_with_http_info(body, opts) data end # Reset password # Consumes the supplied password reset token and updates the password for the associated account. # @param body [NewPassword] # @param [Hash] opts the optional parameters # @return [Array<(NewPassword, Integer, Hash)>] NewPassword data, response status code and response headers def reset_password_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.reset_password ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.reset_password" end # resource path local_var_path = '/v1/reset_password' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'NewPassword' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#reset_password\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of the coupons that match the given attributes (with total count) # Gets a list of all the coupons with attributes matching the query criteria # @param application_id [Integer] # @param campaign_id [Integer] # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @option opts [String] :batch_id Filter results by batches of coupons # @return [InlineResponse2004] def search_coupons_advanced(application_id, campaign_id, body, opts = {}) data, _status_code, _headers = search_coupons_advanced_with_http_info(application_id, campaign_id, body, opts) data end # Get a list of the coupons that match the given attributes (with total count) # Gets a list of all the coupons with attributes matching the query criteria # @param application_id [Integer] # @param campaign_id [Integer] # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @option opts [String] :batch_id Filter results by batches of coupons # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers def search_coupons_advanced_with_http_info(application_id, campaign_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.search_coupons_advanced ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.search_coupons_advanced" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.search_coupons_advanced" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.search_coupons_advanced" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2004' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#search_coupons_advanced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of the coupons that match the given attributes in all active campaigns of an application (with total count) # Gets a list of all the coupons with attributes matching the query criteria in all active campaigns of an application # @param application_id [Integer] # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @option opts [String] :campaign_state Filter results by the state of the campaign. # @return [InlineResponse2004] def search_coupons_advanced_application_wide(application_id, body, opts = {}) data, _status_code, _headers = search_coupons_advanced_application_wide_with_http_info(application_id, body, opts) data end # Get a list of the coupons that match the given attributes in all active campaigns of an application (with total count) # Gets a list of all the coupons with attributes matching the query criteria in all active campaigns of an application # @param application_id [Integer] # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @option opts [String] :campaign_state Filter results by the state of the campaign. # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers def search_coupons_advanced_application_wide_with_http_info(application_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.search_coupons_advanced_application_wide ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.search_coupons_advanced_application_wide" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.search_coupons_advanced_application_wide" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end allowable_values = ["enabled", "disabled", "archived", "draft", "scheduled", "running", "expired"] if @api_client.config.client_side_validation && opts[:'campaign_state'] && !allowable_values.include?(opts[:'campaign_state']) fail ArgumentError, "invalid value for \"campaign_state\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/coupons_search_advanced'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'campaignState'] = opts[:'campaign_state'] if !opts[:'campaign_state'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2004' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#search_coupons_advanced_application_wide\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of the coupons that match the given attributes in all active campaigns of an application # Gets a list of all the coupons with attributes matching the query criteria in all active campaigns of an application # @param application_id [Integer] # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @option opts [String] :campaign_state Filter results by the state of the campaign. # @return [InlineResponse2005] def search_coupons_advanced_application_wide_without_total_count(application_id, body, opts = {}) data, _status_code, _headers = search_coupons_advanced_application_wide_without_total_count_with_http_info(application_id, body, opts) data end # Get a list of the coupons that match the given attributes in all active campaigns of an application # Gets a list of all the coupons with attributes matching the query criteria in all active campaigns of an application # @param application_id [Integer] # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [String] :batch_id Filter results by batches of coupons # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @option opts [String] :campaign_state Filter results by the state of the campaign. # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers def search_coupons_advanced_application_wide_without_total_count_with_http_info(application_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.search_coupons_advanced_application_wide_without_total_count ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.search_coupons_advanced_application_wide_without_total_count" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.search_coupons_advanced_application_wide_without_total_count" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end allowable_values = ["enabled", "disabled", "archived", "draft", "scheduled", "running", "expired"] if @api_client.config.client_side_validation && opts[:'campaign_state'] && !allowable_values.include?(opts[:'campaign_state']) fail ArgumentError, "invalid value for \"campaign_state\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/coupons_search_advanced/no_total'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'campaignState'] = opts[:'campaign_state'] if !opts[:'campaign_state'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2005' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#search_coupons_advanced_application_wide_without_total_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of the coupons that match the given attributes # Gets a list of all the coupons with attributes matching the query criteria # @param application_id [Integer] # @param campaign_id [Integer] # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code (default to false) # @option opts [String] :batch_id Filter results by batches of coupons # @return [InlineResponse2005] def search_coupons_advanced_without_total_count(application_id, campaign_id, body, opts = {}) data, _status_code, _headers = search_coupons_advanced_without_total_count_with_http_info(application_id, campaign_id, body, opts) data end # Get a list of the coupons that match the given attributes # Gets a list of all the coupons with attributes matching the query criteria # @param application_id [Integer] # @param campaign_id [Integer] # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of items to include in this response. When omitted, the maximum value of 1000 will be used. # @option opts [Integer] :skip Skips the given number of items when paging through large result sets. # @option opts [String] :sort The field by which results should be sorted. Sorting defaults to ascending order, prefix the field name with `-` to sort in descending order. # @option opts [String] :value Filter results performing case-insensitive matching against the coupon code. Both the code and the query are folded to remove all non-alpha-numeric characters. # @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. # @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiry date is set and in the past. The second matches coupons in which start date is null or in the past and expiry date is null or in the future, the third matches coupons in which start date is set and in the future. # @option opts [String] :usable Either \"true\" or \"false\". If \"true\", only coupons where `usageCounter < usageLimit` will be returned, \"false\" will return only coupons where `usageCounter >= usageLimit`. # @option opts [Integer] :referral_id Filter the results by matching them with the Id of a referral, that meaning the coupons that had been created as an effect of the usage of a referral code. # @option opts [String] :recipient_integration_id Filter results by match with a profile id specified in the coupon's RecipientIntegrationId field # @option opts [Boolean] :exact_match Filter results to an exact case-insensitive matching against the coupon code # @option opts [String] :batch_id Filter results by batches of coupons # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers def search_coupons_advanced_without_total_count_with_http_info(application_id, campaign_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.search_coupons_advanced_without_total_count ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.search_coupons_advanced_without_total_count" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.search_coupons_advanced_without_total_count" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.search_coupons_advanced_without_total_count" end allowable_values = ["expired", "validNow", "validFuture"] if @api_client.config.client_side_validation && opts[:'valid'] && !allowable_values.include?(opts[:'valid']) fail ArgumentError, "invalid value for \"valid\", must be one of #{allowable_values}" end allowable_values = ["true", "false"] if @api_client.config.client_side_validation && opts[:'usable'] && !allowable_values.include?(opts[:'usable']) fail ArgumentError, "invalid value for \"usable\", must be one of #{allowable_values}" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_search_advanced/no_total'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? query_params[:'value'] = opts[:'value'] if !opts[:'value'].nil? query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil? query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil? query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil? query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil? query_params[:'referralId'] = opts[:'referral_id'] if !opts[:'referral_id'].nil? query_params[:'recipientIntegrationId'] = opts[:'recipient_integration_id'] if !opts[:'recipient_integration_id'].nil? query_params[:'exactMatch'] = opts[:'exact_match'] if !opts[:'exact_match'].nil? query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil? # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'InlineResponse2005' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#search_coupons_advanced_without_total_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an additional cost # Updates an existing additional cost. Once created, the only property of an additional cost that can be changed is the title (human readable description). This restriction is in place to prevent accidentally breaking live integrations. # @param additional_cost_id [Integer] # @param body [NewAdditionalCost] # @param [Hash] opts the optional parameters # @return [AccountAdditionalCost] def update_additional_cost(additional_cost_id, body, opts = {}) data, _status_code, _headers = update_additional_cost_with_http_info(additional_cost_id, body, opts) data end # Update an additional cost # Updates an existing additional cost. Once created, the only property of an additional cost that can be changed is the title (human readable description). This restriction is in place to prevent accidentally breaking live integrations. # @param additional_cost_id [Integer] # @param body [NewAdditionalCost] # @param [Hash] opts the optional parameters # @return [Array<(AccountAdditionalCost, Integer, Hash)>] AccountAdditionalCost data, response status code and response headers def update_additional_cost_with_http_info(additional_cost_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.update_additional_cost ...' end # verify the required parameter 'additional_cost_id' is set if @api_client.config.client_side_validation && additional_cost_id.nil? fail ArgumentError, "Missing the required parameter 'additional_cost_id' when calling ManagementApi.update_additional_cost" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.update_additional_cost" end # resource path local_var_path = '/v1/additional_costs/{additionalCostId}'.sub('{' + 'additionalCostId' + '}', CGI.escape(additional_cost_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'AccountAdditionalCost' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#update_additional_cost\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a custom attribute # Updates an existing custom attribute. Once created, the only property of a custom attribute that can be changed is the title (human readable description). This restriction is in place to prevent accidentally breaking live integrations. E.g. if you have a customer profile attribute with the name `region`, and your integration is sending `attributes.region` with customer profile updates, changing the name to `locale` would cause the integration requests to begin failing. If you **really** need to change the `type` or `name` property of a custom attribute, create a new attribute and update any relevant integrations and rules to use the new attribute. Then delete the old attribute when you are confident you have migrated any needed data from the old attribute to the new one. # @param attribute_id [Integer] # @param body [NewAttribute] # @param [Hash] opts the optional parameters # @return [Attribute] def update_attribute(attribute_id, body, opts = {}) data, _status_code, _headers = update_attribute_with_http_info(attribute_id, body, opts) data end # Update a custom attribute # Updates an existing custom attribute. Once created, the only property of a custom attribute that can be changed is the title (human readable description). This restriction is in place to prevent accidentally breaking live integrations. E.g. if you have a customer profile attribute with the name `region`, and your integration is sending `attributes.region` with customer profile updates, changing the name to `locale` would cause the integration requests to begin failing. If you **really** need to change the `type` or `name` property of a custom attribute, create a new attribute and update any relevant integrations and rules to use the new attribute. Then delete the old attribute when you are confident you have migrated any needed data from the old attribute to the new one. # @param attribute_id [Integer] # @param body [NewAttribute] # @param [Hash] opts the optional parameters # @return [Array<(Attribute, Integer, Hash)>] Attribute data, response status code and response headers def update_attribute_with_http_info(attribute_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.update_attribute ...' end # verify the required parameter 'attribute_id' is set if @api_client.config.client_side_validation && attribute_id.nil? fail ArgumentError, "Missing the required parameter 'attribute_id' when calling ManagementApi.update_attribute" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.update_attribute" end # resource path local_var_path = '/v1/attributes/{attributeId}'.sub('{' + 'attributeId' + '}', CGI.escape(attribute_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Attribute' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#update_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a Campaign # @param application_id [Integer] # @param campaign_id [Integer] # @param body [UpdateCampaign] # @param [Hash] opts the optional parameters # @return [Campaign] def update_campaign(application_id, campaign_id, body, opts = {}) data, _status_code, _headers = update_campaign_with_http_info(application_id, campaign_id, body, opts) data end # Update a Campaign # @param application_id [Integer] # @param campaign_id [Integer] # @param body [UpdateCampaign] # @param [Hash] opts the optional parameters # @return [Array<(Campaign, Integer, Hash)>] Campaign data, response status code and response headers def update_campaign_with_http_info(application_id, campaign_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.update_campaign ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.update_campaign" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.update_campaign" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.update_campaign" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Campaign' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#update_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a Coupon # @param application_id [Integer] # @param campaign_id [Integer] # @param coupon_id [String] The ID of the coupon code to update # @param body [UpdateCoupon] # @param [Hash] opts the optional parameters # @return [Coupon] def update_coupon(application_id, campaign_id, coupon_id, body, opts = {}) data, _status_code, _headers = update_coupon_with_http_info(application_id, campaign_id, coupon_id, body, opts) data end # Update a Coupon # @param application_id [Integer] # @param campaign_id [Integer] # @param coupon_id [String] The ID of the coupon code to update # @param body [UpdateCoupon] # @param [Hash] opts the optional parameters # @return [Array<(Coupon, Integer, Hash)>] Coupon data, response status code and response headers def update_coupon_with_http_info(application_id, campaign_id, coupon_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.update_coupon ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.update_coupon" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.update_coupon" end # verify the required parameter 'coupon_id' is set if @api_client.config.client_side_validation && coupon_id.nil? fail ArgumentError, "Missing the required parameter 'coupon_id' when calling ManagementApi.update_coupon" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.update_coupon" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons/{couponId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'couponId' + '}', CGI.escape(coupon_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Coupon' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#update_coupon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a Batch of Coupons # @param application_id [Integer] # @param campaign_id [Integer] # @param body [UpdateCouponBatch] # @param [Hash] opts the optional parameters # @return [nil] def update_coupon_batch(application_id, campaign_id, body, opts = {}) update_coupon_batch_with_http_info(application_id, campaign_id, body, opts) nil end # Update a Batch of Coupons # @param application_id [Integer] # @param campaign_id [Integer] # @param body [UpdateCouponBatch] # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_coupon_batch_with_http_info(application_id, campaign_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.update_coupon_batch ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.update_coupon_batch" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.update_coupon_batch" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.update_coupon_batch" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#update_coupon_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a Ruleset # @param application_id [Integer] # @param campaign_id [Integer] # @param ruleset_id [Integer] # @param body [NewRuleset] # @param [Hash] opts the optional parameters # @return [Ruleset] def update_ruleset(application_id, campaign_id, ruleset_id, body, opts = {}) data, _status_code, _headers = update_ruleset_with_http_info(application_id, campaign_id, ruleset_id, body, opts) data end # Update a Ruleset # @param application_id [Integer] # @param campaign_id [Integer] # @param ruleset_id [Integer] # @param body [NewRuleset] # @param [Hash] opts the optional parameters # @return [Array<(Ruleset, Integer, Hash)>] Ruleset data, response status code and response headers def update_ruleset_with_http_info(application_id, campaign_id, ruleset_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementApi.update_ruleset ...' end # verify the required parameter 'application_id' is set if @api_client.config.client_side_validation && application_id.nil? fail ArgumentError, "Missing the required parameter 'application_id' when calling ManagementApi.update_ruleset" end # verify the required parameter 'campaign_id' is set if @api_client.config.client_side_validation && campaign_id.nil? fail ArgumentError, "Missing the required parameter 'campaign_id' when calling ManagementApi.update_ruleset" end # verify the required parameter 'ruleset_id' is set if @api_client.config.client_side_validation && ruleset_id.nil? fail ArgumentError, "Missing the required parameter 'ruleset_id' when calling ManagementApi.update_ruleset" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling ManagementApi.update_ruleset" end # resource path local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/rulesets/{rulesetId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'rulesetId' + '}', CGI.escape(ruleset_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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 = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Ruleset' # auth_names auth_names = opts[:auth_names] || ['manager_auth'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementApi#update_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end