retab 0.1.4 → 0.1.5

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 (85) 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 +0 -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/parses/parse.rb +6 -0
  14. data/lib/retab/parses/parse_request.rb +5 -2
  15. data/lib/retab/parses.rb +33 -1
  16. data/lib/retab/partitions/partition.rb +6 -0
  17. data/lib/retab/partitions/partition_request.rb +5 -2
  18. data/lib/retab/partitions.rb +38 -1
  19. data/lib/retab/splits/split.rb +6 -0
  20. data/lib/retab/splits/split_request.rb +5 -2
  21. data/lib/retab/splits.rb +38 -1
  22. data/lib/retab/types/{job_status.rb → classification_status.rb} +3 -4
  23. data/lib/retab/types/classification_workflow_artifact_status.rb +9 -0
  24. data/lib/retab/types/{supported_endpoint.rb → classifications_status.rb} +1 -1
  25. data/lib/retab/types/{jobs_order.rb → edit_status.rb} +1 -1
  26. data/lib/retab/types/edit_workflow_artifact_status.rb +9 -0
  27. data/lib/retab/types/{jobs_status.rb → edits_status.rb} +1 -1
  28. data/lib/retab/types/{jobs_endpoint.rb → extraction_status.rb} +1 -1
  29. data/lib/retab/types/extraction_workflow_artifact_status.rb +9 -0
  30. data/lib/retab/types/extractions_status.rb +9 -0
  31. data/lib/retab/types/parse_status.rb +9 -0
  32. data/lib/retab/types/parse_workflow_artifact_status.rb +9 -0
  33. data/lib/retab/types/partition_status.rb +9 -0
  34. data/lib/retab/types/partition_workflow_artifact_status.rb +9 -0
  35. data/lib/retab/types/partitions_status.rb +9 -0
  36. data/lib/retab/types/split_status.rb +9 -0
  37. data/lib/retab/types/split_workflow_artifact_status.rb +9 -0
  38. data/lib/retab/types/splits_status.rb +9 -0
  39. data/lib/retab/workflow_artifacts/classification_workflow_artifact.rb +6 -0
  40. data/lib/retab/workflow_artifacts/edit_workflow_artifact.rb +6 -0
  41. data/lib/retab/workflow_artifacts/extraction_workflow_artifact.rb +6 -0
  42. data/lib/retab/workflow_artifacts/parse_workflow_artifact.rb +6 -0
  43. data/lib/retab/workflow_artifacts/partition_workflow_artifact.rb +6 -0
  44. data/lib/retab/workflow_artifacts/split_workflow_artifact.rb +6 -0
  45. data/lib/retab/workflow_steps.rb +2 -2
  46. data/lib/retab.rb +0 -1
  47. data/rbi/retab/classification.rbi +14 -2
  48. data/rbi/retab/classification_request.rbi +6 -0
  49. data/rbi/retab/classification_workflow_artifact.rbi +14 -2
  50. data/rbi/retab/classifications.rbi +14 -3
  51. data/rbi/retab/client.rbi +0 -3
  52. data/rbi/retab/edit.rbi +14 -2
  53. data/rbi/retab/edit_request.rbi +6 -0
  54. data/rbi/retab/edit_workflow_artifact.rbi +14 -2
  55. data/rbi/retab/edits.rbi +14 -3
  56. data/rbi/retab/extraction.rbi +12 -0
  57. data/rbi/retab/extraction_request.rbi +6 -0
  58. data/rbi/retab/extraction_workflow_artifact.rbi +12 -0
  59. data/rbi/retab/extractions.rbi +14 -3
  60. data/rbi/retab/parse.rbi +12 -0
  61. data/rbi/retab/parse_request.rbi +6 -0
  62. data/rbi/retab/parse_workflow_artifact.rbi +12 -0
  63. data/rbi/retab/parses.rbi +12 -2
  64. data/rbi/retab/partition.rbi +12 -0
  65. data/rbi/retab/partition_request.rbi +6 -0
  66. data/rbi/retab/partition_workflow_artifact.rbi +12 -0
  67. data/rbi/retab/partitions.rbi +14 -3
  68. data/rbi/retab/{job_error.rbi → primitive_error.rbi} +1 -1
  69. data/rbi/retab/split.rbi +14 -2
  70. data/rbi/retab/split_request.rbi +6 -0
  71. data/rbi/retab/split_workflow_artifact.rbi +14 -2
  72. data/rbi/retab/splits.rbi +14 -3
  73. metadata +20 -20
  74. data/lib/retab/jobs/create_job_request.rb +0 -28
  75. data/lib/retab/jobs/job.rb +0 -70
  76. data/lib/retab/jobs/job_response.rb +0 -25
  77. data/lib/retab/jobs/job_warning.rb +0 -7
  78. data/lib/retab/jobs.rb +0 -252
  79. data/lib/retab/types/create_job_request_endpoint.rb +0 -34
  80. data/lib/retab/types/jobs_source.rb +0 -14
  81. data/rbi/retab/create_job_request.rbi +0 -36
  82. data/rbi/retab/job.rbi +0 -120
  83. data/rbi/retab/job_response.rbi +0 -30
  84. data/rbi/retab/job_warning.rbi +0 -36
  85. data/rbi/retab/jobs.rbi +0 -76
