retab 0.1.4 → 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.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/lib/retab/classifications/classification.rb +6 -0
  3. data/lib/retab/classifications/classification_request.rb +5 -2
  4. data/lib/retab/{jobs/job_error.rb → classifications/primitive_error.rb} +1 -1
  5. data/lib/retab/classifications.rb +38 -1
  6. data/lib/retab/client.rb +8 -4
  7. data/lib/retab/edits/edit.rb +6 -0
  8. data/lib/retab/edits/edit_request.rb +5 -2
  9. data/lib/retab/edits.rb +38 -1
  10. data/lib/retab/extractions/extraction.rb +6 -0
  11. data/lib/retab/extractions/extraction_request.rb +3 -0
  12. data/lib/retab/extractions.rb +37 -0
  13. data/lib/retab/files/create_file_blueprint_request.rb +31 -0
  14. data/lib/retab/files/file_blueprint.rb +52 -0
  15. data/lib/retab/files.rb +88 -0
  16. data/lib/retab/parses/parse.rb +6 -0
  17. data/lib/retab/parses/parse_request.rb +5 -2
  18. data/lib/retab/parses.rb +33 -1
  19. data/lib/retab/partitions/partition.rb +6 -0
  20. data/lib/retab/partitions/partition_request.rb +5 -2
  21. data/lib/retab/partitions.rb +38 -1
  22. data/lib/retab/schemas/generate_schema_request.rb +3 -3
  23. data/lib/retab/schemas/{partial_schema.rb → schema_generation.rb} +12 -3
  24. data/lib/retab/schemas.rb +5 -5
  25. data/lib/retab/{jobs/job_response.rb → secrets/create_secret_request.rb} +7 -7
  26. data/lib/retab/secrets/secret.rb +34 -0
  27. data/lib/retab/secrets/secret_list_response.rb +20 -0
  28. data/lib/retab/secrets/secret_response.rb +20 -0
  29. data/lib/retab/secrets/secret_value.rb +28 -0
  30. data/lib/retab/secrets/secret_value_response.rb +20 -0
  31. data/lib/retab/secrets/set_secret_request.rb +20 -0
  32. data/lib/retab/secrets.rb +154 -0
  33. data/lib/retab/splits/split.rb +6 -0
  34. data/lib/retab/splits/split_request.rb +5 -2
  35. data/lib/retab/splits.rb +38 -1
  36. data/lib/retab/tables/body_create_table_v_1_tables_post.rb +28 -0
  37. data/lib/retab/tables/body_replace_table_v_1_tables_table_id_put.rb +25 -0
  38. data/lib/retab/tables/query_workflow_table_request.rb +72 -0
  39. data/lib/retab/{jobs/create_job_request.rb → tables/update_workflow_table_request.rb} +4 -7
  40. data/lib/retab/tables/workflow_table.rb +55 -0
  41. data/lib/retab/tables/workflow_table_aggregation_request.rb +28 -0
  42. data/lib/retab/tables/workflow_table_column.rb +34 -0
  43. data/lib/retab/tables/workflow_table_distinct_request.rb +20 -0
  44. data/lib/retab/tables/workflow_table_explain.rb +54 -0
  45. data/lib/retab/tables/workflow_table_filter_rule.rb +28 -0
  46. data/lib/retab/tables/workflow_table_list_response.rb +20 -0
  47. data/lib/retab/tables/workflow_table_profile_column.rb +49 -0
  48. data/lib/retab/tables/workflow_table_profile_response.rb +28 -0
  49. data/lib/retab/tables/workflow_table_response.rb +20 -0
  50. data/lib/retab/tables/workflow_table_row.rb +28 -0
  51. data/lib/retab/tables/workflow_table_rows_response.rb +52 -0
  52. data/lib/retab/tables/workflow_table_sample_request.rb +20 -0
  53. data/lib/retab/tables/workflow_table_schema_response.rb +25 -0
  54. data/lib/retab/tables/workflow_table_search_request.rb +25 -0
  55. data/lib/retab/tables/workflow_table_sort_rule.rb +25 -0
  56. data/lib/retab/{jobs/job_warning.rb → tables/workflow_table_tail_request.rb} +1 -1
  57. data/lib/retab/tables/workflow_table_validation_column_rule.rb +28 -0
  58. data/lib/retab/tables/workflow_table_validation_diagnostic.rb +31 -0
  59. data/lib/retab/tables/workflow_table_validation_request.rb +28 -0
  60. data/lib/retab/tables/workflow_table_validation_response.rb +30 -0
  61. data/lib/retab/tables.rb +356 -0
  62. data/lib/retab/types/{job_status.rb → classification_status.rb} +3 -4
  63. data/lib/retab/types/classification_workflow_artifact_status.rb +9 -0
  64. data/lib/retab/types/{supported_endpoint.rb → classifications_status.rb} +1 -1
  65. data/lib/retab/types/create_file_blueprint_request_mode.rb +13 -0
  66. data/lib/retab/types/declarative_plan_resource_change_type.rb +0 -2
  67. data/lib/retab/types/{jobs_order.rb → edit_status.rb} +1 -1
  68. data/lib/retab/types/edit_workflow_artifact_status.rb +9 -0
  69. data/lib/retab/types/{jobs_status.rb → edits_status.rb} +1 -1
  70. data/lib/retab/types/{jobs_endpoint.rb → extraction_status.rb} +1 -1
  71. data/lib/retab/types/extraction_workflow_artifact_status.rb +9 -0
  72. data/lib/retab/types/extractions_status.rb +9 -0
  73. data/lib/retab/types/file_blueprint_mode.rb +9 -0
  74. data/lib/retab/types/file_blueprint_status.rb +9 -0
  75. data/lib/retab/types/parse_status.rb +9 -0
  76. data/lib/retab/types/parse_workflow_artifact_status.rb +9 -0
  77. data/lib/retab/types/partition_status.rb +9 -0
  78. data/lib/retab/types/partition_workflow_artifact_status.rb +9 -0
  79. data/lib/retab/types/partitions_status.rb +9 -0
  80. data/lib/retab/types/schema_generation_status.rb +9 -0
  81. data/lib/retab/types/split_status.rb +9 -0
  82. data/lib/retab/types/split_workflow_artifact_status.rb +9 -0
  83. data/lib/retab/types/splits_status.rb +9 -0
  84. data/lib/retab/types/validate_workflow_block_config_request_config_mode.rb +9 -0
  85. data/lib/retab/types/workflow_block_type.rb +0 -2
  86. data/lib/retab/types/workflow_table_aggregation_function.rb +17 -0
  87. data/lib/retab/types/workflow_table_filter_operator.rb +46 -0
  88. data/lib/retab/types/workflow_table_sort_direction.rb +9 -0
  89. data/lib/retab/types/workflow_table_validation_severity.rb +13 -0
  90. data/lib/retab/workflow_artifacts/classification_workflow_artifact.rb +6 -0
  91. data/lib/retab/workflow_artifacts/edit_workflow_artifact.rb +6 -0
  92. data/lib/retab/workflow_artifacts/extraction_workflow_artifact.rb +6 -0
  93. data/lib/retab/workflow_artifacts/parse_workflow_artifact.rb +6 -0
  94. data/lib/retab/workflow_artifacts/partition_workflow_artifact.rb +6 -0
  95. data/lib/retab/workflow_artifacts/split_workflow_artifact.rb +6 -0
  96. data/lib/retab/workflow_blocks/validate_workflow_block_config_request.rb +25 -0
  97. data/lib/retab/workflow_blocks/validate_workflow_block_config_response.rb +34 -0
  98. data/lib/retab/workflow_blocks/workflow_block.rb +6 -0
  99. data/lib/retab/workflow_blocks.rb +38 -0
  100. data/lib/retab/workflow_steps.rb +2 -2
  101. data/lib/retab.rb +2 -1
  102. data/rbi/retab/body_create_table_v_1_tables_post.rbi +36 -0
  103. data/rbi/retab/body_replace_table_v_1_tables_table_id_put.rbi +30 -0
  104. data/rbi/retab/classification.rbi +14 -2
  105. data/rbi/retab/classification_request.rbi +6 -0
  106. data/rbi/retab/classification_workflow_artifact.rbi +14 -2
  107. data/rbi/retab/classifications.rbi +14 -3
  108. data/rbi/retab/client.rbi +6 -3
  109. data/rbi/retab/create_file_blueprint_request.rbi +42 -0
  110. data/rbi/retab/create_secret_request.rbi +30 -0
  111. data/rbi/retab/edit.rbi +14 -2
  112. data/rbi/retab/edit_request.rbi +6 -0
  113. data/rbi/retab/edit_workflow_artifact.rbi +14 -2
  114. data/rbi/retab/edits.rbi +14 -3
  115. data/rbi/retab/extraction.rbi +12 -0
  116. data/rbi/retab/extraction_request.rbi +6 -0
  117. data/rbi/retab/extraction_workflow_artifact.rbi +12 -0
  118. data/rbi/retab/extractions.rbi +14 -3
  119. data/rbi/retab/{job.rbi → file_blueprint.rbi} +29 -65
  120. data/rbi/retab/files.rbi +28 -0
  121. data/rbi/retab/generate_schema_request.rbi +2 -2
  122. data/rbi/retab/parse.rbi +12 -0
  123. data/rbi/retab/parse_request.rbi +6 -0
  124. data/rbi/retab/parse_workflow_artifact.rbi +12 -0
  125. data/rbi/retab/parses.rbi +12 -2
  126. data/rbi/retab/partition.rbi +12 -0
  127. data/rbi/retab/partition_request.rbi +6 -0
  128. data/rbi/retab/partition_workflow_artifact.rbi +12 -0
  129. data/rbi/retab/partitions.rbi +14 -3
  130. data/rbi/retab/{job_error.rbi → primitive_error.rbi} +1 -1
  131. data/rbi/retab/query_workflow_table_request.rbi +120 -0
  132. data/rbi/retab/{partial_schema.rbi → schema_generation.rbi} +19 -1
  133. data/rbi/retab/schemas.rbi +3 -3
  134. data/rbi/retab/secret.rbi +48 -0
  135. data/rbi/retab/secret_list_response.rbi +24 -0
  136. data/rbi/retab/secret_response.rbi +24 -0
  137. data/rbi/retab/secret_value.rbi +36 -0
  138. data/rbi/retab/secret_value_response.rbi +24 -0
  139. data/rbi/retab/secrets.rbi +62 -0
  140. data/rbi/retab/set_secret_request.rbi +24 -0
  141. data/rbi/retab/split.rbi +14 -2
  142. data/rbi/retab/split_request.rbi +6 -0
  143. data/rbi/retab/split_workflow_artifact.rbi +14 -2
  144. data/rbi/retab/splits.rbi +14 -3
  145. data/rbi/retab/tables.rbi +127 -0
  146. data/rbi/retab/update_workflow_table_request.rbi +30 -0
  147. data/rbi/retab/{job_response.rbi → validate_workflow_block_config_request.rbi} +9 -9
  148. data/rbi/retab/validate_workflow_block_config_response.rbi +48 -0
  149. data/rbi/retab/workflow_block.rbi +12 -0
  150. data/rbi/retab/workflow_blocks.rbi +11 -0
  151. data/rbi/retab/workflow_table.rbi +90 -0
  152. data/rbi/retab/workflow_table_aggregation_request.rbi +36 -0
  153. data/rbi/retab/workflow_table_column.rbi +48 -0
  154. data/rbi/retab/workflow_table_distinct_request.rbi +24 -0
  155. data/rbi/retab/workflow_table_explain.rbi +84 -0
  156. data/rbi/retab/workflow_table_filter_rule.rbi +36 -0
  157. data/rbi/retab/workflow_table_list_response.rbi +24 -0
  158. data/rbi/retab/workflow_table_profile_column.rbi +78 -0
  159. data/rbi/retab/workflow_table_profile_response.rbi +36 -0
  160. data/rbi/retab/workflow_table_response.rbi +24 -0
  161. data/rbi/retab/{job_warning.rbi → workflow_table_row.rbi} +11 -11
  162. data/rbi/retab/workflow_table_rows_response.rbi +84 -0
  163. data/rbi/retab/workflow_table_sample_request.rbi +24 -0
  164. data/rbi/retab/workflow_table_schema_response.rbi +30 -0
  165. data/rbi/retab/workflow_table_search_request.rbi +30 -0
  166. data/rbi/retab/workflow_table_sort_rule.rbi +30 -0
  167. data/rbi/retab/workflow_table_tail_request.rbi +24 -0
  168. data/rbi/retab/workflow_table_validation_column_rule.rbi +36 -0
  169. data/rbi/retab/workflow_table_validation_diagnostic.rbi +42 -0
  170. data/rbi/retab/workflow_table_validation_request.rbi +36 -0
  171. data/rbi/retab/workflow_table_validation_response.rbi +36 -0
  172. metadata +107 -22
  173. data/lib/retab/jobs/job.rb +0 -70
  174. data/lib/retab/jobs.rb +0 -252
  175. data/lib/retab/types/create_job_request_endpoint.rb +0 -34
  176. data/lib/retab/types/jobs_source.rb +0 -14
  177. data/rbi/retab/create_job_request.rbi +0 -36
  178. data/rbi/retab/jobs.rbi +0 -76
