Class: Dodopayments::Resources::Brands
- Inherits:
-
Object
- Object
- Dodopayments::Resources::Brands
- Defined in:
- lib/dodopayments/resources/brands.rb
Instance Method Summary collapse
- #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(request_options: {}) ⇒ Dodopayments::Models::BrandListResponse
-
#retrieve(id, request_options: {}) ⇒ Dodopayments::Models::Brand
Thin handler just calls ‘get_brand` and wraps in `Json(…)`.
- #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.
118 119 120 |
# File 'lib/dodopayments/resources/brands.rb', line 118 def initialize(client:) @client = client end |
Instance Method Details
#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(request_options: {}) ⇒ Dodopayments::Models::BrandListResponse
88 89 90 91 92 93 94 95 |
# File 'lib/dodopayments/resources/brands.rb', line 88 def list(params = {}) @client.request( method: :get, path: "brands", model: Dodopayments::Models::BrandListResponse, options: params[:request_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
106 107 108 109 110 111 112 113 |
# File 'lib/dodopayments/resources/brands.rb', line 106 def update_images(id, params = {}) @client.request( method: :put, path: ["brands/%1$s/images", id], model: Dodopayments::Models::BrandUpdateImagesResponse, options: params[:request_options] ) end |