@@ -45,12 +45,24 @@ module Retab
45
45
  sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
46
46
  def instructions=(value); end
47
47
 
48
- sig { returns(T::Array[Retab::SplitResult]) }
48
+ sig { returns(T.nilable(T::Array[Retab::SplitResult])) }
49
49
  def output; end
50
50
 
51
- sig { params(value: T::Array[Retab::SplitResult]).returns(T::Array[Retab::SplitResult]) }
51
+ sig { params(value: T.nilable(T::Array[Retab::SplitResult])).returns(T.nilable(T::Array[Retab::SplitResult])) }
52
52
  def output=(value); end
53
53
 
54
+ sig { returns(T.nilable(String)) }
55
+ def status; end
56
+
57
+ sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
58
+ def status=(value); end
59
+
60
+ sig { returns(T.nilable(Retab::PrimitiveError)) }
61
+ def error; end
62
+
63
+ sig { params(value: T.nilable(Retab::PrimitiveError)).returns(T.nilable(Retab::PrimitiveError)) }
64
+ def error=(value); end
65
+
54
66
  sig { returns(T.nilable(Retab::SplitConsensus)) }
55
67
  def consensus; end
56
68
 
data/rbi/retab/splits.rbi CHANGED
@@ -16,12 +16,13 @@ module Retab
16
16
  limit: T.nilable(Integer),
17
17
  order: T.nilable(String),
18
18
  filename: T.nilable(String),
19
+ status: T.nilable(String),
19
20
  from_date: T.nilable(String),
20
21
  to_date: T.nilable(String),
21
22
  request_options: T::Hash[Symbol, T.untyped]
22
23
  ).returns(Retab::PaginatedList[Retab::Split])
23
24
  end
24
- def list(before:, after:, limit:, order:, filename:, from_date:, to_date:, request_options:); end
25
+ def list(before:, after:, limit:, order:, filename:, status:, from_date:, to_date:, request_options:); end
25
26
 
26
27
  sig do
27
28
  params(
@@ -31,18 +32,20 @@ module Retab
31
32
  instructions: T.nilable(String),
32
33
  n_consensus: T.nilable(Integer),
33
34
  bust_cache: T.nilable(T::Boolean),
35
+ background: T.nilable(T::Boolean),
34
36
  request_options: T::Hash[Symbol, T.untyped]
35
37
  ).returns(Retab::Split)
36
38
  end
37
- def create(document:, subdocuments:, model:, instructions:, n_consensus:, bust_cache:, request_options:); end
39
+ def create(document:, subdocuments:, model:, instructions:, n_consensus:, bust_cache:, background:, request_options:); end
38
40
 
