Class: MethodRuby::Resources::Accounts::Attributes
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Accounts::Attributes
- Defined in:
- lib/method_ruby/resources/accounts/attributes.rb
Overview
Attribute data for accounts
Instance Method Summary collapse
-
#create(account_id, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::AttributeCreateResponse
Some parameter documentations has been truncated, see Models::Accounts::AttributeCreateParams for more details.
-
#initialize(client:) ⇒ Attributes
constructor
private
A new instance of Attributes.
-
#list(account_id, method_version:, page: nil, page_cursor: nil, page_limit: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::AttributeListResponse
Some parameter documentations has been truncated, see Models::Accounts::AttributeListParams for more details.
-
#retrieve(acc_attr_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::AttributeRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::AttributeRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Attributes
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 Attributes.
115 116 117 |
# File 'lib/method_ruby/resources/accounts/attributes.rb', line 115 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::AttributeCreateResponse
Some parameter documentations has been truncated, see Models::Accounts::AttributeCreateParams for more details.
Creates a new attribute request for the specified account.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/method_ruby/resources/accounts/attributes.rb', line 26 def create(account_id, params) parsed, = MethodRuby::Accounts::AttributeCreateParams.dump_request(params) @client.request( method: :post, path: ["accounts/%1$s/attributes", account_id], headers: parsed.transform_keys( method_version: "method-version", idempotency_key: "idempotency-key" ), model: MethodRuby::Models::Accounts::AttributeCreateResponse, security: {secret_key: true}, options: ) end |
#list(account_id, method_version:, page: nil, page_cursor: nil, page_limit: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::AttributeListResponse
Some parameter documentations has been truncated, see Models::Accounts::AttributeListParams for more details.
Returns a list of attributes for the specified account.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/method_ruby/resources/accounts/attributes.rb', line 97 def list(account_id, params) query_params = [:page, :page_cursor, :page_limit] parsed, = MethodRuby::Accounts::AttributeListParams.dump_request(params) query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["accounts/%1$s/attributes", account_id], query: query, headers: parsed.except(*query_params).transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::AttributeListResponse, security: {secret_key: true}, options: ) end |
#retrieve(acc_attr_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::AttributeRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::AttributeRetrieveParams for more details.
Retrieves an account attribute by its unique identifier.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/method_ruby/resources/accounts/attributes.rb', line 59 def retrieve(acc_attr_id, params) parsed, = MethodRuby::Accounts::AttributeRetrieveParams.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/attributes/%2$s", account_id, acc_attr_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::AttributeRetrieveResponse, security: {secret_key: true}, options: ) end |