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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 567e2e76bac62e208e33807bd9106e8e2b03973a06a1d1f9bffb7c794efd4474
|
|
4
|
+
data.tar.gz: 94eb206cd48778a4f64be7ce9ac52c4f78e4c69a5b2277f6ba66dec5938726af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2bdfce3ca56f7d285a347649e6c085b31ca780c43cd4a120f5d818cd47e3c114098b6264a0f3ca7edb9aa8625f460a0773b6dba7a3062b68a20c33521f18ebf9
|
|
7
|
+
data.tar.gz: '0169629387665c14a306b6f0869281c8531ccf9ea590629b381e8a2cdce9ed79f8d1a555f076c23b127d3c5c6115fb43bb0c348fe38c3a1365a3b0dacdcf4489'
|
data/lib/retab/client.rb
CHANGED
|
@@ -33,10 +33,18 @@ module Retab
|
|
|
33
33
|
@schemas ||= Retab::Schemas.new(self)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
def secrets
|
|
37
|
+
@secrets ||= Retab::Secrets.new(self)
|
|
38
|
+
end
|
|
39
|
+
|
|
36
40
|
def splits
|
|
37
41
|
@splits ||= Retab::Splits.new(self)
|
|
38
42
|
end
|
|
39
43
|
|
|
44
|
+
def tables
|
|
45
|
+
@tables ||= Retab::Tables.new(self)
|
|
46
|
+
end
|
|
47
|
+
|
|
40
48
|
def workflows
|
|
41
49
|
@workflows ||= Retab::Workflows.new(self)
|
|
42
50
|
end
|
|
@@ -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 CreateFileBlueprintRequest < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
file_id: :file_id,
|
|
10
|
+
mode: :mode,
|
|
11
|
+
intent: :intent,
|
|
12
|
+
background: :background
|
|
13
|
+
}.freeze
|
|
14
|
+
|
|
15
|
+
attr_accessor(
|
|
16
|
+
:file_id,
|
|
17
|
+
:mode,
|
|
18
|
+
:intent,
|
|
19
|
+
:background
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def initialize(json)
|
|
23
|
+
super()
|
|
24
|
+
hash = self.class.normalize(json)
|
|
25
|
+
@file_id = hash[:file_id]
|
|
26
|
+
@mode = hash[:mode]
|
|
27
|
+
@intent = hash[:intent]
|
|
28
|
+
@background = hash[:background].nil? ? false : hash[:background]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class FileBlueprint < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
object: :object,
|
|
10
|
+
id: :id,
|
|
11
|
+
file: :file,
|
|
12
|
+
mode: :mode,
|
|
13
|
+
intent: :intent,
|
|
14
|
+
output: :output,
|
|
15
|
+
status: :status,
|
|
16
|
+
error: :error,
|
|
17
|
+
created_at: :created_at,
|
|
18
|
+
started_at: :started_at,
|
|
19
|
+
completed_at: :completed_at
|
|
20
|
+
}.freeze
|
|
21
|
+
|
|
22
|
+
attr_accessor(
|
|
23
|
+
:object,
|
|
24
|
+
:id,
|
|
25
|
+
:file,
|
|
26
|
+
:mode,
|
|
27
|
+
:intent,
|
|
28
|
+
:output,
|
|
29
|
+
:status,
|
|
30
|
+
:error,
|
|
31
|
+
:created_at,
|
|
32
|
+
:started_at,
|
|
33
|
+
:completed_at
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
def initialize(json)
|
|
37
|
+
super()
|
|
38
|
+
hash = self.class.normalize(json)
|
|
39
|
+
@object = hash[:object].nil? ? "file.blueprint" : hash[:object]
|
|
40
|
+
@id = hash[:id]
|
|
41
|
+
@file = hash[:file] ? Retab::FileRef.new(hash[:file]) : nil
|
|
42
|
+
@mode = hash[:mode]
|
|
43
|
+
@intent = hash[:intent]
|
|
44
|
+
@output = hash[:output] || {}
|
|
45
|
+
@status = hash[:status].nil? ? "pending" : hash[:status]
|
|
46
|
+
@error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil
|
|
47
|
+
@created_at = hash[:created_at]
|
|
48
|
+
@started_at = hash[:started_at]
|
|
49
|
+
@completed_at = hash[:completed_at]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
data/lib/retab/files.rb
CHANGED
|
@@ -88,6 +88,94 @@ module Retab
|
|
|
88
88
|
)
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
+
# Create File Blueprint
|
|
92
|
+
# @param file_id [String] File id to analyze.
|
|
93
|
+
# @param mode [Retab::Types::CreateFileBlueprintRequestMode, nil] Optional analysis depth override. Omit to let Retab choose.
|
|
94
|
+
# @param intent [String, nil] Optional user intent used to guide the blueprint analysis.
|
|
95
|
+
# @param background [Boolean, nil] If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1/<primitive>/{id} until status is terminal. Mutually exclusive with stream.
|
|
96
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
97
|
+
# @return [Retab::FileBlueprint]
|
|
98
|
+
def create_blueprint(
|
|
99
|
+
file_id:,
|
|
100
|
+
mode: nil,
|
|
101
|
+
intent: nil,
|
|
102
|
+
background: nil,
|
|
103
|
+
request_options: {}
|
|
104
|
+
)
|
|
105
|
+
body = {
|
|
106
|
+
"file_id" => file_id,
|
|
107
|
+
"mode" => mode,
|
|
108
|
+
"intent" => intent,
|
|
109
|
+
"background" => background
|
|
110
|
+
}.compact
|
|
111
|
+
response = @client.request(
|
|
112
|
+
method: :post,
|
|
113
|
+
path: "/v1/files/blueprints",
|
|
114
|
+
auth: true,
|
|
115
|
+
body: body,
|
|
116
|
+
request_options: request_options
|
|
117
|
+
)
|
|
118
|
+
result = Retab::FileBlueprint.new(response.body)
|
|
119
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
120
|
+
http_status: response.code.to_i,
|
|
121
|
+
http_headers: response.each_header.to_h,
|
|
122
|
+
request_id: response["x-request-id"]
|
|
123
|
+
)
|
|
124
|
+
result
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Get File Blueprint
|
|
128
|
+
# @param blueprint_id [String]
|
|
129
|
+
# @param include_output [Boolean, nil] When false, returns a cheap status-only projection (no output), served from cache for in-flight background runs.
|
|
130
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
131
|
+
# @return [Retab::FileBlueprint]
|
|
132
|
+
def get_blueprint(
|
|
133
|
+
blueprint_id:,
|
|
134
|
+
include_output: true,
|
|
135
|
+
request_options: {}
|
|
136
|
+
)
|
|
137
|
+
params = {
|
|
138
|
+
"include_output" => include_output
|
|
139
|
+
}.compact
|
|
140
|
+
response = @client.request(
|
|
141
|
+
method: :get,
|
|
142
|
+
path: "/v1/files/blueprints/#{Retab::Util.encode_path(blueprint_id)}",
|
|
143
|
+
auth: true,
|
|
144
|
+
params: params,
|
|
145
|
+
request_options: request_options
|
|
146
|
+
)
|
|
147
|
+
result = Retab::FileBlueprint.new(response.body)
|
|
148
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
149
|
+
http_status: response.code.to_i,
|
|
150
|
+
http_headers: response.each_header.to_h,
|
|
151
|
+
request_id: response["x-request-id"]
|
|
152
|
+
)
|
|
153
|
+
result
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Cancel File Blueprint
|
|
157
|
+
# @param blueprint_id [String]
|
|
158
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
159
|
+
# @return [Retab::FileBlueprint]
|
|
160
|
+
def create_blueprint_cancel(
|
|
161
|
+
blueprint_id:,
|
|
162
|
+
request_options: {}
|
|
163
|
+
)
|
|
164
|
+
response = @client.request(
|
|
165
|
+
method: :post,
|
|
166
|
+
path: "/v1/files/blueprints/#{Retab::Util.encode_path(blueprint_id)}/cancel",
|
|
167
|
+
auth: true,
|
|
168
|
+
request_options: request_options
|
|
169
|
+
)
|
|
170
|
+
result = Retab::FileBlueprint.new(response.body)
|
|
171
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
172
|
+
http_status: response.code.to_i,
|
|
173
|
+
http_headers: response.each_header.to_h,
|
|
174
|
+
request_id: response["x-request-id"]
|
|
175
|
+
)
|
|
176
|
+
result
|
|
177
|
+
end
|
|
178
|
+
|
|
91
179
|
# Upload File
|
|
92
180
|
# @param filename [String] Filename to store
|
|
93
181
|
# @param content_type [String, nil] MIME type the client will upload
|
|
@@ -10,7 +10,7 @@ module Retab
|
|
|
10
10
|
model: :model,
|
|
11
11
|
instructions: :instructions,
|
|
12
12
|
image_resolution_dpi: :image_resolution_dpi,
|
|
13
|
-
|
|
13
|
+
background: :background
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
attr_accessor(
|
|
@@ -18,7 +18,7 @@ module Retab
|
|
|
18
18
|
:model,
|
|
19
19
|
:instructions,
|
|
20
20
|
:image_resolution_dpi,
|
|
21
|
-
:
|
|
21
|
+
:background
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
def initialize(json)
|
|
@@ -28,7 +28,7 @@ module Retab
|
|
|
28
28
|
@model = hash[:model].nil? ? "retab-small" : hash[:model]
|
|
29
29
|
@instructions = hash[:instructions]
|
|
30
30
|
@image_resolution_dpi = hash[:image_resolution_dpi]
|
|
31
|
-
@
|
|
31
|
+
@background = hash[:background].nil? ? false : hash[:background]
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -3,20 +3,26 @@
|
|
|
3
3
|
# This file is auto-generated by oagen. Do not edit.
|
|
4
4
|
|
|
5
5
|
module Retab
|
|
6
|
-
class
|
|
6
|
+
class SchemaGeneration < Retab::Types::BaseModel
|
|
7
7
|
|
|
8
8
|
HASH_ATTRS = {
|
|
9
9
|
object: :object,
|
|
10
10
|
created_at: :created_at,
|
|
11
11
|
json_schema: :json_schema,
|
|
12
|
-
strict: :strict
|
|
12
|
+
strict: :strict,
|
|
13
|
+
id: :id,
|
|
14
|
+
status: :status,
|
|
15
|
+
error: :error
|
|
13
16
|
}.freeze
|
|
14
17
|
|
|
15
18
|
attr_accessor(
|
|
16
19
|
:object,
|
|
17
20
|
:created_at,
|
|
18
21
|
:json_schema,
|
|
19
|
-
:strict
|
|
22
|
+
:strict,
|
|
23
|
+
:id,
|
|
24
|
+
:status,
|
|
25
|
+
:error
|
|
20
26
|
)
|
|
21
27
|
|
|
22
28
|
def initialize(json)
|
|
@@ -26,6 +32,9 @@ module Retab
|
|
|
26
32
|
@created_at = hash[:created_at]
|
|
27
33
|
@json_schema = hash[:json_schema] || {}
|
|
28
34
|
@strict = hash[:strict].nil? ? true : hash[:strict]
|
|
35
|
+
@id = hash[:id]
|
|
36
|
+
@status = hash[:status].nil? ? "pending" : hash[:status]
|
|
37
|
+
@error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil
|
|
29
38
|
end
|
|
30
39
|
end
|
|
31
40
|
end
|
data/lib/retab/schemas.rb
CHANGED
|
@@ -15,15 +15,15 @@ module Retab
|
|
|
15
15
|
# @param model [String, nil]
|
|
16
16
|
# @param instructions [String, nil]
|
|
17
17
|
# @param image_resolution_dpi [Integer, nil] Resolution of the image sent to the LLM
|
|
18
|
-
# @param
|
|
18
|
+
# @param background [Boolean, nil] If true, run asynchronously: returns immediately with status 'queued'. Poll GET /v1/schemas/generate/{schema_generation_id} until status is terminal.
|
|
19
19
|
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
20
|
-
# @return [Retab::
|
|
20
|
+
# @return [Retab::SchemaGeneration]
|
|
21
21
|
def generate(
|
|
22
22
|
documents:,
|
|
23
23
|
model: nil,
|
|
24
24
|
instructions: nil,
|
|
25
25
|
image_resolution_dpi: nil,
|
|
26
|
-
|
|
26
|
+
background: nil,
|
|
27
27
|
request_options: {}
|
|
28
28
|
)
|
|
29
29
|
documents = documents.map { |d| Retab::MimeData.coerce(d) } unless documents.nil?
|
|
@@ -32,7 +32,7 @@ module Retab
|
|
|
32
32
|
"model" => model,
|
|
33
33
|
"instructions" => instructions,
|
|
34
34
|
"image_resolution_dpi" => image_resolution_dpi,
|
|
35
|
-
"
|
|
35
|
+
"background" => background
|
|
36
36
|
}.compact
|
|
37
37
|
response = @client.request(
|
|
38
38
|
method: :post,
|
|
@@ -41,7 +41,7 @@ module Retab
|
|
|
41
41
|
body: body,
|
|
42
42
|
request_options: request_options
|
|
43
43
|
)
|
|
44
|
-
result = Retab::
|
|
44
|
+
result = Retab::SchemaGeneration.new(response.body)
|
|
45
45
|
result.last_response = Retab::Types::ApiResponse.new(
|
|
46
46
|
http_status: response.code.to_i,
|
|
47
47
|
http_headers: response.each_header.to_h,
|
|
@@ -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 CreateSecretRequest < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
name: :name,
|
|
10
|
+
value: :value
|
|
11
|
+
}.freeze
|
|
12
|
+
|
|
13
|
+
attr_accessor(
|
|
14
|
+
:name,
|
|
15
|
+
:value
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
def initialize(json)
|
|
19
|
+
super()
|
|
20
|
+
hash = self.class.normalize(json)
|
|
21
|
+
@name = hash[:name]
|
|
22
|
+
@value = hash[:value]
|
|
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 Secret < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
name: :name,
|
|
10
|
+
created_at: :created_at,
|
|
11
|
+
updated_at: :updated_at,
|
|
12
|
+
created_by: :created_by,
|
|
13
|
+
updated_by: :updated_by
|
|
14
|
+
}.freeze
|
|
15
|
+
|
|
16
|
+
attr_accessor(
|
|
17
|
+
:name,
|
|
18
|
+
:created_at,
|
|
19
|
+
:updated_at,
|
|
20
|
+
:created_by,
|
|
21
|
+
:updated_by
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
def initialize(json)
|
|
25
|
+
super()
|
|
26
|
+
hash = self.class.normalize(json)
|
|
27
|
+
@name = hash[:name]
|
|
28
|
+
@created_at = hash[:created_at]
|
|
29
|
+
@updated_at = hash[:updated_at]
|
|
30
|
+
@created_by = hash[:created_by]
|
|
31
|
+
@updated_by = hash[:updated_by]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class SecretListResponse < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
secrets: :secrets
|
|
10
|
+
}.freeze
|
|
11
|
+
|
|
12
|
+
attr_accessor :secrets
|
|
13
|
+
|
|
14
|
+
def initialize(json)
|
|
15
|
+
super()
|
|
16
|
+
hash = self.class.normalize(json)
|
|
17
|
+
@secrets = (hash[:secrets] || []).map { |item| item ? Retab::Secret.new(item) : nil }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class SecretResponse < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
secret: :secret
|
|
10
|
+
}.freeze
|
|
11
|
+
|
|
12
|
+
attr_accessor :secret
|
|
13
|
+
|
|
14
|
+
def initialize(json)
|
|
15
|
+
super()
|
|
16
|
+
hash = self.class.normalize(json)
|
|
17
|
+
@secret = hash[:secret] ? Retab::Secret.new(hash[:secret]) : nil
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
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 SecretValue < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
name: :name,
|
|
10
|
+
value: :value,
|
|
11
|
+
updated_at: :updated_at
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
attr_accessor(
|
|
15
|
+
:name,
|
|
16
|
+
:value,
|
|
17
|
+
:updated_at
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def initialize(json)
|
|
21
|
+
super()
|
|
22
|
+
hash = self.class.normalize(json)
|
|
23
|
+
@name = hash[:name]
|
|
24
|
+
@value = hash[:value]
|
|
25
|
+
@updated_at = hash[:updated_at]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class SecretValueResponse < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
secret: :secret
|
|
10
|
+
}.freeze
|
|
11
|
+
|
|
12
|
+
attr_accessor :secret
|
|
13
|
+
|
|
14
|
+
def initialize(json)
|
|
15
|
+
super()
|
|
16
|
+
hash = self.class.normalize(json)
|
|
17
|
+
@secret = hash[:secret] ? Retab::SecretValue.new(hash[:secret]) : nil
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module Retab
|
|
6
|
+
class SetSecretRequest < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
value: :value
|
|
10
|
+
}.freeze
|
|
11
|
+
|
|
12
|
+
attr_accessor :value
|
|
13
|
+
|
|
14
|
+
def initialize(json)
|
|
15
|
+
super()
|
|
16
|
+
hash = self.class.normalize(json)
|
|
17
|
+
@value = hash[:value]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,154 @@
|
|
|
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 Secrets
|
|
9
|
+
def initialize(client)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# List Secrets
|
|
14
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
15
|
+
# @return [Retab::SecretListResponse]
|
|
16
|
+
def list_secrets(request_options: {})
|
|
17
|
+
response = @client.request(
|
|
18
|
+
method: :get,
|
|
19
|
+
path: "/v1/secrets",
|
|
20
|
+
auth: true,
|
|
21
|
+
request_options: request_options
|
|
22
|
+
)
|
|
23
|
+
result = Retab::SecretListResponse.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 Secret
|
|
33
|
+
# @param name [String]
|
|
34
|
+
# @param value [String]
|
|
35
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
36
|
+
# @return [Retab::SecretResponse]
|
|
37
|
+
def create_secret(
|
|
38
|
+
name:,
|
|
39
|
+
value:,
|
|
40
|
+
request_options: {}
|
|
41
|
+
)
|
|
42
|
+
body = {
|
|
43
|
+
"name" => name,
|
|
44
|
+
"value" => value
|
|
45
|
+
}
|
|
46
|
+
response = @client.request(
|
|
47
|
+
method: :post,
|
|
48
|
+
path: "/v1/secrets",
|
|
49
|
+
auth: true,
|
|
50
|
+
body: body,
|
|
51
|
+
request_options: request_options
|
|
52
|
+
)
|
|
53
|
+
result = Retab::SecretResponse.new(response.body)
|
|
54
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
55
|
+
http_status: response.code.to_i,
|
|
56
|
+
http_headers: response.each_header.to_h,
|
|
57
|
+
request_id: response["x-request-id"]
|
|
58
|
+
)
|
|
59
|
+
result
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Get Secret
|
|
63
|
+
# @param name [String]
|
|
64
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
65
|
+
# @return [Retab::SecretResponse]
|
|
66
|
+
def get_secret(
|
|
67
|
+
name:,
|
|
68
|
+
request_options: {}
|
|
69
|
+
)
|
|
70
|
+
response = @client.request(
|
|
71
|
+
method: :get,
|
|
72
|
+
path: "/v1/secrets/#{Retab::Util.encode_path(name)}",
|
|
73
|
+
auth: true,
|
|
74
|
+
request_options: request_options
|
|
75
|
+
)
|
|
76
|
+
result = Retab::SecretResponse.new(response.body)
|
|
77
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
78
|
+
http_status: response.code.to_i,
|
|
79
|
+
http_headers: response.each_header.to_h,
|
|
80
|
+
request_id: response["x-request-id"]
|
|
81
|
+
)
|
|
82
|
+
result
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Set Secret
|
|
86
|
+
# @param name [String]
|
|
87
|
+
# @param value [String]
|
|
88
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
89
|
+
# @return [Retab::SecretResponse]
|
|
90
|
+
def update_secret(
|
|
91
|
+
name:,
|
|
92
|
+
value:,
|
|
93
|
+
request_options: {}
|
|
94
|
+
)
|
|
95
|
+
body = {
|
|
96
|
+
"value" => value
|
|
97
|
+
}
|
|
98
|
+
response = @client.request(
|
|
99
|
+
method: :put,
|
|
100
|
+
path: "/v1/secrets/#{Retab::Util.encode_path(name)}",
|
|
101
|
+
auth: true,
|
|
102
|
+
body: body,
|
|
103
|
+
request_options: request_options
|
|
104
|
+
)
|
|
105
|
+
result = Retab::SecretResponse.new(response.body)
|
|
106
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
107
|
+
http_status: response.code.to_i,
|
|
108
|
+
http_headers: response.each_header.to_h,
|
|
109
|
+
request_id: response["x-request-id"]
|
|
110
|
+
)
|
|
111
|
+
result
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Delete Secret
|
|
115
|
+
# @param name [String]
|
|
116
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
117
|
+
# @return [void]
|
|
118
|
+
def delete_secret(
|
|
119
|
+
name:,
|
|
120
|
+
request_options: {}
|
|
121
|
+
)
|
|
122
|
+
@client.request(
|
|
123
|
+
method: :delete,
|
|
124
|
+
path: "/v1/secrets/#{Retab::Util.encode_path(name)}",
|
|
125
|
+
auth: true,
|
|
126
|
+
request_options: request_options
|
|
127
|
+
)
|
|
128
|
+
nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Get Secret Value
|
|
132
|
+
# @param name [String]
|
|
133
|
+
# @param request_options [Hash] (see Retab::Types::RequestOptions)
|
|
134
|
+
# @return [Retab::SecretValueResponse]
|
|
135
|
+
def list_secret_value(
|
|
136
|
+
name:,
|
|
137
|
+
request_options: {}
|
|
138
|
+
)
|
|
139
|
+
response = @client.request(
|
|
140
|
+
method: :get,
|
|
141
|
+
path: "/v1/secrets/#{Retab::Util.encode_path(name)}/value",
|
|
142
|
+
auth: true,
|
|
143
|
+
request_options: request_options
|
|
144
|
+
)
|
|
145
|
+
result = Retab::SecretValueResponse.new(response.body)
|
|
146
|
+
result.last_response = Retab::Types::ApiResponse.new(
|
|
147
|
+
http_status: response.code.to_i,
|
|
148
|
+
http_headers: response.each_header.to_h,
|
|
149
|
+
request_id: response["x-request-id"]
|
|
150
|
+
)
|
|
151
|
+
result
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
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 BodyCreateTableV1TablesPost < Retab::Types::BaseModel
|
|
7
|
+
|
|
8
|
+
HASH_ATTRS = {
|
|
9
|
+
name: :name,
|
|
10
|
+
file: :file,
|
|
11
|
+
column_schema_overrides: :column_schema_overrides
|
|
12
|
+
}.freeze
|
|
13
|
+
|
|
14
|
+
attr_accessor(
|
|
15
|
+
:name,
|
|
16
|
+
:file,
|
|
17
|
+
:column_schema_overrides
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def initialize(json)
|
|
21
|
+
super()
|
|
22
|
+
hash = self.class.normalize(json)
|
|
23
|
+
@name = hash[:name]
|
|
24
|
+
@file = hash[:file]
|
|
25
|
+
@column_schema_overrides = hash[:column_schema_overrides]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|