39
41
  sig do
40
42
  params(
41
43
  split_id: String,
44
+ include_output: T.nilable(T::Boolean),
42
45
  request_options: T::Hash[Symbol, T.untyped]
43
46
  ).returns(Retab::Split)
44
47
  end
45
- def get(split_id:, request_options:); end
48
+ def get(split_id:, include_output:, request_options:); end
46
49
 
47
50
  sig do
48
51
  params(
@@ -52,5 +55,13 @@ module Retab
52
55
  end
53
56
  def delete(split_id:, request_options:); end
54
57
 
58
+ sig do
59
+ params(
60
+ split_id: String,
61
+ request_options: T::Hash[Symbol, T.untyped]
62
+ ).returns(Retab::Split)
63
+ end
64
+ def create_split_cancel(split_id:, request_options:); end
65
+
55
66
  end
56
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Retab
@@ -53,6 +53,7 @@ files:
53
53
  - lib/retab/classifications/classification_decision.rb
54
54
  - lib/retab/classifications/classification_request.rb
55
55
  - lib/retab/classifications/file_ref.rb
56
+ - lib/retab/classifications/primitive_error.rb
56
57
  - lib/retab/classifications/retab_usage.rb
57
58
  - lib/retab/client.rb
58
59
  - lib/retab/configuration.rb
@@ -120,12 +121,6 @@ files:
120
121
  - lib/retab/files/file_link.rb
121
122
  - lib/retab/files/upload_file_request.rb
122
123
  - lib/retab/inflections.rb
123
- - lib/retab/jobs.rb
124
- - lib/retab/jobs/create_job_request.rb
125
- - lib/retab/jobs/job.rb
126
- - lib/retab/jobs/job_error.rb
127
- - lib/retab/jobs/job_response.rb
128
- - lib/retab/jobs/job_warning.rb
129
124
  - lib/retab/mime.rb
130
125
  - lib/retab/paginated_list.rb
131
126
  - lib/retab/parses.rb
@@ -156,19 +151,24 @@ files:
156
151
  - lib/retab/types/assertion_outcome.rb
157
152
  - lib/retab/types/base_model.rb
158
153
  - lib/retab/types/cancel_workflow_response_cancellation_status.rb
154
+ - lib/retab/types/classification_status.rb
155
+ - lib/retab/types/classification_workflow_artifact_status.rb
159
156
  - lib/retab/types/classifications_order.rb
157
+ - lib/retab/types/classifications_status.rb
160
158
  - lib/retab/types/condition_evaluation_details_logical_operator.rb
161
159
  - lib/retab/types/condition_evaluation_result_logical_operator.rb
162
160
  - lib/retab/types/create_experiment_request_n_consensus.rb
163
- - lib/retab/types/create_job_request_endpoint.rb
164
161
  - lib/retab/types/declarative_apply_response_action.rb
165
162
  - lib/retab/types/declarative_plan_field_change_action.rb
166
163
  - lib/retab/types/declarative_plan_resource_change_actions.rb
167
164
  - lib/retab/types/declarative_plan_resource_change_target.rb
168
165
  - lib/retab/types/declarative_plan_resource_change_type.rb
169
166
  - lib/retab/types/declarative_plan_response_action.rb
167
+ - lib/retab/types/edit_status.rb
170
168
  - lib/retab/types/edit_templates_order.rb
169
+ - lib/retab/types/edit_workflow_artifact_status.rb
171
170
  - lib/retab/types/edits_order.rb
171
+ - lib/retab/types/edits_status.rb
172
172
  - lib/retab/types/error_step_lifecycle_category.rb
173
173
  - lib/retab/types/error_step_lifecycle_stage.rb
174
174
  - lib/retab/types/error_terminal_category.rb
@@ -183,14 +183,12 @@ files:
183
183
  - lib/retab/types/experiment_runs_order.rb
184
184
  - lib/retab/types/experiment_schema_drift_status.rb
185
185
  - lib/retab/types/experiment_summary_metrics_response_block_type.rb
186
+ - lib/retab/types/extraction_status.rb
187
+ - lib/retab/types/extraction_workflow_artifact_status.rb
186
188
  - lib/retab/types/extractions_order.rb
189
+ - lib/retab/types/extractions_status.rb
187
190
  - lib/retab/types/field_type.rb
188
191
  - lib/retab/types/files_order.rb
189
- - lib/retab/types/job_status.rb
190
- - lib/retab/types/jobs_endpoint.rb
191
- - lib/retab/types/jobs_order.rb
192
- - lib/retab/types/jobs_source.rb
193
- - lib/retab/types/jobs_status.rb
194
192
  - lib/retab/types/latest_block_test_run_summary_outcome.rb
195
193
  - lib/retab/types/latest_block_test_run_summary_status.rb
196
194
  - lib/retab/types/length_compare_condition_op.rb
@@ -198,9 +196,14 @@ files:
198
196
  - lib/retab/types/n_consensus_value.rb
199
197
  - lib/retab/types/number_compare_condition_op.rb
200
198
  - lib/retab/types/parse_request_table_parsing_format.rb
199
+ - lib/retab/types/parse_status.rb
200
+ - lib/retab/types/parse_workflow_artifact_status.rb
201
201
  - lib/retab/types/parse_workflow_artifact_table_parsing_format.rb
202
202
  - lib/retab/types/parses_order.rb
203
+ - lib/retab/types/partition_status.rb
204
+ - lib/retab/types/partition_workflow_artifact_status.rb
203
205
  - lib/retab/types/partitions_order.rb
206
+ - lib/retab/types/partitions_status.rb
204
207
  - lib/retab/types/public_handle_payload_type.rb
205
208
  - lib/retab/types/request_options.rb
206
209
  - lib/retab/types/resume_status.rb
@@ -210,10 +213,12 @@ files:
210
213
  - lib/retab/types/review_verdict.rb
211
214
  - lib/retab/types/similarity_gte_condition_method.rb
212
215
  - lib/retab/types/sources_response_document_type.rb
216
+ - lib/retab/types/split_status.rb
217
+ - lib/retab/types/split_workflow_artifact_status.rb
213
218
  - lib/retab/types/splits_order.rb
219
+ - lib/retab/types/splits_status.rb
214
220
  - lib/retab/types/step_artifact_ref_operation.rb
215
221
  - lib/retab/types/submission_status.rb
216
- - lib/retab/types/supported_endpoint.rb
217
222
  - lib/retab/types/table_parsing_format.rb
218
223
  - lib/retab/types/trigger_info_type.rb
219
224
  - lib/retab/types/update_experiment_request_n_consensus.rb
@@ -460,7 +465,6 @@ files:
460
465
  - rbi/retab/create_edit_template_request.rbi
461
466
  - rbi/retab/create_experiment_request.rbi
462
467
  - rbi/retab/create_experiment_run_request.rbi
463
- - rbi/retab/create_job_request.rbi
464
468
  - rbi/retab/create_review_version_request.rbi
465
469
  - rbi/retab/create_upload_response.rbi
466
470
  - rbi/retab/create_workflow_request.rbi
@@ -536,11 +540,6 @@ files:
536
540
  - rbi/retab/function_invocation.rbi
537
541
  - rbi/retab/generate_schema_request.rbi
538
542
  - rbi/retab/http_validation_error.rbi
539
- - rbi/retab/job.rbi
540
- - rbi/retab/job_error.rbi
541
- - rbi/retab/job_response.rbi
542
- - rbi/retab/job_warning.rbi
543
- - rbi/retab/jobs.rbi
544
543
  - rbi/retab/json_handle_input.rbi
545
544
  - rbi/retab/json_schema_valid_condition.rbi
546
545
  - rbi/retab/latest_block_test_run_summary.rbi
@@ -575,6 +574,7 @@ files:
575
574
  - rbi/retab/pending_workflow_experiment_result.rbi
576
575
  - rbi/retab/pending_workflow_experiment_run.rbi
577
576
  - rbi/retab/pending_workflow_test_run.rbi
577
+ - rbi/retab/primitive_error.rbi
578
578
  - rbi/retab/public_handle_payload.rbi
579
579
  - rbi/retab/publish_workflow_request.rbi
580
580
  - rbi/retab/queued_step_lifecycle.rbi
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This file is auto-generated by oagen. Do not edit.
4
-
5
- module Retab
6
- class CreateJobRequest < Retab::Types::BaseModel
7
-
8
- HASH_ATTRS = {
9
- endpoint: :endpoint,
10
- request: :request,
11
- metadata: :metadata
12
- }.freeze
13
-
14
- attr_accessor(
15
- :endpoint,
16
- :request,
17
- :metadata
18
- )
19
-
20
- def initialize(json)
21
- super()
22
- hash = self.class.normalize(json)
23
- @endpoint = hash[:endpoint]
24
- @request = hash[:request] || {}
25
- @metadata = hash[:metadata] || {}
26
- end
27
- end
28
- end
@@ -1,70 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This file is auto-generated by oagen. Do not edit.
4
-
5
- module Retab
6
- class Job < Retab::Types::BaseModel
7
-
8
- HASH_ATTRS = {
9
- id: :id,
10
- object: :object,
11
- status: :status,
12
- endpoint: :endpoint,
13
- error: :error,
14
- warnings: :warnings,
15
- created_at: :created_at,
16
- started_at: :started_at,
17
- completed_at: :completed_at,
18
- expires_at: :expires_at,
19
- metadata: :metadata,
20
- cancelled: :cancelled,
21
- attempt_count: :attempt_count,
22
- last_attempt_at: :last_attempt_at,
23
- last_failure_code: :last_failure_code,
24
- request: :request,
25
- response: :response
26
- }.freeze
27
-
28
- attr_accessor(
29
- :id,
30
- :object,
31
- :status,
32
- :endpoint,
33
- :error,
34
- :warnings,
35
- :created_at,
36
- :started_at,
37
- :completed_at,
38
- :expires_at,
39
- :metadata,
40
- :cancelled,
41
- :attempt_count,
42
- :last_attempt_at,
43
- :last_failure_code,
44
- :request,
45
- :response
46
- )
47
-
48
- def initialize(json)
49
- super()
50
- hash = self.class.normalize(json)
51
- @id = hash[:id]
52
- @object = hash[:object].nil? ? "job" : hash[:object]
53
- @status = hash[:status].nil? ? "validating" : hash[:status]
54
- @endpoint = hash[:endpoint]
55
- @error = hash[:error] ? Retab::JobError.new(hash[:error]) : nil
56
- @warnings = (hash[:warnings] || []).map { |item| item ? Retab::JobWarning.new(item) : nil }
57
- @created_at = hash[:created_at]
58
- @started_at = hash[:started_at]
59
- @completed_at = hash[:completed_at]
60
- @expires_at = hash[:expires_at]
61
- @metadata = hash[:metadata] || {}
62
- @cancelled = hash[:cancelled].nil? ? false : hash[:cancelled]
63
- @attempt_count = hash[:attempt_count]
64
- @last_attempt_at = hash[:last_attempt_at]
65
- @last_failure_code = hash[:last_failure_code]
66
- @request = hash[:request] || {}
67
- @response = hash[:response] ? Retab::JobResponse.new(hash[:response]) : nil
68
- end
69
- end
70
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This file is auto-generated by oagen. Do not edit.
4
-
5
- module Retab
6
- class JobResponse < Retab::Types::BaseModel
7
-
8
- HASH_ATTRS = {
9
- status_code: :status_code,
10
- body: :body
11
- }.freeze
12
-
13
- attr_accessor(
14
- :status_code,
15
- :body
16
- )
17
-
18
- def initialize(json)
19
- super()
20
- hash = self.class.normalize(json)
21
- @status_code = hash[:status_code]
22
- @body = hash[:body] || {}
23
- end
24
- end
25
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This file is auto-generated by oagen. Do not edit.
4
-
5
- module Retab
6
- JobWarning = JobError
7
- end
data/lib/retab/jobs.rb DELETED
@@ -1,252 +0,0 @@
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 Jobs
9
- def initialize(client)
10
- @client = client
11
- end
12
-
13
- # List Jobs
14
- # @param before [String, nil] First job ID from the current page, used to fetch the previous page
15
- # @param after [String, nil] Last job ID from the previous page, used to fetch the next page
16
- # @param limit [Integer, nil] Number of jobs to return
17
- # @param order [Retab::Types::JobsOrder, nil] Sort order by created_at
18
- # @param job_id [String, nil] Filter by job ID
19
- # @param status [Retab::Types::JobsStatus, nil] Filter by status
20
- # @param endpoint [Retab::Types::JobsEndpoint, nil] Filter by endpoint
21
- # @param source [Retab::Types::JobsSource, nil] High-level source filter. Use api/project/workflow.
22
- # @param project_id [String, nil] Filter by request.project_id
23
- # @param workflow_id [String, nil] Filter by metadata.workflow_id
24
- # @param workflow_block_id [String, nil] Filter by metadata.workflow_block_id or metadata.block_id
25
- # @param model [String, nil] Filter by request.model
26
- # @param filename_regex [String, nil] Regex or plain text pattern applied to request filenames.
27
- # @param filename_contains [String, nil] Plain text substring applied to request filenames.
28
- # @param document_type [Array<String>, nil] Filter by document type. Can be repeated. Accepted values: bmp, csv, doc, docm, docx, dotm, dotx, eml, gif, heic, heif, htm, html, jpeg, jpg, json, md, mhtml, msg, odp, ods, odt, ots, ott, pdf, png, ppt, pptx, rtf, svg, tif, tiff, tsv, txt, webp, xlam, xls, xlsb, xlsm, xlsx, xltm, xltx, xml, yaml, yml.
29
- # @param from_date [String, nil] Filter jobs created on or after this date (YYYY-MM-DD)
30
- # @param to_date [String, nil] Filter jobs created on or before this date (YYYY-MM-DD)
31
- # @param metadata [String, nil] JSON object string to filter metadata key/value pairs.
32
- # @param include_request [Boolean, nil] Whether to include the full original request body in each listed job.
33
- # @param include_response [Boolean, nil] Whether to include full response payloads in each listed job.
34
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
35
- # @return [Retab::PaginatedList<Retab::Job>]
36
- def list(
37
- before: nil,
38
- after: nil,
39
- limit: 20,
40
- order: "desc",
41
- job_id: nil,
42
- status: nil,
43
- endpoint: nil,
44
- source: nil,
45
- project_id: nil,
46
- workflow_id: nil,
47
- workflow_block_id: nil,
48
- model: nil,
49
- filename_regex: nil,
50
- filename_contains: nil,
51
- document_type: nil,
52
- from_date: nil,
53
- to_date: nil,
54
- metadata: nil,
55
- include_request: false,
56
- include_response: false,
57
- request_options: {}
58
- )
59
- params = {
60
- "before" => before,
61
- "after" => after,
62
- "limit" => limit,
63
- "order" => order,
64
- "job_id" => job_id,
65
- "status" => status,
66
- "endpoint" => endpoint,
67
- "source" => source,
68
- "project_id" => project_id,
69
- "workflow_id" => workflow_id,
70
- "workflow_block_id" => workflow_block_id,
71
- "model" => model,
72
- "filename_regex" => filename_regex,
73
- "filename_contains" => filename_contains,
74
- "document_type" => document_type,
75
- "from_date" => from_date,
76
- "to_date" => to_date,
77
- "metadata" => metadata,
78
- "include_request" => include_request,
79
- "include_response" => include_response
80
- }.compact
81
- response = @client.request(
82
- method: :get,
83
- path: "/v1/jobs",
84
- auth: true,
85
- params: params,
86
- request_options: request_options
87
- )
88
- fetch_next = -> (cursor) {
89
- list(
90
- before: before,
91
- after: cursor,
92
- limit: limit,
93
- order: order,
94
- job_id: job_id,
95
- status: status,
96
- endpoint: endpoint,
97
- source: source,
98
- project_id: project_id,
99
- workflow_id: workflow_id,
100
- workflow_block_id: workflow_block_id,
101
- model: model,
102
- filename_regex: filename_regex,
103
- filename_contains: filename_contains,
104
- document_type: document_type,
105
- from_date: from_date,
106
- to_date: to_date,
107
- metadata: metadata,
108
- include_request: include_request,
109
- include_response: include_response,
110
- request_options: request_options
111
- )
112
- }
113
- Retab::PaginatedList.from_response(
114
- response,
115
- model: Retab::Job,
116
- filters: {
117
- before: before,
118
- limit: limit,
119
- order: order,
120
- job_id: job_id,
121
- status: status,
122
- endpoint: endpoint,
123
- source: source,
124
- project_id: project_id,
125
- workflow_id: workflow_id,
126
- workflow_block_id: workflow_block_id,
127
- model: model,
128
- filename_regex: filename_regex,
129
- filename_contains: filename_contains,
130
- document_type: document_type,
131
- from_date: from_date,
132
- to_date: to_date,
133
- metadata: metadata,
134
- include_request: include_request,
135
- include_response: include_response
136
- },
137
- fetch_next: fetch_next
138
- )
139
- end
140
-
141
- # Create Job
142
- # @param endpoint [Retab::Types::CreateJobRequestEndpoint]
143
- # @param request [Hash{String => Object}]
144
- # @param metadata [Hash{String => String}, nil] Max 16 pairs; keys ≤64 chars, values ≤512 chars
145
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
146
- # @return [Retab::Job]
147
- def create(
148
- endpoint:,
149
- request:,
150
- metadata: nil,
151
- request_options: {}
152
- )
153
- body = {
154
- "endpoint" => endpoint,
155
- "request" => request,
156
- "metadata" => metadata
157
- }.compact
158
- response = @client.request(
159
- method: :post,
160
- path: "/v1/jobs",
161
- auth: true,
162
- body: body,
163
- request_options: request_options
164
- )
165
- result = Retab::Job.new(response.body)
166
- result.last_response = Retab::Types::ApiResponse.new(
167
- http_status: response.code.to_i,
168
- http_headers: response.each_header.to_h,
169
- request_id: response["x-request-id"]
170
- )
171
- result
172
- end
173
-
174
- # Retrieve Job
175
- # @param job_id [String]
176
- # @param include_request [Boolean, nil] Include the original request payload in the response.
177
- # @param include_response [Boolean, nil] Include the job response payload in the response.
178
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
179
- # @return [Retab::Job]
180
- def get(
181
- job_id:,
182
- include_request: false,
183
- include_response: false,
184
- request_options: {}
185
- )
186
- params = {
187
- "include_request" => include_request,
188
- "include_response" => include_response
189
- }.compact
190
- response = @client.request(
191
- method: :get,
192
- path: "/v1/jobs/#{Retab::Util.encode_path(job_id)}",
193
- auth: true,
194
- params: params,
195
- request_options: request_options
196
- )
197
- result = Retab::Job.new(response.body)
198
- result.last_response = Retab::Types::ApiResponse.new(
199
- http_status: response.code.to_i,
200
- http_headers: response.each_header.to_h,
201
- request_id: response["x-request-id"]
202
- )
203
- result
204
- end
205
-
206
- # Cancel Job
207
- # @param job_id [String]
208
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
209
- # @return [Retab::Job]
210
- def cancel(
211
- job_id:,
212
- request_options: {}
213
- )
214
- response = @client.request(
215
- method: :post,
216
- path: "/v1/jobs/#{Retab::Util.encode_path(job_id)}/cancel",
217
- auth: true,
218
- request_options: request_options
219
- )
220
- result = Retab::Job.new(response.body)
221
- result.last_response = Retab::Types::ApiResponse.new(
222
- http_status: response.code.to_i,
223
- http_headers: response.each_header.to_h,
224
- request_id: response["x-request-id"]
225
- )
226
- result
227
- end
228
-
229
- # Retry Job
230
- # @param job_id [String]
231
- # @param request_options [Hash] (see Retab::Types::RequestOptions)
232
- # @return [Retab::Job]
233
- def retry(
234
- job_id:,
235
- request_options: {}
236
- )
237
- response = @client.request(
238
- method: :post,
239
- path: "/v1/jobs/#{Retab::Util.encode_path(job_id)}/retry",
240
- auth: true,
241
- request_options: request_options
242
- )
243
- result = Retab::Job.new(response.body)
244
- result.last_response = Retab::Types::ApiResponse.new(
245
- http_status: response.code.to_i,
246
- http_headers: response.each_header.to_h,
247
- request_id: response["x-request-id"]
248
- )
249
- result
250
- end
251
- end
252
- end
@@ -1,34 +0,0 @@
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 CreateJobRequestEndpoint
8
- V_1_EXTRACTIONS = "/v1/extractions"
9
- V_1_PARSES = "/v1/parses"
10
- V_1_SPLITS = "/v1/splits"
11
- V_1_PARTITIONS = "/v1/partitions"
12
- V_1_CLASSIFICATIONS = "/v1/classifications"
13
- V_1_SCHEMAS_GENERATE = "/v1/schemas/generate"
14
- V_1_EDITS = "/v1/edits"
15
- V_1_EDITS_TEMPLATES_GENERATE = "/v1/edits/templates/generate"
16
- V_1_EVALS_EXTRACT_PROCESS = "/v1/evals/extract/process"
17
- V_1_EVALS_EXTRACT_EXTRACT = "/v1/evals/extract/extract"
18
- V_1_EVALS_EXTRACT_SPLIT = "/v1/evals/extract/split"
19
- ALL = [
20
- V_1_EXTRACTIONS,
21
- V_1_PARSES,
22
- V_1_SPLITS,
23
- V_1_PARTITIONS,
24
- V_1_CLASSIFICATIONS,
25
- V_1_SCHEMAS_GENERATE,
26
- V_1_EDITS,
27
- V_1_EDITS_TEMPLATES_GENERATE,
28
- V_1_EVALS_EXTRACT_PROCESS,
29
- V_1_EVALS_EXTRACT_EXTRACT,
30
- V_1_EVALS_EXTRACT_SPLIT
31
- ].freeze
32
- end
33
- end
34
- end
@@ -1,14 +0,0 @@
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 JobsSource
8
- API = "api"
9
- PROJECT = "project"
10
- WORKFLOW = "workflow"
11
- ALL = [API, PROJECT, WORKFLOW].freeze
12
- end
13
- end
14
- end
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This file is auto-generated by oagen. Do not edit.
4
-
5
- # typed: strong
6
-
7
- module Retab
8
- class CreateJobRequest
9
- sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
10
- def initialize(json); end
11
-
12
- sig { returns(String) }
13
- def endpoint; end
14
-
15
- sig { params(value: String).returns(String) }
16
- def endpoint=(value); end
17
-
18
- sig { returns(T::Hash[String, T.untyped]) }
19
- def request; end
20
-
21
- sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) }
22
- def request=(value); end
23
-
24
- sig { returns(T.nilable(T::Hash[String, String])) }
25
- def metadata; end
26
-
27
- sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
28
- def metadata=(value); end
29
-
30
- sig { returns(T::Hash[Symbol, T.untyped]) }
31
- def to_h; end
32
-
33
- sig { params(args: T.untyped).returns(String) }
34
- def to_json(*args); end
35
- end
36
- end