docspring 4.7.0 → 4.8.0

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 (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +18 -1
  4. data/lib/docspring/api/client.rb +1354 -123
  5. data/lib/docspring/api_client.rb +1 -1
  6. data/lib/docspring/models/add_page_numbers_request.rb +279 -0
  7. data/lib/docspring/models/ask_support_help_request.rb +1 -1
  8. data/lib/docspring/models/base64_job_source.rb +222 -0
  9. data/lib/docspring/models/combined_pdf_job_source.rb +222 -0
  10. data/lib/docspring/models/compress_pdf_request.rb +207 -0
  11. data/lib/docspring/models/create_template_request.rb +22 -2
  12. data/lib/docspring/models/custom_file_job_source.rb +222 -0
  13. data/lib/docspring/models/decrypt_pdf_request.rb +217 -0
  14. data/lib/docspring/models/encrypt_pdf_request.rb +237 -0
  15. data/lib/docspring/models/error_info.rb +15 -5
  16. data/lib/docspring/models/extract_pages_request.rb +234 -0
  17. data/lib/docspring/models/field.rb +1 -1
  18. data/lib/docspring/models/field_input.rb +1 -1
  19. data/lib/docspring/models/flatten_pdf_request.rb +207 -0
  20. data/lib/docspring/models/html_engine_options.rb +1 -1
  21. data/lib/docspring/models/html_engine_options_input.rb +1 -1
  22. data/lib/docspring/models/htmlto_pdf_request.rb +322 -0
  23. data/lib/docspring/models/image_format.rb +41 -0
  24. data/lib/docspring/models/images_to_pdf_request.rb +241 -0
  25. data/lib/docspring/models/job.rb +508 -0
  26. data/lib/docspring/models/job_file.rb +308 -0
  27. data/lib/docspring/models/job_file_job_source.rb +232 -0
  28. data/lib/docspring/models/job_html_engine.rb +41 -0
  29. data/lib/docspring/models/job_list.rb +200 -0
  30. data/lib/docspring/models/job_operation.rb +53 -0
  31. data/lib/docspring/models/job_operation_filter.rb +53 -0
  32. data/lib/docspring/models/job_options.rb +392 -0
  33. data/lib/docspring/models/job_page_margin.rb +198 -0
  34. data/lib/docspring/models/job_page_size.rb +51 -0
  35. data/lib/docspring/models/job_source.rb +267 -0
  36. data/lib/docspring/models/job_source_input.rb +66 -0
  37. data/lib/docspring/models/job_source_type.rb +46 -0
  38. data/lib/docspring/models/job_state.rb +42 -0
  39. data/lib/docspring/models/markdown_to_pdf_request.rb +312 -0
  40. data/lib/docspring/models/page_image.rb +3 -3
  41. data/lib/docspring/models/page_number_position.rb +45 -0
  42. data/lib/docspring/models/page_size.rb +45 -0
  43. data/lib/docspring/models/pdf_permissions.rb +198 -0
  44. data/lib/docspring/models/pdf_permissions_input.rb +198 -0
  45. data/lib/docspring/models/pdfto_images_request.rb +269 -0
  46. data/lib/docspring/models/pdfto_text_request.rb +217 -0
  47. data/lib/docspring/models/rotate_pages_request.rb +244 -0
  48. data/lib/docspring/models/split_pdf_request.rb +229 -0
  49. data/lib/docspring/models/submission_job_source.rb +222 -0
  50. data/lib/docspring/models/template.rb +41 -2
  51. data/lib/docspring/models/template_blank_page.rb +212 -0
  52. data/lib/docspring/models/template_blank_page_input.rb +212 -0
  53. data/lib/docspring/models/template_document.rb +1 -1
  54. data/lib/docspring/models/template_html_engine.rb +41 -0
  55. data/lib/docspring/models/template_page_images.rb +3 -3
  56. data/lib/docspring/models/template_page_list.rb +243 -0
  57. data/lib/docspring/models/template_page_list_input.rb +243 -0
  58. data/lib/docspring/models/template_page_processing_status.rb +28 -1
  59. data/lib/docspring/models/update_template_request.rb +33 -2
  60. data/lib/docspring/models/upload_job_source.rb +222 -0
  61. data/lib/docspring/models/url_job_source.rb +222 -0
  62. data/lib/docspring/models/watermark_layer.rb +41 -0
  63. data/lib/docspring/models/watermark_pdf_request.rb +316 -0
  64. data/lib/docspring/models/webhook_event_type.rb +4 -1
  65. data/lib/docspring/request_schemas.json +1997 -45
  66. data/lib/docspring/version.rb +1 -1
  67. data/lib/docspring.rb +45 -0
  68. metadata +46 -1
@@ -0,0 +1,322 @@
1
+ =begin
2
+ #DocSpring API
3
+
4
+ #Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
5
+
6
+ The version of the OpenAPI document: v2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0-DOCSPRING
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DocSpring
17
+ # A page of HTML to convert to PDF, as `html` or as a file in `input` (one of them), with the page's settings. The Standard engine converts it unless you ask for Chromium: it doesn't run JavaScript, so a page with a script element fails with a message that says to send `engine` `chromium`. Images, stylesheets and fonts the page links to are downloaded, and on the Standard engine a link that can't be downloaded fails the job with a message naming it.
18
+ class HTMLToPdfRequest < ApiModelBase
19
+ # The file the job reads. The job shows it as `inputs[0]`.
20
+ attr_accessor :input
21
+
22
+ # Your own data about the job, such as an ID from your app. Up to 50 keys.
23
+ attr_accessor :metadata
24
+
25
+ # Seconds after the job finishes until its files are deleted, up to 10 years (315360000), sooner or later than the account's expiry setting. Defaults to the account's expiry setting for the PDF tools, which keeps them until you delete the job when it's off. A job that fails is kept for at least 48 hours.
26
+ attr_accessor :expires_in
27
+
28
+ # The page's HTML, with its CSS in `<style>` elements or linked stylesheets. Up to 10 MB. The request body as a whole is limited to 10 MB too, so send a large page as a file in `input` (also up to 10 MB).
29
+ attr_accessor :html
30
+
31
+ # What converts the page. `standard` (the default) is DocSpring's own engine: fast, and it doesn't run JavaScript. `chromium` prints the page with Chromium, which runs its JavaScript.
32
+ attr_accessor :engine
33
+
34
+ # The scale Chromium prints the page at. Default 1. Only with `engine` `chromium`.
35
+ attr_accessor :scale
36
+
37
+ # HTML printed in each page's top margin. An element with the class `pageNumber`, `totalPages` or `date` gets the page's number, the number of pages or today's date. Give its text a `font-size`.
38
+ attr_accessor :header_html
39
+
40
+ # HTML printed in each page's bottom margin, with the same classes as `header_html`.
41
+ attr_accessor :footer_html
42
+
43
+ # The paper size. Default `Letter`. Don't send it with `width` and `height`.
44
+ attr_accessor :page_size
45
+
46
+ # A custom page's width, such as `8.5in` or `210mm`. Send it with `height`.
47
+ attr_accessor :width
48
+
49
+ # A custom page's height, such as `11in` or `297mm`. Send it with `width`.
50
+ attr_accessor :height
51
+
52
+ # Turn the page on its side. Default false.
53
+ attr_accessor :landscape
54
+
55
+ # The page's margins. Each side's default is `1in`.
56
+ attr_accessor :margin
57
+
58
+ # Print the page's own background (what `html` or `body` sets). Default false.
59
+ attr_accessor :print_background
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
82
+
83
+ # Attribute mapping from ruby-style variable name to JSON key.
84
+ def self.attribute_map
85
+ {
86
+ :'input' => :'input',
87
+ :'metadata' => :'metadata',
88
+ :'expires_in' => :'expires_in',
89
+ :'html' => :'html',
90
+ :'engine' => :'engine',
91
+ :'scale' => :'scale',
92
+ :'header_html' => :'header_html',
93
+ :'footer_html' => :'footer_html',
94
+ :'page_size' => :'page_size',
95
+ :'width' => :'width',
96
+ :'height' => :'height',
97
+ :'landscape' => :'landscape',
98
+ :'margin' => :'margin',
99
+ :'print_background' => :'print_background'
100
+ }
101
+ end
102
+
103
+ # Returns attribute mapping this model knows about
104
+ def self.acceptable_attribute_map
105
+ attribute_map
106
+ end
107
+
108
+ # Returns all the JSON keys this model knows about
109
+ def self.acceptable_attributes
110
+ acceptable_attribute_map.values
111
+ end
112
+
113
+ # Attribute type mapping.
114
+ def self.openapi_types
115
+ {
116
+ :'input' => :'JobSourceInput',
117
+ :'metadata' => :'Hash<String, Object>',
118
+ :'expires_in' => :'Integer',
119
+ :'html' => :'String',
120
+ :'engine' => :'JobHtmlEngine',
121
+ :'scale' => :'Float',
122
+ :'header_html' => :'String',
123
+ :'footer_html' => :'String',
124
+ :'page_size' => :'JobPageSize',
125
+ :'width' => :'String',
126
+ :'height' => :'String',
127
+ :'landscape' => :'Boolean',
128
+ :'margin' => :'JobPageMargin',
129
+ :'print_background' => :'Boolean'
130
+ }
131
+ end
132
+
133
+ # List of attributes with nullable: true
134
+ def self.openapi_nullable
135
+ Set.new([
136
+ ])
137
+ end
138
+
139
+ # Returns attribute type mapping
140
+ def self.acceptable_openapi_types
141
+ openapi_types
142
+ end
143
+
144
+ # Returns the nullable attributes
145
+ def self.acceptable_openapi_nullable
146
+ openapi_nullable
147
+ end
148
+
149
+ # Initializes the object
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ def initialize(attributes = {})
152
+ if (!attributes.is_a?(Hash))
153
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::HTMLToPdfRequest` initialize method"
154
+ end
155
+
156
+ # check to see if the attribute exists and convert string to symbol for hash key
157
+ acceptable_attribute_map = self.class.acceptable_attribute_map
158
+ attributes = attributes.each_with_object({}) { |(k, v), h|
159
+ if (!acceptable_attribute_map.key?(k.to_sym))
160
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::HTMLToPdfRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
161
+ end
162
+ h[k.to_sym] = v
163
+ }
164
+
165
+ if attributes.key?(:'input')
166
+ self.input = attributes[:'input']
167
+ end
168
+
169
+ if attributes.key?(:'metadata')
170
+ if (value = attributes[:'metadata']).is_a?(Hash)
171
+ self.metadata = value
172
+ end
173
+ end
174
+
175
+ if attributes.key?(:'expires_in')
176
+ self.expires_in = attributes[:'expires_in']
177
+ end
178
+
179
+ if attributes.key?(:'html')
180
+ self.html = attributes[:'html']
181
+ end
182
+
183
+ if attributes.key?(:'engine')
184
+ self.engine = attributes[:'engine']
185
+ end
186
+
187
+ if attributes.key?(:'scale')
188
+ self.scale = attributes[:'scale']
189
+ end
190
+
191
+ if attributes.key?(:'header_html')
192
+ self.header_html = attributes[:'header_html']
193
+ end
194
+
195
+ if attributes.key?(:'footer_html')
196
+ self.footer_html = attributes[:'footer_html']
197
+ end
198
+
199
+ if attributes.key?(:'page_size')
200
+ self.page_size = attributes[:'page_size']
201
+ end
202
+
203
+ if attributes.key?(:'width')
204
+ self.width = attributes[:'width']
205
+ end
206
+
207
+ if attributes.key?(:'height')
208
+ self.height = attributes[:'height']
209
+ end
210
+
211
+ if attributes.key?(:'landscape')
212
+ self.landscape = attributes[:'landscape']
213
+ end
214
+
215
+ if attributes.key?(:'margin')
216
+ self.margin = attributes[:'margin']
217
+ end
218
+
219
+ if attributes.key?(:'print_background')
220
+ self.print_background = attributes[:'print_background']
221
+ end
222
+ end
223
+
224
+ # Show invalid properties with the reasons. Usually used together with valid?
225
+ # @return Array for valid properties with the reasons
226
+ def list_invalid_properties
227
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
228
+ invalid_properties = Array.new
229
+ invalid_properties
230
+ end
231
+
232
+ # Check to see if the all the properties in the model are valid
233
+ # @return true if the model is valid
234
+ def valid?
235
+ warn '[DEPRECATED] the `valid?` method is obsolete'
236
+ true
237
+ end
238
+
239
+ # Checks equality by comparing each attribute.
240
+ # @param [Object] Object to be compared
241
+ def ==(o)
242
+ return true if self.equal?(o)
243
+ self.class == o.class &&
244
+ input == o.input &&
245
+ metadata == o.metadata &&
246
+ expires_in == o.expires_in &&
247
+ html == o.html &&
248
+ engine == o.engine &&
249
+ scale == o.scale &&
250
+ header_html == o.header_html &&
251
+ footer_html == o.footer_html &&
252
+ page_size == o.page_size &&
253
+ width == o.width &&
254
+ height == o.height &&
255
+ landscape == o.landscape &&
256
+ margin == o.margin &&
257
+ print_background == o.print_background
258
+ end
259
+
260
+ # @see the `==` method
261
+ # @param [Object] Object to be compared
262
+ def eql?(o)
263
+ self == o
264
+ end
265
+
266
+ # Calculates hash code according to all attributes.
267
+ # @return [Integer] Hash code
268
+ def hash
269
+ [input, metadata, expires_in, html, engine, scale, header_html, footer_html, page_size, width, height, landscape, margin, print_background].hash
270
+ end
271
+
272
+ # Builds the object from hash
273
+ # @param [Hash] attributes Model attributes in the form of hash
274
+ # @return [Object] Returns the model itself
275
+ def self.build_from_hash(attributes)
276
+ return nil unless attributes.is_a?(Hash)
277
+ attributes = attributes.transform_keys(&:to_sym)
278
+ # include attributes inherited from allOf parents (the nearest declaration wins)
279
+ map = acceptable_attribute_map
280
+ transformed_hash = {}
281
+ acceptable_openapi_types.each_pair do |key, type|
282
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
283
+ transformed_hash["#{key}"] = nil
284
+ elsif type =~ /\AArray<(.*)>/i
285
+ # check to ensure the input is an array given that the attribute
286
+ # is documented as an array but the input is not
287
+ if attributes[map[key]].is_a?(Array)
288
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
289
+ end
290
+ elsif !attributes[map[key]].nil?
291
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
292
+ end
293
+ end
294
+ # Responses can include enum values added after this client was released, so the enum setters
295
+ # accept any value while the model is built from a response
296
+ allocate.tap do |model|
297
+ model.instance_variable_set(:@_skip_enum_validation, true)
298
+ model.send(:initialize, transformed_hash)
299
+ model.remove_instance_variable(:@_skip_enum_validation)
300
+ end
301
+ end
302
+
303
+ # Returns the object in the form of hash
304
+ # @return [Hash] Returns the object in the form of hash
305
+ def to_hash
306
+ hash = {}
307
+ # include attributes inherited from allOf parents (the nearest declaration wins)
308
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
309
+ value = self.send(attr)
310
+ if value.nil?
311
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
312
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
313
+ end
314
+
315
+ hash[param] = _to_hash(value)
316
+ end
317
+ hash
318
+ end
319
+
320
+ end
321
+
322
+ end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #DocSpring API
3
+
4
+ #Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
5
+
6
+ The version of the OpenAPI document: v2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0-DOCSPRING
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DocSpring
17
+ class ImageFormat
18
+ PNG = "png".freeze
19
+ JPG = "jpg".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [PNG, JPG].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ # Only responses are built from hashes, and a value added to the API after this client was released is kept as it
37
+ # is: the constants are the values this client knows
38
+ value
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,241 @@
1
+ =begin
2
+ #DocSpring API
3
+
4
+ #Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
5
+
6
+ The version of the OpenAPI document: v2
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0-DOCSPRING
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DocSpring
17
+ # The PNG and JPEG images, one per page, in order.
18
+ class ImagesToPdfRequest < ApiModelBase
19
+ # The files the job reads, in order. Empty for an html_to_pdf or markdown_to_pdf job whose request sent the document itself.
20
+ attr_accessor :inputs
21
+
22
+ # Your own data about the job, such as an ID from your app. Up to 50 keys.
23
+ attr_accessor :metadata
24
+
25
+ # Seconds after the job finishes until its files are deleted, up to 10 years (315360000), sooner or later than the account's expiry setting. Defaults to the account's expiry setting for the PDF tools, which keeps them until you delete the job when it's off. A job that fails is kept for at least 48 hours.
26
+ attr_accessor :expires_in
27
+
28
+ # Each page's size: `fit` (the default) makes each page the size of its image. A paper size centers each image on a page of that size, landscape for an image wider than it is tall, and shrinks an image only when it's larger than the page.
29
+ attr_accessor :page_size
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'inputs' => :'inputs',
57
+ :'metadata' => :'metadata',
58
+ :'expires_in' => :'expires_in',
59
+ :'page_size' => :'page_size'
60
+ }
61
+ end
62
+
63
+ # Returns attribute mapping this model knows about
64
+ def self.acceptable_attribute_map
65
+ attribute_map
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ acceptable_attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'inputs' => :'Array<JobSourceInput>',
77
+ :'metadata' => :'Hash<String, Object>',
78
+ :'expires_in' => :'Integer',
79
+ :'page_size' => :'PageSize'
80
+ }
81
+ end
82
+
83
+ # List of attributes with nullable: true
84
+ def self.openapi_nullable
85
+ Set.new([
86
+ ])
87
+ end
88
+
89
+ # Returns attribute type mapping
90
+ def self.acceptable_openapi_types
91
+ openapi_types
92
+ end
93
+
94
+ # Returns the nullable attributes
95
+ def self.acceptable_openapi_nullable
96
+ openapi_nullable
97
+ end
98
+
99
+ # Initializes the object
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ def initialize(attributes = {})
102
+ if (!attributes.is_a?(Hash))
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::ImagesToPdfRequest` initialize method"
104
+ end
105
+
106
+ # check to see if the attribute exists and convert string to symbol for hash key
107
+ acceptable_attribute_map = self.class.acceptable_attribute_map
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!acceptable_attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::ImagesToPdfRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'inputs')
116
+ if (value = attributes[:'inputs']).is_a?(Array)
117
+ self.inputs = value
118
+ end
119
+ else
120
+ self.inputs = nil
121
+ end
122
+
123
+ if attributes.key?(:'metadata')
124
+ if (value = attributes[:'metadata']).is_a?(Hash)
125
+ self.metadata = value
126
+ end
127
+ end
128
+
129
+ if attributes.key?(:'expires_in')
130
+ self.expires_in = attributes[:'expires_in']
131
+ end
132
+
133
+ if attributes.key?(:'page_size')
134
+ self.page_size = attributes[:'page_size']
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
+ invalid_properties = Array.new
143
+ if @inputs.nil?
144
+ invalid_properties.push('invalid value for "inputs", inputs cannot be nil.')
145
+ end
146
+
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ return false if @inputs.nil?
155
+ true
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] inputs Value to be assigned
160
+ def inputs=(inputs)
161
+ if inputs.nil?
162
+ fail ArgumentError, 'inputs cannot be nil'
163
+ end
164
+
165
+ @inputs = inputs
166
+ end
167
+
168
+ # Checks equality by comparing each attribute.
169
+ # @param [Object] Object to be compared
170
+ def ==(o)
171
+ return true if self.equal?(o)
172
+ self.class == o.class &&
173
+ inputs == o.inputs &&
174
+ metadata == o.metadata &&
175
+ expires_in == o.expires_in &&
176
+ page_size == o.page_size
177
+ end
178
+
179
+ # @see the `==` method
180
+ # @param [Object] Object to be compared
181
+ def eql?(o)
182
+ self == o
183
+ end
184
+
185
+ # Calculates hash code according to all attributes.
186
+ # @return [Integer] Hash code
187
+ def hash
188
+ [inputs, metadata, expires_in, page_size].hash
189
+ end
190
+
191
+ # Builds the object from hash
192
+ # @param [Hash] attributes Model attributes in the form of hash
193
+ # @return [Object] Returns the model itself
194
+ def self.build_from_hash(attributes)
195
+ return nil unless attributes.is_a?(Hash)
196
+ attributes = attributes.transform_keys(&:to_sym)
197
+ # include attributes inherited from allOf parents (the nearest declaration wins)
198
+ map = acceptable_attribute_map
199
+ transformed_hash = {}
200
+ acceptable_openapi_types.each_pair do |key, type|
201
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
202
+ transformed_hash["#{key}"] = nil
203
+ elsif type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[map[key]].is_a?(Array)
207
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
208
+ end
209
+ elsif !attributes[map[key]].nil?
210
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
211
+ end
212
+ end
213
+ # Responses can include enum values added after this client was released, so the enum setters
214
+ # accept any value while the model is built from a response
215
+ allocate.tap do |model|
216
+ model.instance_variable_set(:@_skip_enum_validation, true)
217
+ model.send(:initialize, transformed_hash)
218
+ model.remove_instance_variable(:@_skip_enum_validation)
219
+ end
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ # include attributes inherited from allOf parents (the nearest declaration wins)
227
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ end
240
+
241
+ end