@@ -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
@@ -13,6 +13,8 @@ module Retab
13
13
  n_consensus: :n_consensus,
14
14
  instructions: :instructions,
15
15
  output: :output,
16
+ status: :status,
17
+ error: :error,
16
18
  consensus: :consensus,
17
19
  usage: :usage,
18
20
  created_at: :created_at
@@ -26,6 +28,8 @@ module Retab
26
28
  :n_consensus,
27
29
  :instructions,
28
30
  :output,
31
+ :status,
32
+ :error,
29
33
  :consensus,
30
34
  :usage,
31
35
  :created_at
@@ -41,6 +45,8 @@ module Retab
41
45
  @n_consensus = hash[:n_consensus]
42
46
  @instructions = hash[:instructions]
43
47
  @output = (hash[:output] || []).map { |item| item ? Retab::SplitResult.new(item) : nil }
48
+ @status = hash[:status].nil? ? "pending" : hash[:status]
49
+ @error = hash[:error] ? Retab::PrimitiveError.new(hash[:error]) : nil
44
50
  @consensus = hash[:consensus] ? Retab::SplitConsensus.new(hash[:consensus]) : nil
45
51
  @usage = hash[:usage] ? Retab::RetabUsage.new(hash[:usage]) : nil
46
52
  @created_at = hash[:created_at]
