Class: ModernTreasury::Resources::Identifications

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/identifications.rb,
sig/modern_treasury/resources/identifications.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Identifications

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

Parameters:



101
102
103
# File 'lib/modern_treasury/resources/identifications.rb', line 101

def initialize(client:)
  @client = client
end

Instance Method Details

#create(id_number:, id_type:, legal_entity_id:, documents: nil, expiration_date: nil, issuing_country: nil, issuing_region: nil, request_options: {}) ⇒ ModernTreasury::Models::Identification

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

Create an Identification for a Legal Entity.

Parameters:

  • id_number (String) —

    The ID number of identification document.

  • id_type (Symbol, ModernTreasury::Models::IdentificationCreateParams::IDType) —

    The type of ID number.

  • legal_entity_id (String) —

    The ID of the Legal Entity the identification belongs to.

  • documents (Array<ModernTreasury::Models::IdentificationCreateParams::Document>) —

    A list of documents to attach to the identification.

  • expiration_date (Date, nil) —

    The date when the Identification is no longer considered valid by the issuing au

  • issuing_country (String, nil) —

    The ISO 3166-1 alpha-2 country code of the country that issued the identificatio

  • issuing_region (String, nil) —

    The region in which the identifcation was issued.

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

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
# File 'lib/modern_treasury/resources/identifications.rb', line 32

def create(params)
  parsed, options = ModernTreasury::IdentificationCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/identifications",
    body: parsed,
    model: ModernTreasury::Identification,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::Identification

Get an existing Identification.

Parameters:

Returns:

See Also:



54
55
56
57
58
59
60
61
# File 'lib/modern_treasury/resources/identifications.rb', line 54

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["api/identifications/%1$s", id],
    model: ModernTreasury::Identification,
    options: params[:request_options]
  )
end

#update(id, expiration_date: nil, id_number: nil, id_type: nil, issuing_country: nil, issuing_region: nil, request_options: {}) ⇒ ModernTreasury::Models::Identification

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

Update an existing Identification.

Parameters:

  • id (String) —

    The id of an existing identification.

  • expiration_date (Date, nil) —

    The date when the Identification is no longer considered valid by the issuing au

  • id_number (String) —

    The ID number of identification document.

  • id_type (Symbol, ModernTreasury::Models::IdentificationUpdateParams::IDType) —

    The type of ID number.

  • issuing_country (String, nil) —

    The ISO 3166-1 alpha-2 country code of the country that issued the identificatio

  • issuing_region (String, nil) —

    The region in which the identifcation was issued.

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

Returns:

See Also:



87
88
89
90
91
92
93
94
95
96
# File 'lib/modern_treasury/resources/identifications.rb', line 87

def update(id, params = {})
  parsed, options = ModernTreasury::IdentificationUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["api/identifications/%1$s", id],
    body: parsed,
    model: ModernTreasury::Identification,
    options: options
  )
end