Class: VoucherifySdk::BinApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ BinApi

Returns a new instance of BinApi.



19
20
21
# File 'lib/VoucherifySdk/api/bin_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/bin_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_bin_entry(bin_entry_id, opts = {}) ⇒ nil

Delete Bin Entry Deletes permanently a bin entry with a given ID.The following resources can be moved to the bin and permanently deleted: - campaigns - vouchers - products - SKUs To use this endpoint and delete a given resource type, you must have the following permissions: - vouchers.delete to delete a voucher, - campaigns.delete to delete a campaign, - products.delete to delete a product or SKU.

Parameters:

  • bin_entry_id (String)

    Provide the unique identifier of the bin entry.

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

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/VoucherifySdk/api/bin_api.rb', line 27

def delete_bin_entry(bin_entry_id, opts = {})
  delete_bin_entry_with_http_info(bin_entry_id, opts)
  nil
end

#list_bin_entries(opts = {}) ⇒ TrashBinListResponseBody

List Bin Entries Retrieves a list of resources moved to the bin. The following resources can be moved to the bin: - campaigns - vouchers - products - SKUs To use this endpoint, you must have the following permissions: - vouchers.read - campaigns.read - products.read

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. If no limit is set, it returns 10 items.

  • :order (ParameterOrderListBin)

    Orders the bin entries according to the bin entry ID. The dash - preceding a sorting option means sorting in a descending order.

  • :starting_after_id (String)

    A cursor for pagination. It retrieves the results starting after a result with the given ID.

  • :filters (ParameterFiltersListBin)

    Filters for listing bin entries.

Returns:



87
88
89
90
# File 'lib/VoucherifySdk/api/bin_api.rb', line 87

def list_bin_entries(opts = {})
  data, _status_code, _headers = list_bin_entries_with_http_info(opts)
  data
end