@@ -11,7 +11,8 @@ module Retab
11
11
  model: :model,
12
12
  instructions: :instructions,
13
13
  n_consensus: :n_consensus,
14
- bust_cache: :bust_cache
14
+ bust_cache: :bust_cache,
15
+ background: :background
15
16
  }.freeze
16
17
 
17
18
  attr_accessor(
@@ -20,7 +21,8 @@ module Retab
20
21
  :model,
21
22
  :instructions,
22
23
  :n_consensus,
23
- :bust_cache
24
+ :bust_cache,
25
+ :background
24
26
  )
25
27
 
26
28
  def initialize(json)
@@ -32,6 +34,7 @@ module Retab
32
34
  @instructions = hash[:instructions]
33
35
  @n_consensus = hash[:n_consensus]
34
36
  @bust_cache = hash[:bust_cache].nil? ? false : hash[:bust_cache]
37
+ @background = hash[:background].nil? ? false : hash[:background]
35
38
  end
36
39
  end
37
40
  end
data/lib/retab/splits.rb CHANGED
@@ -16,6 +16,7 @@ module Retab
16
16
  # @param limit [Integer, nil]
17
17
  # @param order [Retab::Types::SplitsOrder, nil]
18
18
  # @param filename [String, nil]
19
+ # @param status [Retab::Types::SplitsStatus, nil]
19
20
  # @param from_date [String, nil]
