Class: Increase::Resources::Documents

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Documents

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

Parameters:



94
95
96
# File 'lib/increase/resources/documents.rb', line 94

def initialize(client:)
  @client = client
end

Instance Method Details

#create(category: , account_verification_letter: nil, funding_instructions: nil, request_options: {}) ⇒ Increase::Models::Document

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

Create a Document

Parameters:

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
# File 'lib/increase/resources/documents.rb', line 24

def create(params)
  parsed, options = Increase::DocumentCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "documents",
    body: parsed,
    model: Increase::Document,
    options: options
  )
end

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

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

List Documents

Parameters:

Returns:

See Also:



79
80
81
82
83
84
85
86
87
88
89
# File 'lib/increase/resources/documents.rb', line 79

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

#retrieve(document_id, request_options: {}) ⇒ Increase::Models::Document

Retrieve a Document

Parameters:

  • document_id (String)

    The identifier of the Document to retrieve.

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

Returns:

See Also:



46
47
48
49
50
51
52
53
# File 'lib/increase/resources/documents.rb', line 46

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