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

#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:



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

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)


98
99
100
101
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 98

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)


164
165
166
167
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 164

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:



225
226
227
228
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 225

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:



288
289
290
291
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 288

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:



352
353
354
355
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 352

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:



420
421
422
423
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 420

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)

    A limit on the number of objects to be returned. Limit can range between 1 and 100 items.

  • :page (Integer)

    Which page of results to return.

  • :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:



487
488
489
490
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 487

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:



567
568
569
570
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 567

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_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:



630
631
632
633
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 630

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:



695
696
697
698
# File 'lib/VoucherifySdk/api/promotions_api.rb', line 695

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