20
21
  # @param to_date [String, nil]
21
22
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
@@ -26,6 +27,7 @@ module Retab
26
27
  limit: 10,
27
28
  order: "desc",
28
29
  filename: nil,
30
+ status: nil,
29
31
  from_date: nil,
30
32
  to_date: nil,
31
33
  request_options: {}
@@ -36,6 +38,7 @@ module Retab
36
38
  "limit" => limit,
37
39
  "order" => order,
38
40
  "filename" => filename,
41
+ "status" => status,
39
42
  "from_date" => from_date,
40
43
  "to_date" => to_date
41
44
  }.compact
@@ -53,6 +56,7 @@ module Retab
53
56
  limit: limit,
54
57
  order: order,
55
58
  filename: filename,
59
+ status: status,
56
60
  from_date: from_date,
57
61
  to_date: to_date,
58
62
  request_options: request_options
@@ -66,6 +70,7 @@ module Retab
66
70
  limit: limit,
67
71
  order: order,
68
72
  filename: filename,
73
+ status: status,
69
74
  from_date: from_date,
70
75
  to_date: to_date
71
76
  },
@@ -80,6 +85,7 @@ module Retab
80
85
  # @param instructions [String, nil] Free-form instructions appended to the system prompt to steer the split.
81
86
  # @param n_consensus [Integer, nil] Number of consensus split runs to perform. Uses deterministic single-pass when set to 1.
