Class: FlatApi::OmrJobCreation
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- FlatApi::OmrJobCreation
- Defined in:
- lib/flat_api/models/omr_job_creation.rb
Overview
Parameters to create an OMR job. Send without files to create a draft (then add files with addOmrJobFile and run startOmrJob), or include files and autoStart: true to import in a single request.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#auto_start ⇒ Object
Start processing immediately.
-
#collection ⇒ Object
Target collection ID.
-
#files ⇒ Object
Optional inline inputs for a one-shot import.
-
#idempotency_key ⇒ Object
Optional client-supplied key.
-
#interactive_steps ⇒ Object
Steps at which the pipeline should pause for this client.
-
#locales ⇒ Object
Locale hints (BCP 47) to improve text and lyric detection, for example
[\"ja\", \"en\"]. -
#output ⇒ Object
Returns the value of attribute output.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OmrJobCreation
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ OmrJobCreation
Initializes the object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 105 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `FlatApi::OmrJobCreation` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `FlatApi::OmrJobCreation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'output') self.output = attributes[:'output'] else self.output = 'library' end if attributes.key?(:'interactive_steps') if (value = attributes[:'interactive_steps']).is_a?(Array) self.interactive_steps = value end end if attributes.key?(:'locales') if (value = attributes[:'locales']).is_a?(Array) self.locales = value end end if attributes.key?(:'collection') self.collection = attributes[:'collection'] end if attributes.key?(:'idempotency_key') self.idempotency_key = attributes[:'idempotency_key'] end if attributes.key?(:'files') if (value = attributes[:'files']).is_a?(Array) self.files = value end end if attributes.key?(:'auto_start') self.auto_start = attributes[:'auto_start'] end end |
Instance Attribute Details
#auto_start ⇒ Object
Start processing immediately. Only valid when files is provided.
37 38 39 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 37 def auto_start @auto_start end |
#collection ⇒ Object
Target collection ID. Only used when output is library.
28 29 30 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 28 def collection @collection end |
#files ⇒ Object
Optional inline inputs for a one-shot import. For multi-image or mobile capture, omit this and use addOmrJobFile.
34 35 36 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 34 def files @files end |
#idempotency_key ⇒ Object
Optional client-supplied key. A retry with the same key returns the existing job instead of creating a duplicate, for safe retries on flaky networks.
31 32 33 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 31 def idempotency_key @idempotency_key end |
#interactive_steps ⇒ Object
Steps at which the pipeline should pause for this client. Omit or send [] for a fully automatic import. The server only pauses at the steps listed here; declare only steps your client can actually render.
22 23 24 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 22 def interactive_steps @interactive_steps end |
#locales ⇒ Object
Locale hints (BCP 47) to improve text and lyric detection, for example [\"ja\", \"en\"]. The first entry drives the OCR reader. This is the input hint; the detected main language is confirmed later at the details step.
25 26 27 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 25 def locales @locales end |
#output ⇒ Object
Returns the value of attribute output.
19 20 21 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 19 def output @output end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
75 76 77 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 75 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
80 81 82 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 80 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 62 def self.attribute_map { :'output' => :'output', :'interactive_steps' => :'interactiveSteps', :'locales' => :'locales', :'collection' => :'collection', :'idempotency_key' => :'idempotencyKey', :'files' => :'files', :'auto_start' => :'autoStart' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 200 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
98 99 100 101 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 98 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 85 def self.openapi_types { :'output' => :'OmrJobOutput', :'interactive_steps' => :'Array<OmrStepName>', :'locales' => :'Array<String>', :'collection' => :'String', :'idempotency_key' => :'String', :'files' => :'Array<OmrJobInputFile>', :'auto_start' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 173 def ==(o) return true if self.equal?(o) self.class == o.class && output == o.output && interactive_steps == o.interactive_steps && locales == o.locales && collection == o.collection && idempotency_key == o.idempotency_key && files == o.files && auto_start == o.auto_start end |
#eql?(o) ⇒ Boolean
187 188 189 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 187 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
193 194 195 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 193 def hash [output, interactive_steps, locales, collection, idempotency_key, files, auto_start].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
158 159 160 161 162 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 158 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 222 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
166 167 168 169 |
# File 'lib/flat_api/models/omr_job_creation.rb', line 166 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |