cloudmersive-ocr-api-client 1.4.7 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +7 -7
  4. data/cloudmersive-ocr-api-client.gemspec +3 -3
  5. data/docs/FormFieldDefinition.md +1 -0
  6. data/docs/ImageOcrApi.md +39 -33
  7. data/docs/PdfOcrApi.md +11 -9
  8. data/docs/PreprocessingApi.md +6 -6
  9. data/docs/ReceiptsApi.md +1 -1
  10. data/lib/cloudmersive-ocr-api-client.rb +1 -1
  11. data/lib/cloudmersive-ocr-api-client/api/image_ocr_api.rb +49 -49
  12. data/lib/cloudmersive-ocr-api-client/api/pdf_ocr_api.rb +17 -19
  13. data/lib/cloudmersive-ocr-api-client/api/preprocessing_api.rb +26 -32
  14. data/lib/cloudmersive-ocr-api-client/api/receipts_api.rb +6 -7
  15. data/lib/cloudmersive-ocr-api-client/api_client.rb +11 -9
  16. data/lib/cloudmersive-ocr-api-client/api_error.rb +1 -1
  17. data/lib/cloudmersive-ocr-api-client/configuration.rb +2 -2
  18. data/lib/cloudmersive-ocr-api-client/models/business_card_recognition_result.rb +7 -10
  19. data/lib/cloudmersive-ocr-api-client/models/field_result.rb +7 -10
  20. data/lib/cloudmersive-ocr-api-client/models/form_definition_template.rb +7 -10
  21. data/lib/cloudmersive-ocr-api-client/models/form_field_definition.rb +18 -11
  22. data/lib/cloudmersive-ocr-api-client/models/form_recognition_result.rb +7 -10
  23. data/lib/cloudmersive-ocr-api-client/models/form_table_column_definition.rb +7 -10
  24. data/lib/cloudmersive-ocr-api-client/models/form_table_definition.rb +7 -10
  25. data/lib/cloudmersive-ocr-api-client/models/get_page_angle_result.rb +7 -10
  26. data/lib/cloudmersive-ocr-api-client/models/image_to_lines_with_location_result.rb +7 -10
  27. data/lib/cloudmersive-ocr-api-client/models/image_to_text_response.rb +7 -10
  28. data/lib/cloudmersive-ocr-api-client/models/image_to_words_with_location_result.rb +7 -10
  29. data/lib/cloudmersive-ocr-api-client/models/ocr_line_element.rb +7 -10
  30. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result.rb +7 -11
  31. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_lines_with_location.rb +7 -10
  32. data/lib/cloudmersive-ocr-api-client/models/ocr_page_result_with_words_with_location.rb +7 -10
  33. data/lib/cloudmersive-ocr-api-client/models/ocr_photo_text_element.rb +7 -10
  34. data/lib/cloudmersive-ocr-api-client/models/ocr_word_element.rb +7 -10
  35. data/lib/cloudmersive-ocr-api-client/models/pdf_to_lines_with_location_result.rb +7 -10
  36. data/lib/cloudmersive-ocr-api-client/models/pdf_to_text_response.rb +7 -10
  37. data/lib/cloudmersive-ocr-api-client/models/pdf_to_words_with_location_result.rb +7 -10
  38. data/lib/cloudmersive-ocr-api-client/models/photo_to_words_with_location_result.rb +9 -13
  39. data/lib/cloudmersive-ocr-api-client/models/point.rb +7 -10
  40. data/lib/cloudmersive-ocr-api-client/models/receipt_line_item.rb +7 -10
  41. data/lib/cloudmersive-ocr-api-client/models/receipt_recognition_result.rb +7 -10
  42. data/lib/cloudmersive-ocr-api-client/models/table_cell_result.rb +7 -10
  43. data/lib/cloudmersive-ocr-api-client/models/table_result.rb +7 -10
  44. data/lib/cloudmersive-ocr-api-client/models/table_row_result.rb +7 -10
  45. data/lib/cloudmersive-ocr-api-client/version.rb +2 -2
  46. data/spec/api/image_ocr_api_spec.rb +14 -11
  47. data/spec/api/pdf_ocr_api_spec.rb +5 -5
  48. data/spec/api/preprocessing_api_spec.rb +7 -7
  49. data/spec/api/receipts_api_spec.rb +2 -2
  50. data/spec/api_client_spec.rb +52 -35
  51. data/spec/configuration_spec.rb +9 -9
  52. data/spec/models/business_card_recognition_result_spec.rb +9 -10
  53. data/spec/models/field_result_spec.rb +3 -4
  54. data/spec/models/form_definition_template_spec.rb +3 -4
  55. data/spec/models/form_field_definition_spec.rb +24 -19
  56. data/spec/models/form_recognition_result_spec.rb +6 -7
  57. data/spec/models/form_table_column_definition_spec.rb +7 -8
  58. data/spec/models/form_table_definition_spec.rb +5 -6
  59. data/spec/models/get_page_angle_result_spec.rb +3 -4
  60. data/spec/models/image_to_lines_with_location_result_spec.rb +3 -4
  61. data/spec/models/image_to_text_response_spec.rb +3 -4
  62. data/spec/models/image_to_words_with_location_result_spec.rb +3 -4
  63. data/spec/models/ocr_line_element_spec.rb +3 -4
  64. data/spec/models/ocr_page_result_spec.rb +4 -5
  65. data/spec/models/ocr_page_result_with_lines_with_location_spec.rb +4 -5
  66. data/spec/models/ocr_page_result_with_words_with_location_spec.rb +4 -5
  67. data/spec/models/ocr_photo_text_element_spec.rb +8 -9
  68. data/spec/models/ocr_word_element_spec.rb +12 -13
  69. data/spec/models/pdf_to_lines_with_location_result_spec.rb +3 -4
  70. data/spec/models/pdf_to_text_response_spec.rb +3 -4
  71. data/spec/models/pdf_to_words_with_location_result_spec.rb +3 -4
  72. data/spec/models/photo_to_words_with_location_result_spec.rb +4 -5
  73. data/spec/models/point_spec.rb +3 -4
  74. data/spec/models/receipt_line_item_spec.rb +3 -4
  75. data/spec/models/receipt_recognition_result_spec.rb +10 -11
  76. data/spec/models/table_cell_result_spec.rb +3 -4
  77. data/spec/models/table_result_spec.rb +3 -4
  78. data/spec/models/table_row_result_spec.rb +2 -3
  79. data/spec/spec_helper.rb +1 -1
  80. metadata +2 -2
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -33,7 +33,7 @@ module CloudmersiveOcrApiClient
33
33
  @config = config
