Class: VoucherifySdk::ExportsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ExportsApi

Returns a new instance of ExportsApi.



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

def api_client
  @api_client
end

Instance Method Details

#create_export(opts = {}) ⇒ ExportsCreateResponseBody

Create Export Create export object. The export can be any of the following types: voucher, redemption, publication, customer, order, points_expiration, or voucher_transactions. # Defaults If you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object: # Fetching particular data sets Using the parameters body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields: # Orders # Vouchers # Publications # Redemptions # Customers # Points Expirations # Gift Card Transactions # Loyalty Card Transactions

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :exports_create_request_body (ExportsCreateRequestBody)

    Specify the details of the export that you would like to create.

Returns:



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

def create_export(opts = {})
  data, _status_code, _headers = create_export_with_http_info(opts)
  data
end

#delete_export(export_id, opts = {}) ⇒ nil

Delete Export This method deletes a previously created export object.

Parameters:

  • export_id (String)

    Unique export object ID of previously created export. This object can be a: voucher, redemption, publication, customer, order, points_expiration, or voucher_transactions.

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

    the optional parameters

Returns:

  • (nil)


91
92
93
94
# File 'lib/VoucherifySdk/api/exports_api.rb', line 91

def delete_export(export_id, opts = {})
  delete_export_with_http_info(export_id, opts)
  nil
end

#download_export(export_id, opts = {}) ⇒ String

Download Export Download the contents of the exported CSV file. 📘 Important notes **Base URL:** - download.voucherify.io (Europe) - us1.download.voucherify.io (US) - as1.download.voucherify.io (Asia) Token: Can be found within the result parameter of the Get Export method response.

Parameters:

  • export_id (String)

    Unique export object ID.

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

    the optional parameters

Options Hash (opts):

  • :token (String)

    Token that was issued to the export, to get this token, get the export first

Returns:

  • (String)


149
150
151
152
# File 'lib/VoucherifySdk/api/exports_api.rb', line 149

def download_export(export_id, opts = {})
  data, _status_code, _headers = download_export_with_http_info(export_id, opts)
  data
end

#get_export(export_id, opts = {}) ⇒ ExportsGetResponseBody

Get Export Retrieves the URL of the downloadable file, which was generated via the Create Export method.

Parameters:

  • export_id (String)

    Unique export object ID of previously created export. This object can be a: voucher, redemption, publication, customer, order, points_expiration, or voucher_transactions.

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

    the optional parameters

Returns:



210
211
212
213
# File 'lib/VoucherifySdk/api/exports_api.rb', line 210

def get_export(export_id, opts = {})
  data, _status_code, _headers = get_export_with_http_info(export_id, opts)
  data
end

#list_exports(opts = {}) ⇒ ExportsListResponseBody

List Exports List all exports.

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.

  • :page (Integer)

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

  • :order (ParameterOrderListExports)

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

Returns:



271
272
273
274
# File 'lib/VoucherifySdk/api/exports_api.rb', line 271

def list_exports(opts = {})
  data, _status_code, _headers = list_exports_with_http_info(opts)
  data
end