Class: Increase::Resources::PhysicalCards

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/physical_cards.rb

Instance Method Summary collapse

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.

Parameters:



118
119
120
# File 'lib/increase/resources/physical_cards.rb', line 118

def initialize(client:)
  @client = client
end

Instance Method Details

#create(card_id: , cardholder: , shipment: , physical_card_profile_id: nil, request_options: {}) ⇒ Increase::Models::PhysicalCard

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

Create a Physical Card

Parameters:

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
# File 'lib/increase/resources/physical_cards.rb', line 26

def create(params)
  parsed, options = Increase::PhysicalCardCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "physical_cards",
    body: parsed,
    model: Increase::PhysicalCard,
    options: options
  )
end

#list(card_id: nil, created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::PhysicalCard>

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

List Physical Cards

Parameters:

  • card_id (String)

    Filter Physical Cards to ones belonging to the specified Card.

  • created_at (Increase::Models::PhysicalCardListParams::CreatedAt)
  • cursor (String)

    Return the page of entries after this one.

  • idempotency_key (String)

    Filter records to the one with the specified ‘idempotency_key` you chose for tha

  • limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 ob

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

Returns:

See Also:



103
104
105
106
107
108
109
110
111
112
113
# File 'lib/increase/resources/physical_cards.rb', line 103

def list(params = {})
  parsed, options = Increase::PhysicalCardListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "physical_cards",
    query: parsed,
    page: Increase::Internal::Page,
    model: Increase::PhysicalCard,
    options: options
  )
end

#retrieve(physical_card_id, request_options: {}) ⇒ Increase::Models::PhysicalCard

Retrieve a Physical Card

Parameters:

  • physical_card_id (String)

    The identifier of the Physical Card.

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

Returns:

See Also:



48
49
50
51
52
53
54
55
# File 'lib/increase/resources/physical_cards.rb', line 48

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

Parameters:

Returns:

See Also:



70
71
72
73
74
75
76
77
78
79
# File 'lib/increase/resources/physical_cards.rb', line 70

def update(physical_card_id, params)
  parsed, options = Increase::PhysicalCardUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["physical_cards/%1$s", physical_card_id],
    body: parsed,
    model: Increase::PhysicalCard,
    options: options
  )
end