Class: MethodRuby::Resources::Accounts::Products
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Accounts::Products
- Defined in:
- lib/method_ruby/resources/accounts/products.rb
Overview
Products associated with accounts
Instance Method Summary collapse
-
#initialize(client:) ⇒ Products
constructor
private
A new instance of Products.
-
#list(account_id, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::ProductListResponse
Some parameter documentations has been truncated, see Models::Accounts::ProductListParams for more details.
-
#retrieve(prd_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::ProductRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::ProductRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Products
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 Products.
73 74 75 |
# File 'lib/method_ruby/resources/accounts/products.rb', line 73 def initialize(client:) @client = client end |
Instance Method Details
#list(account_id, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::ProductListResponse
Some parameter documentations has been truncated, see Models::Accounts::ProductListParams for more details.
Returns a list of products for the specified account.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/method_ruby/resources/accounts/products.rb', line 58 def list(account_id, params) parsed, = MethodRuby::Accounts::ProductListParams.dump_request(params) @client.request( method: :get, path: ["accounts/%1$s/products", account_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::ProductListResponse, security: {secret_key: true}, options: ) end |
#retrieve(prd_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::ProductRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::ProductRetrieveParams for more details.
Retrieves an account product by its unique identifier.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/method_ruby/resources/accounts/products.rb', line 26 def retrieve(prd_id, params) parsed, = MethodRuby::Accounts::ProductRetrieveParams.dump_request(params) account_id = parsed.delete(:account_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["accounts/%1$s/products/%2$s", account_id, prd_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::ProductRetrieveResponse, security: {secret_key: true}, options: ) end |