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



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.

Options Hash (opts):



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.



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.



148
149
150
151
# File 'lib/VoucherifySdk/api/categories_api.rb', line 148

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.



206
207
208
209
# File 'lib/VoucherifySdk/api/categories_api.rb', line 206

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.

Options Hash (opts):



265
266
267
268
# File 'lib/VoucherifySdk/api/categories_api.rb', line 265

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