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,200 @@
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 jobs, newest first.
18
+ class JobList < ApiModelBase
19
+ # The items on this page.
20
+ attr_accessor :data
21
+
22
+ # Pass it as `cursor` to get the next page. Null on the last page.
23
+ attr_accessor :next_cursor
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'data' => :'data',
29
+ :'next_cursor' => :'next_cursor'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'data' => :'Array<Job>',
47
+ :'next_cursor' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ :'next_cursor'
55
+ ])
56
+ end
57
+
58
+ # Returns attribute type mapping
59
+ def self.acceptable_openapi_types
60
+ openapi_types
61
+ end
62
+
63
+ # Returns the nullable attributes
64
+ def self.acceptable_openapi_nullable
65
+ openapi_nullable
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::JobList` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::JobList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'data')
85
+ if (value = attributes[:'data']).is_a?(Array)
86
+ self.data = value
87
+ end
88
+ else
89
+ self.data = nil
90
+ end
91
+
92
+ if attributes.key?(:'next_cursor')
93
+ self.next_cursor = attributes[:'next_cursor']
94
+ else
95
+ self.next_cursor = nil
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
+ invalid_properties = Array.new
104
+ if @data.nil?
105
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
106
+ end
107
+
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ return false if @data.nil?
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] data Value to be assigned
121
+ def data=(data)
122
+ if data.nil?
123
+ fail ArgumentError, 'data cannot be nil'
124
+ end
125
+
126
+ @data = data
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ data == o.data &&
135
+ next_cursor == o.next_cursor
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [data, next_cursor].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ # include attributes inherited from allOf parents (the nearest declaration wins)
157
+ map = acceptable_attribute_map
158
+ transformed_hash = {}
159
+ acceptable_openapi_types.each_pair do |key, type|
160
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
170
+ end
171
+ end
172
+ # Responses can include enum values added after this client was released, so the enum setters
173
+ # accept any value while the model is built from a response
174
+ allocate.tap do |model|
175
+ model.instance_variable_set(:@_skip_enum_validation, true)
176
+ model.send(:initialize, transformed_hash)
177
+ model.remove_instance_variable(:@_skip_enum_validation)
178
+ end
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ # include attributes inherited from allOf parents (the nearest declaration wins)
186
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ end
199
+
200
+ end
@@ -0,0 +1,53 @@
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 JobOperation
18
+ SPLIT_PDF = "split_pdf".freeze
19
+ EXTRACT_PAGES = "extract_pages".freeze
20
+ ROTATE_PAGES = "rotate_pages".freeze
21
+ ENCRYPT_PDF = "encrypt_pdf".freeze
22
+ DECRYPT_PDF = "decrypt_pdf".freeze
23
+ WATERMARK_PDF = "watermark_pdf".freeze
24
+ ADD_PAGE_NUMBERS = "add_page_numbers".freeze
25
+ COMPRESS_PDF = "compress_pdf".freeze
26
+ FLATTEN_PDF = "flatten_pdf".freeze
27
+ PDF_TO_IMAGES = "pdf_to_images".freeze
28
+ IMAGES_TO_PDF = "images_to_pdf".freeze
29
+ PDF_TO_TEXT = "pdf_to_text".freeze
30
+ HTML_TO_PDF = "html_to_pdf".freeze
31
+ MARKDOWN_TO_PDF = "markdown_to_pdf".freeze
32
+
33
+ def self.all_vars
34
+ @all_vars ||= [SPLIT_PDF, EXTRACT_PAGES, ROTATE_PAGES, ENCRYPT_PDF, DECRYPT_PDF, WATERMARK_PDF, ADD_PAGE_NUMBERS, COMPRESS_PDF, FLATTEN_PDF, PDF_TO_IMAGES, IMAGES_TO_PDF, PDF_TO_TEXT, HTML_TO_PDF, MARKDOWN_TO_PDF].freeze
35
+ end
36
+
37
+ # Builds the enum from string
38
+ # @param [String] The enum value in the form of the string
39
+ # @return [String] The enum value
40
+ def self.build_from_hash(value)
41
+ new.build_from_hash(value)
42
+ end
43
+
44
+ # Builds the enum from string
45
+ # @param [String] The enum value in the form of the string
46
+ # @return [String] The enum value
47
+ def build_from_hash(value)
48
+ # Only responses are built from hashes, and a value added to the API after this client was released is kept as it
49
+ # is: the constants are the values this client knows
50
+ value
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
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 JobOperationFilter
18
+ SPLIT_PDF = "split_pdf".freeze
19
+ EXTRACT_PAGES = "extract_pages".freeze
20
+ ROTATE_PAGES = "rotate_pages".freeze
21
+ ENCRYPT_PDF = "encrypt_pdf".freeze
22
+ DECRYPT_PDF = "decrypt_pdf".freeze
23
+ WATERMARK_PDF = "watermark_pdf".freeze
24
+ ADD_PAGE_NUMBERS = "add_page_numbers".freeze
25
+ COMPRESS_PDF = "compress_pdf".freeze
26
+ FLATTEN_PDF = "flatten_pdf".freeze
27
+ PDF_TO_IMAGES = "pdf_to_images".freeze
28
+ IMAGES_TO_PDF = "images_to_pdf".freeze
29
+ PDF_TO_TEXT = "pdf_to_text".freeze
30
+ HTML_TO_PDF = "html_to_pdf".freeze
31
+ MARKDOWN_TO_PDF = "markdown_to_pdf".freeze
32
+
33
+ def self.all_vars
34
+ @all_vars ||= [SPLIT_PDF, EXTRACT_PAGES, ROTATE_PAGES, ENCRYPT_PDF, DECRYPT_PDF, WATERMARK_PDF, ADD_PAGE_NUMBERS, COMPRESS_PDF, FLATTEN_PDF, PDF_TO_IMAGES, IMAGES_TO_PDF, PDF_TO_TEXT, HTML_TO_PDF, MARKDOWN_TO_PDF].freeze
35
+ end
36
+
37
+ # Builds the enum from string
38
+ # @param [String] The enum value in the form of the string
39
+ # @return [String] The enum value
40
+ def self.build_from_hash(value)
41
+ new.build_from_hash(value)
42
+ end
43
+
44
+ # Builds the enum from string
45
+ # @param [String] The enum value in the form of the string
46
+ # @return [String] The enum value
47
+ def build_from_hash(value)
48
+ # Only responses are built from hashes, and a value added to the API after this client was released is kept as it
49
+ # is: the constants are the values this client knows
50
+ value
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,392 @@
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 job's options. Each tool has its own; a job has only its tool's.
18
+ class JobOptions < ApiModelBase
19
+ # The pages the tool used, such as `1-3,5,8-z`.
20
+ attr_accessor :pages
21
+
22
+ # split_pdf's pages per file.
23
+ attr_accessor :pages_per_file
24
+
25
+ # split_pdf's ranges, one per file.
26
+ attr_accessor :ranges
27
+
28
+ # rotate_pages' turn in degrees clockwise, or watermark_pdf's angle in degrees anticlockwise.
29
+ attr_accessor :angle
30
+
31
+ # encrypt_pdf's permissions.
32
+ attr_accessor :permissions
33
+
34
+ # watermark_pdf's text, or add_page_numbers' label.
35
+ attr_accessor :text
36
+
37
+ # The text's size in points.
38
+ attr_accessor :font_size
39
+
40
+ # watermark_pdf's text color.
41
+ attr_accessor :color
42
+
43
+ # watermark_pdf's opacity.
44
+ attr_accessor :opacity
45
+
46
+ # Whether watermark_pdf put its text `over` or `under` the page content.
47
+ attr_accessor :layer
48
+
49
+ # Where add_page_numbers put the numbers, such as `bottom_center`.
50
+ attr_accessor :position
51
+
52
+ # add_page_numbers' first number.
53
+ attr_accessor :start_at
54
+
55
+ # pdf_to_images' image format, `png` or `jpg`.
56
+ attr_accessor :format
57
+
58
+ # pdf_to_images' resolution in dots per inch.
59
+ attr_accessor :dpi
60
+
61
+ # pdf_to_images' JPEG quality.
62
+ attr_accessor :quality
63
+
64
+ # images_to_pdf's page size, or html_to_pdf's and markdown_to_pdf's paper size.
65
+ attr_accessor :page_size
66
+
67
+ # html_to_pdf's and markdown_to_pdf's custom page width.
68
+ attr_accessor :width
69
+
70
+ # html_to_pdf's and markdown_to_pdf's custom page height.
71
+ attr_accessor :height
72
+
73
+ # Whether html_to_pdf or markdown_to_pdf turned the page on its side.
74
+ attr_accessor :landscape
75
+
76
+ # html_to_pdf's and markdown_to_pdf's page margins (`top`, `right`, `bottom`, `left`).
77
+ attr_accessor :margin
78
+
79
+ # Whether html_to_pdf or markdown_to_pdf printed the page's own background.
80
+ attr_accessor :print_background
81
+
82
+ # The engine an html_to_pdf job asked for, `standard` or `chromium`.
83
+ attr_accessor :engine
84
+
85
+ # html_to_pdf's scale on Chromium.
86
+ attr_accessor :scale
87
+
88
+ # Attribute mapping from ruby-style variable name to JSON key.
89
+ def self.attribute_map
90
+ {
91
+ :'pages' => :'pages',
92
+ :'pages_per_file' => :'pages_per_file',
93
+ :'ranges' => :'ranges',
94
+ :'angle' => :'angle',
95
+ :'permissions' => :'permissions',
96
+ :'text' => :'text',
97
+ :'font_size' => :'font_size',
98
+ :'color' => :'color',
99
+ :'opacity' => :'opacity',
100
+ :'layer' => :'layer',
101
+ :'position' => :'position',
102
+ :'start_at' => :'start_at',
103
+ :'format' => :'format',
104
+ :'dpi' => :'dpi',
105
+ :'quality' => :'quality',
106
+ :'page_size' => :'page_size',
107
+ :'width' => :'width',
108
+ :'height' => :'height',
109
+ :'landscape' => :'landscape',
110
+ :'margin' => :'margin',
111
+ :'print_background' => :'print_background',
112
+ :'engine' => :'engine',
113
+ :'scale' => :'scale'
114
+ }
115
+ end
116
+
117
+ # Returns attribute mapping this model knows about
118
+ def self.acceptable_attribute_map
119
+ attribute_map
120
+ end
121
+
122
+ # Returns all the JSON keys this model knows about
123
+ def self.acceptable_attributes
124
+ acceptable_attribute_map.values
125
+ end
126
+
127
+ # Attribute type mapping.
128
+ def self.openapi_types
129
+ {
130
+ :'pages' => :'String',
131
+ :'pages_per_file' => :'Integer',
132
+ :'ranges' => :'Array<String>',
133
+ :'angle' => :'Float',
134
+ :'permissions' => :'PdfPermissions',
135
+ :'text' => :'String',
136
+ :'font_size' => :'Float',
137
+ :'color' => :'String',
138
+ :'opacity' => :'Float',
139
+ :'layer' => :'String',
140
+ :'position' => :'String',
141
+ :'start_at' => :'Integer',
142
+ :'format' => :'String',
143
+ :'dpi' => :'Integer',
144
+ :'quality' => :'Integer',
145
+ :'page_size' => :'String',
146
+ :'width' => :'String',
147
+ :'height' => :'String',
148
+ :'landscape' => :'Boolean',
149
+ :'margin' => :'Hash<String, Object>',
150
+ :'print_background' => :'Boolean',
151
+ :'engine' => :'String',
152
+ :'scale' => :'Float'
153
+ }
154
+ end
155
+
156
+ # List of attributes with nullable: true
157
+ def self.openapi_nullable
158
+ Set.new([
159
+ ])
160
+ end
161
+
162
+ # Returns attribute type mapping
163
+ def self.acceptable_openapi_types
164
+ openapi_types
165
+ end
166
+
167
+ # Returns the nullable attributes
168
+ def self.acceptable_openapi_nullable
169
+ openapi_nullable
170
+ end
171
+
172
+ # Initializes the object
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ def initialize(attributes = {})
175
+ if (!attributes.is_a?(Hash))
176
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::JobOptions` initialize method"
177
+ end
178
+
179
+ # check to see if the attribute exists and convert string to symbol for hash key
180
+ acceptable_attribute_map = self.class.acceptable_attribute_map
181
+ attributes = attributes.each_with_object({}) { |(k, v), h|
182
+ if (!acceptable_attribute_map.key?(k.to_sym))
183
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::JobOptions`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
184
+ end
185
+ h[k.to_sym] = v
186
+ }
187
+
188
+ if attributes.key?(:'pages')
189
+ self.pages = attributes[:'pages']
190
+ end
191
+
192
+ if attributes.key?(:'pages_per_file')
193
+ self.pages_per_file = attributes[:'pages_per_file']
194
+ end
195
+
196
+ if attributes.key?(:'ranges')
197
+ if (value = attributes[:'ranges']).is_a?(Array)
198
+ self.ranges = value
199
+ end
200
+ end
201
+
202
+ if attributes.key?(:'angle')
203
+ self.angle = attributes[:'angle']
204
+ end
205
+
206
+ if attributes.key?(:'permissions')
207
+ self.permissions = attributes[:'permissions']
208
+ end
209
+
210
+ if attributes.key?(:'text')
211
+ self.text = attributes[:'text']
212
+ end
213
+
214
+ if attributes.key?(:'font_size')
215
+ self.font_size = attributes[:'font_size']
216
+ end
217
+
218
+ if attributes.key?(:'color')
219
+ self.color = attributes[:'color']
220
+ end
221
+
222
+ if attributes.key?(:'opacity')
223
+ self.opacity = attributes[:'opacity']
224
+ end
225
+
226
+ if attributes.key?(:'layer')
227
+ self.layer = attributes[:'layer']
228
+ end
229
+
230
+ if attributes.key?(:'position')
231
+ self.position = attributes[:'position']
232
+ end
233
+
234
+ if attributes.key?(:'start_at')
235
+ self.start_at = attributes[:'start_at']
236
+ end
237
+
238
+ if attributes.key?(:'format')
239
+ self.format = attributes[:'format']
240
+ end
241
+
242
+ if attributes.key?(:'dpi')
243
+ self.dpi = attributes[:'dpi']
244
+ end
245
+
246
+ if attributes.key?(:'quality')
247
+ self.quality = attributes[:'quality']
248
+ end
249
+
250
+ if attributes.key?(:'page_size')
251
+ self.page_size = attributes[:'page_size']
252
+ end
253
+
254
+ if attributes.key?(:'width')
255
+ self.width = attributes[:'width']
256
+ end
257
+
258
+ if attributes.key?(:'height')
259
+ self.height = attributes[:'height']
260
+ end
261
+
262
+ if attributes.key?(:'landscape')
263
+ self.landscape = attributes[:'landscape']
264
+ end
265
+
266
+ if attributes.key?(:'margin')
267
+ if (value = attributes[:'margin']).is_a?(Hash)
268
+ self.margin = value
269
+ end
270
+ end
271
+
272
+ if attributes.key?(:'print_background')
273
+ self.print_background = attributes[:'print_background']
274
+ end
275
+
276
+ if attributes.key?(:'engine')
277
+ self.engine = attributes[:'engine']
278
+ end
279
+
280
+ if attributes.key?(:'scale')
281
+ self.scale = attributes[:'scale']
282
+ end
283
+ end
284
+
285
+ # Show invalid properties with the reasons. Usually used together with valid?
286
+ # @return Array for valid properties with the reasons
287
+ def list_invalid_properties
288
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
289
+ invalid_properties = Array.new
290
+ invalid_properties
291
+ end
292
+
293
+ # Check to see if the all the properties in the model are valid
294
+ # @return true if the model is valid
295
+ def valid?
296
+ warn '[DEPRECATED] the `valid?` method is obsolete'
297
+ true
298
+ end
299
+
300
+ # Checks equality by comparing each attribute.
301
+ # @param [Object] Object to be compared
302
+ def ==(o)
303
+ return true if self.equal?(o)
304
+ self.class == o.class &&
305
+ pages == o.pages &&
306
+ pages_per_file == o.pages_per_file &&
307
+ ranges == o.ranges &&
308
+ angle == o.angle &&
309
+ permissions == o.permissions &&
310
+ text == o.text &&
311
+ font_size == o.font_size &&
312
+ color == o.color &&
313
+ opacity == o.opacity &&
314
+ layer == o.layer &&
315
+ position == o.position &&
316
+ start_at == o.start_at &&
317
+ format == o.format &&
318
+ dpi == o.dpi &&
319
+ quality == o.quality &&
320
+ page_size == o.page_size &&
321
+ width == o.width &&
322
+ height == o.height &&
323
+ landscape == o.landscape &&
324
+ margin == o.margin &&
325
+ print_background == o.print_background &&
326
+ engine == o.engine &&
327
+ scale == o.scale
328
+ end
329
+
330
+ # @see the `==` method
331
+ # @param [Object] Object to be compared
332
+ def eql?(o)
333
+ self == o
334
+ end
335
+
336
+ # Calculates hash code according to all attributes.
337
+ # @return [Integer] Hash code
338
+ def hash
339
+ [pages, pages_per_file, ranges, angle, permissions, text, font_size, color, opacity, layer, position, start_at, format, dpi, quality, page_size, width, height, landscape, margin, print_background, engine, scale].hash
340
+ end
341
+
342
+ # Builds the object from hash
343
+ # @param [Hash] attributes Model attributes in the form of hash
344
+ # @return [Object] Returns the model itself
345
+ def self.build_from_hash(attributes)
346
+ return nil unless attributes.is_a?(Hash)
347
+ attributes = attributes.transform_keys(&:to_sym)
348
+ # include attributes inherited from allOf parents (the nearest declaration wins)
349
+ map = acceptable_attribute_map
350
+ transformed_hash = {}
351
+ acceptable_openapi_types.each_pair do |key, type|
352
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
353
+ transformed_hash["#{key}"] = nil
354
+ elsif type =~ /\AArray<(.*)>/i
355
+ # check to ensure the input is an array given that the attribute
356
+ # is documented as an array but the input is not
357
+ if attributes[map[key]].is_a?(Array)
358
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
359
+ end
360
+ elsif !attributes[map[key]].nil?
361
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
362
+ end
363
+ end
364
+ # Responses can include enum values added after this client was released, so the enum setters
365
+ # accept any value while the model is built from a response
366
+ allocate.tap do |model|
367
+ model.instance_variable_set(:@_skip_enum_validation, true)
368
+ model.send(:initialize, transformed_hash)
369
+ model.remove_instance_variable(:@_skip_enum_validation)
370
+ end
371
+ end
372
+
373
+ # Returns the object in the form of hash
374
+ # @return [Hash] Returns the object in the form of hash
375
+ def to_hash
376
+ hash = {}
377
+ # include attributes inherited from allOf parents (the nearest declaration wins)
378
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
379
+ value = self.send(attr)
380
+ if value.nil?
381
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
382
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
383
+ end
384
+
385
+ hash[param] = _to_hash(value)
386
+ end
387
+ hash
388
+ end
389
+
390
+ end
391
+
392
+ end