Class: Dodopayments::Resources::Brands
- Inherits:
-
Object
- Object
- Dodopayments::Resources::Brands
- Defined in:
- lib/dodopayments/resources/brands.rb,
sig/dodopayments/resources/brands.rbs
Instance Method Summary collapse
-
#archive(id, move_products_to: nil, request_options: {}) ⇒ Dodopayments::Models::BrandArchiveResponse
Some parameter documentations has been truncated, see Models::BrandArchiveParams for more details.
- #create(description: nil, name: nil, statement_descriptor: nil, support_email: nil, url: nil, request_options: {}) ⇒ Dodopayments::Models::Brand
-
#initialize(client:) ⇒ Brands
constructor
private
A new instance of Brands.
- #list(include_archived: nil, request_options: {}) ⇒ Dodopayments::Models::BrandListResponse
-
#retrieve(id, request_options: {}) ⇒ Dodopayments::Models::Brand
Thin handler just calls
get_brandand wraps inJson(...). - #update(id, description: nil, image_id: nil, name: nil, statement_descriptor: nil, support_email: nil, url: nil, request_options: {}) ⇒ Dodopayments::Models::Brand
- #update_images(id, request_options: {}) ⇒ Dodopayments::Models::BrandUpdateImagesResponse
Constructor Details
#initialize(client:) ⇒ Brands
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Brands.
151 152 153 |
# File 'lib/dodopayments/resources/brands.rb', line 151 def initialize(client:) @client = client end |
Instance Method Details
#archive(id, move_products_to: nil, request_options: {}) ⇒ Dodopayments::Models::BrandArchiveResponse
Some parameter documentations has been truncated, see Models::BrandArchiveParams for more details.
Archive a brand. Its products, live subscriptions, and product collections move
to the move_products_to brand. Archive is permanent.
119 120 121 122 123 124 125 126 127 128 |
# File 'lib/dodopayments/resources/brands.rb', line 119 def archive(id, params = {}) parsed, = Dodopayments::BrandArchiveParams.dump_request(params) @client.request( method: :post, path: ["brands/%1$s/archive", id], body: parsed, model: Dodopayments::Models::BrandArchiveResponse, options: ) end |
#create(description: nil, name: nil, statement_descriptor: nil, support_email: nil, url: nil, request_options: {}) ⇒ Dodopayments::Models::Brand
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dodopayments/resources/brands.rb', line 18 def create(params = {}) parsed, = Dodopayments::BrandCreateParams.dump_request(params) @client.request( method: :post, path: "brands", body: parsed, model: Dodopayments::Brand, options: ) end |
#list(include_archived: nil, request_options: {}) ⇒ Dodopayments::Models::BrandListResponse
90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/dodopayments/resources/brands.rb', line 90 def list(params = {}) parsed, = Dodopayments::BrandListParams.dump_request(params) query = Dodopayments::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "brands", query: query, model: Dodopayments::Models::BrandListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ Dodopayments::Models::Brand
Thin handler just calls get_brand and wraps in Json(...)
40 41 42 43 44 45 46 47 |
# File 'lib/dodopayments/resources/brands.rb', line 40 def retrieve(id, params = {}) @client.request( method: :get, path: ["brands/%1$s", id], model: Dodopayments::Brand, options: params[:request_options] ) end |
#update(id, description: nil, image_id: nil, name: nil, statement_descriptor: nil, support_email: nil, url: nil, request_options: {}) ⇒ Dodopayments::Models::Brand
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/dodopayments/resources/brands.rb', line 70 def update(id, params = {}) parsed, = Dodopayments::BrandUpdateParams.dump_request(params) @client.request( method: :patch, path: ["brands/%1$s", id], body: parsed, model: Dodopayments::Brand, options: ) end |
#update_images(id, request_options: {}) ⇒ Dodopayments::Models::BrandUpdateImagesResponse
139 140 141 142 143 144 145 146 |
# File 'lib/dodopayments/resources/brands.rb', line 139 def update_images(id, params = {}) @client.request( method: :put, path: ["brands/%1$s/images", id], model: Dodopayments::Models::BrandUpdateImagesResponse, options: params[:request_options] ) end |