Class: Dodopayments::Resources::Products::LocalizedPrices
- Inherits:
-
Object
- Object
- Dodopayments::Resources::Products::LocalizedPrices
- Defined in:
- lib/dodopayments/resources/products/localized_prices.rb
Instance Method Summary collapse
- #archive(id, product_id:, request_options: {}) ⇒ nil
-
#create(product_id, amount:, currency:, country_code: nil, request_options: {}) ⇒ Dodopayments::Models::Products::LocalizedPrice
Some parameter documentations has been truncated, see Models::Products::LocalizedPriceCreateParams for more details.
-
#initialize(client:) ⇒ LocalizedPrices
constructor
private
A new instance of LocalizedPrices.
- #list(product_id, request_options: {}) ⇒ Dodopayments::Models::Products::ListLocalizedPricesResponse
- #retrieve(id, product_id:, request_options: {}) ⇒ Dodopayments::Models::Products::LocalizedPrice
-
#update(id, product_id:, amount: nil, request_options: {}) ⇒ Dodopayments::Models::Products::LocalizedPrice
Some parameter documentations has been truncated, see Models::Products::LocalizedPriceUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ LocalizedPrices
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 LocalizedPrices.
138 139 140 |
# File 'lib/dodopayments/resources/products/localized_prices.rb', line 138 def initialize(client:) @client = client end |
Instance Method Details
#archive(id, product_id:, request_options: {}) ⇒ nil
121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/dodopayments/resources/products/localized_prices.rb', line 121 def archive(id, params) parsed, = Dodopayments::Products::LocalizedPriceArchiveParams.dump_request(params) product_id = parsed.delete(:product_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :delete, path: ["products/%1$s/localized-prices/%2$s", product_id, id], model: NilClass, options: ) end |
#create(product_id, amount:, currency:, country_code: nil, request_options: {}) ⇒ Dodopayments::Models::Products::LocalizedPrice
Some parameter documentations has been truncated, see Models::Products::LocalizedPriceCreateParams for more details.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dodopayments/resources/products/localized_prices.rb', line 25 def create(product_id, params) parsed, = Dodopayments::Products::LocalizedPriceCreateParams.dump_request(params) @client.request( method: :post, path: ["products/%1$s/localized-prices", product_id], body: parsed, model: Dodopayments::Products::LocalizedPrice, options: ) end |
#list(product_id, request_options: {}) ⇒ Dodopayments::Models::Products::ListLocalizedPricesResponse
101 102 103 104 105 106 107 108 |
# File 'lib/dodopayments/resources/products/localized_prices.rb', line 101 def list(product_id, params = {}) @client.request( method: :get, path: ["products/%1$s/localized-prices", product_id], model: Dodopayments::Products::ListLocalizedPricesResponse, options: params[:request_options] ) end |
#retrieve(id, product_id:, request_options: {}) ⇒ Dodopayments::Models::Products::LocalizedPrice
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/dodopayments/resources/products/localized_prices.rb', line 47 def retrieve(id, params) parsed, = Dodopayments::Products::LocalizedPriceRetrieveParams.dump_request(params) product_id = parsed.delete(:product_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["products/%1$s/localized-prices/%2$s", product_id, id], model: Dodopayments::Products::LocalizedPrice, options: ) end |
#update(id, product_id:, amount: nil, request_options: {}) ⇒ Dodopayments::Models::Products::LocalizedPrice
Some parameter documentations has been truncated, see Models::Products::LocalizedPriceUpdateParams for more details.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/dodopayments/resources/products/localized_prices.rb', line 77 def update(id, params) parsed, = Dodopayments::Products::LocalizedPriceUpdateParams.dump_request(params) product_id = parsed.delete(:product_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["products/%1$s/localized-prices/%2$s", product_id, id], body: parsed, model: Dodopayments::Products::LocalizedPrice, options: ) end |