Class: MethodRuby::Resources::Accounts::CardBrands

Inherits:
Object
  • Object
show all
Defined in:
lib/method_ruby/resources/accounts/card_brands.rb

Overview

Card brand information for accounts

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardBrands

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 CardBrands.

Parameters:



115
116
117
# File 'lib/method_ruby/resources/accounts/card_brands.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::CardBrandCreateResponse

Some parameter documentations has been truncated, see Models::Accounts::CardBrandCreateParams for more details.

Creates a new card brand lookup for the specified account.

Parameters:

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/method_ruby/resources/accounts/card_brands.rb', line 26

def create(, params)
  parsed, options = MethodRuby::Accounts::CardBrandCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["accounts/%1$s/card_brands", ],
    headers: parsed.transform_keys(
      method_version: "method-version",
      idempotency_key: "idempotency-key"
    ),
    model: MethodRuby::Models::Accounts::CardBrandCreateResponse,
    security: {secret_key: true},
    options: options
  )
end

#list(account_id, method_version:, page: nil, page_cursor: nil, page_limit: nil, request_options: {}) ⇒ MethodRuby::Models::Accounts::CardBrandListResponse

Some parameter documentations has been truncated, see Models::Accounts::CardBrandListParams for more details.

Returns a list of card brand records for the specified account.

Parameters:

  • account_id (String)

    Path param: Unique identifier for the account.

  • method_version (Symbol, MethodRuby::Models::Accounts::CardBrandListParams::MethodVersion)

    Header param: API version to use for this request. This spec targets ‘2025-12-01

  • page (Integer)

    Query param: Page number for pagination (1-indexed).

  • page_cursor (String)

    Query param: Cursor for cursor-based pagination. Use the value from ‘Pagination-

  • page_limit (Integer)

    Query param: Number of items per page.

  • request_options (MethodRuby::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/method_ruby/resources/accounts/card_brands.rb', line 97

def list(, params)
  query_params = [:page, :page_cursor, :page_limit]
  parsed, options = MethodRuby::Accounts::CardBrandListParams.dump_request(params)
  query = MethodRuby::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :get,
    path: ["accounts/%1$s/card_brands", ],
    query: query,
    headers: parsed.except(*query_params).transform_keys(method_version: "method-version"),
    model: MethodRuby::Models::Accounts::CardBrandListResponse,
    security: {secret_key: true},
    options: options
  )
end

#retrieve(cbrd_id, account_id:, method_version:, request_options: {}) ⇒ MethodRuby::Models::Accounts::CardBrandRetrieveResponse

Some parameter documentations has been truncated, see Models::Accounts::CardBrandRetrieveParams for more details.

Retrieves an account card brand by its unique identifier.

Parameters:

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/method_ruby/resources/accounts/card_brands.rb', line 59

def retrieve(cbrd_id, params)
  parsed, options = MethodRuby::Accounts::CardBrandRetrieveParams.dump_request(params)
   =
    parsed.delete(:account_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["accounts/%1$s/card_brands/%2$s", , cbrd_id],
    headers: parsed.transform_keys(method_version: "method-version"),
    model: MethodRuby::Models::Accounts::CardBrandRetrieveResponse,
    security: {secret_key: true},
    options: options
  )
end