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.
127 128 129 |
# File 'lib/increase/resources/physical_cards.rb', line 127 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
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/increase/resources/physical_cards.rb', line 28 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
111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/increase/resources/physical_cards.rb', line 111 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
50 51 52 53 54 55 56 57 |
# File 'lib/increase/resources/physical_cards.rb', line 50 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
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/increase/resources/physical_cards.rb', line 73 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 |