Class: Dataleon::Resources::Companies::Documents
- Inherits:
-
Object
- Object
- Dataleon::Resources::Companies::Documents
- Defined in:
- lib/dataleon/resources/companies/documents.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Documents
constructor
private
A new instance of Documents.
-
#list(company_id, request_options: {}) ⇒ Dataleon::Models::Individuals::DocumentResponse
Get documents to an company.
-
#upload(company_id, document_type:, file: nil, url: nil, request_options: {}) ⇒ Dataleon::Models::Individuals::GenericDocument
Upload documents to an company.
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.
59 60 61 |
# File 'lib/dataleon/resources/companies/documents.rb', line 59 def initialize(client:) @client = client end |
Instance Method Details
#list(company_id, request_options: {}) ⇒ Dataleon::Models::Individuals::DocumentResponse
Get documents to an company
18 19 20 21 22 23 24 25 |
# File 'lib/dataleon/resources/companies/documents.rb', line 18 def list(company_id, params = {}) @client.request( method: :get, path: ["companies/%1$s/documents", company_id], model: Dataleon::Individuals::DocumentResponse, options: params[:request_options] ) end |
#upload(company_id, document_type:, file: nil, url: nil, request_options: {}) ⇒ Dataleon::Models::Individuals::GenericDocument
Upload documents to an company
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/dataleon/resources/companies/documents.rb', line 44 def upload(company_id, params) parsed, = Dataleon::Companies::DocumentUploadParams.dump_request(params) @client.request( method: :post, path: ["companies/%1$s/documents", company_id], headers: {"content-type" => "multipart/form-data"}, body: parsed, model: Dataleon::Individuals::GenericDocument, options: ) end |