82
87
  # @param bust_cache [Boolean, nil] If true, skip the LLM cache and force a fresh completion
88
+ # @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.
83
89
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
84
90
  # @return [Retab::Split]
85
91
  def create(
@@ -89,6 +95,7 @@ module Retab
89
95
  instructions: nil,
90
96
  n_consensus: nil,
91
97
  bust_cache: nil,
98
+ background: nil,
92
99
  request_options: {}
93
100
  )
94
101
  document = Retab::MimeData.coerce(document) unless document.nil?
@@ -98,7 +105,8 @@ module Retab
98
105
  "model" => model,
99
106
  "instructions" => instructions,
100
107
  "n_consensus" => n_consensus,
101
- "bust_cache" => bust_cache
108
+ "bust_cache" => bust_cache,
109
+ "background" => background
102
110
  }.compact
103
111
  response = @client.request(
104
112
  method: :post,
@@ -118,16 +126,22 @@ module Retab
118
126
 
119
127
  # Get Split
120
128
  # @param split_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.
121
130
  # @param request_options [Hash] (see Retab::Types::RequestOptions)
122
131
  # @return [Retab::Split]
123
132
  def get(
124
133
  split_id:,
134
+ include_output: true,
125
135
  request_options: {}
126
136
  )
137
+ params = {
138
+ "include_output" => include_output
139
+ }.compact
127
140
  response = @client.request(
128
141
  method: :get,
129
142
  path: "/v1/splits/#{Retab::Util.encode_path(split_id)}",
130
143
  auth: true,
144
+ params: params,
131
145
  request_options: request_options
132
146
  )
133
147
  result = Retab::Split.new(response.body)
@@ -155,5 +169,28 @@ module Retab
155
169
  )
156
170
  nil
157
171
  end
172
+
173
+ # Cancel Split
174
+ # @param split_id [String]
175
+ # @param request_options [Hash] (see Retab::Types::RequestOptions)
176
+ # @return [Retab::Split]
177
+ def create_split_cancel(
178
+ split_id:,
179
+ request_options: {}
180
+ )
181
+ response = @client.request(
182
+ method: :post,
183
+ path: "/v1/splits/#{Retab::Util.encode_path(split_id)}/cancel",
184
+ auth: true,
185
+ request_options: request_options
186
+ )
187
+ result = Retab::Split.new(response.body)
188
+ result.last_response = Retab::Types::ApiResponse.new(
189
+ http_status: response.code.to_i,
190
+ http_headers: response.each_header.to_h,
191
+ request_id: response["x-request-id"]
192
+ )
193
+ result
194
+ end
158
195
  end
159
196
  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
