Class: Increase::Resources::PhysicalCards
- Inherits:
-
Object
- Object
- Increase::Resources::PhysicalCards
- Defined in:
- lib/increase/resources/physical_cards.rb,
sig/increase/resources/physical_cards.rbs
Instance Method Summary collapse
-
#create(card_id:, cardholder:, shipment:, physical_card_profile_id: nil, request_options: {}) ⇒ Increase::Models::PhysicalCard
Create a Physical Card.
-
#initialize(client:) ⇒ PhysicalCards
constructor
private
A new instance of PhysicalCards.
-
#list(card_id: nil, created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::PhysicalCard>
List Physical Cards.
-
#retrieve(physical_card_id, request_options: {}) ⇒ Increase::Models::PhysicalCard
Retrieve a Physical Card.
-
#update(physical_card_id, status:, request_options: {}) ⇒ Increase::Models::PhysicalCard
Update a Physical Card.
Constructor Details
#initialize(client:) ⇒ PhysicalCards
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 PhysicalCards.
124 125 126 |
# File 'lib/increase/resources/physical_cards.rb', line 124 def initialize(client:) @client = client end |
Instance Method Details
#create(card_id:, cardholder:, shipment:, physical_card_profile_id: nil, request_options: {}) ⇒ Increase::Models::PhysicalCard
Create a Physical Card
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/increase/resources/physical_cards.rb', line 27 def create(params) parsed, = Increase::PhysicalCardCreateParams.dump_request(params) @client.request( method: :post, path: "physical_cards", body: parsed, model: Increase::PhysicalCard, options: ) end |
#list(card_id: nil, created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::PhysicalCard>
List Physical Cards
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/increase/resources/physical_cards.rb', line 108 def list(params = {}) parsed, = Increase::PhysicalCardListParams.dump_request(params) query = Increase::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "physical_cards", query: query, page: Increase::Internal::Page, model: Increase::PhysicalCard, options: ) end |
#retrieve(physical_card_id, request_options: {}) ⇒ Increase::Models::PhysicalCard
Retrieve a Physical Card
49 50 51 52 53 54 55 56 |
# File 'lib/increase/resources/physical_cards.rb', line 49 def retrieve(physical_card_id, params = {}) @client.request( method: :get, path: ["physical_cards/%1$s", physical_card_id], model: Increase::PhysicalCard, options: params[:request_options] ) end |
#update(physical_card_id, status:, request_options: {}) ⇒ Increase::Models::PhysicalCard
Update a Physical Card
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/increase/resources/physical_cards.rb', line 72 def update(physical_card_id, params) parsed, = Increase::PhysicalCardUpdateParams.dump_request(params) @client.request( method: :patch, path: ["physical_cards/%1$s", physical_card_id], body: parsed, model: Increase::PhysicalCard, options: ) end |