Class: Rafflesia::QueryExports
- Inherits:
-
Object
- Object
- Rafflesia::QueryExports
- Defined in:
- lib/rafflesia/query_exports.rb
Instance Method Summary collapse
-
#cancel(export_id:, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportData
POST /v1/query_exports/export_id/cancel.
-
#create(query:, format: nil, max_rows: nil, retention_days: nil, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportData
POST /v1/query_exports.
-
#download(export_id:, request_options: {}) ⇒ String
Download immutable query-export Parquet bytes with a verified checksum.
-
#get(export_id:, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportData
GET /v1/query_exports/export_id.
-
#initialize(client) ⇒ QueryExports
constructor
A new instance of QueryExports.
-
#list(limit: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportListData
GET /v1/query_exports.
-
#retry(export_id:, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportData
POST /v1/query_exports/export_id/retry.
Constructor Details
#initialize(client) ⇒ QueryExports
Returns a new instance of QueryExports.
9 10 11 |
# File 'lib/rafflesia/query_exports.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#cancel(export_id:, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportData
POST /v1/query_exports/export_id/cancel
97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/rafflesia/query_exports.rb', line 97 def cancel( export_id:, request_options: {} ) response = @client.request( method: :post, path: "/v1/query_exports/#{Rafflesia::Util.encode_path(export_id)}/cancel", auth: true, request_options: ) result = Rafflesia::EnvelopeQueryExportData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#create(query:, format: nil, max_rows: nil, retention_days: nil, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportData
POST /v1/query_exports
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/rafflesia/query_exports.rb', line 49 def create( query:, format: nil, max_rows: nil, retention_days: nil, request_options: {} ) body = { 'format' => format, 'max_rows' => max_rows, 'query' => query, 'retention_days' => retention_days }.compact response = @client.request( method: :post, path: '/v1/query_exports', auth: true, body: body, request_options: ) result = Rafflesia::EnvelopeQueryExportData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#download(export_id:, request_options: {}) ⇒ String
Download immutable query-export Parquet bytes with a verified checksum.
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/rafflesia/query_exports.rb', line 116 def download( export_id:, request_options: {} ) response = @client.request( method: :get, path: "/v1/query_exports/#{Rafflesia::Util.encode_path(export_id)}/download", auth: true, request_options: ) response.body end |
#get(export_id:, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportData
GET /v1/query_exports/export_id
78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/rafflesia/query_exports.rb', line 78 def get( export_id:, request_options: {} ) response = @client.request( method: :get, path: "/v1/query_exports/#{Rafflesia::Util.encode_path(export_id)}", auth: true, request_options: ) result = Rafflesia::EnvelopeQueryExportData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#list(limit: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportListData
GET /v1/query_exports
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/rafflesia/query_exports.rb', line 19 def list( limit: nil, starting_after: nil, status: nil, request_options: {} ) params = { 'limit' => limit, 'starting_after' => starting_after, 'status' => status }.compact response = @client.request( method: :get, path: '/v1/query_exports', auth: true, params: params, request_options: ) result = Rafflesia::EnvelopeQueryExportListData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#retry(export_id:, request_options: {}) ⇒ Rafflesia::EnvelopeQueryExportData
POST /v1/query_exports/export_id/retry
133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/rafflesia/query_exports.rb', line 133 def retry( export_id:, request_options: {} ) response = @client.request( method: :post, path: "/v1/query_exports/#{Rafflesia::Util.encode_path(export_id)}/retry", auth: true, request_options: ) result = Rafflesia::EnvelopeQueryExportData.new(response.body) result.last_response = Rafflesia::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |