Class: MethodRuby::Resources::Accounts::Updates
- Inherits:
-
Object
- Object
- MethodRuby::Resources::Accounts::Updates
- Defined in:
- lib/method_ruby/resources/accounts/updates.rb
Overview
Update records for accounts
Instance Method Summary collapse
-
#create(account_id, method_version:, idempotency_key: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::UpdateCreateResponse
Some parameter documentations has been truncated, see Models::Accounts::UpdateCreateParams for more details.
-
#initialize(client:) ⇒ Updates
constructor
private
A new instance of Updates.
-
#list(account_id, method_version:, page: nil, page_cursor: nil, page_limit: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::UpdateListResponse
Some parameter documentations has been truncated, see Models::Accounts::UpdateListParams for more details.
-
#retrieve(update_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::UpdateRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::UpdateRetrieveParams for more details.
Constructor Details
#initialize(client:) ⇒ Updates
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 Updates.
115 116 117 |
# File 'lib/method_ruby/resources/accounts/updates.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::UpdateCreateResponse
Some parameter documentations has been truncated, see Models::Accounts::UpdateCreateParams for more details.
Creates a new update 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/updates.rb', line 26 def create(account_id, params) parsed, = MethodRuby::Accounts::UpdateCreateParams.dump_request(params) @client.request( method: :post, path: ["accounts/%1$s/updates", account_id], headers: parsed.transform_keys( method_version: "method-version", idempotency_key: "idempotency-key" ), model: MethodRuby::Models::Accounts::UpdateCreateResponse, security: {secret_key: true}, options: ) end |
#list(account_id, method_version:, page: nil, page_cursor: nil, page_limit: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::UpdateListResponse
Some parameter documentations has been truncated, see Models::Accounts::UpdateListParams for more details.
Returns a list of update records for the specified account.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/method_ruby/resources/accounts/updates.rb', line 97 def list(account_id, params) query_params = [:page, :page_cursor, :page_limit] parsed, = MethodRuby::Accounts::UpdateListParams.dump_request(params) query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :get, path: ["accounts/%1$s/updates", account_id], query: query, headers: parsed.except(*query_params).transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::UpdateListResponse, security: {secret_key: true}, options: ) end |
#retrieve(update_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::UpdateRetrieveResponse
Some parameter documentations has been truncated, see Models::Accounts::UpdateRetrieveParams for more details.
Retrieves an account update 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/updates.rb', line 59 def retrieve(update_id, params) parsed, = MethodRuby::Accounts::UpdateRetrieveParams.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/updates/%2$s", account_id, update_id], headers: parsed.transform_keys(method_version: "method-version"), model: MethodRuby::Models::Accounts::UpdateRetrieveResponse, security: {secret_key: true}, options: ) end |