34
34
  @user_agent = "Swagger-Codegen/#{VERSION}/ruby"
35
35
  @default_headers = {
36
- 'Content-Type' => "application/json",
36
+ 'Content-Type' => 'application/json',
37
37
  'User-Agent' => @user_agent
38
38
  }
39
39
  end
@@ -112,6 +112,8 @@ module CloudmersiveOcrApiClient
112
112
  :verbose => @config.debugging
113
113
  }
114
114
 
115
+ req_opts.merge!(multipart: true) if header_params['Content-Type'].start_with? "multipart/"
116
+
115
117
  # set custom cert, if provided
116
118
  req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
117
119
 
@@ -137,7 +139,7 @@ module CloudmersiveOcrApiClient
137
139
  # @param [String] mime MIME
138
140
  # @return [Boolean] True if the MIME is application/json
139
141
  def json_mime?(mime)
140
- (mime == "*/*") || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
142
+ (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
141
143
  end
142
144
 
143
145
  # Deserialize the response to the given return type.
@@ -201,12 +203,12 @@ module CloudmersiveOcrApiClient
201
203
  when /\AArray<(.+)>\z/
202
204
  # e.g. Array<Pet>
203
205
  sub_type = $1
204
- data.map {|item| convert_to_type(item, sub_type) }
206
+ data.map { |item| convert_to_type(item, sub_type) }
205
207
  when /\AHash\<String, (.+)\>\z/
206
208
  # e.g. Hash<String, Integer>
207
209
  sub_type = $1
208
210
  {}.tap do |hash|
209
- data.each {|k, v| hash[k] = convert_to_type(v, sub_type) }
211
+ data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
210
212
  end
211
213
  else
212
214
  # models, e.g. Pet
@@ -228,7 +230,7 @@ module CloudmersiveOcrApiClient
228
230
  encoding = nil
229
231
  request.on_headers do |response|
230
232
  content_disposition = response.headers['Content-Disposition']
231
- if content_disposition and content_disposition =~ /filename=/i
233
+ if content_disposition && content_disposition =~ /filename=/i
232
234
  filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
233
235
  prefix = sanitize_filename(filename)
234
236
  else
@@ -327,7 +329,7 @@ module CloudmersiveOcrApiClient
327
329
  return nil if accepts.nil? || accepts.empty?
328
330
  # use JSON when present, otherwise use all of the provided
329
331
  json_accept = accepts.find { |s| json_mime?(s) }
330
- return json_accept || accepts.join(',')
332
+ json_accept || accepts.join(',')
331
333
  end
332
334
 
333
335
  # Return Content-Type header based on an array of content types provided.
@@ -338,7 +340,7 @@ module CloudmersiveOcrApiClient
338
340
  return 'application/json' if content_types.nil? || content_types.empty?
339
341
  # use JSON when present, otherwise use the first one
340
342
  json_content_type = content_types.find { |s| json_mime?(s) }
341
- return json_content_type || content_types.first
343
+ json_content_type || content_types.first
342
344
  end
343
345
 
344
346
  # Convert object (array, hash, object, etc) to JSON string.
@@ -348,7 +350,7 @@ module CloudmersiveOcrApiClient
348
350
  return model if model.nil? || model.is_a?(String)
349
351
  local_body = nil
350
352
  if model.is_a?(Array)
351
- local_body = model.map{|m| object_to_hash(m) }
353
+ local_body = model.map { |m| object_to_hash(m) }
352
354
  else
353
355
  local_body = object_to_hash(model)
354
356
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -170,7 +170,7 @@ module CloudmersiveOcrApiClient
170
170
  def base_path=(base_path)
171
171
  # Add leading and trailing slashes to base_path
172
172
  @base_path = "/#{base_path}".gsub(/\/+/, '/')
173
- @base_path = "" if @base_path == "/"
173
+ @base_path = '' if @base_path == '/'
174
174
  end
175
175
 
176
176
  def base_url
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -39,7 +39,6 @@ module CloudmersiveOcrApiClient
39
39
  # The date and time printed on the business card (if included on the business card)
40
40
  attr_accessor :timestamp
41
41
 
42
-
43
42
  # Attribute mapping from ruby-style variable name to JSON key.
44
43
  def self.attribute_map
45
44
  {
@@ -74,7 +73,7 @@ module CloudmersiveOcrApiClient
74
73
  return unless attributes.is_a?(Hash)
75
74
 
76
75
  # convert string to symbol for hash key
77
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
76
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
78
77
 
79
78
  if attributes.has_key?(:'Successful')
80
79
  self.successful = attributes[:'Successful']
@@ -107,20 +106,19 @@ module CloudmersiveOcrApiClient
107
106
  if attributes.has_key?(:'Timestamp')
108
107
  self.timestamp = attributes[:'Timestamp']
109
108
  end
110
-
111
109
  end
112
110
 
113
111
  # Show invalid properties with the reasons. Usually used together with valid?
114
112
  # @return Array for valid properties with the reasons
115
113
  def list_invalid_properties
116
114
  invalid_properties = Array.new
117
- return invalid_properties
115
+ invalid_properties
118
116
  end
119
117
 
120
118
  # Check to see if the all the properties in the model are valid
121
119
  # @return true if the model is valid
122
120
  def valid?
123
- return true
121
+ true
124
122
  end
125
123
 
126
124
  # Checks equality by comparing each attribute.
@@ -157,10 +155,10 @@ module CloudmersiveOcrApiClient
157
155
  return nil unless attributes.is_a?(Hash)
158
156
  self.class.swagger_types.each_pair do |key, type|
159
157
  if type =~ /\AArray<(.*)>/i
160
- # check to ensure the input is an array given that the the attribute
158
+ # check to ensure the input is an array given that the attribute
161
159
  # is documented as an array but the input is not
162
160
  if attributes[self.class.attribute_map[key]].is_a?(Array)
163
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
164
162
  end
165
163
  elsif !attributes[self.class.attribute_map[key]].nil?
166
164
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -242,7 +240,7 @@ module CloudmersiveOcrApiClient
242
240
  # @return [Hash] Returns the value in the form of hash
243
241
  def _to_hash(value)
244
242
  if value.is_a?(Array)
245
- value.compact.map{ |v| _to_hash(v) }
243
+ value.compact.map { |v| _to_hash(v) }
246
244
  elsif value.is_a?(Hash)
247
245
  {}.tap do |hash|
248
246
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -255,5 +253,4 @@ module CloudmersiveOcrApiClient
255
253
  end
256
254
 
257
255
  end
258
-
259
256
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -21,7 +21,6 @@ module CloudmersiveOcrApiClient
21
21
  # Result field value(s) extracted
22
22
  attr_accessor :field_values
23
23
 
24
-
25
24
  # Attribute mapping from ruby-style variable name to JSON key.
26
25
  def self.attribute_map
27
26
  {
@@ -44,7 +43,7 @@ module CloudmersiveOcrApiClient
44
43
  return unless attributes.is_a?(Hash)
45
44
 
46
45
  # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
47
 
49
48
  if attributes.has_key?(:'TargetField')
50
49
  self.target_field = attributes[:'TargetField']
@@ -55,20 +54,19 @@ module CloudmersiveOcrApiClient
55
54
  self.field_values = value
56
55
  end
57
56
  end
58
-
59
57
  end
60
58
 
61
59
  # Show invalid properties with the reasons. Usually used together with valid?
62
60
  # @return Array for valid properties with the reasons
63
61
  def list_invalid_properties
64
62
  invalid_properties = Array.new
65
- return invalid_properties
63
+ invalid_properties
66
64
  end
67
65
 
68
66
  # Check to see if the all the properties in the model are valid
69
67
  # @return true if the model is valid
70
68
  def valid?
71
- return true
69
+ true
72
70
  end
73
71
 
74
72
  # Checks equality by comparing each attribute.
@@ -99,10 +97,10 @@ module CloudmersiveOcrApiClient
99
97
  return nil unless attributes.is_a?(Hash)
100
98
  self.class.swagger_types.each_pair do |key, type|
101
99
  if type =~ /\AArray<(.*)>/i
102
- # check to ensure the input is an array given that the the attribute
100
+ # check to ensure the input is an array given that the attribute
103
101
  # is documented as an array but the input is not
104
102
  if attributes[self.class.attribute_map[key]].is_a?(Array)
105
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
106
104
  end
107
105
  elsif !attributes[self.class.attribute_map[key]].nil?
108
106
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -184,7 +182,7 @@ module CloudmersiveOcrApiClient
184
182
  # @return [Hash] Returns the value in the form of hash
185
183
  def _to_hash(value)
186
184
  if value.is_a?(Array)
187
- value.compact.map{ |v| _to_hash(v) }
185
+ value.compact.map { |v| _to_hash(v) }
188
186
  elsif value.is_a?(Hash)
189
187
  {}.tap do |hash|
190
188
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -197,5 +195,4 @@ module CloudmersiveOcrApiClient
197
195
  end
198
196
 
199
197
  end
200
-
201
198
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -21,7 +21,6 @@ module CloudmersiveOcrApiClient
21
21
  # Table definitions in the template; a table is comprised of columns and rows and exists in a 2-dimensional layout; a common example of a table would be an invoice
22
22
  attr_accessor :table_definitions
23
23
 
24
-
25
24
  # Attribute mapping from ruby-style variable name to JSON key.
26
25
  def self.attribute_map
27
26
  {
@@ -44,7 +43,7 @@ module CloudmersiveOcrApiClient
44
43
  return unless attributes.is_a?(Hash)
45
44
 
46
45
  # convert string to symbol for hash key
47
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
47
 
49
48
  if attributes.has_key?(:'FieldDefinitions')
50
49
  if (value = attributes[:'FieldDefinitions']).is_a?(Array)
@@ -57,20 +56,19 @@ module CloudmersiveOcrApiClient
57
56
  self.table_definitions = value
58
57
  end
59
58
  end
60
-
61
59
  end
62
60
 
63
61
  # Show invalid properties with the reasons. Usually used together with valid?
64
62
  # @return Array for valid properties with the reasons
65
63
  def list_invalid_properties
66
64
  invalid_properties = Array.new
67
- return invalid_properties
65
+ invalid_properties
68
66
  end
69
67
 
70
68
  # Check to see if the all the properties in the model are valid
71
69
  # @return true if the model is valid
72
70
  def valid?
73
- return true
71
+ true
74
72
  end
75
73
 
76
74
  # Checks equality by comparing each attribute.
@@ -101,10 +99,10 @@ module CloudmersiveOcrApiClient
101
99
  return nil unless attributes.is_a?(Hash)
102
100
  self.class.swagger_types.each_pair do |key, type|
103
101
  if type =~ /\AArray<(.*)>/i
104
- # check to ensure the input is an array given that the the attribute
102
+ # check to ensure the input is an array given that the attribute
105
103
  # is documented as an array but the input is not
106
104
  if attributes[self.class.attribute_map[key]].is_a?(Array)
107
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
105
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
106
  end
109
107
  elsif !attributes[self.class.attribute_map[key]].nil?
110
108
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -186,7 +184,7 @@ module CloudmersiveOcrApiClient
186
184
  # @return [Hash] Returns the value in the form of hash
187
185
  def _to_hash(value)
188
186
  if value.is_a?(Array)
189
- value.compact.map{ |v| _to_hash(v) }
187
+ value.compact.map { |v| _to_hash(v) }
190
188
  elsif value.is_a?(Hash)
191
189
  {}.tap do |hash|
192
190
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -199,5 +197,4 @@ module CloudmersiveOcrApiClient
199
197
  end
200
198
 
201
199
  end
202
-
203
200
  end
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
9
+ Swagger Codegen version: 2.4.14
10
10
 
11
11
  =end
12
12
 
@@ -27,6 +27,9 @@ module CloudmersiveOcrApiClient
27
27
  # Optional - the bottom anchor of the field
28
28
  attr_accessor :bottom_anchor
29
29
 
30
+ # Optional - alterate match text for the specified anchor
31
+ attr_accessor :alternate_anchor
32
+
30
33
  # Optional - the matching mode for the anchor. Possible values are Complete (requires the entire anchor to match) and Partial (allows only part of the anchor to match) and Horizontal (anchor must be laid out horizontally). Default is Partial.
31
34
  attr_accessor :anchor_mode
32
35
 
@@ -66,7 +69,6 @@ module CloudmersiveOcrApiClient
66
69
  # Optional - additional options that can be set for this field definition, separated by commas. Possible values are AllowMultiMatch (allow the same anchor to be matched to multiple fields)
67
70
  attr_accessor :options
68
71
 
69
-
70
72
  # Attribute mapping from ruby-style variable name to JSON key.
71
73
  def self.attribute_map
72
74
  {
@@ -74,6 +76,7 @@ module CloudmersiveOcrApiClient
74
76
  :'left_anchor' => :'LeftAnchor',
75
77
  :'top_anchor' => :'TopAnchor',
76
78
  :'bottom_anchor' => :'BottomAnchor',
79
+ :'alternate_anchor' => :'AlternateAnchor',
77
80
  :'anchor_mode' => :'AnchorMode',
78
81
  :'data_type' => :'DataType',
79
82
  :'target_digit_count' => :'TargetDigitCount',
@@ -97,6 +100,7 @@ module CloudmersiveOcrApiClient
97
100
  :'left_anchor' => :'String',
98
101
  :'top_anchor' => :'String',
99
102
  :'bottom_anchor' => :'String',
103
+ :'alternate_anchor' => :'String',
100
104
  :'anchor_mode' => :'String',
101
105
  :'data_type' => :'String',
102
106
  :'target_digit_count' => :'Integer',
@@ -119,7 +123,7 @@ module CloudmersiveOcrApiClient
119
123
  return unless attributes.is_a?(Hash)
120
124
 
121
125
  # convert string to symbol for hash key
122
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
126
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
123
127
 
124
128
  if attributes.has_key?(:'FieldID')
125
129
  self.field_id = attributes[:'FieldID']
@@ -137,6 +141,10 @@ module CloudmersiveOcrApiClient
137
141
  self.bottom_anchor = attributes[:'BottomAnchor']
138
142
  end
139
143
 
144
+ if attributes.has_key?(:'AlternateAnchor')
145
+ self.alternate_anchor = attributes[:'AlternateAnchor']
146
+ end
147
+
140
148
  if attributes.has_key?(:'AnchorMode')
141
149
  self.anchor_mode = attributes[:'AnchorMode']
142
150
  end
@@ -190,20 +198,19 @@ module CloudmersiveOcrApiClient
190
198
  if attributes.has_key?(:'Options')
191
199
  self.options = attributes[:'Options']
192
200
  end
193
-
194
201
  end
195
202
 
196
203
  # Show invalid properties with the reasons. Usually used together with valid?
197
204
  # @return Array for valid properties with the reasons
198
205
  def list_invalid_properties
199
206
  invalid_properties = Array.new
200
- return invalid_properties
207
+ invalid_properties
201
208
  end
202
209
 
203
210
  # Check to see if the all the properties in the model are valid
204
211
  # @return true if the model is valid
205
212
  def valid?
206
- return true
213
+ true
207
214
  end
208
215
 
209
216
  # Checks equality by comparing each attribute.
@@ -215,6 +222,7 @@ module CloudmersiveOcrApiClient
215
222
  left_anchor == o.left_anchor &&
216
223
  top_anchor == o.top_anchor &&
217
224
  bottom_anchor == o.bottom_anchor &&
225
+ alternate_anchor == o.alternate_anchor &&
218
226
  anchor_mode == o.anchor_mode &&
219
227
  data_type == o.data_type &&
220
228
  target_digit_count == o.target_digit_count &&
@@ -239,7 +247,7 @@ module CloudmersiveOcrApiClient
239
247
  # Calculates hash code according to all attributes.
240
248
  # @return [Fixnum] Hash code
241
249
  def hash
242
- [field_id, left_anchor, top_anchor, bottom_anchor, anchor_mode, data_type, target_digit_count, minimum_character_count, allow_numeric_digits, vertical_alignment_type, horizontal_alignment_type, target_field_width_relative, target_field_height_relative, target_field_horizontal_adjustment, target_field_vertical_adjustment, ignore, options].hash
250
+ [field_id, left_anchor, top_anchor, bottom_anchor, alternate_anchor, anchor_mode, data_type, target_digit_count, minimum_character_count, allow_numeric_digits, vertical_alignment_type, horizontal_alignment_type, target_field_width_relative, target_field_height_relative, target_field_horizontal_adjustment, target_field_vertical_adjustment, ignore, options].hash
243
251
  end
244
252
 
245
253
  # Builds the object from hash
@@ -249,10 +257,10 @@ module CloudmersiveOcrApiClient
249
257
  return nil unless attributes.is_a?(Hash)
250
258
  self.class.swagger_types.each_pair do |key, type|
251
259
  if type =~ /\AArray<(.*)>/i
252
- # check to ensure the input is an array given that the the attribute
260
+ # check to ensure the input is an array given that the attribute
253
261
  # is documented as an array but the input is not
254
262
  if attributes[self.class.attribute_map[key]].is_a?(Array)
255
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
263
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
256
264
  end
257
265
  elsif !attributes[self.class.attribute_map[key]].nil?
258
266
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -334,7 +342,7 @@ module CloudmersiveOcrApiClient
334
342
  # @return [Hash] Returns the value in the form of hash
335
343
  def _to_hash(value)
336
344
  if value.is_a?(Array)
337
- value.compact.map{ |v| _to_hash(v) }
345
+ value.compact.map { |v| _to_hash(v) }
338
346
  elsif value.is_a?(Hash)
339
347
  {}.tap do |hash|
340
348
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -347,5 +355,4 @@ module CloudmersiveOcrApiClient
347
355
  end
348
356
 
349
357
  end
350
-
351
358
  end