retab 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/retab/client.rb +8 -0
- data/lib/retab/files/create_file_blueprint_request.rb +31 -0
- data/lib/retab/files/file_blueprint.rb +52 -0
- data/lib/retab/files.rb +88 -0
- data/lib/retab/schemas/generate_schema_request.rb +3 -3
- data/lib/retab/schemas/{partial_schema.rb → schema_generation.rb} +12 -3
- data/lib/retab/schemas.rb +5 -5
- data/lib/retab/secrets/create_secret_request.rb +25 -0
- data/lib/retab/secrets/secret.rb +34 -0
- data/lib/retab/secrets/secret_list_response.rb +20 -0
- data/lib/retab/secrets/secret_response.rb +20 -0
- data/lib/retab/secrets/secret_value.rb +28 -0
- data/lib/retab/secrets/secret_value_response.rb +20 -0
- data/lib/retab/secrets/set_secret_request.rb +20 -0
- data/lib/retab/secrets.rb +154 -0
- data/lib/retab/tables/body_create_table_v_1_tables_post.rb +28 -0
- data/lib/retab/tables/body_replace_table_v_1_tables_table_id_put.rb +25 -0
- data/lib/retab/tables/query_workflow_table_request.rb +72 -0
- data/lib/retab/tables/update_workflow_table_request.rb +25 -0
- data/lib/retab/tables/workflow_table.rb +55 -0
- data/lib/retab/tables/workflow_table_aggregation_request.rb +28 -0
- data/lib/retab/tables/workflow_table_column.rb +34 -0
- data/lib/retab/tables/workflow_table_distinct_request.rb +20 -0
- data/lib/retab/tables/workflow_table_explain.rb +54 -0
- data/lib/retab/tables/workflow_table_filter_rule.rb +28 -0
- data/lib/retab/tables/workflow_table_list_response.rb +20 -0
- data/lib/retab/tables/workflow_table_profile_column.rb +49 -0
- data/lib/retab/tables/workflow_table_profile_response.rb +28 -0
- data/lib/retab/tables/workflow_table_response.rb +20 -0
- data/lib/retab/tables/workflow_table_row.rb +28 -0
- data/lib/retab/tables/workflow_table_rows_response.rb +52 -0
- data/lib/retab/tables/workflow_table_sample_request.rb +20 -0
- data/lib/retab/tables/workflow_table_schema_response.rb +25 -0
- data/lib/retab/tables/workflow_table_search_request.rb +25 -0
- data/lib/retab/tables/workflow_table_sort_rule.rb +25 -0
- data/lib/retab/tables/workflow_table_tail_request.rb +7 -0
- data/lib/retab/tables/workflow_table_validation_column_rule.rb +28 -0
- data/lib/retab/tables/workflow_table_validation_diagnostic.rb +31 -0
- data/lib/retab/tables/workflow_table_validation_request.rb +28 -0
- data/lib/retab/tables/workflow_table_validation_response.rb +30 -0
- data/lib/retab/tables.rb +356 -0
- data/lib/retab/types/create_file_blueprint_request_mode.rb +13 -0
- data/lib/retab/types/declarative_plan_resource_change_type.rb +0 -2
- data/lib/retab/types/file_blueprint_mode.rb +9 -0
- data/lib/retab/types/file_blueprint_status.rb +9 -0
- data/lib/retab/types/schema_generation_status.rb +9 -0
- data/lib/retab/types/validate_workflow_block_config_request_config_mode.rb +9 -0
- data/lib/retab/types/workflow_block_type.rb +0 -2
- data/lib/retab/types/workflow_table_aggregation_function.rb +17 -0
- data/lib/retab/types/workflow_table_filter_operator.rb +46 -0
- data/lib/retab/types/workflow_table_sort_direction.rb +9 -0
- data/lib/retab/types/workflow_table_validation_severity.rb +13 -0
- data/lib/retab/workflow_blocks/validate_workflow_block_config_request.rb +25 -0
- data/lib/retab/workflow_blocks/validate_workflow_block_config_response.rb +34 -0
- data/lib/retab/workflow_blocks/workflow_block.rb +6 -0
- data/lib/retab/workflow_blocks.rb +38 -0
- data/lib/retab.rb +2 -0
- data/rbi/retab/body_create_table_v_1_tables_post.rbi +36 -0
- data/rbi/retab/body_replace_table_v_1_tables_table_id_put.rbi +30 -0
- data/rbi/retab/client.rbi +6 -0
- data/rbi/retab/create_file_blueprint_request.rbi +42 -0
- data/rbi/retab/create_secret_request.rbi +30 -0
- data/rbi/retab/file_blueprint.rbi +84 -0
- data/rbi/retab/files.rbi +28 -0
- data/rbi/retab/generate_schema_request.rbi +2 -2
- data/rbi/retab/query_workflow_table_request.rbi +120 -0
- data/rbi/retab/{partial_schema.rbi → schema_generation.rbi} +19 -1
- data/rbi/retab/schemas.rbi +3 -3
- data/rbi/retab/secret.rbi +48 -0
- data/rbi/retab/secret_list_response.rbi +24 -0
- data/rbi/retab/secret_response.rbi +24 -0
- data/rbi/retab/secret_value.rbi +36 -0
- data/rbi/retab/secret_value_response.rbi +24 -0
- data/rbi/retab/secrets.rbi +62 -0
- data/rbi/retab/set_secret_request.rbi +24 -0
- data/rbi/retab/tables.rbi +127 -0
- data/rbi/retab/update_workflow_table_request.rbi +30 -0
- data/rbi/retab/validate_workflow_block_config_request.rbi +30 -0
- data/rbi/retab/validate_workflow_block_config_response.rbi +48 -0
- data/rbi/retab/workflow_block.rbi +12 -0
- data/rbi/retab/workflow_blocks.rbi +11 -0
- data/rbi/retab/workflow_table.rbi +90 -0
- data/rbi/retab/workflow_table_aggregation_request.rbi +36 -0
- data/rbi/retab/workflow_table_column.rbi +48 -0
- data/rbi/retab/workflow_table_distinct_request.rbi +24 -0
- data/rbi/retab/workflow_table_explain.rbi +84 -0
- data/rbi/retab/workflow_table_filter_rule.rbi +36 -0
- data/rbi/retab/workflow_table_list_response.rbi +24 -0
- data/rbi/retab/workflow_table_profile_column.rbi +78 -0
- data/rbi/retab/workflow_table_profile_response.rbi +36 -0
- data/rbi/retab/workflow_table_response.rbi +24 -0
- data/rbi/retab/workflow_table_row.rbi +36 -0
- data/rbi/retab/workflow_table_rows_response.rbi +84 -0
- data/rbi/retab/workflow_table_sample_request.rbi +24 -0
- data/rbi/retab/workflow_table_schema_response.rbi +30 -0
- data/rbi/retab/workflow_table_search_request.rbi +30 -0
- data/rbi/retab/workflow_table_sort_rule.rbi +30 -0
- data/rbi/retab/workflow_table_tail_request.rbi +24 -0
- data/rbi/retab/workflow_table_validation_column_rule.rbi +36 -0
- data/rbi/retab/workflow_table_validation_diagnostic.rbi +42 -0
- data/rbi/retab/workflow_table_validation_request.rbi +36 -0
- data/rbi/retab/workflow_table_validation_response.rbi +36 -0
- metadata +88 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class WorkflowTableValidationDiagnostic < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
severity: :severity,
|
|
10
|
+
column: :column,
|
|
11
|
+
rule: :rule,
|
|
12
|
+
message: :message
|
|
13
|
+
}.freeze
|
|
14
|
+
|
|
15
|
+
attr_accessor(
|
|
16
|
+
:severity,
|
|
17
|
+
:column,
|
|
18
|
+
:rule,
|
|
19
|
+
:message
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def initialize(json)
|
|
23
|
+
super()
|
|
24
|
+
hash = self.class.normalize(json)
|
|
25
|
+
@severity = hash[:severity]
|
|
26
|
+
@column = hash[:column]
|
|
27
|
+
@rule = hash[:rule]
|
|
28
|
+
@message = hash[:message]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class WorkflowTableValidationRequest < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
required_columns: :required_columns,
|
|
10
|
+
columns: :columns,
|
|
11
|
+
unique: :unique
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
attr_accessor(
|
|
15
|
+
:required_columns,
|
|
16
|
+
:columns,
|
|
17
|
+
:unique
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def initialize(json)
|
|
21
|
+
super()
|
|
22
|
+
hash = self.class.normalize(json)
|
|
23
|
+
@required_columns = (hash[:required_columns] || [])
|
|
24
|
+
@columns = hash[:columns] || {}
|
|
25
|
+
@unique = (hash[:unique] || []).map { |item| (item || []) }
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class WorkflowTableValidationResponse < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
table_id: :table_id,
|
|
10
|
+
diagnostics: :diagnostics,
|
|
11
|
+
has_errors: :has_errors
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
attr_accessor(
|
|
15
|
+
:table_id,
|
|
16
|
+
:diagnostics,
|
|
17
|
+
:has_errors
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def initialize(json)
|
|
21
|
+
super()
|
|
22
|
+
hash = self.class.normalize(json)
|
|
23
|
+
@table_id = hash[:table_id]
|
|
24
|
+
@diagnostics = (hash[:diagnostics] || []).map { |item|
|
|
25
|
+
item ? Retab::WorkflowTableValidationDiagnostic.new(item) : nil
|
|
26
|
+
}
|
|
27
|
+
@has_errors = hash[:has_errors].nil? ? false : hash[:has_errors]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
data/lib/retab/tables.rb
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
require "json"
|
|
6
|
+
|
|
7
|
+
module Retab
|
|
8
|
+
class Tables
|
|
9
|
+
def initialize(client)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# List Tables
|
|
14
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
15
|
+
# @return [Retab::WorkflowTableListResponse]
|
|
16
|
+
def list(request_options: {})
|
|
17
|
+
response = @client.request(
|
|
18
|
+
method: :get,
|
|
19
|
+
path: "/v1/tables",
|
|
20
|
+
auth: true,
|
|
21
|
+
request_options: request_options
|
|
22
|
+
)
|
|
23
|
+
result = Retab::WorkflowTableListResponse.new(response.body)
|
|
24
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
25
|
+
http_status: response.code.to_i,
|
|
26
|
+
http_headers: response.each_header.to_h,
|
|
27
|
+
request_id: response["x-request-id"]
|
|
28
|
+
)
|
|
29
|
+
result
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create Table
|
|
33
|
+
# @param name [String]
|
|
34
|
+
# @param file [String]
|
|
35
|
+
# @param column_schema_overrides [String, nil]
|
|
36
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
37
|
+
# @return [Retab::WorkflowTableListResponse]
|
|
38
|
+
def create(
|
|
39
|
+
name:,
|
|
40
|
+
file:,
|
|
41
|
+
column_schema_overrides: nil,
|
|
42
|
+
request_options: {}
|
|
43
|
+
)
|
|
44
|
+
body = {
|
|
45
|
+
"name" => name,
|
|
46
|
+
"file" => file,
|
|
47
|
+
"column_schema_overrides" => column_schema_overrides
|
|
48
|
+
}.compact
|
|
49
|
+
response = @client.request(
|
|
50
|
+
method: :post,
|
|
51
|
+
path: "/v1/tables",
|
|
52
|
+
auth: true,
|
|
53
|
+
body: body,
|
|
54
|
+
request_options: request_options
|
|
55
|
+
)
|
|
56
|
+
result = Retab::WorkflowTableListResponse.new(response.body)
|
|
57
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
58
|
+
http_status: response.code.to_i,
|
|
59
|
+
http_headers: response.each_header.to_h,
|
|
60
|
+
request_id: response["x-request-id"]
|
|
61
|
+
)
|
|
62
|
+
result
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Get Table
|
|
66
|
+
# @param table_id [String]
|
|
67
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
68
|
+
# @return [Retab::WorkflowTableResponse]
|
|
69
|
+
def get(
|
|
70
|
+
table_id:,
|
|
71
|
+
request_options: {}
|
|
72
|
+
)
|
|
73
|
+
response = @client.request(
|
|
74
|
+
method: :get,
|
|
75
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}",
|
|
76
|
+
auth: true,
|
|
77
|
+
request_options: request_options
|
|
78
|
+
)
|
|
79
|
+
result = Retab::WorkflowTableResponse.new(response.body)
|
|
80
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
81
|
+
http_status: response.code.to_i,
|
|
82
|
+
http_headers: response.each_header.to_h,
|
|
83
|
+
request_id: response["x-request-id"]
|
|
84
|
+
)
|
|
85
|
+
result
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Replace Table
|
|
89
|
+
# @param table_id [String]
|
|
90
|
+
# @param file [String]
|
|
91
|
+
# @param column_schema_overrides [String, nil]
|
|
92
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
93
|
+
# @return [Retab::WorkflowTableListResponse]
|
|
94
|
+
def replace(
|
|
95
|
+
table_id:,
|
|
96
|
+
file:,
|
|
97
|
+
column_schema_overrides: nil,
|
|
98
|
+
request_options: {}
|
|
99
|
+
)
|
|
100
|
+
body = {
|
|
101
|
+
"file" => file,
|
|
102
|
+
"column_schema_overrides" => column_schema_overrides
|
|
103
|
+
}.compact
|
|
104
|
+
response = @client.request(
|
|
105
|
+
method: :put,
|
|
106
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}",
|
|
107
|
+
auth: true,
|
|
108
|
+
body: body,
|
|
109
|
+
request_options: request_options
|
|
110
|
+
)
|
|
111
|
+
result = Retab::WorkflowTableListResponse.new(response.body)
|
|
112
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
113
|
+
http_status: response.code.to_i,
|
|
114
|
+
http_headers: response.each_header.to_h,
|
|
115
|
+
request_id: response["x-request-id"]
|
|
116
|
+
)
|
|
117
|
+
result
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Update Table
|
|
121
|
+
# @param table_id [String]
|
|
122
|
+
# @param name [String, nil]
|
|
123
|
+
# @param metadata [Hash{String => Object}, nil]
|
|
124
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
125
|
+
# @return [Retab::WorkflowTableListResponse]
|
|
126
|
+
def update_table(
|
|
127
|
+
table_id:,
|
|
128
|
+
name: nil,
|
|
129
|
+
metadata: nil,
|
|
130
|
+
request_options: {}
|
|
131
|
+
)
|
|
132
|
+
body = {
|
|
133
|
+
"name" => name,
|
|
134
|
+
"metadata" => metadata
|
|
135
|
+
}.compact
|
|
136
|
+
response = @client.request(
|
|
137
|
+
method: :patch,
|
|
138
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}",
|
|
139
|
+
auth: true,
|
|
140
|
+
body: body,
|
|
141
|
+
request_options: request_options
|
|
142
|
+
)
|
|
143
|
+
result = Retab::WorkflowTableListResponse.new(response.body)
|
|
144
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
145
|
+
http_status: response.code.to_i,
|
|
146
|
+
http_headers: response.each_header.to_h,
|
|
147
|
+
request_id: response["x-request-id"]
|
|
148
|
+
)
|
|
149
|
+
result
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Delete Table
|
|
153
|
+
# @param table_id [String]
|
|
154
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
155
|
+
# @return [Retab::WorkflowTableListResponse]
|
|
156
|
+
def delete(
|
|
157
|
+
table_id:,
|
|
158
|
+
request_options: {}
|
|
159
|
+
)
|
|
160
|
+
response = @client.request(
|
|
161
|
+
method: :delete,
|
|
162
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}",
|
|
163
|
+
auth: true,
|
|
164
|
+
request_options: request_options
|
|
165
|
+
)
|
|
166
|
+
result = Retab::WorkflowTableListResponse.new(response.body)
|
|
167
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
168
|
+
http_status: response.code.to_i,
|
|
169
|
+
http_headers: response.each_header.to_h,
|
|
170
|
+
request_id: response["x-request-id"]
|
|
171
|
+
)
|
|
172
|
+
result
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Download Table Csv
|
|
176
|
+
# @param table_id [String]
|
|
177
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
178
|
+
# @return [void]
|
|
179
|
+
def download(
|
|
180
|
+
table_id:,
|
|
181
|
+
request_options: {}
|
|
182
|
+
)
|
|
183
|
+
@client.request(
|
|
184
|
+
method: :get,
|
|
185
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}/download",
|
|
186
|
+
auth: true,
|
|
187
|
+
request_options: request_options
|
|
188
|
+
)
|
|
189
|
+
nil
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Profile Table
|
|
193
|
+
# @param table_id [String]
|
|
194
|
+
# @param select [Array<String>, nil]
|
|
195
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
196
|
+
# @return [Retab::WorkflowTableProfileResponse]
|
|
197
|
+
def profile(
|
|
198
|
+
table_id:,
|
|
199
|
+
select: nil,
|
|
200
|
+
request_options: {}
|
|
201
|
+
)
|
|
202
|
+
params = {
|
|
203
|
+
"select" => select
|
|
204
|
+
}.compact
|
|
205
|
+
response = @client.request(
|
|
206
|
+
method: :get,
|
|
207
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}/profile",
|
|
208
|
+
auth: true,
|
|
209
|
+
params: params,
|
|
210
|
+
request_options: request_options
|
|
211
|
+
)
|
|
212
|
+
result = Retab::WorkflowTableProfileResponse.new(response.body)
|
|
213
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
214
|
+
http_status: response.code.to_i,
|
|
215
|
+
http_headers: response.each_header.to_h,
|
|
216
|
+
request_id: response["x-request-id"]
|
|
217
|
+
)
|
|
218
|
+
result
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Query Table
|
|
222
|
+
# @param table_id [String]
|
|
223
|
+
# @param filters [Array<Retab::WorkflowTableFilterRule>, nil]
|
|
224
|
+
# @param search [Retab::WorkflowTableSearchRequest, nil]
|
|
225
|
+
# @param case_sensitive [Boolean, nil]
|
|
226
|
+
# @param select [Array<String>, nil]
|
|
227
|
+
# @param distinct [Retab::WorkflowTableDistinctRequest, nil]
|
|
228
|
+
# @param group_by [Array<String>, nil]
|
|
229
|
+
# @param aggregations [Array<Retab::WorkflowTableAggregationRequest>, nil]
|
|
230
|
+
# @param sort [Array<Retab::WorkflowTableSortRule>, nil]
|
|
231
|
+
# @param sample [Retab::WorkflowTableSampleRequest, nil]
|
|
232
|
+
# @param tail [Retab::WorkflowTableTailRequest, nil]
|
|
233
|
+
# @param count_only [Boolean, nil]
|
|
234
|
+
# @param include_explain [Boolean, nil]
|
|
235
|
+
# @param sort_column [String, nil]
|
|
236
|
+
# @param sort_direction [Retab::Types::WorkflowTableSortDirection, nil]
|
|
237
|
+
# @param viewer_mode [String, nil]
|
|
238
|
+
# @param offset [Integer, nil]
|
|
239
|
+
# @param limit [Integer, nil]
|
|
240
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
241
|
+
# @return [Retab::WorkflowTableRowsResponse]
|
|
242
|
+
def query(
|
|
243
|
+
table_id:,
|
|
244
|
+
filters: nil,
|
|
245
|
+
search: nil,
|
|
246
|
+
case_sensitive: nil,
|
|
247
|
+
select: nil,
|
|
248
|
+
distinct: nil,
|
|
249
|
+
group_by: nil,
|
|
250
|
+
aggregations: nil,
|
|
251
|
+
sort: nil,
|
|
252
|
+
sample: nil,
|
|
253
|
+
tail: nil,
|
|
254
|
+
count_only: nil,
|
|
255
|
+
include_explain: nil,
|
|
256
|
+
sort_column: nil,
|
|
257
|
+
sort_direction: nil,
|
|
258
|
+
viewer_mode: nil,
|
|
259
|
+
offset: nil,
|
|
260
|
+
limit: nil,
|
|
261
|
+
request_options: {}
|
|
262
|
+
)
|
|
263
|
+
body = {
|
|
264
|
+
"filters" => filters,
|
|
265
|
+
"search" => search,
|
|
266
|
+
"case_sensitive" => case_sensitive,
|
|
267
|
+
"select" => select,
|
|
268
|
+
"distinct" => distinct,
|
|
269
|
+
"group_by" => group_by,
|
|
270
|
+
"aggregations" => aggregations,
|
|
271
|
+
"sort" => sort,
|
|
272
|
+
"sample" => sample,
|
|
273
|
+
"tail" => tail,
|
|
274
|
+
"count_only" => count_only,
|
|
275
|
+
"include_explain" => include_explain,
|
|
276
|
+
"sort_column" => sort_column,
|
|
277
|
+
"sort_direction" => sort_direction,
|
|
278
|
+
"viewer_mode" => viewer_mode,
|
|
279
|
+
"offset" => offset,
|
|
280
|
+
"limit" => limit
|
|
281
|
+
}.compact
|
|
282
|
+
response = @client.request(
|
|
283
|
+
method: :post,
|
|
284
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}/query",
|
|
285
|
+
auth: true,
|
|
286
|
+
body: body,
|
|
287
|
+
request_options: request_options
|
|
288
|
+
)
|
|
289
|
+
result = Retab::WorkflowTableRowsResponse.new(response.body)
|
|
290
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
291
|
+
http_status: response.code.to_i,
|
|
292
|
+
http_headers: response.each_header.to_h,
|
|
293
|
+
request_id: response["x-request-id"]
|
|
294
|
+
)
|
|
295
|
+
result
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
# Get Table Schema
|
|
299
|
+
# @param table_id [String]
|
|
300
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
301
|
+
# @return [Retab::WorkflowTableSchemaResponse]
|
|
302
|
+
def schema(
|
|
303
|
+
table_id:,
|
|
304
|
+
request_options: {}
|
|
305
|
+
)
|
|
306
|
+
response = @client.request(
|
|
307
|
+
method: :get,
|
|
308
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}/schema",
|
|
309
|
+
auth: true,
|
|
310
|
+
request_options: request_options
|
|
311
|
+
)
|
|
312
|
+
result = Retab::WorkflowTableSchemaResponse.new(response.body)
|
|
313
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
314
|
+
http_status: response.code.to_i,
|
|
315
|
+
http_headers: response.each_header.to_h,
|
|
316
|
+
request_id: response["x-request-id"]
|
|
317
|
+
)
|
|
318
|
+
result
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# Validate Table
|
|
322
|
+
# @param table_id [String]
|
|
323
|
+
# @param required_columns [Array<String>, nil]
|
|
324
|
+
# @param columns [Hash{String => Retab::WorkflowTableValidationColumnRule}, nil]
|
|
325
|
+
# @param unique [Array<Array<String>>, nil]
|
|
326
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
327
|
+
# @return [Retab::WorkflowTableValidationResponse]
|
|
328
|
+
def validate(
|
|
329
|
+
table_id:,
|
|
330
|
+
required_columns: nil,
|
|
331
|
+
columns: nil,
|
|
332
|
+
unique: nil,
|
|
333
|
+
request_options: {}
|
|
334
|
+
)
|
|
335
|
+
body = {
|
|
336
|
+
"required_columns" => required_columns,
|
|
337
|
+
"columns" => columns,
|
|
338
|
+
"unique" => unique
|
|
339
|
+
}.compact
|
|
340
|
+
response = @client.request(
|
|
341
|
+
method: :post,
|
|
342
|
+
path: "/v1/tables/#{Retab::Util.encode_path(table_id)}/validate",
|
|
343
|
+
auth: true,
|
|
344
|
+
body: body,
|
|
345
|
+
request_options: request_options
|
|
346
|
+
)
|
|
347
|
+
result = Retab::WorkflowTableValidationResponse.new(response.body)
|
|
348
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
349
|
+
http_status: response.code.to_i,
|
|
350
|
+
http_headers: response.each_header.to_h,
|
|
351
|
+
request_id: response["x-request-id"]
|
|
352
|
+
)
|
|
353
|
+
result
|
|
354
|
+
end
|
|
355
|
+
end
|
|
356
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
module Types
|
|
7
|
+
class CreateFileBlueprintRequestMode
|
|
8
|
+
INSTANT = "instant"
|
|
9
|
+
REASONING = "reasoning"
|
|
10
|
+
ALL = [INSTANT, REASONING].freeze
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -17,7 +17,6 @@ module Retab
|
|
|
17
17
|
CLASSIFIER = "classifier"
|
|
18
18
|
CONDITIONAL = "conditional"
|
|
19
19
|
API_CALL = "api_call"
|
|
20
|
-
REVIEW = "review"
|
|
21
20
|
FUNCTION = "function"
|
|
22
21
|
WHILE_LOOP = "while_loop"
|
|
23
22
|
FOR_EACH = "for_each"
|
|
@@ -39,7 +38,6 @@ module Retab
|
|
|
39
38
|
CLASSIFIER,
|
|
40
39
|
CONDITIONAL,
|
|
41
40
|
API_CALL,
|
|
42
|
-
REVIEW,
|
|
43
41
|
FUNCTION,
|
|
44
42
|
WHILE_LOOP,
|
|
45
43
|
FOR_EACH,
|
|
@@ -15,7 +15,6 @@ module Retab
|
|
|
15
15
|
CLASSIFIER = "classifier"
|
|
16
16
|
CONDITIONAL = "conditional"
|
|
17
17
|
API_CALL = "api_call"
|
|
18
|
-
REVIEW = "review"
|
|
19
18
|
FUNCTION = "function"
|
|
20
19
|
WHILE_LOOP = "while_loop"
|
|
21
20
|
FOR_EACH = "for_each"
|
|
@@ -35,7 +34,6 @@ module Retab
|
|
|
35
34
|
CLASSIFIER,
|
|
36
35
|
CONDITIONAL,
|
|
37
36
|
API_CALL,
|
|
38
|
-
REVIEW,
|
|
39
37
|
FUNCTION,
|
|
40
38
|
WHILE_LOOP,
|
|
41
39
|
FOR_EACH,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
module Types
|
|
7
|
+
class WorkflowTableAggregationFunction
|
|
8
|
+
COUNT = "count"
|
|
9
|
+
COUNT_DISTINCT = "count_distinct"
|
|
10
|
+
MIN = "min"
|
|
11
|
+
MAX = "max"
|
|
12
|
+
SUM = "sum"
|
|
13
|
+
AVG = "avg"
|
|
14
|
+
ALL = [COUNT, COUNT_DISTINCT, MIN, MAX, SUM, AVG].freeze
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
module Types
|
|
7
|
+
class WorkflowTableFilterOperator
|
|
8
|
+
EQ = "eq"
|
|
9
|
+
NE = "ne"
|
|
10
|
+
GT = "gt"
|
|
11
|
+
GTE = "gte"
|
|
12
|
+
LT = "lt"
|
|
13
|
+
LTE = "lte"
|
|
14
|
+
CONTAINS = "contains"
|
|
15
|
+
NOT_CONTAINS = "not_contains"
|
|
16
|
+
STARTS_WITH = "starts_with"
|
|
17
|
+
ENDS_WITH = "ends_with"
|
|
18
|
+
IN = "in"
|
|
19
|
+
NOT_IN = "not_in"
|
|
20
|
+
BETWEEN = "between"
|
|
21
|
+
IS_EMPTY = "is_empty"
|
|
22
|
+
IS_NOT_EMPTY = "is_not_empty"
|
|
23
|
+
IS_NULL = "is_null"
|
|
24
|
+
IS_NOT_NULL = "is_not_null"
|
|
25
|
+
ALL = [
|
|
26
|
+
EQ,
|
|
27
|
+
NE,
|
|
28
|
+
GT,
|
|
29
|
+
GTE,
|
|
30
|
+
LT,
|
|
31
|
+
LTE,
|
|
32
|
+
CONTAINS,
|
|
33
|
+
NOT_CONTAINS,
|
|
34
|
+
STARTS_WITH,
|
|
35
|
+
ENDS_WITH,
|
|
36
|
+
IN,
|
|
37
|
+
NOT_IN,
|
|
38
|
+
BETWEEN,
|
|
39
|
+
IS_EMPTY,
|
|
40
|
+
IS_NOT_EMPTY,
|
|
41
|
+
IS_NULL,
|
|
42
|
+
IS_NOT_NULL
|
|
43
|
+
].freeze
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class ValidateWorkflowBlockConfigRequest < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
config: :config,
|
|
10
|
+
config_mode: :config_mode
|
|
11
|
+
}.freeze
|
|
12
|
+
|
|
13
|
+
attr_accessor(
|
|
14
|
+
:config,
|
|
15
|
+
:config_mode
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def initialize(json)
|
|
19
|
+
super()
|
|
20
|
+
hash = self.class.normalize(json)
|
|
21
|
+
@config = hash[:config] || {}
|
|
22
|
+
@config_mode = hash[:config_mode].nil? ? "replace" : hash[:config_mode]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class ValidateWorkflowBlockConfigResponse < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
ok: :ok,
|
|
10
|
+
workflow_id: :workflow_id,
|
|
11
|
+
block_id: :block_id,
|
|
12
|
+
block_type: :block_type,
|
|
13
|
+
config_hash: :config_hash
|
|
14
|
+
}.freeze
|
|
15
|
+
|
|
16
|
+
attr_accessor(
|
|
17
|
+
:ok,
|
|
18
|
+
:workflow_id,
|
|
19
|
+
:block_id,
|
|
20
|
+
:block_type,
|
|
21
|
+
:config_hash
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
def initialize(json)
|
|
25
|
+
super()
|
|
26
|
+
hash = self.class.normalize(json)
|
|
27
|
+
@ok = hash[:ok].nil? ? true : hash[:ok]
|
|
28
|
+
@workflow_id = hash[:workflow_id]
|
|
29
|
+
@block_id = hash[:block_id]
|
|
30
|
+
@block_type = hash[:block_type]
|
|
31
|
+
@config_hash = hash[:config_hash]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|