Class: Increase::Resources::Entities

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Entities

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

Parameters:



209
210
211
# File 'lib/increase/resources/entities.rb', line 209

def initialize(client:)
  @client = client
end

Instance Method Details

#archive(entity_id, request_options: {}) ⇒ Increase::Models::Entity

Archive an Entity

Parameters:

  • entity_id (String)

    The identifier of the Entity to archive. Any accounts associated with an entity must be closed before the entity can be archived.

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

Returns:

See Also:



197
198
199
200
201
202
203
204
# File 'lib/increase/resources/entities.rb', line 197

def archive(entity_id, params = {})
  @client.request(
    method: :post,
    path: ["entities/%1$s/archive", entity_id],
    model: Increase::Entity,
    options: params[:request_options]
  )
end

#create(structure:, corporation: nil, description: nil, government_authority: nil, joint: nil, natural_person: nil, risk_rating: nil, supplemental_documents: nil, terms_agreements: nil, third_party_verification: nil, trust: nil, request_options: {}) ⇒ Increase::Models::Entity

Create an Entity

Parameters:

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
# File 'lib/increase/resources/entities.rb', line 57

def create(params)
  parsed, options = Increase::EntityCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "entities",
    body: parsed,
    model: Increase::Entity,
    options: options
  )
end

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

List Entities

Parameters:

Returns:

See Also:



171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/increase/resources/entities.rb', line 171

def list(params = {})
  parsed, options = Increase::EntityListParams.dump_request(params)
  query = Increase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "entities",
    query: query,
    page: Increase::Internal::Page,
    model: Increase::Entity,
    options: options
  )
end

#retrieve(entity_id, request_options: {}) ⇒ Increase::Models::Entity

Retrieve an Entity

Parameters:

  • entity_id (String)

    The identifier of the Entity to retrieve.

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

Returns:

See Also:



79
80
81
82
83
84
85
86
# File 'lib/increase/resources/entities.rb', line 79

def retrieve(entity_id, params = {})
  @client.request(
    method: :get,
    path: ["entities/%1$s", entity_id],
    model: Increase::Entity,
    options: params[:request_options]
  )
end

#update(entity_id, corporation: nil, details_confirmed_at: nil, government_authority: nil, natural_person: nil, risk_rating: nil, terms_agreements: nil, third_party_verification: nil, trust: nil, request_options: {}) ⇒ Increase::Models::Entity

Update an Entity

Parameters:

Returns:

See Also:



133
134
135
136
137
138
139
140
141
142
# File 'lib/increase/resources/entities.rb', line 133

def update(entity_id, params = {})
  parsed, options = Increase::EntityUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["entities/%1$s", entity_id],
    body: parsed,
    model: Increase::Entity,
    options: options
  )
end