Class: VoucherifySdk::CategoriesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CategoriesApi

Returns a new instance of CategoriesApi.



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

def api_client
  @api_client
end

Instance Method Details

#create_category(opts = {}) ⇒ CategoriesCreateResponseBody

Create Category Create category with a specific name and hierarchy.

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



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

def create_category(opts = {})
  data, _status_code, _headers = create_category_with_http_info(opts)
  data
end

#delete_category(category_id, opts = {}) ⇒ nil

Delete Category Delete a category by the category ID.

Parameters:

  • category_id (String)

    Unique category ID assigned by Voucherify.

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

    the optional parameters

Returns:

  • (nil)


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

def delete_category(category_id, opts = {})
  delete_category_with_http_info(category_id, opts)
  nil
end

#get_category(category_id, opts = {}) ⇒ CategoriesGetResponseBody

Get Category Retrieve a category by the category ID.

Parameters:

  • category_id (String)

    Unique category ID assigned by Voucherify.

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

    the optional parameters

Returns:



152
153
154
155
# File 'lib/VoucherifySdk/api/categories_api.rb', line 152

def get_category(category_id, opts = {})
  data, _status_code, _headers = get_category_with_http_info(category_id, opts)
  data
end

#list_categories(opts = {}) ⇒ CategoriesListResponseBody

List Categories List all categories.

Parameters:

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

    the optional parameters

Returns:



214
215
216
217
# File 'lib/VoucherifySdk/api/categories_api.rb', line 214

def list_categories(opts = {})
  data, _status_code, _headers = list_categories_with_http_info(opts)
  data
end

#update_category(category_id, opts = {}) ⇒ CategoriesUpdateResponseBody

Update Category Update category using the category ID.

Parameters:

  • category_id (String)

    Unique category ID assigned by Voucherify.

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

    the optional parameters

Options Hash (opts):

Returns:



273
274
275
276
# File 'lib/VoucherifySdk/api/categories_api.rb', line 273

def update_category(category_id, opts = {})
  data, _status_code, _headers = update_category_with_http_info(category_id, opts)
  data
end