@@ -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 BodyReplaceTableV1TablesTableIdPut < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ file: :file,
10
+ column_schema_overrides: :column_schema_overrides
11
+ }.freeze
12
+
13
+ attr_accessor(
14
+ :file,
15
+ :column_schema_overrides
16
+ )
17
+
18
+ def initialize(json)
19
+ super()
20
+ hash = self.class.normalize(json)
21
+ @file = hash[:file]
22
+ @column_schema_overrides = hash[:column_schema_overrides]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class QueryWorkflowTableRequest < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ filters: :filters,
10
+ search: :search,
11
+ case_sensitive: :case_sensitive,
12
+ select: :select,
13
+ distinct: :distinct,
14
+ group_by: :group_by,
15
+ aggregations: :aggregations,
16
+ sort: :sort,
17
+ sample: :sample,
18
+ tail: :tail,
19
+ count_only: :count_only,
20
+ include_explain: :include_explain,
21
+ sort_column: :sort_column,
22
+ sort_direction: :sort_direction,
23
+ viewer_mode: :viewer_mode,
24
+ offset: :offset,
25
+ limit: :limit
26
+ }.freeze
27
+
28
+ attr_accessor(
29
+ :filters,
30
+ :search,
31
+ :case_sensitive,
32
+ :select,
33
+ :distinct,
34
+ :group_by,
35
+ :aggregations,
36
+ :sort,
37
+ :sample,
38
+ :tail,
39
+ :count_only,
40
+ :include_explain,
41
+ :sort_column,
42
+ :sort_direction,
43
+ :viewer_mode,
44
+ :offset,
45
+ :limit
46
+ )
47
+
48
+ def initialize(json)
49
+ super()
50
+ hash = self.class.normalize(json)
51
+ @filters = (hash[:filters] || []).map { |item| item ? Retab::WorkflowTableFilterRule.new(item) : nil }
52
+ @search = hash[:search] ? Retab::WorkflowTableSearchRequest.new(hash[:search]) : nil
53
+ @case_sensitive = hash[:case_sensitive].nil? ? false : hash[:case_sensitive]
54
+ @select = (hash[:select] || [])
55
+ @distinct = hash[:distinct] ? Retab::WorkflowTableDistinctRequest.new(hash[:distinct]) : nil
56
+ @group_by = (hash[:group_by] || [])
57
+ @aggregations = (hash[:aggregations] || []).map { |item|
58
+ item ? Retab::WorkflowTableAggregationRequest.new(item) : nil
59
+ }
60
+ @sort = (hash[:sort] || []).map { |item| item ? Retab::WorkflowTableSortRule.new(item) : nil }
61
+ @sample = hash[:sample] ? Retab::WorkflowTableSampleRequest.new(hash[:sample]) : nil
62
+ @tail = hash[:tail] ? Retab::WorkflowTableTailRequest.new(hash[:tail]) : nil
63
+ @count_only = hash[:count_only].nil? ? false : hash[:count_only]
64
+ @include_explain = hash[:include_explain].nil? ? false : hash[:include_explain]
65
+ @sort_column = hash[:sort_column]
66
+ @sort_direction = hash[:sort_direction]
67
+ @viewer_mode = hash[:viewer_mode]
68
+ @offset = hash[:offset]
69
+ @limit = hash[:limit]
70
+ end
71
+ end
72
+ end
@@ -3,25 +3,22 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module Retab
6
- class CreateJobRequest < Retab::Types::BaseModel
6
+ class UpdateWorkflowTableRequest < Retab::Types::BaseModel
7
7
 
8
8
  HASH_ATTRS = {
9
- endpoint: :endpoint,
10
- request: :request,
9
+ name: :name,
11
10
  metadata: :metadata
12
11
  }.freeze
13
12
 
14
13
  attr_accessor(
15
- :endpoint,
16
- :request,
14
+ :name,
17
15
  :metadata
18
16
  )
19
17
 
20
18
  def initialize(json)
21
19
  super()
22
20
  hash = self.class.normalize(json)
23
- @endpoint = hash[:endpoint]
24
- @request = hash[:request] || {}
21
+ @name = hash[:name]
25
22
  @metadata = hash[:metadata] || {}
26
23
  end
27
24
  end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class WorkflowTable < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ id: :id,
