=begin
#Talon.One API
#Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
The version of the OpenAPI document:
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 to card in a given loyalty program
# Add points to the given loyalty card in the specified card-based loyalty program.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param body [AddLoyaltyPoints] body
# @param [Hash] opts the optional parameters
# @return [nil]
def add_loyalty_card_points(loyalty_program_id, loyalty_card_identifier, body, opts = {})
add_loyalty_card_points_with_http_info(loyalty_program_id, loyalty_card_identifier, body, opts)
nil
end
# Add points to card in a given loyalty program
# Add points to the given loyalty card in the specified card-based loyalty program.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param body [AddLoyaltyPoints] body
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def add_loyalty_card_points_with_http_info(loyalty_program_id, loyalty_card_identifier, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.add_loyalty_card_points ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.add_loyalty_card_points"
end
# verify the required parameter 'loyalty_card_identifier' is set
if @api_client.config.client_side_validation && loyalty_card_identifier.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_card_identifier' when calling ManagementApi.add_loyalty_card_points"
end
if @api_client.config.client_side_validation && loyalty_card_identifier.to_s.length > 108
fail ArgumentError, 'invalid value for "loyalty_card_identifier" when calling ManagementApi.add_loyalty_card_points, the character length must be smaller than or equal to 108.'
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_card_points"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardIdentifier}/add_points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardIdentifier' + '}', CGI.escape(loyalty_card_identifier.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]
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_card_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Add points to customer profile
# Add points in the specified loyalty program for the given customer. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint.
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param integration_id [String] The identifier of the profile.
# @param body [AddLoyaltyPoints] body
# @param [Hash] opts the optional parameters
# @return [nil]
def add_loyalty_points(loyalty_program_id, integration_id, body, opts = {})
add_loyalty_points_with_http_info(loyalty_program_id, integration_id, body, opts)
nil
end
# Add points to customer profile
# Add points in the specified loyalty program for the given customer. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint.
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param integration_id [String] The identifier of the profile.
# @param body [AddLoyaltyPoints] body
# @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(loyalty_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 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_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/{loyaltyProgramId}/profile/{integrationId}/add_points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_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'])
# 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] || ['management_key', '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 the specified Application
# Copy the campaign into all specified Applications.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [CampaignCopy] body
# @param [Hash] opts the optional parameters
# @return [InlineResponse2003]
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 the specified Application
# Copy the campaign into all specified Applications.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [CampaignCopy] body
# @param [Hash] opts the optional parameters
# @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 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] || 'InlineResponse2003'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Create account-level collection
# Create account-level collection.
# @param body [NewCollection] body
# @param [Hash] opts the optional parameters
# @return [Collection]
def create_account_collection(body, opts = {})
data, _status_code, _headers = create_account_collection_with_http_info(body, opts)
data
end
# Create account-level collection
# Create account-level collection.
# @param body [NewCollection] body
# @param [Hash] opts the optional parameters
# @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers
def create_account_collection_with_http_info(body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.create_account_collection ...'
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_account_collection"
end
# resource path
local_var_path = '/v1/collections'
# 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] || 'Collection'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_account_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create additional cost
# Create an [additional cost](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). These additional costs are shared across all applications in your account, and are never required.
# @param body [NewAdditionalCost] body
# @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
# Create additional cost
# Create an [additional cost](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs). These additional costs are shared across all applications in your account, and are never required.
# @param body [NewAdditionalCost] body
# @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] || ['management_key', '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
# Create custom attribute
# Create a _custom attribute_ in this account. [Custom attributes](https://docs.talon.one/docs/dev/concepts/attributes) allow you to add data to Talon.One domain entities like campaigns, coupons, customers and so on. These attributes can then be given values when creating/updating these entities, 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] body
# @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
# Create custom attribute
# Create a _custom attribute_ in this account. [Custom attributes](https://docs.talon.one/docs/dev/concepts/attributes) allow you to add data to Talon.One domain entities like campaigns, coupons, customers and so on. These attributes can then be given values when creating/updating these entities, 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] body
# @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] || ['management_key', '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 campaign from campaign template
# Use the campaign template referenced in the request body to create a new campaign in one of the connected Applications. If the template was created from a campaign with rules referencing [campaign collections](https://docs.talon.one/docs/product/campaigns/managing-collections), the corresponding collections for the new campaign are created automatically.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [CreateTemplateCampaign] body
# @param [Hash] opts the optional parameters
# @return [CreateTemplateCampaignResponse]
def create_campaign_from_template(application_id, body, opts = {})
data, _status_code, _headers = create_campaign_from_template_with_http_info(application_id, body, opts)
data
end
# Create campaign from campaign template
# Use the campaign template referenced in the request body to create a new campaign in one of the connected Applications. If the template was created from a campaign with rules referencing [campaign collections](https://docs.talon.one/docs/product/campaigns/managing-collections), the corresponding collections for the new campaign are created automatically.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [CreateTemplateCampaign] body
# @param [Hash] opts the optional parameters
# @return [Array<(CreateTemplateCampaignResponse, Integer, Hash)>] CreateTemplateCampaignResponse data, response status code and response headers
def create_campaign_from_template_with_http_info(application_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.create_campaign_from_template ...'
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_from_template"
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_from_template"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/create_campaign_from_template'.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] || 'CreateTemplateCampaignResponse'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_from_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create collection
# Create a collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [NewCampaignCollection] body
# @param [Hash] opts the optional parameters
# @return [Collection]
def create_collection(application_id, campaign_id, body, opts = {})
data, _status_code, _headers = create_collection_with_http_info(application_id, campaign_id, body, opts)
data
end
# Create collection
# Create a collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [NewCampaignCollection] body
# @param [Hash] opts the optional parameters
# @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers
def create_collection_with_http_info(application_id, campaign_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.create_collection ...'
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_collection"
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_collection"
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_collection"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections'.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] || 'Collection'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_collection\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] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [NewCoupons] body
# @param [Hash] opts the optional parameters
# @option opts [String] :silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (default to 'yes')
# @return [InlineResponse2006]
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] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [NewCoupons] body
# @param [Hash] opts the optional parameters
# @option opts [String] :silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles.
# @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 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] || 'InlineResponse2006'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Create coupons asynchronously
# Create up to 5,000,000 coupons asynchronously. You should typically use this enpdoint when you create at least 20,001 coupons. You receive an email when the creation is complete. If you want to create less than 20,001 coupons, you can use the [Create coupons](https://docs.talon.one/management-api#tag/Coupons/operation/createCoupons) endpoint.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [NewCouponCreationJob] body
# @param [Hash] opts the optional parameters
# @return [AsyncCouponCreationResponse]
def create_coupons_async(application_id, campaign_id, body, opts = {})
data, _status_code, _headers = create_coupons_async_with_http_info(application_id, campaign_id, body, opts)
data
end
# Create coupons asynchronously
# Create up to 5,000,000 coupons asynchronously. You should typically use this enpdoint when you create at least 20,001 coupons. You receive an email when the creation is complete. If you want to create less than 20,001 coupons, you can use the [Create coupons](https://docs.talon.one/management-api#tag/Coupons/operation/createCoupons) endpoint.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [NewCouponCreationJob] body
# @param [Hash] opts the optional parameters
# @return [Array<(AsyncCouponCreationResponse, Integer, Hash)>] AsyncCouponCreationResponse data, response status code and response headers
def create_coupons_async_with_http_info(application_id, campaign_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.create_coupons_async ...'
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_async"
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_async"
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_async"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_async'.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] || 'AsyncCouponCreationResponse'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_async\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create coupons for multiple recipients
# Create coupons according to some pattern for up to 1000 recipients.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [NewCouponsForMultipleRecipients] body
# @param [Hash] opts the optional parameters
# @option opts [String] :silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. (default to 'yes')
# @return [InlineResponse2006]
def create_coupons_for_multiple_recipients(application_id, campaign_id, body, opts = {})
data, _status_code, _headers = create_coupons_for_multiple_recipients_with_http_info(application_id, campaign_id, body, opts)
data
end
# Create coupons for multiple recipients
# Create coupons according to some pattern for up to 1000 recipients.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [NewCouponsForMultipleRecipients] body
# @param [Hash] opts the optional parameters
# @option opts [String] :silent Possible values: `yes` or `no`. - `yes`: Increases the perfomance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles.
# @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers
def create_coupons_for_multiple_recipients_with_http_info(application_id, campaign_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.create_coupons_for_multiple_recipients ...'
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_for_multiple_recipients"
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_for_multiple_recipients"
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_for_multiple_recipients"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/coupons_with_recipients'.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] || 'InlineResponse2006'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_for_multiple_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create notification about campaign-related changes
# Create a [notification about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications). A notification about campaign-related changes is different from regular webhooks in that it is Application-scoped and has a predefined payload. [Regular webhooks](https://docs.talon.one/docs/dev/getting-started/webhooks) have user-definable payloads. **Tip:** - You can create these notifications using the Campaign Manager. See [Managing notifications](https://docs.talon.one/docs/product/applications/outbound-notifications). - You can review the payload you will receive in the [specs](https://docs.talon.one/outbound-notifications#/paths/campaign_created/post).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [NewNotificationWebhook] body
# @param [Hash] opts the optional parameters
# @return [NotificationWebhook]
def create_notification_webhook(application_id, body, opts = {})
data, _status_code, _headers = create_notification_webhook_with_http_info(application_id, body, opts)
data
end
# Create notification about campaign-related changes
# Create a [notification about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications). A notification about campaign-related changes is different from regular webhooks in that it is Application-scoped and has a predefined payload. [Regular webhooks](https://docs.talon.one/docs/dev/getting-started/webhooks) have user-definable payloads. **Tip:** - You can create these notifications using the Campaign Manager. See [Managing notifications](https://docs.talon.one/docs/product/applications/outbound-notifications). - You can review the payload you will receive in the [specs](https://docs.talon.one/outbound-notifications#/paths/campaign_created/post).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [NewNotificationWebhook] body
# @param [Hash] opts the optional parameters
# @return [Array<(NotificationWebhook, Integer, Hash)>] NotificationWebhook data, response status code and response headers
def create_notification_webhook_with_http_info(application_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.create_notification_webhook ...'
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_notification_webhook"
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_notification_webhook"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/notification_webhooks'.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] || 'NotificationWebhook'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_notification_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Request a password reset
# Send an email with a password recovery link to the email address of an existing account. **Note:** The password recovery link expires 30 minutes after this endpoint is triggered.
# @param body [NewPasswordEmail] body
# @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
# Send an email with a password recovery link to the email address of an existing account. **Note:** The password recovery link expires 30 minutes after this endpoint is triggered.
# @param body [NewPasswordEmail] body
# @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] || ['management_key', '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 session
# Create a session to use the Management API endpoints. Use the value of the `token` property provided in the response as bearer token in other API calls. A token is valid for 3 months. In accordance with best pratices, use your generated token for all your API requests. Do **not** regenerate a token for each request. This endpoint has a rate limit of 3 to 6 requests per second per account, depending on your setup.
Granular API key
Instead of using a session, you can also use the
Management API key feature in the Campaign Manager to decide which endpoints can be used with a given key.
# @param body [LoginParams] body
# @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 session
# Create a session to use the Management API endpoints. Use the value of the `token` property provided in the response as bearer token in other API calls. A token is valid for 3 months. In accordance with best pratices, use your generated token for all your API requests. Do **not** regenerate a token for each request. This endpoint has a rate limit of 3 to 6 requests per second per account, depending on your setup. <div class=\"redoc-section\"> <p class=\"title\">Granular API key</p> Instead of using a session, you can also use the <a href=\"https://docs.talon.one/docs/product/account/dev-tools/managing-mapi-keys\">Management API key feature</a> in the Campaign Manager to decide which endpoints can be used with a given key. </div>
# @param body [LoginParams] body
# @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] || ['management_key', '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
# Deduct points from card in a given loyalty program.
# Deduct points from the given loyalty card in the specified card-based loyalty program.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param body [DeductLoyaltyPoints] body
# @param [Hash] opts the optional parameters
# @return [nil]
def deduct_loyalty_card_points(loyalty_program_id, loyalty_card_identifier, body, opts = {})
deduct_loyalty_card_points_with_http_info(loyalty_program_id, loyalty_card_identifier, body, opts)
nil
end
# Deduct points from card in a given loyalty program.
# Deduct points from the given loyalty card in the specified card-based loyalty program.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param body [DeductLoyaltyPoints] body
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def deduct_loyalty_card_points_with_http_info(loyalty_program_id, loyalty_card_identifier, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.deduct_loyalty_card_points ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.deduct_loyalty_card_points"
end
# verify the required parameter 'loyalty_card_identifier' is set
if @api_client.config.client_side_validation && loyalty_card_identifier.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_card_identifier' when calling ManagementApi.deduct_loyalty_card_points"
end
if @api_client.config.client_side_validation && loyalty_card_identifier.to_s.length > 108
fail ArgumentError, 'invalid value for "loyalty_card_identifier" when calling ManagementApi.deduct_loyalty_card_points, the character length must be smaller than or equal to 108.'
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.deduct_loyalty_card_points"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardIdentifier}/deduct_points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardIdentifier' + '}', CGI.escape(loyalty_card_identifier.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]
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#deduct_loyalty_card_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete account-level collection
# Delete the given account-level collection.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [nil]
def delete_account_collection(collection_id, opts = {})
delete_account_collection_with_http_info(collection_id, opts)
nil
end
# Delete account-level collection
# Delete the given account-level collection.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_account_collection_with_http_info(collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.delete_account_collection ...'
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.delete_account_collection"
end
# resource path
local_var_path = '/v1/collections/{collectionId}'.sub('{' + 'collectionId' + '}', CGI.escape(collection_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]
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_account_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete campaign
# Delete the given campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @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 campaign
# Delete the given campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @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] || ['management_key', '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 collection
# Delete the given collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [nil]
def delete_collection(application_id, campaign_id, collection_id, opts = {})
delete_collection_with_http_info(application_id, campaign_id, collection_id, opts)
nil
end
# Delete collection
# Delete the given collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_collection_with_http_info(application_id, campaign_id, collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.delete_collection ...'
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_collection"
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_collection"
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.delete_collection"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'collectionId' + '}', CGI.escape(collection_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]
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete coupon
# Delete the specified coupon.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param coupon_id [String] The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response.
# @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 coupon
# Delete the specified coupon.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param coupon_id [String] The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response.
# @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] || ['management_key', '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
# Deletes all the coupons matching the specified criteria.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :starts_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :starts_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :expires_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :expires_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: 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 - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned.
# @option opts [Integer] :referral_id Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming 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
# Deletes all the coupons matching the specified criteria.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :starts_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :starts_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :expires_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :expires_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid - `expired`: Matches coupons in which the expiration date is set and in the past. - `validNow`: Matches coupons in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: 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 - `true`: only coupons where `usageCounter < usageLimit` will be returned. - `false`: only coupons where `usageCounter >= usageLimit` will be returned.
# @option opts [Integer] :referral_id Filter the results by matching them with the ID of a referral. This filter shows the coupons created by redeeming 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] || ['management_key', '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 loyalty card
# Delete the given loyalty card.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param [Hash] opts the optional parameters
# @return [nil]
def delete_loyalty_card(loyalty_program_id, loyalty_card_identifier, opts = {})
delete_loyalty_card_with_http_info(loyalty_program_id, loyalty_card_identifier, opts)
nil
end
# Delete loyalty card
# Delete the given loyalty card.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_loyalty_card_with_http_info(loyalty_program_id, loyalty_card_identifier, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.delete_loyalty_card ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.delete_loyalty_card"
end
# verify the required parameter 'loyalty_card_identifier' is set
if @api_client.config.client_side_validation && loyalty_card_identifier.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_card_identifier' when calling ManagementApi.delete_loyalty_card"
end
if @api_client.config.client_side_validation && loyalty_card_identifier.to_s.length > 108
fail ArgumentError, 'invalid value for "loyalty_card_identifier" when calling ManagementApi.delete_loyalty_card, the character length must be smaller than or equal to 108.'
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardIdentifier}'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardIdentifier' + '}', CGI.escape(loyalty_card_identifier.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]
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_loyalty_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete notification about campaign-related changes
# Remove the given existing [notification about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param notification_webhook_id [Integer] The ID of the webhook. Get it with the appropriate _List notifications_ endpoint.
# @param [Hash] opts the optional parameters
# @return [nil]
def delete_notification_webhook(application_id, notification_webhook_id, opts = {})
delete_notification_webhook_with_http_info(application_id, notification_webhook_id, opts)
nil
end
# Delete notification about campaign-related changes
# Remove the given existing [notification about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param notification_webhook_id [Integer] The ID of the webhook. Get it with the appropriate _List notifications_ endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_notification_webhook_with_http_info(application_id, notification_webhook_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.delete_notification_webhook ...'
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_notification_webhook"
end
# verify the required parameter 'notification_webhook_id' is set
if @api_client.config.client_side_validation && notification_webhook_id.nil?
fail ArgumentError, "Missing the required parameter 'notification_webhook_id' when calling ManagementApi.delete_notification_webhook"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/notification_webhooks/{notificationWebhookId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'notificationWebhookId' + '}', CGI.escape(notification_webhook_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] || ['management_key', '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_notification_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Delete referral
# Delete the specified referral.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param referral_id [String] The ID of the referral code.
# @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 referral
# Delete the specified referral.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param referral_id [String] The ID of the referral code.
# @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] || ['management_key', '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
# Destroy session
# Destroys the session.
# @param [Hash] opts the optional parameters
# @return [nil]
def destroy_session(opts = {})
destroy_session_with_http_info(opts)
nil
end
# Destroy session
# Destroys the session.
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def destroy_session_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.destroy_session ...'
end
# resource path
local_var_path = '/v1/sessions'
# 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] || ['management_key', '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#destroy_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export account-level collection's items
# Download a CSV file containing items from an account-level collection. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/).
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [String]
def export_account_collection_items(collection_id, opts = {})
data, _status_code, _headers = export_account_collection_items_with_http_info(collection_id, opts)
data
end
# Export account-level collection's items
# Download a CSV file containing items from an account-level collection. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/).
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_account_collection_items_with_http_info(collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_account_collection_items ...'
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.export_account_collection_items"
end
# resource path
local_var_path = '/v1/collections/{collectionId}/export'.sub('{' + 'collectionId' + '}', CGI.escape(collection_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/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_account_collection_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export a collection's items
# Download a CSV file containing a collection's items. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [String]
def export_collection_items(application_id, campaign_id, collection_id, opts = {})
data, _status_code, _headers = export_collection_items_with_http_info(application_id, campaign_id, collection_id, opts)
data
end
# Export a collection's items
# Download a CSV file containing a collection's items. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_collection_items_with_http_info(application_id, campaign_id, collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_collection_items ...'
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.export_collection_items"
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.export_collection_items"
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.export_collection_items"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/export'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'collectionId' + '}', CGI.escape(collection_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/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_collection_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export coupons
# Download a CSV file containing the coupons that match the given properties. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `accountid`: The ID of your deployment. - `applicationid`: The ID of the Application this coupon is related to. - `attributes`: A json object describing _custom_ referral attribute names and their values. - `batchid`: The ID of the batch this coupon is part of. - `campaignid`: The ID of the campaign this coupon is related to. - `counter`: The number of times this coupon has been redeemed. - `created`: The creation date of the coupon code. - `deleted`: Whether the coupon code is deleted. - `deleted_changelogid`: The ID of the delete event in the logs. - `discount_counter`: The amount of discount given by this coupon. - `discount_limitval`: The maximum discount amount that can be given be this coupon. - `expirydate`: The end date in RFC3339 of the code redemption period. - `id`: The internal ID of the coupon code. - `importid`: The ID of the import job that created this coupon. - `is_reservation_mandatory`: Whether this coupon requires a reservation to be redeemed. - `limits`: The limits set on this coupon. - `limitval`: The maximum number of redemptions of this code. - `recipientintegrationid`: The integration ID of the customer considered as recipient of the coupon. Only the customer with this integration ID can redeem the corresponding coupon code. Learn about [coupon reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - `reservation`: Whether the coupon is reserved. - `reservation_counter`: How many times this coupon has been reserved. - `reservation_limitval`: The maximum of number of reservations this coupon can have. - `startdate`: The start date in RFC3339 of the code redemption period. - `value`: The coupon code.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Float] :campaign_id Filter results by campaign.
# @option opts [String] :sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration 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. This filter shows the coupons created by redeeming 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] :date_format Determines the format of dates in the export document.
# @option opts [String] :campaign_state Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts.
# @return [String]
def export_coupons(application_id, opts = {})
data, _status_code, _headers = export_coupons_with_http_info(application_id, opts)
data
end
# Export coupons
# Download a CSV file containing the coupons that match the given properties. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `accountid`: The ID of your deployment. - `applicationid`: The ID of the Application this coupon is related to. - `attributes`: A json object describing _custom_ referral attribute names and their values. - `batchid`: The ID of the batch this coupon is part of. - `campaignid`: The ID of the campaign this coupon is related to. - `counter`: The number of times this coupon has been redeemed. - `created`: The creation date of the coupon code. - `deleted`: Whether the coupon code is deleted. - `deleted_changelogid`: The ID of the delete event in the logs. - `discount_counter`: The amount of discount given by this coupon. - `discount_limitval`: The maximum discount amount that can be given be this coupon. - `expirydate`: The end date in RFC3339 of the code redemption period. - `id`: The internal ID of the coupon code. - `importid`: The ID of the import job that created this coupon. - `is_reservation_mandatory`: Whether this coupon requires a reservation to be redeemed. - `limits`: The limits set on this coupon. - `limitval`: The maximum number of redemptions of this code. - `recipientintegrationid`: The integration ID of the customer considered as recipient of the coupon. Only the customer with this integration ID can redeem the corresponding coupon code. Learn about [coupon reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - `referralid`: The ID of the referral code that triggered the creation of this coupon (create coupon effect). - `reservation`: Whether the coupon is reserved. - `reservation_counter`: How many times this coupon has been reserved. - `reservation_limitval`: The maximum of number of reservations this coupon can have. - `startdate`: The start date in RFC3339 of the code redemption period. - `value`: The coupon code.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Float] :campaign_id Filter results by campaign.
# @option opts [String] :sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration 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. This filter shows the coupons created by redeeming 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] :date_format Determines the format of dates in the export document.
# @option opts [String] :campaign_state Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_coupons_with_http_info(application_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_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.export_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
allowable_values = ["excel", "ISO8601"]
if @api_client.config.client_side_validation && opts[:'date_format'] && !allowable_values.include?(opts[:'date_format'])
fail ArgumentError, "invalid value for \"date_format\", 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}/export_coupons'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].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[:'dateFormat'] = opts[:'date_format'] if !opts[:'date_format'].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/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_coupons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export customer sessions
# Download a CSV file containing the customer sessions that match the request. **Important:** Archived sessions cannot be exported. See the [retention policy](https://docs.talon.one/docs/product/server-infrastructure-and-data-retention#data-retention-policy). **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - `id`: The internal ID of the session. - `firstsession`: Whether this is a first session. - `integrationid`: The integration ID of the session. - `applicationid`: The ID of the Application. - `profileid`: The internal ID of the customer profile. - `profileintegrationid`: The integration ID of the customer profile. - `created`: The timestamp when the session was created. - `state`: The [state](https://docs.talon.one/docs/dev/concepts/entities#customer-session-states) of the session. - `cartitems`: The cart items in the session. - `discounts`: The discounts in the session. - `total`: The total value of the session. - `attributes`: The attributes set in the session. - `closedat`: Timestamp when the session was closed. - `cancelledat`: Timestamp when the session was cancelled. - `referral`: The referral code in the session. - `identifiers`: The identifiers in the session. - `additional_costs`: The [additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs) in the session. - `updated`: Timestamp of the last session update. - `coupons`: Coupon codes in the session.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.
# @option opts [String] :profile_integration_id Only return sessions for the customer that matches this customer integration ID.
# @option opts [String] :date_format Determines the format of dates in the export document.
# @option opts [String] :customer_session_state Filter results by state.
# @return [String]
def export_customer_sessions(application_id, opts = {})
data, _status_code, _headers = export_customer_sessions_with_http_info(application_id, opts)
data
end
# Export customer sessions
# Download a CSV file containing the customer sessions that match the request. **Important:** Archived sessions cannot be exported. See the [retention policy](https://docs.talon.one/docs/product/server-infrastructure-and-data-retention#data-retention-policy). **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). - `id`: The internal ID of the session. - `firstsession`: Whether this is a first session. - `integrationid`: The integration ID of the session. - `applicationid`: The ID of the Application. - `profileid`: The internal ID of the customer profile. - `profileintegrationid`: The integration ID of the customer profile. - `created`: The timestamp when the session was created. - `state`: The [state](https://docs.talon.one/docs/dev/concepts/entities#customer-session-states) of the session. - `cartitems`: The cart items in the session. - `discounts`: The discounts in the session. - `total`: The total value of the session. - `attributes`: The attributes set in the session. - `closedat`: Timestamp when the session was closed. - `cancelledat`: Timestamp when the session was cancelled. - `referral`: The referral code in the session. - `identifiers`: The identifiers in the session. - `additional_costs`: The [additional costs](https://docs.talon.one/docs/product/account/dev-tools/managing-additional-costs) in the session. - `updated`: Timestamp of the last session update. - `coupons`: Coupon codes in the session.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string.
# @option opts [String] :profile_integration_id Only return sessions for the customer that matches this customer integration ID.
# @option opts [String] :date_format Determines the format of dates in the export document.
# @option opts [String] :customer_session_state Filter results by state.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_customer_sessions_with_http_info(application_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_customer_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.export_customer_sessions"
end
allowable_values = ["excel", "ISO8601"]
if @api_client.config.client_side_validation && opts[:'date_format'] && !allowable_values.include?(opts[:'date_format'])
fail ArgumentError, "invalid value for \"date_format\", must be one of #{allowable_values}"
end
allowable_values = ["open", "closed", "partially_returned", "cancelled"]
if @api_client.config.client_side_validation && opts[:'customer_session_state'] && !allowable_values.include?(opts[:'customer_session_state'])
fail ArgumentError, "invalid value for \"customer_session_state\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/export_customer_sessions'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
query_params[:'profileIntegrationId'] = opts[:'profile_integration_id'] if !opts[:'profile_integration_id'].nil?
query_params[:'dateFormat'] = opts[:'date_format'] if !opts[:'date_format'].nil?
query_params[:'customerSessionState'] = opts[:'customer_session_state'] if !opts[:'customer_session_state'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_customer_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export triggered effects
# Download a CSV file containing the triggered effects that match the given attributes. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `applicationid`: The ID of the Application. - `campaignid`: The ID of the campaign. - `couponid`: The ID of the coupon, when applicable to the effect. - `created`: The timestamp of the effect. - `event_type`: The name of the event. See the [docs](https://docs.talon.one/docs/dev/concepts/events). - `eventid`: The internal ID of the effect. - `name`: The effect name. See the [docs](https://docs.talon.one/docs/dev/integration-api/api-effects). - `profileintegrationid`: The ID of the customer profile, when applicable. - `props`: The [properties](https://docs.talon.one/docs/dev/integration-api/api-effects) of the effect. - `ruleindex`: The index of the rule. - `rulesetid`: The ID of the rule set. - `sessionid`: The internal ID of the session that triggered the effect. - `profileid`: The internal ID of the customer profile. - `sessionintegrationid`: The integration ID of the session. - `total_revenue`: The total revenue.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Float] :campaign_id Filter results by campaign.
# @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :date_format Determines the format of dates in the export document.
# @return [String]
def export_effects(application_id, opts = {})
data, _status_code, _headers = export_effects_with_http_info(application_id, opts)
data
end
# Export triggered effects
# Download a CSV file containing the triggered effects that match the given attributes. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `applicationid`: The ID of the Application. - `campaignid`: The ID of the campaign. - `couponid`: The ID of the coupon, when applicable to the effect. - `created`: The timestamp of the effect. - `event_type`: The name of the event. See the [docs](https://docs.talon.one/docs/dev/concepts/events). - `eventid`: The internal ID of the effect. - `name`: The effect name. See the [docs](https://docs.talon.one/docs/dev/integration-api/api-effects). - `profileintegrationid`: The ID of the customer profile, when applicable. - `props`: The [properties](https://docs.talon.one/docs/dev/integration-api/api-effects) of the effect. - `ruleindex`: The index of the rule. - `rulesetid`: The ID of the rule set. - `sessionid`: The internal ID of the session that triggered the effect. - `profileid`: The internal ID of the customer profile. - `sessionintegrationid`: The integration ID of the session. - `total_revenue`: The total revenue.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Float] :campaign_id Filter results by campaign.
# @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :date_format Determines the format of dates in the export document.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_effects_with_http_info(application_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_effects ...'
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.export_effects"
end
allowable_values = ["excel", "ISO8601"]
if @api_client.config.client_side_validation && opts[:'date_format'] && !allowable_values.include?(opts[:'date_format'])
fail ArgumentError, "invalid value for \"date_format\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/export_effects'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
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?
query_params[:'dateFormat'] = opts[:'date_format'] if !opts[:'date_format'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_effects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export customer loyalty balance to CSV
# ⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/).
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :end_date Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. **Note:** It must be an RFC3339 timestamp string.
# @return [String]
def export_loyalty_balance(loyalty_program_id, opts = {})
data, _status_code, _headers = export_loyalty_balance_with_http_info(loyalty_program_id, opts)
data
end
# Export customer loyalty balance to CSV
# ⚠️ Deprecation notice: Support for requests to this endpoint will end soon. To export customer loyalty balances to CSV, use the [Export customer loyalty balances to CSV](/management-api#tag/Loyalty/operation/exportLoyaltyBalances) endpoint. Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/).
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :end_date Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. **Note:** It must be an RFC3339 timestamp string.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_loyalty_balance_with_http_info(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_loyalty_balance ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.export_loyalty_balance"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balance'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_loyalty_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export customer loyalty balances
# Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export.
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :end_date Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. **Note:** It must be an RFC3339 timestamp string.
# @return [String]
def export_loyalty_balances(loyalty_program_id, opts = {})
data, _status_code, _headers = export_loyalty_balances_with_http_info(loyalty_program_id, opts)
data
end
# Export customer loyalty balances
# Download a CSV file containing the balance of each customer in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `profileIntegrationID`: The integration ID of the customer profile. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points. - `currentTier`: The tier that the customer is in at the time of the export.
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :end_date Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. **Note:** It must be an RFC3339 timestamp string.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_loyalty_balances_with_http_info(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_loyalty_balances ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.export_loyalty_balances"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/export_customer_balances'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_loyalty_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export loyalty card transaction logs to CSV
# Download a CSV file containing the balances of all cards in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The alphanumeric identifier of the loyalty card. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :end_date Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. **Note:** It must be an RFC3339 timestamp string.
# @return [String]
def export_loyalty_card_balances(loyalty_program_id, opts = {})
data, _status_code, _headers = export_loyalty_card_balances_with_http_info(loyalty_program_id, opts)
data
end
# Export loyalty card transaction logs to CSV
# Download a CSV file containing the balances of all cards in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `loyaltyProgramID`: The ID of the loyalty program. - `loyaltySubledger`: The name of the subdleger, when applicatble. - `cardIdentifier`: The alphanumeric identifier of the loyalty card. - `cardState`:The state of the loyalty card. It can be `active` or `inactive`. - `currentBalance`: The current point balance. - `pendingBalance`: The number of pending points. - `expiredBalance`: The number of expired points. - `spentBalance`: The number of spent points.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :end_date Used to return balances only for entries older than this timestamp. The expired, active, and pending points are relative to this timestamp. **Note:** It must be an RFC3339 timestamp string.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_loyalty_card_balances_with_http_info(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_loyalty_card_balances ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.export_loyalty_card_balances"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/export_card_balances'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_loyalty_card_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export a loyalty card ledger log
# Download a CSV file containing a loyalty card ledger log of the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/).
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This must be an RFC3339 timestamp string.
# @param [Hash] opts the optional parameters
# @option opts [String] :date_format Determines the format of dates in the export document.
# @return [String]
def export_loyalty_card_ledger(loyalty_program_id, loyalty_card_identifier, range_start, range_end, opts = {})
data, _status_code, _headers = export_loyalty_card_ledger_with_http_info(loyalty_program_id, loyalty_card_identifier, range_start, range_end, opts)
data
end
# Export a loyalty card ledger log
# Download a CSV file containing a loyalty card ledger log of the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/).
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This must be an RFC3339 timestamp string.
# @param [Hash] opts the optional parameters
# @option opts [String] :date_format Determines the format of dates in the export document.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_loyalty_card_ledger_with_http_info(loyalty_program_id, loyalty_card_identifier, range_start, range_end, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_loyalty_card_ledger ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.export_loyalty_card_ledger"
end
# verify the required parameter 'loyalty_card_identifier' is set
if @api_client.config.client_side_validation && loyalty_card_identifier.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_card_identifier' when calling ManagementApi.export_loyalty_card_ledger"
end
if @api_client.config.client_side_validation && loyalty_card_identifier.to_s.length > 108
fail ArgumentError, 'invalid value for "loyalty_card_identifier" when calling ManagementApi.export_loyalty_card_ledger, the character length must be smaller than or equal to 108.'
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.export_loyalty_card_ledger"
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.export_loyalty_card_ledger"
end
allowable_values = ["excel", "ISO8601"]
if @api_client.config.client_side_validation && opts[:'date_format'] && !allowable_values.include?(opts[:'date_format'])
fail ArgumentError, "invalid value for \"date_format\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardIdentifier}/export_log'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardIdentifier' + '}', CGI.escape(loyalty_card_identifier.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'rangeStart'] = range_start
query_params[:'rangeEnd'] = range_end
query_params[:'dateFormat'] = opts[:'date_format'] if !opts[:'date_format'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_loyalty_card_ledger\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export customer's transaction logs
# Download a CSV file containing a customer's transaction logs in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `customerprofileid`: The ID of the profile. - `customersessionid`: The ID of the customer session. - `rulesetid`: The ID of the rule set. - `rulename`: The name of the rule. - `programid`: The ID of the loyalty program. - `type`: The type of the loyalty program. - `name`: The name of the loyalty program. - `subledgerid`: The ID of the subledger, when applicable. - `startdate`: The start date of the program. - `expirydate`: The expiration date of the program. - `id`: The ID of the transaction. - `created`: The timestamp of the creation of the loyalty program. - `amount`: The number of points in that transaction. - `archived`: Whether the session related to the transaction is archived.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This must be an RFC3339 timestamp string.
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param integration_id [String] The identifier of the profile.
# @param [Hash] opts the optional parameters
# @option opts [String] :date_format Determines the format of dates in the export document.
# @return [String]
def export_loyalty_ledger(range_start, range_end, loyalty_program_id, integration_id, opts = {})
data, _status_code, _headers = export_loyalty_ledger_with_http_info(range_start, range_end, loyalty_program_id, integration_id, opts)
data
end
# Export customer's transaction logs
# Download a CSV file containing a customer's transaction logs in the loyalty program. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The generated file can contain the following columns: - `customerprofileid`: The ID of the profile. - `customersessionid`: The ID of the customer session. - `rulesetid`: The ID of the rule set. - `rulename`: The name of the rule. - `programid`: The ID of the loyalty program. - `type`: The type of the loyalty program. - `name`: The name of the loyalty program. - `subledgerid`: The ID of the subledger, when applicable. - `startdate`: The start date of the program. - `expirydate`: The expiration date of the program. - `id`: The ID of the transaction. - `created`: The timestamp of the creation of the loyalty program. - `amount`: The number of points in that transaction. - `archived`: Whether the session related to the transaction is archived.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This must be an RFC3339 timestamp string.
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param integration_id [String] The identifier of the profile.
# @param [Hash] opts the optional parameters
# @option opts [String] :date_format Determines the format of dates in the export document.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_loyalty_ledger_with_http_info(range_start, range_end, loyalty_program_id, integration_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_loyalty_ledger ...'
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.export_loyalty_ledger"
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.export_loyalty_ledger"
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.export_loyalty_ledger"
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.export_loyalty_ledger"
end
allowable_values = ["excel", "ISO8601"]
if @api_client.config.client_side_validation && opts[:'date_format'] && !allowable_values.include?(opts[:'date_format'])
fail ArgumentError, "invalid value for \"date_format\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'rangeStart'] = range_start
query_params[:'rangeEnd'] = range_end
query_params[:'dateFormat'] = opts[:'date_format'] if !opts[:'date_format'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_loyalty_ledger\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Export referrals
# Download a CSV file containing the referrals that match the given parameters. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `code`: The referral code. - `advocateprofileintegrationid`: The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Float] :campaign_id Filter results by campaign.
# @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future.
# @option opts [String] :usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned.
# @option opts [String] :batch_id Filter results by batches of referrals
# @option opts [String] :date_format Determines the format of dates in the export document.
# @return [String]
def export_referrals(application_id, opts = {})
data, _status_code, _headers = export_referrals_with_http_info(application_id, opts)
data
end
# Export referrals
# Download a CSV file containing the referrals that match the given parameters. **Tip:** If the exported CSV file is too large to view, you can [split it into multiple files](https://www.makeuseof.com/tag/how-to-split-a-huge-csv-excel-workbook-into-seperate-files/). The CSV file contains the following columns: - `code`: The referral code. - `advocateprofileintegrationid`: The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Float] :campaign_id Filter results by campaign.
# @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid - `expired`: Matches referrals in which the expiration date is set and in the past. - `validNow`: Matches referrals in which start date is null or in the past and expiration date is null or in the future. - `validFuture`: Matches referrals in which start date is set and in the future.
# @option opts [String] :usable - `true`, only referrals where `usageCounter < usageLimit` will be returned. - `false`, only referrals where `usageCounter >= usageLimit` will be returned.
# @option opts [String] :batch_id Filter results by batches of referrals
# @option opts [String] :date_format Determines the format of dates in the export document.
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
def export_referrals_with_http_info(application_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.export_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.export_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
allowable_values = ["excel", "ISO8601"]
if @api_client.config.client_side_validation && opts[:'date_format'] && !allowable_values.include?(opts[:'date_format'])
fail ArgumentError, "invalid value for \"date_format\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/export_referrals'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
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?
query_params[:'valid'] = opts[:'valid'] if !opts[:'valid'].nil?
query_params[:'usable'] = opts[:'usable'] if !opts[:'usable'].nil?
query_params[:'batchId'] = opts[:'batch_id'] if !opts[:'batch_id'].nil?
query_params[:'dateFormat'] = opts[:'date_format'] if !opts[:'date_format'].nil?
# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/csv'])
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'String'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#export_referrals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get access logs for Application
# Retrieve the list of API calls sent to the specified Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This 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 in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [InlineResponse20017]
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
# Retrieve the list of API calls sent to the specified Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This 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 in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [Array<(InlineResponse20017, Integer, Hash)>] InlineResponse20017 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_access_logs_without_total_count, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_access_logs_without_total_count, must be greater than or equal to 1.'
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] || 'InlineResponse20017'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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] The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property.
# @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] The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property.
# @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] || ['management_key', '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 Talon.One account.
# @param account_id [Integer] The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property.
# @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 Talon.One account.
# @param account_id [Integer] The identifier of the account. Retrieve it via the [List users in account](https://docs.talon.one/management-api#operation/getUsers) endpoint in the `accountId` property.
# @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] || ['management_key', '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 account-level collection
# Retrieve a given account-level collection.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [Collection]
def get_account_collection(collection_id, opts = {})
data, _status_code, _headers = get_account_collection_with_http_info(collection_id, opts)
data
end
# Get account-level collection
# Retrieve a given account-level collection.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers
def get_account_collection_with_http_info(collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_account_collection ...'
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.get_account_collection"
end
# resource path
local_var_path = '/v1/collections/{collectionId}'.sub('{' + 'collectionId' + '}', CGI.escape(collection_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] || 'Collection'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get additional cost
# Returns the additional cost.
# @param additional_cost_id [Integer] The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**.
# @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 additional cost
# Returns the additional cost.
# @param additional_cost_id [Integer] The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**.
# @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] || ['management_key', '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 in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [InlineResponse20031]
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 in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [Array<(InlineResponse20031, Integer, Hash)>] InlineResponse20031 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_additional_costs, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_additional_costs, must be greater than or equal to 1.'
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] || 'InlineResponse20031'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List 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. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This 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 in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [InlineResponse20018]
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
# List 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. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This 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 in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [Array<(InlineResponse20018, Integer, Hash)>] InlineResponse20018 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_all_access_logs, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_all_access_logs, must be greater than or equal to 1.'
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] || 'InlineResponse20018'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List roles
# List all roles.
# @param [Hash] opts the optional parameters
# @return [InlineResponse20039]
def get_all_roles(opts = {})
data, _status_code, _headers = get_all_roles_with_http_info(opts)
data
end
# List roles
# List all roles.
# @param [Hash] opts the optional parameters
# @return [Array<(InlineResponse20039, Integer, Hash)>] InlineResponse20039 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] || 'InlineResponse20039'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @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] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @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] || ['management_key', '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 Application health
# Display the health of the Application and show the last time the Application was used. You can also display this information from the **Settings** of an Application, in the **Developer Settings** menu. See the [docs](https://docs.talon.one/docs/dev/tutorials/monitoring-integration-status).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @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 Application health
# Display the health of the Application and show the last time the Application was used. You can also display this information from the **Settings** of an Application, in the **Developer Settings** menu. See the [docs](https://docs.talon.one/docs/dev/tutorials/monitoring-integration-status).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @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] || ['management_key', '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's customer
# Retrieve the customers of the specified application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param customer_id [Integer] The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
# @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's customer
# Retrieve the customers of the specified application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param customer_id [Integer] The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
# @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] || ['management_key', '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 friends referred by customer profile
# List the friends referred by the specified customer profile in this Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param integration_id [String] The Integration ID of the Advocate's Profile.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @return [InlineResponse20029]
def get_application_customer_friends(application_id, integration_id, opts = {})
data, _status_code, _headers = get_application_customer_friends_with_http_info(application_id, integration_id, opts)
data
end
# List friends referred by customer profile
# List the friends referred by the specified customer profile in this Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param integration_id [String] The Integration ID of the Advocate's Profile.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @return [Array<(InlineResponse20029, Integer, Hash)>] InlineResponse20029 data, response status code and response headers
def get_application_customer_friends_with_http_info(application_id, integration_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_application_customer_friends ...'
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_friends"
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_application_customer_friends"
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_customer_friends, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_customer_friends, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/applications/{applicationId}/profile/{integrationId}/friends'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_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[:'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] || 'InlineResponse20029'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_friends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List application's customers
# List all the customers of the specified application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @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 in this response. (default to 1000)
# @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 includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @return [InlineResponse20020]
def get_application_customers(application_id, opts = {})
data, _status_code, _headers = get_application_customers_with_http_info(application_id, opts)
data
end
# List application's customers
# List all the customers of the specified application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @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 in this response.
# @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 includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @return [Array<(InlineResponse20020, Integer, Hash)>] InlineResponse20020 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_customers, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_customers, must be greater than or equal to 1.'
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] || 'InlineResponse20020'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List application customers matching the given attributes
# Get a list of the application customers matching the provided criteria. 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.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [CustomerProfileSearchQuery] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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 includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @return [InlineResponse20021]
def get_application_customers_by_attributes(application_id, body, opts = {})
data, _status_code, _headers = get_application_customers_by_attributes_with_http_info(application_id, body, opts)
data
end
# List application customers matching the given attributes
# Get a list of the application customers matching the provided criteria. 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.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [CustomerProfileSearchQuery] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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 includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @return [Array<(InlineResponse20021, Integer, Hash)>] InlineResponse20021 data, response status code and response headers
def get_application_customers_by_attributes_with_http_info(application_id, 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 '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_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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_customers_by_attributes, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_customers_by_attributes, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/applications/{applicationId}/customer_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[:'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'])
# 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] || 'InlineResponse20021'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_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](https://docs.talon.one/integration-api#operation/trackEvent)
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [InlineResponse20027]
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](https://docs.talon.one/integration-api#operation/trackEvent)
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [Array<(InlineResponse20027, Integer, Hash)>] InlineResponse20027 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_event_types, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_event_types, must be greater than or equal to 1.'
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] || 'InlineResponse20027'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Lists all events recorded for an application. Instead of having the total number of results in the response, this endpoint only mentions whether there are more results.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally.
# @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 [InlineResponse20026]
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 mentions whether there are more results.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally.
# @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<(InlineResponse20026, Integer, Hash)>] InlineResponse20026 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[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_events_without_total_count, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_events_without_total_count, must be greater than or equal to 1.'
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] || 'InlineResponse20026'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Get the details of the given session. You can list the sessions with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param session_id [Integer] The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.
# @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
# Get the details of the given session. You can list the sessions with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param session_id [Integer] The **internal** ID of the session. You can get the ID with the [List Application sessions](https://docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.
# @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] || ['management_key', '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
# List all the sessions of the specified Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally.
# @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 [InlineResponse20025]
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
# List all the sessions of the specified Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally.
# @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<(InlineResponse20025, Integer, Hash)>] InlineResponse20025 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_sessions, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_application_sessions, must be greater than or equal to 1.'
end
allowable_values = ["open", "closed", "partially_returned", "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] || 'InlineResponse20025'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 applications in the current account.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [InlineResponse2002]
def get_applications(opts = {})
data, _status_code, _headers = get_applications_with_http_info(opts)
data
end
# List Applications
# List all applications in the current account.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [Array<(InlineResponse2002, Integer, Hash)>] InlineResponse2002 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_applications, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_applications, must be greater than or equal to 1.'
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] || 'InlineResponse2002'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 custom attribute
# Retrieve the specified custom attribute.
# @param attribute_id [Integer] The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.
# @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 custom attribute
# Retrieve the specified custom attribute.
# @param attribute_id [Integer] The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.
# @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] || ['management_key', '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
# Return all the custom attributes for the account.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :entity Returned attributes will be filtered by supplied entity.
# @return [InlineResponse20030]
def get_attributes(opts = {})
data, _status_code, _headers = get_attributes_with_http_info(opts)
data
end
# List custom attributes
# Return all the custom attributes for the account.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :entity Returned attributes will be filtered by supplied entity.
# @return [Array<(InlineResponse20030, Integer, Hash)>] InlineResponse20030 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_attributes, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_attributes, must be greater than or equal to 1.'
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?
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] || 'InlineResponse20030'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List audiences
# Get all audiences created in the account. To create an audience, use [Create audience](https://docs.talon.one/integration-api#tag/Audiences/operation/createAudienceV2).
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @return [InlineResponse20028]
def get_audiences(opts = {})
data, _status_code, _headers = get_audiences_with_http_info(opts)
data
end
# List audiences
# Get all audiences created in the account. To create an audience, use [Create audience](https://docs.talon.one/integration-api#tag/Audiences/operation/createAudienceV2).
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @return [Array<(InlineResponse20028, Integer, Hash)>] InlineResponse20028 data, response status code and response headers
def get_audiences_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_audiences ...'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_audiences, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_audiences, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/audiences'
# 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[:'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] || 'InlineResponse20028'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_audiences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get campaign
# Retrieve the given campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @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 campaign
# Retrieve the given campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @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] || ['management_key', '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
# Retrieve statistical data about the performance of the given campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This 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 [InlineResponse20019]
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
# Retrieve statistical data about the performance of the given campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This 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<(InlineResponse20019, Integer, Hash)>] InlineResponse20019 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] || 'InlineResponse20019'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List campaigns that match the given attributes
# Get a list of all the campaigns that match a set of attributes.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [CampaignSearch] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :campaign_state Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts.
# @return [InlineResponse2003]
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
# List campaigns that match the given attributes
# Get a list of all the campaigns that match a set of attributes.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [CampaignSearch] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :campaign_state Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts.
# @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_campaign_by_attributes, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_campaign_by_attributes, must be greater than or equal to 1.'
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] || 'InlineResponse2003'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 campaign templates
# Retrieve a list of campaign templates.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :state Filter results by the state of the campaign template.
# @option opts [String] :name Filter results performing case-insensitive matching against the name of the campaign template.
# @option opts [String] :tags Filter results performing case-insensitive matching against the tags of the campaign template. 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 [Integer] :user_id Filter results by user ID.
# @return [InlineResponse2009]
def get_campaign_templates(opts = {})
data, _status_code, _headers = get_campaign_templates_with_http_info(opts)
data
end
# List campaign templates
# Retrieve a list of campaign templates.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :state Filter results by the state of the campaign template.
# @option opts [String] :name Filter results performing case-insensitive matching against the name of the campaign template.
# @option opts [String] :tags Filter results performing case-insensitive matching against the tags of the campaign template. 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 [Integer] :user_id Filter results by user ID.
# @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers
def get_campaign_templates_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_campaign_templates ...'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_campaign_templates, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_campaign_templates, must be greater than or equal to 1.'
end
allowable_values = ["enabled", "disabled", "draft"]
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/campaign_templates'
# 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[:'state'] = opts[:'state'] if !opts[:'state'].nil?
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?
query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_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] || 'InlineResponse2009'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List campaigns
# List the campaigns of the specified application that match your filter criteria.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :campaign_state Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [Integer] :campaign_group_id Filter results to campaigns owned by the specified campaign group ID.
# @option opts [Integer] :template_id The ID of the Campaign Template this Campaign was created from.
# @return [InlineResponse2003]
def get_campaigns(application_id, opts = {})
data, _status_code, _headers = get_campaigns_with_http_info(application_id, opts)
data
end
# List campaigns
# List the campaigns of the specified application that match your filter criteria.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :campaign_state Filter results by the state of the campaign. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the campaign creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [Integer] :campaign_group_id Filter results to campaigns owned by the specified campaign group ID.
# @option opts [Integer] :template_id The ID of the Campaign Template this Campaign was created from.
# @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_campaigns, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_campaigns, must be greater than or equal to 1.'
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?
query_params[:'templateId'] = opts[:'template_id'] if !opts[:'template_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] || 'InlineResponse2003'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 logs for an account
# Retrieve the audit logs displayed in **Accounts > Audit logs**.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Float] :application_id Filter results by Application ID.
# @option opts [String] :entity_path Filter results on a case insensitive matching of the url path of the entity
# @option opts [Integer] :user_id Filter results by user ID.
# @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @option opts [Integer] :management_key_id Filter results that match the given management key ID.
# @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 [InlineResponse20037]
def get_changes(opts = {})
data, _status_code, _headers = get_changes_with_http_info(opts)
data
end
# Get audit logs for an account
# Retrieve the audit logs displayed in **Accounts > Audit logs**.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Float] :application_id Filter results by Application ID.
# @option opts [String] :entity_path Filter results on a case insensitive matching of the url path of the entity
# @option opts [Integer] :user_id Filter results by user ID.
# @option opts [DateTime] :created_before Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the change creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @option opts [Integer] :management_key_id Filter results that match the given management key ID.
# @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<(InlineResponse20037, Integer, Hash)>] InlineResponse20037 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_changes, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_changes, must be greater than or equal to 1.'
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[:'entityPath'] = opts[:'entity_path'] if !opts[:'entity_path'].nil?
query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_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[:'managementKeyId'] = opts[:'management_key_id'] if !opts[:'management_key_id'].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] || 'InlineResponse20037'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Get collection
# Retrieve a given collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [Collection]
def get_collection(application_id, campaign_id, collection_id, opts = {})
data, _status_code, _headers = get_collection_with_http_info(application_id, campaign_id, collection_id, opts)
data
end
# Get collection
# Retrieve a given collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers
def get_collection_with_http_info(application_id, campaign_id, collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_collection ...'
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_collection"
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_collection"
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.get_collection"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'collectionId' + '}', CGI.escape(collection_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] || 'Collection'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get collection items
# Retrieve the items from the given collection.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @return [InlineResponse20015]
def get_collection_items(collection_id, opts = {})
data, _status_code, _headers = get_collection_items_with_http_info(collection_id, opts)
data
end
# Get collection items
# Retrieve the items from the given collection.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @return [Array<(InlineResponse20015, Integer, Hash)>] InlineResponse20015 data, response status code and response headers
def get_collection_items_with_http_info(collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_collection_items ...'
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.get_collection_items"
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_collection_items, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_collection_items, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/collections/{collectionId}/items'.sub('{' + 'collectionId' + '}', CGI.escape(collection_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?
# 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] || ['management_key', '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_collection_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List coupons
# List all the coupons matching the specified criteria.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration 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. This filter shows the coupons created by redeeming 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 [InlineResponse2007]
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
# List all the coupons matching the specified criteria.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration 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. This filter shows the coupons created by redeeming 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<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_coupons_without_total_count, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_coupons_without_total_count, must be greater than or equal to 1.'
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] || 'InlineResponse2007'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 customer's activity report
# Fetch the summary report of a given customer in the given application, in a time range.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This must be an RFC3339 timestamp string.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param customer_id [Integer] The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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 customer's activity report
# Fetch the summary report of a given customer in the given application, in a time range.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This must be an RFC3339 timestamp string.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param customer_id [Integer] The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customer_activity_report, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customer_activity_report, must be greater than or equal to 1.'
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] || ['management_key', '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
# 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 mentions whether there are more results.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This must be an RFC3339 timestamp string.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :name Only return reports matching the customer name
# @option opts [String] :integration_id Filter results performing an exact matching against the profile integration identifier.
# @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 [InlineResponse20024]
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 mentions whether there are more results.
# @param range_start [DateTime] Only return results from after this timestamp. This must be an RFC3339 timestamp string.
# @param range_end [DateTime] Only return results from before this timestamp. This must be an RFC3339 timestamp string.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :name Only return reports matching the customer name
# @option opts [String] :integration_id Filter results performing an exact matching against the profile integration identifier.
# @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<(InlineResponse20024, Integer, Hash)>] InlineResponse20024 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customer_activity_reports_without_total_count, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customer_activity_reports_without_total_count, must be greater than or equal to 1.'
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] || 'InlineResponse20024'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 customer's analytics report
# Fetch analytics for a given customer in the given application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param customer_id [Integer] The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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 customer's analytics report
# Fetch analytics for a given customer in the given application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param customer_id [Integer] The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customer_analytics, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customer_analytics, must be greater than or equal to 1.'
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] || ['management_key', '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
# Return the details of the specified customer profile. Performance tips
You can retrieve the same information via the Integration API, which can save you extra API requests. consider these options: - Request the customer profile to be part of the response content using [Update Customer Session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2). - Send an empty update with the [Update Customer Profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint with `runRuleEngine=false`.
# @param customer_id [Integer] The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
# @param [Hash] opts the optional parameters
# @return [CustomerProfile]
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
# Return the details of the specified customer profile. <div class=\"redoc-section\"> <p class=\"title\">Performance tips</p> You can retrieve the same information via the Integration API, which can save you extra API requests. consider these options: - Request the customer profile to be part of the response content using [Update Customer Session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2). - Send an empty update with the [Update Customer Profile](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint with `runRuleEngine=false`. </div>
# @param customer_id [Integer] The value of the `id` property of a customer profile. Get it with the [List Application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(CustomerProfile, Integer, Hash)>] CustomerProfile 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] || 'CustomerProfile'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List all customer profiles.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @option opts [Boolean] :sandbox Indicates whether you are pointing to a sandbox or Live customer. (default to false)
# @return [InlineResponse20023]
def get_customer_profiles(opts = {})
data, _status_code, _headers = get_customer_profiles_with_http_info(opts)
data
end
# List customer profiles
# List all customer profiles.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @option opts [Boolean] :sandbox Indicates whether you are pointing to a sandbox or Live customer.
# @return [Array<(InlineResponse20023, Integer, Hash)>] InlineResponse20023 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customer_profiles, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customer_profiles, must be greater than or equal to 1.'
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?
query_params[:'sandbox'] = opts[:'sandbox'] if !opts[:'sandbox'].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] || ['management_key', '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
# List customer profiles matching the given attributes
# Get a list of the customer profiles matching the provided criteria. 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.
# @param body [CustomerProfileSearchQuery] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @option opts [Boolean] :sandbox Indicates whether you are pointing to a sandbox or Live customer. (default to false)
# @return [InlineResponse20022]
def get_customers_by_attributes(body, opts = {})
data, _status_code, _headers = get_customers_by_attributes_with_http_info(body, opts)
data
end
# List customer profiles matching the given attributes
# Get a list of the customer profiles matching the provided criteria. 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.
# @param body [CustomerProfileSearchQuery] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @option opts [Boolean] :sandbox Indicates whether you are pointing to a sandbox or Live customer.
# @return [Array<(InlineResponse20022, Integer, Hash)>] InlineResponse20022 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customers_by_attributes, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_customers_by_attributes, must be greater than or equal to 1.'
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?
query_params[:'sandbox'] = opts[:'sandbox'] if !opts[:'sandbox'].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] || 'InlineResponse20022'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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.
# @param [Hash] opts the optional parameters
# @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 in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [InlineResponse20035]
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.
# @param [Hash] opts the optional parameters
# @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 in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [Array<(InlineResponse20035, Integer, Hash)>] InlineResponse20035 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_event_types, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_event_types, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/event_types'
# query parameters
query_params = opts[:query_params] || {}
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] || 'InlineResponse20035'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List all past exports
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @option opts [Float] :application_id Filter results by Application ID.
# @option opts [Integer] :campaign_id Filter by the campaign ID on which the limit counters are used.
# @option opts [String] :entity The name of the entity type that was exported.
# @return [InlineResponse20038]
def get_exports(opts = {})
data, _status_code, _headers = get_exports_with_http_info(opts)
data
end
# Get exports
# List all past exports
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @option opts [Float] :application_id Filter results by Application ID.
# @option opts [Integer] :campaign_id Filter by the campaign ID on which the limit counters are used.
# @option opts [String] :entity The name of the entity type that was exported.
# @return [Array<(InlineResponse20038, Integer, Hash)>] InlineResponse20038 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_exports, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_exports, must be greater than or equal to 1.'
end
allowable_values = ["Coupon", "Referral", "Effect", "CustomerSession", "LoyaltyLedger", "LoyaltyLedgerLog", "Collection", "AudienceMembership"]
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] || 'InlineResponse20038'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 loyalty card
# Get the given loyalty card.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param [Hash] opts the optional parameters
# @return [LoyaltyCard]
def get_loyalty_card(loyalty_program_id, loyalty_card_identifier, opts = {})
data, _status_code, _headers = get_loyalty_card_with_http_info(loyalty_program_id, loyalty_card_identifier, opts)
data
end
# Get loyalty card
# Get the given loyalty card.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(LoyaltyCard, Integer, Hash)>] LoyaltyCard data, response status code and response headers
def get_loyalty_card_with_http_info(loyalty_program_id, loyalty_card_identifier, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_card ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.get_loyalty_card"
end
# verify the required parameter 'loyalty_card_identifier' is set
if @api_client.config.client_side_validation && loyalty_card_identifier.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_card_identifier' when calling ManagementApi.get_loyalty_card"
end
if @api_client.config.client_side_validation && loyalty_card_identifier.to_s.length > 108
fail ArgumentError, 'invalid value for "loyalty_card_identifier" when calling ManagementApi.get_loyalty_card, the character length must be smaller than or equal to 108.'
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardIdentifier}'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardIdentifier' + '}', CGI.escape(loyalty_card_identifier.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] || 'LoyaltyCard'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get loyalty card transaction logs
# Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/loyalty-cards/loyalty-card-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :start_date Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
# @option opts [DateTime] :end_date Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @option opts [String] :subledger_id The ID of the subledger by which we filter the data.
# @return [InlineResponse20013]
def get_loyalty_card_transaction_logs(loyalty_program_id, loyalty_card_identifier, opts = {})
data, _status_code, _headers = get_loyalty_card_transaction_logs_with_http_info(loyalty_program_id, loyalty_card_identifier, opts)
data
end
# Get loyalty card transaction logs
# Retrieve the transaction logs for the given [loyalty card](https://docs.talon.one/docs/product/loyalty-programs/loyalty-cards/loyalty-card-overview) within the specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types) with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [DateTime] :start_date Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
# @option opts [DateTime] :end_date Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
# @option opts [Integer] :page_size The number of items in this response.
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @option opts [String] :subledger_id The ID of the subledger by which we filter the data.
# @return [Array<(InlineResponse20013, Integer, Hash)>] InlineResponse20013 data, response status code and response headers
def get_loyalty_card_transaction_logs_with_http_info(loyalty_program_id, loyalty_card_identifier, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_card_transaction_logs ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.get_loyalty_card_transaction_logs"
end
# verify the required parameter 'loyalty_card_identifier' is set
if @api_client.config.client_side_validation && loyalty_card_identifier.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_card_identifier' when calling ManagementApi.get_loyalty_card_transaction_logs"
end
if @api_client.config.client_side_validation && loyalty_card_identifier.to_s.length > 108
fail ArgumentError, 'invalid value for "loyalty_card_identifier" when calling ManagementApi.get_loyalty_card_transaction_logs, the character length must be smaller than or equal to 108.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_loyalty_card_transaction_logs, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_loyalty_card_transaction_logs, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardIdentifier}/logs'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardIdentifier' + '}', CGI.escape(loyalty_card_identifier.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
query_params[:'subledgerId'] = opts[:'subledger_id'] if !opts[:'subledger_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] || 'InlineResponse20013'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_card_transaction_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List loyalty cards
# For the given card-based loyalty program, list the loyalty cards that match your filter criteria.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :identifier Optional query parameter to search cards by identifier.
# @option opts [Integer] :profile_id Filter by the profile ID.
# @return [InlineResponse20012]
def get_loyalty_cards(loyalty_program_id, opts = {})
data, _status_code, _headers = get_loyalty_cards_with_http_info(loyalty_program_id, opts)
data
end
# List loyalty cards
# For the given card-based loyalty program, list the loyalty cards that match your filter criteria.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :identifier Optional query parameter to search cards by identifier.
# @option opts [Integer] :profile_id Filter by the profile ID.
# @return [Array<(InlineResponse20012, Integer, Hash)>] InlineResponse20012 data, response status code and response headers
def get_loyalty_cards_with_http_info(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_cards ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.get_loyalty_cards"
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_loyalty_cards, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_loyalty_cards, must be greater than or equal to 1.'
end
if @api_client.config.client_side_validation && !opts[:'identifier'].nil? && opts[:'identifier'].to_s.length < 4
fail ArgumentError, 'invalid value for "opts[:"identifier"]" when calling ManagementApi.get_loyalty_cards, the character length must be great than or equal to 4.'
end
if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'] < 1
fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling ManagementApi.get_loyalty_cards, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_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[:'identifier'] = opts[:'identifier'] if !opts[:'identifier'].nil?
query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_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] || 'InlineResponse20012'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_cards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Get customer's full loyalty ledger
# Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions).
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param integration_id [String] The identifier of the profile.
# @param [Hash] opts the optional parameters
# @return [LoyaltyLedger]
def get_loyalty_points(loyalty_program_id, integration_id, opts = {})
data, _status_code, _headers = get_loyalty_points_with_http_info(loyalty_program_id, integration_id, opts)
data
end
# Get customer's full loyalty ledger
# Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions).
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param integration_id [String] The identifier of the profile.
# @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(loyalty_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 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_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/{loyaltyProgramId}/profile/{integrationId}'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_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] || ['management_key', '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 loyalty program
# Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory)
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @return [LoyaltyProgram]
def get_loyalty_program(loyalty_program_id, opts = {})
data, _status_code, _headers = get_loyalty_program_with_http_info(loyalty_program_id, opts)
data
end
# Get loyalty program
# Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory)
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @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(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_program ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.get_loyalty_program"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_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] || ['management_key', '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 loyalty program transactions
# Retrieve all loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions).
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :loyalty_transaction_type Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file.
# @option opts [String] :subledger_id The ID of the subledger by which we filter the data.
# @option opts [DateTime] :start_date Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
# @option opts [DateTime] :end_date Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
# @option opts [Integer] :page_size The number of items in this response. (default to 50)
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @return [InlineResponse20011]
def get_loyalty_program_transactions(loyalty_program_id, opts = {})
data, _status_code, _headers = get_loyalty_program_transactions_with_http_info(loyalty_program_id, opts)
data
end
# List loyalty program transactions
# Retrieve all loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions).
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :loyalty_transaction_type Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file.
# @option opts [String] :subledger_id The ID of the subledger by which we filter the data.
# @option opts [DateTime] :start_date Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
# @option opts [DateTime] :end_date Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** It must be an RFC3339 timestamp string.
# @option opts [Integer] :page_size The number of items in this response.
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @return [Array<(InlineResponse20011, Integer, Hash)>] InlineResponse20011 data, response status code and response headers
def get_loyalty_program_transactions_with_http_info(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_program_transactions ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.get_loyalty_program_transactions"
end
allowable_values = ["manual", "session", "import"]
if @api_client.config.client_side_validation && opts[:'loyalty_transaction_type'] && !allowable_values.include?(opts[:'loyalty_transaction_type'])
fail ArgumentError, "invalid value for \"loyalty_transaction_type\", must be one of #{allowable_values}"
end
if @api_client.config.client_side_validation && !opts[:'loyalty_transaction_type'].nil? && opts[:'loyalty_transaction_type'].to_s.length > 255
fail ArgumentError, 'invalid value for "opts[:"loyalty_transaction_type"]" when calling ManagementApi.get_loyalty_program_transactions, the character length must be smaller than or equal to 255.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_loyalty_program_transactions, must be smaller than or equal to 50.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_loyalty_program_transactions, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/transactions'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s))
# query parameters
query_params = opts[:query_params] || {}
query_params[:'loyaltyTransactionType'] = opts[:'loyalty_transaction_type'] if !opts[:'loyalty_transaction_type'].nil?
query_params[:'subledgerId'] = opts[:'subledger_id'] if !opts[:'subledger_id'].nil?
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].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] || 'InlineResponse20011'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List loyalty programs
# List the loyalty programs of the account.
# @param [Hash] opts the optional parameters
# @return [InlineResponse20010]
def get_loyalty_programs(opts = {})
data, _status_code, _headers = get_loyalty_programs_with_http_info(opts)
data
end
# List loyalty programs
# List the loyalty programs of the account.
# @param [Hash] opts the optional parameters
# @return [Array<(InlineResponse20010, Integer, Hash)>] InlineResponse20010 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] || 'InlineResponse20010'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Retrieve the statistics of the specified loyalty program such as the total active points, pending points, spent points, and expired points. **Important:** The returned data does not include the current day. All statistics are updated daily at 11:59 PM in the loyalty program time zone.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @return [LoyaltyStatistics]
def get_loyalty_statistics(loyalty_program_id, opts = {})
data, _status_code, _headers = get_loyalty_statistics_with_http_info(loyalty_program_id, opts)
data
end
# Get loyalty program statistics
# Retrieve the statistics of the specified loyalty program such as the total active points, pending points, spent points, and expired points. **Important:** The returned data does not include the current day. All statistics are updated daily at 11:59 PM in the loyalty program time zone.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @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(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_loyalty_statistics ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.get_loyalty_statistics"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/statistics'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_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] || ['management_key', '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
# Get notification about campaign-related changes
# Return the given [notification about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param notification_webhook_id [Integer] The ID of the webhook. Get it with the appropriate _List notifications_ endpoint.
# @param [Hash] opts the optional parameters
# @return [NotificationWebhook]
def get_notification_webhook(application_id, notification_webhook_id, opts = {})
data, _status_code, _headers = get_notification_webhook_with_http_info(application_id, notification_webhook_id, opts)
data
end
# Get notification about campaign-related changes
# Return the given [notification about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param notification_webhook_id [Integer] The ID of the webhook. Get it with the appropriate _List notifications_ endpoint.
# @param [Hash] opts the optional parameters
# @return [Array<(NotificationWebhook, Integer, Hash)>] NotificationWebhook data, response status code and response headers
def get_notification_webhook_with_http_info(application_id, notification_webhook_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_notification_webhook ...'
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_notification_webhook"
end
# verify the required parameter 'notification_webhook_id' is set
if @api_client.config.client_side_validation && notification_webhook_id.nil?
fail ArgumentError, "Missing the required parameter 'notification_webhook_id' when calling ManagementApi.get_notification_webhook"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/notification_webhooks/{notificationWebhookId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'notificationWebhookId' + '}', CGI.escape(notification_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] || 'NotificationWebhook'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_notification_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List notifications about campaign-related changes
# List all [notifications about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications) for the given Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @return [InlineResponse2004]
def get_notification_webhooks(application_id, opts = {})
data, _status_code, _headers = get_notification_webhooks_with_http_info(application_id, opts)
data
end
# List notifications about campaign-related changes
# List all [notifications about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications) for the given Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
def get_notification_webhooks_with_http_info(application_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.get_notification_webhooks ...'
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_notification_webhooks"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/notification_webhooks'.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] || 'InlineResponse2004'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_notification_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List referrals
# List all referrals of the specified campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration 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 [InlineResponse2008]
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
# List all referrals of the specified campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the referral creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches referrals in which the expiration date is set and in the past. The second matches referrals in which start date is null or in the past and expiration 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<(InlineResponse2008, Integer, Hash)>] InlineResponse2008 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_referrals_without_total_count, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_referrals_without_total_count, must be greater than or equal to 1.'
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] || 'InlineResponse2008'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 role
# Get the details of the specified role. To see all the roles, use [List roles](#operation/getAllRoles).
# @param role_id [Integer] The Id of role.
# @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 role
# Get the details of the specified role. To see all the roles, use [List roles](#operation/getAllRoles).
# @param role_id [Integer] The Id of role.
# @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] || ['management_key', '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 ruleset
# Retrieve the specified ruleset.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param ruleset_id [Integer] The ID of the ruleset.
# @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 ruleset
# Retrieve the specified ruleset.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param ruleset_id [Integer] The ID of the ruleset.
# @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] || ['management_key', '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
# List all rulesets of this campaign. A ruleset is a revision of the rules of a campaign. **Important:** The response also includes deleted rules. You should only consider the latest revision of the returned rulesets.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [InlineResponse2005]
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
# List all rulesets of this campaign. A ruleset is a revision of the rules of a campaign. **Important:** The response also includes deleted rules. You should only consider the latest revision of the returned rulesets.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_rulesets, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_rulesets, must be greater than or equal to 1.'
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] || 'InlineResponse2005'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 user
# Retrieve the data (including an invitation code) for a user. Non-admin users can only get their own profile.
# @param user_id [Integer] The ID of the user.
# @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 user
# Retrieve the data (including an invitation code) for a user. Non-admin users can only get their own profile.
# @param user_id [Integer] The ID of the user.
# @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] || ['management_key', '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 account
# Retrieve all users in your account.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [InlineResponse20036]
def get_users(opts = {})
data, _status_code, _headers = get_users_with_http_info(opts)
data
end
# List users in account
# Retrieve all users in your account.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @return [Array<(InlineResponse20036, Integer, Hash)>] InlineResponse20036 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_users, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_users, must be greater than or equal to 1.'
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] || 'InlineResponse20036'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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 a webhook by its id.
# @param webhook_id [Integer] The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**.
# @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 a webhook by its id.
# @param webhook_id [Integer] The ID of the webhook. You can find the ID in the Campaign Manager's URL when you display the details of the webhook in **Account** > **Webhooks**.
# @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] || ['management_key', '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 are created as soon as an integration request triggers a webhook effect. See the [docs](https://docs.talon.one/docs/dev/getting-started/webhooks).
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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 Filter results by Application ID.
# @option opts [Float] :campaign_id Filter results by campaign.
# @option opts [DateTime] :created_before Only return events created before this date. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally.
# @return [InlineResponse20033]
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 are created as soon as an integration request triggers a webhook effect. See the [docs](https://docs.talon.one/docs/dev/getting-started/webhooks).
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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 Filter results by Application ID.
# @option opts [Float] :campaign_id Filter results by campaign.
# @option opts [DateTime] :created_before Only return events created before this date. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Only return events created after this date. You can use any timezone. Talon.One will convert to UTC internally.
# @return [Array<(InlineResponse20033, Integer, Hash)>] InlineResponse20033 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_webhook_activation_logs, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_webhook_activation_logs, must be greater than or equal to 1.'
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] || 'InlineResponse20033'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Retrieve all webhook log entries.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :status Filter results by HTTP status codes.
# @option opts [Float] :webhook_id Filter results by Webhook.
# @option opts [Float] :application_id Filter results by 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. You can use any timezone. Talon.One will convert to UTC internally.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @return [InlineResponse20034]
def get_webhook_logs(opts = {})
data, _status_code, _headers = get_webhook_logs_with_http_info(opts)
data
end
# List webhook log entries
# Retrieve all webhook log entries.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [String] :status Filter results by HTTP status codes.
# @option opts [Float] :webhook_id Filter results by Webhook.
# @option opts [Float] :application_id Filter results by 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. You can use any timezone. Talon.One will convert to UTC internally.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @return [Array<(InlineResponse20034, Integer, Hash)>] InlineResponse20034 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_webhook_logs, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_webhook_logs, must be greater than or equal to 1.'
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] || 'InlineResponse20034'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List all webhooks.
# @param [Hash] opts the optional parameters
# @option opts [String] :application_ids Filter by one or more application IDs separated by a comma.
# @option opts [String] :sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @return [InlineResponse20032]
def get_webhooks(opts = {})
data, _status_code, _headers = get_webhooks_with_http_info(opts)
data
end
# List webhooks
# List all webhooks.
# @param [Hash] opts the optional parameters
# @option opts [String] :application_ids Filter by one or more application IDs separated by a comma.
# @option opts [String] :sort The field by which results should be sorted. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Integer] :page_size The number of items in this response.
# @option opts [Integer] :skip Skips the given number of items when paging through large result sets.
# @return [Array<(InlineResponse20032, Integer, Hash)>] InlineResponse20032 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_webhooks, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.get_webhooks, must be greater than or equal to 1.'
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] || 'InlineResponse20032'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Import data in existing account-level collection
# Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Import]
def import_account_collection(collection_id, opts = {})
data, _status_code, _headers = import_account_collection_with_http_info(collection_id, opts)
data
end
# Import data in existing account-level collection
# Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Array<(Import, Integer, Hash)>] Import data, response status code and response headers
def import_account_collection_with_http_info(collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.import_account_collection ...'
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.import_account_collection"
end
# resource path
local_var_path = '/v1/collections/{collectionId}/import'.sub('{' + 'collectionId' + '}', CGI.escape(collection_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(['multipart/form-data'])
# form parameters
form_params = opts[:form_params] || {}
form_params['upFile'] = opts[:'up_file'] if !opts[:'up_file'].nil?
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Import'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#import_account_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Import allowed values for attribute
# Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. The file should be sent as multipart data. The import **replaces** the previous list of allowed values for this attribute, if any. The CSV file **must** only contain the following column: - `item` (required): the values in your allowed list, for example a list of SKU's. An allowed list is limited to 500,000 items. Example: ```text item CS-VG-04032021-UP-50D-10 CS-DV-04042021-UP-49D-12 CS-DG-02082021-UP-50G-07 ```
# @param attribute_id [Integer] The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Import]
def import_allowed_list(attribute_id, opts = {})
data, _status_code, _headers = import_allowed_list_with_http_info(attribute_id, opts)
data
end
# Import allowed values for attribute
# Upload a CSV file containing a list of [picklist values](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes#picklist-values) for the specified attribute. The file should be sent as multipart data. The import **replaces** the previous list of allowed values for this attribute, if any. The CSV file **must** only contain the following column: - `item` (required): the values in your allowed list, for example a list of SKU's. An allowed list is limited to 500,000 items. Example: ```text item CS-VG-04032021-UP-50D-10 CS-DV-04042021-UP-49D-12 CS-DG-02082021-UP-50G-07 ```
# @param attribute_id [Integer] The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Array<(Import, Integer, Hash)>] Import data, response status code and response headers
def import_allowed_list_with_http_info(attribute_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.import_allowed_list ...'
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.import_allowed_list"
end
# resource path
local_var_path = '/v1/attributes/{attributeId}/allowed_list/import'.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(['multipart/form-data'])
# form parameters
form_params = opts[:form_params] || {}
form_params['upFile'] = opts[:'up_file'] if !opts[:'up_file'].nil?
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Import'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#import_allowed_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Import data in existing collection
# Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Import]
def import_collection(application_id, campaign_id, collection_id, opts = {})
data, _status_code, _headers = import_collection_with_http_info(application_id, campaign_id, collection_id, opts)
data
end
# Import data in existing collection
# Upload a CSV file containing the collection of string values that should be attached as payload for collection. The file should be sent as multipart data. The import **replaces** the initial content of the collection. The CSV file **must** only contain the following column: - `item`: the values in your collection. A collection is limited to 500,000 items. Example: ``` item Addidas Nike Asics ``` **Note:** Before sending a request to this endpoint, ensure the data in the CSV to import is different from the data currently stored in the collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Array<(Import, Integer, Hash)>] Import data, response status code and response headers
def import_collection_with_http_info(application_id, campaign_id, collection_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.import_collection ...'
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.import_collection"
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.import_collection"
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.import_collection"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}/import'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'collectionId' + '}', CGI.escape(collection_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(['multipart/form-data'])
# form parameters
form_params = opts[:form_params] || {}
form_params['upFile'] = opts[:'up_file'] if !opts[:'up_file'].nil?
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Import'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#import_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Import coupons
# Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `value` (required): The coupon code. - `expirydate`: The end date in RFC3339 of the code redemption period. - `startdate`: The start date in RFC3339 of the code redemption period. - `recipientintegrationid`: The integration ID of the customer who receives the coupon. Only the customer with this integration ID can redeem the corresponding coupon code. Learn about [coupon reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - `limitval`: The maximum number of redemptions of this code. For unlimited redemptions, use `0`. Defaults to `1` when not provided. - `discountlimit`: The total discount value that the code can give. This is typically used to represent a gift card value. - `attributes`: A json object describing _custom_ referral attribute names and their values. Double the double-quotes in the object. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated to the coupon entity, set it with `\"{\"\"category\"\": \"\"10_off\"\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text \"value\",\"expirydate\",\"startdate\",\"recipientintegrationid\",\"limitval\",\"attributes\",\"discountlimit\" COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\"{\"\"Category\"\": \"\"10_off\"\"}\",2.4 ``` Once imported, you can find the `batchId` in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Import]
def import_coupons(application_id, campaign_id, opts = {})
data, _status_code, _headers = import_coupons_with_http_info(application_id, campaign_id, opts)
data
end
# Import coupons
# Upload a CSV file containing the coupons that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `value` (required): The coupon code. - `expirydate`: The end date in RFC3339 of the code redemption period. - `startdate`: The start date in RFC3339 of the code redemption period. - `recipientintegrationid`: The integration ID of the customer who receives the coupon. Only the customer with this integration ID can redeem the corresponding coupon code. Learn about [coupon reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code). - `limitval`: The maximum number of redemptions of this code. For unlimited redemptions, use `0`. Defaults to `1` when not provided. - `discountlimit`: The total discount value that the code can give. This is typically used to represent a gift card value. - `attributes`: A json object describing _custom_ referral attribute names and their values. Double the double-quotes in the object. For example, if you created a [custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated to the coupon entity, set it with `\"{\"\"category\"\": \"\"10_off\"\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text \"value\",\"expirydate\",\"startdate\",\"recipientintegrationid\",\"limitval\",\"attributes\",\"discountlimit\" COUP1,2018-07-01T04:00:00Z,2018-05-01T04:00:00Z,cust123,1,\"{\"\"Category\"\": \"\"10_off\"\"}\",2.4 ``` Once imported, you can find the `batchId` in the Campaign Manager or by using [List coupons](#tag/Coupons/operation/getCouponsWithoutTotalCount).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Array<(Import, Integer, Hash)>] Import data, response status code and response headers
def import_coupons_with_http_info(application_id, campaign_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.import_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.import_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.import_coupons"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_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 '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(['multipart/form-data'])
# form parameters
form_params = opts[:form_params] || {}
form_params['upFile'] = opts[:'up_file'] if !opts[:'up_file'].nil?
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Import'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#import_coupons\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Import loyalty cards
# Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The alphanumeric identifier of the loyalty card. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ```
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Import]
def import_loyalty_cards(loyalty_program_id, opts = {})
data, _status_code, _headers = import_loyalty_cards_with_http_info(loyalty_program_id, opts)
data
end
# Import loyalty cards
# Upload a CSV file containing the loyalty cards that you want to use in your card-based loyalty program. Send the file as multipart data. It contains the following columns for each card: - `identifier` (required): The alphanumeric identifier of the loyalty card. - `state` (required): The state of the loyalty card. It can be `active` or `inactive`. - `customerprofileids` (optional): An array of strings representing the identifiers of the customer profiles linked to the loyalty card. **Note:** We recommend limiting your file size to 500MB. **Example:** ```csv identifier,state,customerprofileids 123-456-789AT,active,Alexa001;UserA ```
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Array<(Import, Integer, Hash)>] Import data, response status code and response headers
def import_loyalty_cards_with_http_info(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.import_loyalty_cards ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.import_loyalty_cards"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/import_cards'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_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'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
# form parameters
form_params = opts[:form_params] || {}
form_params['upFile'] = opts[:'up_file'] if !opts[:'up_file'].nil?
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Import'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#import_loyalty_cards\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Import loyalty points
# Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the loyalty program type, you can import the points into a given customer profile or into a given _active_ loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate`: The earliest date when the points can be redeemed. On this date and until the expiration date, the points are `active`. - `expirydate`: The latest date when the points can be redeemed. After this date, the points are `expired`. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** For existing customer profiles and loyalty cards, the imported points are added to any previous active or pending points, depending on the value provided for `startdate`. If `startdate` matches the current date, the imported points are _active_. If it is later, the points are _pending_ until the date provided for `startdate` is reached. **Note:** We recommend limiting your file size to 500MB. **Example for profile-based programs:** ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` **Example for card-based programs:** ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ```
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Import]
def import_loyalty_points(loyalty_program_id, opts = {})
data, _status_code, _headers = import_loyalty_points_with_http_info(loyalty_program_id, opts)
data
end
# Import loyalty points
# Upload a CSV file containing the loyalty points you want to import into a given loyalty program. Send the file as multipart data. Depending on the loyalty program type, you can import the points into a given customer profile or into a given _active_ loyalty card. The CSV file contains the following columns: - `customerprofileid` (optional): For profile-based loyalty programs, the integration ID of the customer profile where the loyalty points are imported. - `identifier` (optional): For card-based loyalty programs, the identifier of the loyalty card where the loyalty points are imported. - `amount`: The amount of points to award to the customer profile. - `startdate`: The earliest date when the points can be redeemed. On this date and until the expiration date, the points are `active`. - `expirydate`: The latest date when the points can be redeemed. After this date, the points are `expired`. - `subledgerid` (optional): The ID of the subledger that should received the points. - `reason` (optional): The reason why these points are awarded. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** For existing customer profiles and loyalty cards, the imported points are added to any previous active or pending points, depending on the value provided for `startdate`. If `startdate` matches the current date, the imported points are _active_. If it is later, the points are _pending_ until the date provided for `startdate` is reached. **Note:** We recommend limiting your file size to 500MB. **Example for profile-based programs:** ```text customerprofileid,amount,startdate,expirydate,subledgerid,reason URNGV8294NV,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ``` **Example for card-based programs:** ```text identifier,amount,startdate,expirydate,subledgerid,reason summer-loyalty-card-0543,100,2009-11-10T23:00:00Z,2009-11-11T23:00:00Z,subledger1,appeasement ```
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Array<(Import, Integer, Hash)>] Import data, response status code and response headers
def import_loyalty_points_with_http_info(loyalty_program_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.import_loyalty_points ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.import_loyalty_points"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/import_points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_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'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
# form parameters
form_params = opts[:form_params] || {}
form_params['upFile'] = opts[:'up_file'] if !opts[:'up_file'].nil?
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Import'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#import_loyalty_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Import giveaway codes into a giveaway pool
# Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): the code of your giveaway, for instance, a gift card redemption code. - `startdate`: the start date in RFC3339 of the code redemption period. - `enddate`: the last date in RFC3339 of the code redemption period. - `attributes`: A json object describing _custom_ giveaway attribute names and their values. Double the double-quotes in the object. For example, if you [created a custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated to the giveaway entity, set it with `\"{\"\"provider\"\": \"\"myPartnerCompany\"\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ```
# @param pool_id [Integer] The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Import]
def import_pool_giveaways(pool_id, opts = {})
data, _status_code, _headers = import_pool_giveaways_with_http_info(pool_id, opts)
data
end
# Import giveaway codes into a giveaway pool
# Upload a CSV file containing the giveaway codes that should be created. Send the file as multipart data. The CSV file contains the following columns: - `code` (required): the code of your giveaway, for instance, a gift card redemption code. - `startdate`: the start date in RFC3339 of the code redemption period. - `enddate`: the last date in RFC3339 of the code redemption period. - `attributes`: A json object describing _custom_ giveaway attribute names and their values. Double the double-quotes in the object. For example, if you [created a custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `provider` associated to the giveaway entity, set it with `\"{\"\"provider\"\": \"\"myPartnerCompany\"\"}\"`. The `startdate` and `enddate` have nothing to do with the _validity_ of the codes. They are only used by the Rule Engine to award the codes or not. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,enddate,attributes GIVEAWAY1,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY2,2020-11-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Amazon\"\"}\" GIVEAWAY3,2021-01-10T23:00:00Z,2022-11-11T23:00:00Z,\"{\"\"provider\"\": \"\"Aliexpress\"\"}\" ```
# @param pool_id [Integer] The ID of the pool. You can find it in the Campaign Manager, in the **Giveaways** section.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Array<(Import, Integer, Hash)>] Import data, response status code and response headers
def import_pool_giveaways_with_http_info(pool_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.import_pool_giveaways ...'
end
# verify the required parameter 'pool_id' is set
if @api_client.config.client_side_validation && pool_id.nil?
fail ArgumentError, "Missing the required parameter 'pool_id' when calling ManagementApi.import_pool_giveaways"
end
# resource path
local_var_path = '/v1/giveaways/pools/{poolId}/import'.sub('{' + 'poolId' + '}', CGI.escape(pool_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(['multipart/form-data'])
# form parameters
form_params = opts[:form_params] || {}
form_params['upFile'] = opts[:'up_file'] if !opts[:'up_file'].nil?
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Import'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#import_pool_giveaways\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Import referrals
# Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values. Double the double-quotes in the object. For example, if you [created a custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated to the referral entity, set it with `\"{\"\"category\"\": \"\"10_off\"\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ```
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Import]
def import_referrals(application_id, campaign_id, opts = {})
data, _status_code, _headers = import_referrals_with_http_info(application_id, campaign_id, opts)
data
end
# Import referrals
# Upload a CSV file containing the referrals that should be created. The file should be sent as multipart data. The CSV file contains the following columns: - `code` (required): The referral code. - `advocateprofileintegrationid` (required): The profile ID of the advocate. - `startdate`: The start date in RFC3339 of the code redemption period. - `expirydate`: The end date in RFC3339 of the code redemption period. - `limitval`: The maximum number of redemptions of this code. Defaults to `1` when left blank. - `attributes`: A json object describing _custom_ referral attribute names and their values. Double the double-quotes in the object. For example, if you [created a custom attribute](https://docs.talon.one/docs/dev/concepts/attributes#custom-attributes) called `category` associated to the referral entity, set it with `\"{\"\"category\"\": \"\"10_off\"\"}\"`. You can use the time zone of your choice. It is converted to UTC internally by Talon.One. **Note:** We recommend limiting your file size to 500MB. **Example:** ```text code,startdate,expirydate,advocateprofileintegrationid,limitval,attributes REFERRAL_CODE1,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid_4,1,\"{\"\"my_attribute\"\": \"\"10_off\"\"}\" REFERRAL_CODE2,2020-11-10T23:00:00Z,2021-11-11T23:00:00Z,integid1,1,\"{\"\"my_attribute\"\": \"\"20_off\"\"}\" ```
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [String] :up_file The file with the information about the data that should be imported.
# @return [Array<(Import, Integer, Hash)>] Import data, response status code and response headers
def import_referrals_with_http_info(application_id, campaign_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.import_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.import_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.import_referrals"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/import_referrals'.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(['multipart/form-data'])
# form parameters
form_params = opts[:form_params] || {}
form_params['upFile'] = opts[:'up_file'] if !opts[:'up_file'].nil?
# http body (model)
post_body = opts[:body]
# return_type
return_type = opts[:return_type] || 'Import'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#import_referrals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List collections in account
# List collections in account.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @option opts [String] :name Filter by the name of the Collection.
# @return [InlineResponse20014]
def list_account_collections(opts = {})
data, _status_code, _headers = list_account_collections_with_http_info(opts)
data
end
# List collections in account
# List collections in account.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @option opts [String] :name Filter by the name of the Collection.
# @return [Array<(InlineResponse20014, Integer, Hash)>] InlineResponse20014 data, response status code and response headers
def list_account_collections_with_http_info(opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.list_account_collections ...'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.list_account_collections, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.list_account_collections, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/collections'
# 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[:'withTotalResultSize'] = opts[:'with_total_result_size'] if !opts[:'with_total_result_size'].nil?
query_params[:'name'] = opts[:'name'] if !opts[:'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] || ['management_key', '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#list_account_collections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List collections
# List collections in the campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @option opts [String] :name Filter by the name of the Collection.
# @return [InlineResponse20016]
def list_collections(application_id, campaign_id, opts = {})
data, _status_code, _headers = list_collections_with_http_info(application_id, campaign_id, opts)
data
end
# List collections
# List collections in the campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @option opts [String] :name Filter by the name of the Collection.
# @return [Array<(InlineResponse20016, Integer, Hash)>] InlineResponse20016 data, response status code and response headers
def list_collections_with_http_info(application_id, campaign_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.list_collections ...'
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.list_collections"
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.list_collections"
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.list_collections, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.list_collections, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections'.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[:'withTotalResultSize'] = opts[:'with_total_result_size'] if !opts[:'with_total_result_size'].nil?
query_params[:'name'] = opts[:'name'] if !opts[:'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] || 'InlineResponse20016'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#list_collections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# List collections in application
# List collections from all campaigns in the Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @option opts [String] :name Filter by the name of the Collection.
# @return [InlineResponse20016]
def list_collections_in_application(application_id, opts = {})
data, _status_code, _headers = list_collections_in_application_with_http_info(application_id, opts)
data
end
# List collections in application
# List collections from all campaigns in the Application.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @option opts [Boolean] :with_total_result_size When this flag is set, the result includes the total size of the result, across all pages. This might decrease performance on large data sets. - When `true`: `hasMore` is true when there is a next page. `totalResultSize` is always zero. - When `false`: `hasMore` is always false. `totalResultSize` contains the total number of results for this query.
# @option opts [String] :name Filter by the name of the Collection.
# @return [Array<(InlineResponse20016, Integer, Hash)>] InlineResponse20016 data, response status code and response headers
def list_collections_in_application_with_http_info(application_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.list_collections_in_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.list_collections_in_application"
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.list_collections_in_application, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.list_collections_in_application, must be greater than or equal to 1.'
end
# resource path
local_var_path = '/v1/applications/{applicationId}/collections'.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[:'withTotalResultSize'] = opts[:'with_total_result_size'] if !opts[:'with_total_result_size'].nil?
query_params[:'name'] = opts[:'name'] if !opts[:'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] || 'InlineResponse20016'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#list_collections_in_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create notification about added or deducted loyalty points
# Create a notification about added or deducted loyalty points in a given profile-based loyalty program. A notification for added or deducted loyalty points is different from regular webhooks in that it is loyalty program-scoped and has a predefined payload. For more information, see [Managing notifications](https://docs.talon.one/docs/product/loyalty-programs/managing-notifications).
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param body [NewBaseNotification] body
# @param [Hash] opts the optional parameters
# @return [BaseNotification]
def post_added_deducted_points_notification(loyalty_program_id, body, opts = {})
data, _status_code, _headers = post_added_deducted_points_notification_with_http_info(loyalty_program_id, body, opts)
data
end
# Create notification about added or deducted loyalty points
# Create a notification about added or deducted loyalty points in a given profile-based loyalty program. A notification for added or deducted loyalty points is different from regular webhooks in that it is loyalty program-scoped and has a predefined payload. For more information, see [Managing notifications](https://docs.talon.one/docs/product/loyalty-programs/managing-notifications).
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param body [NewBaseNotification] body
# @param [Hash] opts the optional parameters
# @return [Array<(BaseNotification, Integer, Hash)>] BaseNotification data, response status code and response headers
def post_added_deducted_points_notification_with_http_info(loyalty_program_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.post_added_deducted_points_notification ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.post_added_deducted_points_notification"
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.post_added_deducted_points_notification"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/notifications/added_deducted_points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_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'])
# 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] || 'BaseNotification'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#post_added_deducted_points_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Create strikethrough notification
# Create a notification for the in the given Application. For more information, see [Managing notifications](https://docs.talon.one/docs/product/applications/outbound-notifications). See the [payload](https://docs.talon.one/outbound-notifications) you will receive.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [NewBaseNotification] body
# @param [Hash] opts the optional parameters
# @return [BaseNotification]
def post_catalogs_strikethrough_notification(application_id, body, opts = {})
data, _status_code, _headers = post_catalogs_strikethrough_notification_with_http_info(application_id, body, opts)
data
end
# Create strikethrough notification
# Create a notification for the in the given Application. For more information, see [Managing notifications](https://docs.talon.one/docs/product/applications/outbound-notifications). See the [payload](https://docs.talon.one/outbound-notifications) you will receive.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [NewBaseNotification] body
# @param [Hash] opts the optional parameters
# @return [Array<(BaseNotification, Integer, Hash)>] BaseNotification data, response status code and response headers
def post_catalogs_strikethrough_notification_with_http_info(application_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.post_catalogs_strikethrough_notification ...'
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.post_catalogs_strikethrough_notification"
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.post_catalogs_strikethrough_notification"
end
# resource path
local_var_path = '/v1/catalogs/{applicationId}/notifications/strikethrough'.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] || 'BaseNotification'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#post_catalogs_strikethrough_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Deduct points from customer profile
# Deduct points from the specified loyalty program and specified customer profile. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint.
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param integration_id [String] The identifier of the profile.
# @param body [DeductLoyaltyPoints] body
# @param [Hash] opts the optional parameters
# @return [nil]
def remove_loyalty_points(loyalty_program_id, integration_id, body, opts = {})
remove_loyalty_points_with_http_info(loyalty_program_id, integration_id, body, opts)
nil
end
# Deduct points from customer profile
# Deduct points from the specified loyalty program and specified customer profile. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint.
# @param loyalty_program_id [String] The identifier for the loyalty program.
# @param integration_id [String] The identifier of the profile.
# @param body [DeductLoyaltyPoints] body
# @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(loyalty_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 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_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/{loyaltyProgramId}/profile/{integrationId}/deduct_points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_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'])
# 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] || ['management_key', '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] body
# @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] body
# @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] || ['management_key', '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
# List coupons that match the given attributes (without total count)
# List the coupons whose attributes match the query criteria in all **active** campaigns of the given Application. 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. **Note:** The total count is not included in the response.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [Object] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration 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. This filter shows the coupons created by redeeming 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. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts.
# @return [InlineResponse2007]
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
# List coupons that match the given attributes (without total count)
# List the coupons whose attributes match the query criteria in all **active** campaigns of the given Application. 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. **Note:** The total count is not included in the response.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param body [Object] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration 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. This filter shows the coupons created by redeeming 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. - `enabled`: Campaigns that are scheduled, running (activated), or expired. - `running`: Campaigns that are running (activated). - `disabled`: Campaigns that are disabled. - `expired`: Campaigns that are expired. - `archived`: Campaigns that are archived. - `draft`: Campaigns that are drafts.
# @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.search_coupons_advanced_application_wide_without_total_count, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.search_coupons_advanced_application_wide_without_total_count, must be greater than or equal to 1.'
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] || 'InlineResponse2007'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# List coupons that match the given attributes in campaign (without total count)
# List the coupons whose attributes match the query criteria in the given campaign. 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. **Note:** The total count is not included in the response.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [Object] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response. (default to 1000)
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration 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. This filter shows the coupons created by redeeming 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 [InlineResponse2007]
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
# List coupons that match the given attributes in campaign (without total count)
# List the coupons whose attributes match the query criteria in the given campaign. 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. **Note:** The total count is not included in the response.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [Object] body
# @param [Hash] opts the optional parameters
# @option opts [Integer] :page_size The number of items in this response.
# @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. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** This parameter works only with numeric fields.
# @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. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [DateTime] :created_after Filter results comparing the parameter value, expected to be an RFC3339 timestamp string, to the coupon creation timestamp. You can use any timezone. Talon.One will convert to UTC internally.
# @option opts [String] :valid Either \"expired\", \"validNow\", or \"validFuture\". The first option matches coupons in which the expiration date is set and in the past. The second matches coupons in which start date is null or in the past and expiration 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. This filter shows the coupons created by redeeming 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<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 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
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.search_coupons_advanced_without_total_count, must be smaller than or equal to 1000.'
end
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementApi.search_coupons_advanced_without_total_count, must be greater than or equal to 1.'
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] || 'InlineResponse2007'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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
# Transfer loyalty card data
# Transfer card data, such as linked customers, loyalty balances and transactions, from a given loyalty card to a new, automatically created loyalty card. **Important:** - The original card is automatically blocked once the new card is created, and it cannot be activated again. - The default status of the new card is _active_.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param body [TransferLoyaltyCard] body
# @param [Hash] opts the optional parameters
# @return [nil]
def transfer_loyalty_card(loyalty_program_id, loyalty_card_identifier, body, opts = {})
transfer_loyalty_card_with_http_info(loyalty_program_id, loyalty_card_identifier, body, opts)
nil
end
# Transfer loyalty card data
# Transfer card data, such as linked customers, loyalty balances and transactions, from a given loyalty card to a new, automatically created loyalty card. **Important:** - The original card is automatically blocked once the new card is created, and it cannot be activated again. - The default status of the new card is _active_.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param body [TransferLoyaltyCard] body
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def transfer_loyalty_card_with_http_info(loyalty_program_id, loyalty_card_identifier, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.transfer_loyalty_card ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.transfer_loyalty_card"
end
# verify the required parameter 'loyalty_card_identifier' is set
if @api_client.config.client_side_validation && loyalty_card_identifier.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_card_identifier' when calling ManagementApi.transfer_loyalty_card"
end
if @api_client.config.client_side_validation && loyalty_card_identifier.to_s.length > 108
fail ArgumentError, 'invalid value for "loyalty_card_identifier" when calling ManagementApi.transfer_loyalty_card, the character length must be smaller than or equal to 108.'
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.transfer_loyalty_card"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardIdentifier}/transfer'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardIdentifier' + '}', CGI.escape(loyalty_card_identifier.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]
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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#transfer_loyalty_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update account-level collection
# Edit the description of the account-level collection and enable or disable the collection in the specified Applications.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param body [UpdateCollection] body
# @param [Hash] opts the optional parameters
# @return [Collection]
def update_account_collection(collection_id, body, opts = {})
data, _status_code, _headers = update_account_collection_with_http_info(collection_id, body, opts)
data
end
# Update account-level collection
# Edit the description of the account-level collection and enable or disable the collection in the specified Applications.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param body [UpdateCollection] body
# @param [Hash] opts the optional parameters
# @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers
def update_account_collection_with_http_info(collection_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.update_account_collection ...'
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.update_account_collection"
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_account_collection"
end
# resource path
local_var_path = '/v1/collections/{collectionId}'.sub('{' + 'collectionId' + '}', CGI.escape(collection_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] || 'Collection'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_account_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update 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] The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**.
# @param body [NewAdditionalCost] body
# @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 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] The ID of the additional cost. You can find the ID the the Campaign Manager's URL when you display the details of the cost in **Account** > **Tools** > **Additional costs**.
# @param body [NewAdditionalCost] body
# @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] || ['management_key', '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 custom attribute
# Update an existing custom attribute. Once created, the only property of a custom attribute that can be changed is the description. 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.
# @param attribute_id [Integer] The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.
# @param body [NewAttribute] body
# @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 custom attribute
# Update an existing custom attribute. Once created, the only property of a custom attribute that can be changed is the description. 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.
# @param attribute_id [Integer] The ID of the attribute. You can find the ID in the Campaign Manager's URL when you display the details of an attribute in **Account** > **Tools** > **Attributes**.
# @param body [NewAttribute] body
# @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] || ['management_key', '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 campaign
# Update the given campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [UpdateCampaign] body
# @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 campaign
# Update the given campaign.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [UpdateCampaign] body
# @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] || ['management_key', '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 collection description
# Edit the description of the collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param body [UpdateCampaignCollection] body
# @param [Hash] opts the optional parameters
# @return [Collection]
def update_collection(application_id, campaign_id, collection_id, body, opts = {})
data, _status_code, _headers = update_collection_with_http_info(application_id, campaign_id, collection_id, body, opts)
data
end
# Update collection description
# Edit the description of the collection.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param collection_id [Integer] The ID of the collection. You can get it with the [List collection in account](#operation/listCollectionsInApplication) endpoint.
# @param body [UpdateCampaignCollection] body
# @param [Hash] opts the optional parameters
# @return [Array<(Collection, Integer, Hash)>] Collection data, response status code and response headers
def update_collection_with_http_info(application_id, campaign_id, collection_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.update_collection ...'
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_collection"
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_collection"
end
# verify the required parameter 'collection_id' is set
if @api_client.config.client_side_validation && collection_id.nil?
fail ArgumentError, "Missing the required parameter 'collection_id' when calling ManagementApi.update_collection"
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_collection"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/campaigns/{campaignId}/collections/{collectionId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)).sub('{' + 'collectionId' + '}', CGI.escape(collection_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] || 'Collection'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_collection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update coupon
# Update the specified coupon. Important
With this PUT endpoint only, any property you do not explicitly set in your request will be set to null
.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param coupon_id [String] The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response.
# @param body [UpdateCoupon] body
# @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 coupon
# Update the specified coupon. <div class=\"redoc-section\"> <p class=\"title\">Important</p> <p>With this PUT endpoint only, any property you do not explicitly set in your request will be set to <code>null</code>.</p> </div>
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param coupon_id [String] The internal ID of the coupon code. You can find this value in the `id` property from the [List coupons](https://docs.talon.one/management-api#tag/Coupons/operation/getCouponsWithoutTotalCount) endpoint response.
# @param body [UpdateCoupon] body
# @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] || ['management_key', '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 coupons
# Update all coupons, or a specific batch of coupons, in a campaign. You can find the `batchId` in the **Coupons** view of your Application in the Campaign Manager, or you can use [List coupons](#operation/getCouponsWithoutTotalCount). Important
- Only send sequential requests to this endpoint.
- Requests to this endpoint timeout after 30 minutes. If you hit a timeout, reach out to our support team.
To update a specific coupon, use [Update coupon](#operation/updateCoupon).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [UpdateCouponBatch] body
# @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 coupons
# Update all coupons, or a specific batch of coupons, in a campaign. You can find the `batchId` in the **Coupons** view of your Application in the Campaign Manager, or you can use [List coupons](#operation/getCouponsWithoutTotalCount). <div class=\"redoc-section\"> <p class=\"title\">Important</p> <ul> <li>Only send sequential requests to this endpoint.</li> <li>Requests to this endpoint timeout after 30 minutes. If you hit a timeout, reach out to our support team.</li> </ul> </div> To update a specific coupon, use [Update coupon](#operation/updateCoupon).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param body [UpdateCouponBatch] body
# @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] || ['management_key', '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 loyalty card status
# Update the status of the given loyalty card. A card can be _active_ or _inactive_.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param body [UpdateLoyaltyCard] body
# @param [Hash] opts the optional parameters
# @return [LoyaltyCard]
def update_loyalty_card(loyalty_program_id, loyalty_card_identifier, body, opts = {})
data, _status_code, _headers = update_loyalty_card_with_http_info(loyalty_program_id, loyalty_card_identifier, body, opts)
data
end
# Update loyalty card status
# Update the status of the given loyalty card. A card can be _active_ or _inactive_.
# @param loyalty_program_id [Integer] Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.
# @param loyalty_card_identifier [String] Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint.
# @param body [UpdateLoyaltyCard] body
# @param [Hash] opts the optional parameters
# @return [Array<(LoyaltyCard, Integer, Hash)>] LoyaltyCard data, response status code and response headers
def update_loyalty_card_with_http_info(loyalty_program_id, loyalty_card_identifier, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.update_loyalty_card ...'
end
# verify the required parameter 'loyalty_program_id' is set
if @api_client.config.client_side_validation && loyalty_program_id.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling ManagementApi.update_loyalty_card"
end
# verify the required parameter 'loyalty_card_identifier' is set
if @api_client.config.client_side_validation && loyalty_card_identifier.nil?
fail ArgumentError, "Missing the required parameter 'loyalty_card_identifier' when calling ManagementApi.update_loyalty_card"
end
if @api_client.config.client_side_validation && loyalty_card_identifier.to_s.length > 108
fail ArgumentError, 'invalid value for "loyalty_card_identifier" when calling ManagementApi.update_loyalty_card, the character length must be smaller than or equal to 108.'
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_loyalty_card"
end
# resource path
local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardIdentifier}'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardIdentifier' + '}', CGI.escape(loyalty_card_identifier.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] || 'LoyaltyCard'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_loyalty_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update notification about campaign-related changes
# Update the given [notification about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications). **Tip:** You can review the payload you will receive in the [specs](https://docs.talon.one/outbound-notifications#/paths/campaign_edited/post).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param notification_webhook_id [Integer] The ID of the webhook. Get it with the appropriate _List notifications_ endpoint.
# @param body [NewNotificationWebhook] body
# @param [Hash] opts the optional parameters
# @return [NotificationWebhook]
def update_notification_webhook(application_id, notification_webhook_id, body, opts = {})
data, _status_code, _headers = update_notification_webhook_with_http_info(application_id, notification_webhook_id, body, opts)
data
end
# Update notification about campaign-related changes
# Update the given [notification about campaign-related changes](https://docs.talon.one/docs/product/applications/outbound-notifications). **Tip:** You can review the payload you will receive in the [specs](https://docs.talon.one/outbound-notifications#/paths/campaign_edited/post).
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param notification_webhook_id [Integer] The ID of the webhook. Get it with the appropriate _List notifications_ endpoint.
# @param body [NewNotificationWebhook] body
# @param [Hash] opts the optional parameters
# @return [Array<(NotificationWebhook, Integer, Hash)>] NotificationWebhook data, response status code and response headers
def update_notification_webhook_with_http_info(application_id, notification_webhook_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.update_notification_webhook ...'
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_notification_webhook"
end
# verify the required parameter 'notification_webhook_id' is set
if @api_client.config.client_side_validation && notification_webhook_id.nil?
fail ArgumentError, "Missing the required parameter 'notification_webhook_id' when calling ManagementApi.update_notification_webhook"
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_notification_webhook"
end
# resource path
local_var_path = '/v1/applications/{applicationId}/notification_webhooks/{notificationWebhookId}'.sub('{' + 'applicationId' + '}', CGI.escape(application_id.to_s)).sub('{' + 'notificationWebhookId' + '}', CGI.escape(notification_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'])
# 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] || 'NotificationWebhook'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_notification_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# Update referral
# Update the specified referral.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param referral_id [String] The ID of the referral code.
# @param body [UpdateReferral] body
# @param [Hash] opts the optional parameters
# @return [Referral]
def update_referral(application_id, campaign_id, referral_id, body, opts = {})
data, _status_code, _headers = update_referral_with_http_info(application_id, campaign_id, referral_id, body, opts)
data
end
# Update referral
# Update the specified referral.
# @param application_id [Integer] The ID of the Application. It is displayed in your Talon.One deployment URL.
# @param campaign_id [Integer] The ID of the campaign. It is displayed in your Talon.One deployment URL.
# @param referral_id [String] The ID of the referral code.
# @param body [UpdateReferral] body
# @param [Hash] opts the optional parameters
# @return [Array<(Referral, Integer, Hash)>] Referral data, response status code and response headers
def update_referral_with_http_info(application_id, campaign_id, referral_id, body, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: ManagementApi.update_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.update_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.update_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.update_referral"
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_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] || {}
# 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] || 'Referral'
# auth_names
auth_names = opts[:auth_names] || ['management_key', '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_referral\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
end