Class: VoucherifySdk::PromotionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/api/promotions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ PromotionsApi

Returns a new instance of PromotionsApi.



19
20
21
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_promotion_tier_to_campaign(campaign_id, opts = {}) ⇒ PromotionsTiersCreateResponseBody

Add Promotion Tier to Campaign This method allows you to add a new promotion tier to an existing campaign. The tier hierarchy will be set as the next consequtive integer following the lowest ranking tier.

Parameters:

  • campaign_id (String)

    Unique campaign ID assigned by Voucherify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



28
29
30
31
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 28

def add_promotion_tier_to_campaign(campaign_id, opts = {})
  data, _status_code, _headers = add_promotion_tier_to_campaign_with_http_info(campaign_id, opts)
  data
end

#create_promotion_stack(campaign_id, opts = {}) ⇒ PromotionsStacksCreateResponseBody

Create Promotion Stack This method creates one promotion stack. The sequence of promotion tier IDs will determine the promotion stacking order.

Parameters:

  • campaign_id (String)

    Unique campaign ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



94
95
96
97
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 94

def create_promotion_stack(campaign_id, opts = {})
  data, _status_code, _headers = create_promotion_stack_with_http_info(campaign_id, opts)
  data
end

#delete_promotion_stack(campaign_id, stack_id, opts = {}) ⇒ nil

Delete Promotion Stack This method deletes a promotion stack.

Parameters:

  • campaign_id (String)

    ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty Campaign.

  • stack_id (String)

    Promotion stack ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


160
161
162
163
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 160

def delete_promotion_stack(campaign_id, stack_id, opts = {})
  delete_promotion_stack_with_http_info(campaign_id, stack_id, opts)
  nil
end

#delete_promotion_tier(promotion_tier_id, opts = {}) ⇒ nil

Delete Promotion Tier This method deletes a promotion tier.

Parameters:

  • promotion_tier_id (String)

    Unique promotion tier ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


218
219
220
221
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 218

def delete_promotion_tier(promotion_tier_id, opts = {})
  delete_promotion_tier_with_http_info(promotion_tier_id, opts)
  nil
end

#disable_promotion_tier(promotion_tier_id, opts = {}) ⇒ PromotionsTiersDisableResponseBody

Disable Promotion Tier This method disables a promotion tier, i.e. makes the active parameter false.

Parameters:

  • promotion_tier_id (String)

    Unique promotion tier ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



275
276
277
278
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 275

def disable_promotion_tier(promotion_tier_id, opts = {})
  data, _status_code, _headers = disable_promotion_tier_with_http_info(promotion_tier_id, opts)
  data
end

#enable_promotion_tier(promotion_tier_id, opts = {}) ⇒ PromotionsTiersEnableResponseBody

Enable Promotion Tier This method enables a promotion tier, i.e. makes the active parameter true.

Parameters:

  • promotion_tier_id (String)

    Unique promotion tier ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



334
335
336
337
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 334

def enable_promotion_tier(promotion_tier_id, opts = {})
  data, _status_code, _headers = enable_promotion_tier_with_http_info(promotion_tier_id, opts)
  data
end

#get_promotion_stack(campaign_id, stack_id, opts = {}) ⇒ PromotionsStacksGetResponseBody

Get Promotion Stack This method returns the details of a promotion stack, including the promotion tiers grouped within the stack.

Parameters:

  • campaign_id (String)

    ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty Campaign.

  • stack_id (String)

    Promotion stack ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



394
395
396
397
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 394

def get_promotion_stack(campaign_id, stack_id, opts = {})
  data, _status_code, _headers = get_promotion_stack_with_http_info(campaign_id, stack_id, opts)
  data
end

#get_promotion_tier(promotion_tier_id, opts = {}) ⇒ PromotionsTiersGetResponseBody

Get Promotion Tier This method enables you to retrieve a specific promotion tier.

Parameters:

  • promotion_tier_id (String)

    Unique promotion tier ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



454
455
456
457
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 454

def get_promotion_tier(promotion_tier_id, opts = {})
  data, _status_code, _headers = get_promotion_tier_with_http_info(promotion_tier_id, opts)
  data
end

#list_all_promotion_stacks(opts = {}) ⇒ PromotionsStacksListResponseBody

List Promotion Stacks This method enables you to list promotion stacks irrespective of the campaign they are associated with. You can use filters in the query parameters to specify the stacks to be returned in the response. # Advanced filters for fetching promotion stacks

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :order (ParameterOrderListAllPromotionStacks)

    Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

  • :created_at (ParameterCreatedBeforeAfter)

    A filter on the list based on the object created_at field. The value is a dictionary with the following options: before, after. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [created_at] 2017-09-08T13:52:18.227Z

  • :updated_at (ParameterUpdatedBeforeAfter)

    A filter on the list based on the object updated_at field. The value is a dictionary with the following options: before, after. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [updated_at] 2017-09-08T13:52:18.227Z

Returns:



517
518
519
520
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 517

def list_all_promotion_stacks(opts = {})
  data, _status_code, _headers = list_all_promotion_stacks_with_http_info(opts)
  data
end

#list_promotion_stacks_in_campaign(campaign_id, opts = {}) ⇒ PromotionsStacksListResponseBody

List Promotion Stacks in Campaign This method enables you to list promotion stacks from a specified campaign.

Parameters:

  • campaign_id (String)

    Unique campaign ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



585
586
587
588
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 585

def list_promotion_stacks_in_campaign(campaign_id, opts = {})
  data, _status_code, _headers = list_promotion_stacks_in_campaign_with_http_info(campaign_id, opts)
  data
end

#list_promotion_tiers(opts = {}) ⇒ PromotionsTiersListResponseBody

List Promotion Tiers This method enables you to list promotion tiers.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :is_available (Boolean)

    This parameter allows filtering promotions that are only available at the moment. When set to true, it selects only non-expired and active promotions.

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :order (ParameterOrderListPromotionTiers)

    Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

Returns:



647
648
649
650
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 647

def list_promotion_tiers(opts = {})
  data, _status_code, _headers = list_promotion_tiers_with_http_info(opts)
  data
end

#list_promotion_tiers_from_campaign(campaign_id, opts = {}) ⇒ PromotionsTiersListResponseBody

List Promotion Tiers from Campaign This method enables you to list promotion tiers from a specified campaign.

Parameters:

  • campaign_id (String)

    Unique campaign ID assigned by Voucherify.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



713
714
715
716
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 713

def list_promotion_tiers_from_campaign(campaign_id, opts = {})
  data, _status_code, _headers = list_promotion_tiers_from_campaign_with_http_info(campaign_id, opts)
  data
end

#update_promotion_stack(campaign_id, stack_id, opts = {}) ⇒ PromotionsStacksUpdateResponseBody

Update Promotion Stack This methods allows for editing an existing stack.

Parameters:

  • campaign_id (String)

    ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty Campaign.

  • stack_id (String)

    Promotion stack ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



774
775
776
777
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 774

def update_promotion_stack(campaign_id, stack_id, opts = {})
  data, _status_code, _headers = update_promotion_stack_with_http_info(campaign_id, stack_id, opts)
  data
end

#update_promotion_tier(promotion_tier_id, opts = {}) ⇒ PromotionsTiersUpdateResponseBody

Update Promotion Tier This method updates a promotion tier.

Parameters:

  • promotion_tier_id (String)

    Unique promotion tier ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



841
842
843
844
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 841

def update_promotion_tier(promotion_tier_id, opts = {})
  data, _status_code, _headers = update_promotion_tier_with_http_info(promotion_tier_id, opts)
  data
end