10
+ name: :name,
11
+ filename: :filename,
12
+ source_file_id: :source_file_id,
13
+ snapshot_file_id: :snapshot_file_id,
14
+ row_count: :row_count,
15
+ columns: :columns,
16
+ sample_rows: :sample_rows,
17
+ metadata: :metadata,
18
+ uploaded_by_user_id: :uploaded_by_user_id,
19
+ created_at: :created_at,
20
+ updated_at: :updated_at
21
+ }.freeze
22
+
23
+ attr_accessor(
24
+ :id,
25
+ :name,
26
+ :filename,
27
+ :source_file_id,
28
+ :snapshot_file_id,
29
+ :row_count,
30
+ :columns,
31
+ :sample_rows,
32
+ :metadata,
33
+ :uploaded_by_user_id,
34
+ :created_at,
35
+ :updated_at
36
+ )
37
+
38
+ def initialize(json)
39
+ super()
40
+ hash = self.class.normalize(json)
41
+ @id = hash[:id]
42
+ @name = hash[:name]
43
+ @filename = hash[:filename]
44
+ @source_file_id = hash[:source_file_id].nil? ? "" : hash[:source_file_id]
45
+ @snapshot_file_id = hash[:snapshot_file_id].nil? ? "" : hash[:snapshot_file_id]
46
+ @row_count = hash[:row_count]
47
+ @columns = (hash[:columns] || []).map { |item| item ? Retab::WorkflowTableColumn.new(item) : nil }
48
+ @sample_rows = (hash[:sample_rows] || []).map { |item| item || {} }
49
+ @metadata = hash[:metadata] || {}
50
+ @uploaded_by_user_id = hash[:uploaded_by_user_id]
51
+ @created_at = hash[:created_at]
52
+ @updated_at = hash[:updated_at]
53
+ end
54
+ end
55
+ 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 WorkflowTableAggregationRequest < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ function: :function,
10
+ column: :column,
11
+ alias: :alias
12
+ }.freeze
13
+
14
+ attr_accessor(
15
+ :function,
16
+ :column,
17
+ :alias
18
+ )
19
+
20
+ def initialize(json)
21
+ super()
22
+ hash = self.class.normalize(json)
23
+ @function = hash[:function]
24
+ @column = hash[:column]
25
+ @alias = hash[:alias]
26
+ end
27
+ end
28
+ 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 WorkflowTableColumn < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ name: :name,
10
+ json_schema: :json_schema,
11
+ sample_values: :sample_values,
12
+ required: :required,
13
+ unique: :unique
14
+ }.freeze
15
+
16
+ attr_accessor(
17
+ :name,
18
+ :json_schema,
19
+ :sample_values,
20
+ :required,
21
+ :unique
22
+ )
23
+
24
+ def initialize(json)
25
+ super()
26
+ hash = self.class.normalize(json)
27
+ @name = hash[:name]
28
+ @json_schema = hash[:json_schema] || {}
29
+ @sample_values = (hash[:sample_values] || [])
30
+ @required = hash[:required].nil? ? false : hash[:required]
31
+ @unique = hash[:unique].nil? ? false : hash[:unique]
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 WorkflowTableDistinctRequest < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ column: :column
10
+ }.freeze
11
+
12
+ attr_accessor :column
13
+
14
+ def initialize(json)
15
+ super()
16
+ hash = self.class.normalize(json)
17
+ @column = hash[:column]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module Retab
6
+ class WorkflowTableExplain < Retab::Types::BaseModel
7
+
8
+ HASH_ATTRS = {
9
+ table_id: :table_id,
10
+ snapshot_file_id: :snapshot_file_id,
11
+ selected_columns: :selected_columns,
12
+ filters: :filters,
13
+ search: :search,
14
+ sort: :sort,
15
+ offset: :offset,
16
+ limit: :limit,
17
+ distinct: :distinct,
18
+ group_by: :group_by,
19
+ aggregations: :aggregations
20
+ }.freeze
21
+
22
+ attr_accessor(
23
+ :table_id,
24
+ :snapshot_file_id,
25
+ :selected_columns,
26
+ :filters,
27
+ :search,
28
+ :sort,
29
+ :offset,
30
+ :limit,
31
+ :distinct,
32
+ :group_by,
33
+ :aggregations
34
+ )
35
+
36
+ def initialize(json)
37
+ super()
38
+ hash = self.class.normalize(json)
39
+ @table_id = hash[:table_id]
40
+ @snapshot_file_id = hash[:snapshot_file_id].nil? ? "" : hash[:snapshot_file_id]
41
+ @selected_columns = (hash[:selected_columns] || [])
42
+ @filters = (hash[:filters] || []).map { |item| item ? Retab::WorkflowTableFilterRule.new(item) : nil }
43
+ @search = hash[:search] ? Retab::WorkflowTableSearchRequest.new(hash[:search]) : nil
44
+ @sort = (hash[:sort] || []).map { |item| item ? Retab::WorkflowTableSortRule.new(item) : nil }
45
+ @offset = hash[:offset]
46
+ @limit = hash[:limit]
47
+ @distinct = hash[:distinct] ? Retab::WorkflowTableDistinctRequest.new(hash[:distinct]) : nil
48
+ @group_by = (hash[:group_by] || [])
49
+ @aggregations = (hash[:aggregations] || []).map { |item|
50
+ item ? Retab::WorkflowTableAggregationRequest.new(item) : nil
51
+ }
52
+ end
53
+ end
54
+ end