Class: AnswerLayer::ConnectionsResource
- Inherits:
-
Resource
- Object
- Resource
- AnswerLayer::ConnectionsResource
show all
- Defined in:
- lib/answerlayer/resources/connections.rb
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#list ⇒ Object
5
6
7
|
# File 'lib/answerlayer/resources/connections.rb', line 5
def list
request(method: :get, path: "/connections/")
end
|
#schema(connection_id:) ⇒ Object
13
14
15
|
# File 'lib/answerlayer/resources/connections.rb', line 13
def schema(connection_id:)
request(method: :get, path: "/connections/#{connection_id}/schema")
end
|
#test_existing(connection_id:) ⇒ Object
9
10
11
|
# File 'lib/answerlayer/resources/connections.rb', line 9
def test_existing(connection_id:)
to_api_response(request(method: :post, path: "/connections/#{connection_id}/test_existing"))
end
|
#upload_csv(file:, name: nil, has_header: nil, delimiter: nil) ⇒ Object
17
18
19
|
# File 'lib/answerlayer/resources/connections.rb', line 17
def upload_csv(file:, name: nil, has_header: nil, delimiter: nil)
request(method: :post, path: "/csv/upload", multipart: compact(file: file, name: name, has_header: , delimiter: delimiter))
end
|
#upload_duckdb(file:, name: nil) ⇒ Object
21
22
23
|
# File 'lib/answerlayer/resources/connections.rb', line 21
def upload_duckdb(file:, name: nil)
request(method: :post, path: "/duckdb/upload", multipart: compact(file: file, name: name))
end
|