docspring 4.6.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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +25 -1
  4. data/lib/docspring/api/client.rb +1934 -209
  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 +217 -0
  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_code.rb +4 -1
  16. data/lib/docspring/models/error_info.rb +25 -5
  17. data/lib/docspring/models/extract_pages_request.rb +234 -0
  18. data/lib/docspring/models/field.rb +1 -1
  19. data/lib/docspring/models/field_input.rb +1 -1
  20. data/lib/docspring/models/flatten_pdf_request.rb +207 -0
  21. data/lib/docspring/models/html_engine_options.rb +1 -1
  22. data/lib/docspring/models/html_engine_options_input.rb +1 -1
  23. data/lib/docspring/models/htmlto_pdf_request.rb +322 -0
  24. data/lib/docspring/models/image_format.rb +41 -0
  25. data/lib/docspring/models/images_to_pdf_request.rb +241 -0
  26. data/lib/docspring/models/job.rb +508 -0
  27. data/lib/docspring/models/job_file.rb +308 -0
  28. data/lib/docspring/models/job_file_job_source.rb +232 -0
  29. data/lib/docspring/models/job_html_engine.rb +41 -0
  30. data/lib/docspring/models/job_list.rb +200 -0
  31. data/lib/docspring/models/job_operation.rb +53 -0
  32. data/lib/docspring/models/job_operation_filter.rb +53 -0
  33. data/lib/docspring/models/job_options.rb +392 -0
  34. data/lib/docspring/models/job_page_margin.rb +198 -0
  35. data/lib/docspring/models/job_page_size.rb +51 -0
  36. data/lib/docspring/models/job_source.rb +267 -0
  37. data/lib/docspring/models/job_source_input.rb +66 -0
  38. data/lib/docspring/models/job_source_type.rb +46 -0
  39. data/lib/docspring/models/job_state.rb +42 -0
  40. data/lib/docspring/models/markdown_to_pdf_request.rb +312 -0
  41. data/lib/docspring/models/open_support_ticket_request.rb +363 -0
  42. data/lib/docspring/models/page_image.rb +3 -3
  43. data/lib/docspring/models/page_number_position.rb +45 -0
  44. data/lib/docspring/models/page_size.rb +45 -0
  45. data/lib/docspring/models/pdf_permissions.rb +198 -0
  46. data/lib/docspring/models/pdf_permissions_input.rb +198 -0
  47. data/lib/docspring/models/pdfto_images_request.rb +269 -0
  48. data/lib/docspring/models/pdfto_text_request.rb +217 -0
  49. data/lib/docspring/models/reply_to_support_ticket_request.rb +217 -0
  50. data/lib/docspring/models/rotate_pages_request.rb +244 -0
  51. data/lib/docspring/models/send_support_feedback_request.rb +363 -0
  52. data/lib/docspring/models/split_pdf_request.rb +229 -0
  53. data/lib/docspring/models/submission_job_source.rb +222 -0
  54. data/lib/docspring/models/support_feedback.rb +239 -0
  55. data/lib/docspring/models/support_help.rb +316 -0
  56. data/lib/docspring/models/support_help_source.rb +212 -0
  57. data/lib/docspring/models/support_help_state.rb +42 -0
  58. data/lib/docspring/models/support_help_turn.rb +234 -0
  59. data/lib/docspring/models/support_help_turn_role.rb +41 -0
  60. data/lib/docspring/models/support_message.rb +301 -0
  61. data/lib/docspring/models/support_message_author.rb +42 -0
  62. data/lib/docspring/models/support_report_agent.rb +188 -0
  63. data/lib/docspring/models/support_report_category.rb +57 -0
  64. data/lib/docspring/models/support_report_impact.rb +42 -0
  65. data/lib/docspring/models/support_report_kind.rb +47 -0
  66. data/lib/docspring/models/support_report_source.rb +41 -0
  67. data/lib/docspring/models/support_ticket.rb +637 -0
  68. data/lib/docspring/models/support_ticket_list.rb +200 -0
  69. data/lib/docspring/models/support_ticket_list_status.rb +42 -0
  70. data/lib/docspring/models/support_ticket_notifications.rb +197 -0
  71. data/lib/docspring/models/support_ticket_reply.rb +210 -0
  72. data/lib/docspring/models/support_ticket_reply_outcome.rb +41 -0
  73. data/lib/docspring/models/support_ticket_resolution.rb +45 -0
  74. data/lib/docspring/models/support_ticket_status.rb +43 -0
  75. data/lib/docspring/models/support_ticket_watch.rb +239 -0
  76. data/lib/docspring/models/template.rb +41 -2
  77. data/lib/docspring/models/template_blank_page.rb +212 -0
  78. data/lib/docspring/models/template_blank_page_input.rb +212 -0
  79. data/lib/docspring/models/template_document.rb +1 -1
  80. data/lib/docspring/models/template_html_engine.rb +41 -0
  81. data/lib/docspring/models/template_page_images.rb +3 -3
  82. data/lib/docspring/models/template_page_list.rb +243 -0
  83. data/lib/docspring/models/template_page_list_input.rb +243 -0
  84. data/lib/docspring/models/template_page_processing_status.rb +28 -1
  85. data/lib/docspring/models/update_template_request.rb +33 -2
  86. data/lib/docspring/models/upload_job_source.rb +222 -0
  87. data/lib/docspring/models/url_job_source.rb +222 -0
  88. data/lib/docspring/models/watermark_layer.rb +41 -0
  89. data/lib/docspring/models/watermark_pdf_request.rb +316 -0
  90. data/lib/docspring/models/webhook_event_type.rb +4 -1
  91. data/lib/docspring/request_schemas.json +2424 -46
  92. data/lib/docspring/version.rb +1 -1
  93. data/lib/docspring.rb +71 -0
  94. metadata +72 -1
@@ -0,0 +1,312 @@
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
+ # Markdown to convert to PDF, as `markdown` or as a file in `input` (one of them), with the page's settings. GitHub Flavored Markdown: tables, task lists, strikethrough and raw HTML. DocSpring's stylesheet for Markdown styles it, and your `css` is added after it.
18
+ class MarkdownToPdfRequest < 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
+ # 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`.
29
+ attr_accessor :header_html
30
+
31
+ # HTML printed in each page's bottom margin, with the same classes as `header_html`.
32
+ attr_accessor :footer_html
33
+
34
+ # The paper size. Default `Letter`. Don't send it with `width` and `height`.
35
+ attr_accessor :page_size
36
+
37
+ # A custom page's width, such as `8.5in` or `210mm`. Send it with `height`.
38
+ attr_accessor :width
39
+
40
+ # A custom page's height, such as `11in` or `297mm`. Send it with `width`.
41
+ attr_accessor :height
42
+
43
+ # Turn the page on its side. Default false.
44
+ attr_accessor :landscape
45
+
46
+ # The page's margins. Each side's default is `1in`.
47
+ attr_accessor :margin
48
+
49
+ # Print the page's own background (what `html` or `body` sets). Default false.
50
+ attr_accessor :print_background
51
+
52
+ # The Markdown. Up to 10 MB. The request body as a whole is limited to 10 MB too, so send a large document as a file in `input` (also up to 10 MB).
53
+ attr_accessor :markdown
54
+
55
+ # CSS added after DocSpring's stylesheet for Markdown, so its rules win: `h1 { font-family: Georgia, serif; }` changes the headings' font.
56
+ attr_accessor :css
57
+
58
+ class EnumAttributeValidator
59
+ attr_reader :datatype
60
+ attr_reader :allowable_values
61
+
62
+ def initialize(datatype, allowable_values)
63
+ @allowable_values = allowable_values.map do |value|
64
+ case datatype.to_s
65
+ when /Integer/i
66
+ value.to_i
67
+ when /Float/i
68
+ value.to_f
69
+ else
70
+ value
71
+ end
72
+ end
73
+ end
74
+
75
+ def valid?(value)
76
+ !value || allowable_values.include?(value)
77
+ end
78
+ end
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'input' => :'input',
84
+ :'metadata' => :'metadata',
85
+ :'expires_in' => :'expires_in',
86
+ :'header_html' => :'header_html',
87
+ :'footer_html' => :'footer_html',
88
+ :'page_size' => :'page_size',
89
+ :'width' => :'width',
90
+ :'height' => :'height',
91
+ :'landscape' => :'landscape',
92
+ :'margin' => :'margin',
93
+ :'print_background' => :'print_background',
94
+ :'markdown' => :'markdown',
95
+ :'css' => :'css'
96
+ }
97
+ end
98
+
99
+ # Returns attribute mapping this model knows about
100
+ def self.acceptable_attribute_map
101
+ attribute_map
102
+ end
103
+
104
+ # Returns all the JSON keys this model knows about
105
+ def self.acceptable_attributes
106
+ acceptable_attribute_map.values
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.openapi_types
111
+ {
112
+ :'input' => :'JobSourceInput',
113
+ :'metadata' => :'Hash<String, Object>',
114
+ :'expires_in' => :'Integer',
115
+ :'header_html' => :'String',
116
+ :'footer_html' => :'String',
117
+ :'page_size' => :'JobPageSize',
118
+ :'width' => :'String',
119
+ :'height' => :'String',
120
+ :'landscape' => :'Boolean',
121
+ :'margin' => :'JobPageMargin',
122
+ :'print_background' => :'Boolean',
123
+ :'markdown' => :'String',
124
+ :'css' => :'String'
125
+ }
126
+ end
127
+
128
+ # List of attributes with nullable: true
129
+ def self.openapi_nullable
130
+ Set.new([
131
+ ])
132
+ end
133
+
134
+ # Returns attribute type mapping
135
+ def self.acceptable_openapi_types
136
+ openapi_types
137
+ end
138
+
139
+ # Returns the nullable attributes
140
+ def self.acceptable_openapi_nullable
141
+ openapi_nullable
142
+ end
143
+
144
+ # Initializes the object
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ def initialize(attributes = {})
147
+ if (!attributes.is_a?(Hash))
148
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::MarkdownToPdfRequest` initialize method"
149
+ end
150
+
151
+ # check to see if the attribute exists and convert string to symbol for hash key
152
+ acceptable_attribute_map = self.class.acceptable_attribute_map
153
+ attributes = attributes.each_with_object({}) { |(k, v), h|
154
+ if (!acceptable_attribute_map.key?(k.to_sym))
155
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::MarkdownToPdfRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
156
+ end
157
+ h[k.to_sym] = v
158
+ }
159
+
160
+ if attributes.key?(:'input')
161
+ self.input = attributes[:'input']
162
+ end
163
+
164
+ if attributes.key?(:'metadata')
165
+ if (value = attributes[:'metadata']).is_a?(Hash)
166
+ self.metadata = value
167
+ end
168
+ end
169
+
170
+ if attributes.key?(:'expires_in')
171
+ self.expires_in = attributes[:'expires_in']
172
+ end
173
+
174
+ if attributes.key?(:'header_html')
175
+ self.header_html = attributes[:'header_html']
176
+ end
177
+
178
+ if attributes.key?(:'footer_html')
179
+ self.footer_html = attributes[:'footer_html']
180
+ end
181
+
182
+ if attributes.key?(:'page_size')
183
+ self.page_size = attributes[:'page_size']
184
+ end
185
+
186
+ if attributes.key?(:'width')
187
+ self.width = attributes[:'width']
188
+ end
189
+
190
+ if attributes.key?(:'height')
191
+ self.height = attributes[:'height']
192
+ end
193
+
194
+ if attributes.key?(:'landscape')
195
+ self.landscape = attributes[:'landscape']
196
+ end
197
+
198
+ if attributes.key?(:'margin')
199
+ self.margin = attributes[:'margin']
200
+ end
201
+
202
+ if attributes.key?(:'print_background')
203
+ self.print_background = attributes[:'print_background']
204
+ end
205
+
206
+ if attributes.key?(:'markdown')
207
+ self.markdown = attributes[:'markdown']
208
+ end
209
+
210
+ if attributes.key?(:'css')
211
+ self.css = attributes[:'css']
212
+ end
213
+ end
214
+
215
+ # Show invalid properties with the reasons. Usually used together with valid?
216
+ # @return Array for valid properties with the reasons
217
+ def list_invalid_properties
218
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
219
+ invalid_properties = Array.new
220
+ invalid_properties
221
+ end
222
+
223
+ # Check to see if the all the properties in the model are valid
224
+ # @return true if the model is valid
225
+ def valid?
226
+ warn '[DEPRECATED] the `valid?` method is obsolete'
227
+ true
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ input == o.input &&
236
+ metadata == o.metadata &&
237
+ expires_in == o.expires_in &&
238
+ header_html == o.header_html &&
239
+ footer_html == o.footer_html &&
240
+ page_size == o.page_size &&
241
+ width == o.width &&
242
+ height == o.height &&
243
+ landscape == o.landscape &&
244
+ margin == o.margin &&
245
+ print_background == o.print_background &&
246
+ markdown == o.markdown &&
247
+ css == o.css
248
+ end
249
+
250
+ # @see the `==` method
251
+ # @param [Object] Object to be compared
252
+ def eql?(o)
253
+ self == o
254
+ end
255
+
256
+ # Calculates hash code according to all attributes.
257
+ # @return [Integer] Hash code
258
+ def hash
259
+ [input, metadata, expires_in, header_html, footer_html, page_size, width, height, landscape, margin, print_background, markdown, css].hash
260
+ end
261
+
262
+ # Builds the object from hash
263
+ # @param [Hash] attributes Model attributes in the form of hash
264
+ # @return [Object] Returns the model itself
265
+ def self.build_from_hash(attributes)
266
+ return nil unless attributes.is_a?(Hash)
267
+ attributes = attributes.transform_keys(&:to_sym)
268
+ # include attributes inherited from allOf parents (the nearest declaration wins)
269
+ map = acceptable_attribute_map
270
+ transformed_hash = {}
271
+ acceptable_openapi_types.each_pair do |key, type|
272
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
273
+ transformed_hash["#{key}"] = nil
274
+ elsif type =~ /\AArray<(.*)>/i
275
+ # check to ensure the input is an array given that the attribute
276
+ # is documented as an array but the input is not
277
+ if attributes[map[key]].is_a?(Array)
278
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
279
+ end
280
+ elsif !attributes[map[key]].nil?
281
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
282
+ end
283
+ end
284
+ # Responses can include enum values added after this client was released, so the enum setters
285
+ # accept any value while the model is built from a response
286
+ allocate.tap do |model|
287
+ model.instance_variable_set(:@_skip_enum_validation, true)
288
+ model.send(:initialize, transformed_hash)
289
+ model.remove_instance_variable(:@_skip_enum_validation)
290
+ end
291
+ end
292
+
293
+ # Returns the object in the form of hash
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_hash
296
+ hash = {}
297
+ # include attributes inherited from allOf parents (the nearest declaration wins)
298
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
299
+ value = self.send(attr)
300
+ if value.nil?
301
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
302
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
303
+ end
304
+
305
+ hash[param] = _to_hash(value)
306
+ end
307
+ hash
308
+ end
309
+
310
+ end
311
+
312
+ end
@@ -0,0 +1,363 @@
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 problem that blocks the user, a wrong result or a question for the DocSpring team. Never include secrets, credentials or your users' data.
18
+ class OpenSupportTicketRequest < ApiModelBase
19
+ # One line, written like an issue title.
20
+ attr_accessor :title
21
+
22
+ # What kind of problem this is.
23
+ attr_accessor :kind
24
+
25
+ # The part of DocSpring this is about.
26
+ attr_accessor :category
27
+
28
+ # What was tried, what was expected and what happened.
29
+ attr_accessor :description
30
+
31
+ # `blocked`: the task could not be done. `worked_around`: it was done another way. `friction`: it was only slower.
32
+ attr_accessor :impact
33
+
34
+ # What the user asked for, in a short phrase.
35
+ attr_accessor :task
36
+
37
+ # The request IDs of the requests that went wrong: `error.request_id` in an error response, or any response's `X-Request-Id` header.
38
+ attr_accessor :request_ids
39
+
40
+ # The API operation, MCP tool or CLI command involved.
41
+ attr_accessor :tool
42
+
43
+ # The exact error text.
44
+ attr_accessor :error
45
+
46
+ # What would have helped.
47
+ attr_accessor :suggestion
48
+
49
+ # `user`: the user asked for this to be sent. `agent` (the default): an AI agent noticed the problem itself.
50
+ attr_accessor :source
51
+
52
+ # A label the sender chooses for its work, such as a session ID, a branch or a task name. When an account runs several agents at once, each can list only the tickets opened with its own label.
53
+ attr_accessor :session
54
+
55
+ # The AI agent sending this, as it describes itself. Stored as unverified.
56
+ attr_accessor :agent
57
+
58
+ class EnumAttributeValidator
59
+ attr_reader :datatype
60
+ attr_reader :allowable_values
61
+
62
+ def initialize(datatype, allowable_values)
63
+ @allowable_values = allowable_values.map do |value|
64
+ case datatype.to_s
65
+ when /Integer/i
66
+ value.to_i
67
+ when /Float/i
68
+ value.to_f
69
+ else
70
+ value
71
+ end
72
+ end
73
+ end
74
+
75
+ def valid?(value)
76
+ !value || allowable_values.include?(value)
77
+ end
78
+ end
79
+
80
+ # Attribute mapping from ruby-style variable name to JSON key.
81
+ def self.attribute_map
82
+ {
83
+ :'title' => :'title',
84
+ :'kind' => :'kind',
85
+ :'category' => :'category',
86
+ :'description' => :'description',
87
+ :'impact' => :'impact',
88
+ :'task' => :'task',
89
+ :'request_ids' => :'request_ids',
90
+ :'tool' => :'tool',
91
+ :'error' => :'error',
92
+ :'suggestion' => :'suggestion',
93
+ :'source' => :'source',
94
+ :'session' => :'session',
95
+ :'agent' => :'agent'
96
+ }
97
+ end
98
+
99
+ # Returns attribute mapping this model knows about
100
+ def self.acceptable_attribute_map
101
+ attribute_map
102
+ end
103
+
104
+ # Returns all the JSON keys this model knows about
105
+ def self.acceptable_attributes
106
+ acceptable_attribute_map.values
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.openapi_types
111
+ {
112
+ :'title' => :'String',
113
+ :'kind' => :'SupportReportKind',
114
+ :'category' => :'SupportReportCategory',
115
+ :'description' => :'String',
116
+ :'impact' => :'SupportReportImpact',
117
+ :'task' => :'String',
118
+ :'request_ids' => :'Array<String>',
119
+ :'tool' => :'String',
120
+ :'error' => :'String',
121
+ :'suggestion' => :'String',
122
+ :'source' => :'SupportReportSource',
123
+ :'session' => :'String',
124
+ :'agent' => :'SupportReportAgent'
125
+ }
126
+ end
127
+
128
+ # List of attributes with nullable: true
129
+ def self.openapi_nullable
130
+ Set.new([
131
+ ])
132
+ end
133
+
134
+ # Returns attribute type mapping
135
+ def self.acceptable_openapi_types
136
+ openapi_types
137
+ end
138
+
139
+ # Returns the nullable attributes
140
+ def self.acceptable_openapi_nullable
141
+ openapi_nullable
142
+ end
143
+
144
+ # Initializes the object
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ def initialize(attributes = {})
147
+ if (!attributes.is_a?(Hash))
148
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::OpenSupportTicketRequest` initialize method"
149
+ end
150
+
151
+ # check to see if the attribute exists and convert string to symbol for hash key
152
+ acceptable_attribute_map = self.class.acceptable_attribute_map
153
+ attributes = attributes.each_with_object({}) { |(k, v), h|
154
+ if (!acceptable_attribute_map.key?(k.to_sym))
155
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::OpenSupportTicketRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
156
+ end
157
+ h[k.to_sym] = v
158
+ }
159
+
160
+ if attributes.key?(:'title')
161
+ self.title = attributes[:'title']
162
+ else
163
+ self.title = nil
164
+ end
165
+
166
+ if attributes.key?(:'kind')
167
+ self.kind = attributes[:'kind']
168
+ else
169
+ self.kind = nil
170
+ end
171
+
172
+ if attributes.key?(:'category')
173
+ self.category = attributes[:'category']
174
+ end
175
+
176
+ if attributes.key?(:'description')
177
+ self.description = attributes[:'description']
178
+ else
179
+ self.description = nil
180
+ end
181
+
182
+ if attributes.key?(:'impact')
183
+ self.impact = attributes[:'impact']
184
+ end
185
+
186
+ if attributes.key?(:'task')
187
+ self.task = attributes[:'task']
188
+ end
189
+
190
+ if attributes.key?(:'request_ids')
191
+ if (value = attributes[:'request_ids']).is_a?(Array)
192
+ self.request_ids = value
193
+ end
194
+ end
195
+
196
+ if attributes.key?(:'tool')
197
+ self.tool = attributes[:'tool']
198
+ end
199
+
200
+ if attributes.key?(:'error')
201
+ self.error = attributes[:'error']
202
+ end
203
+
204
+ if attributes.key?(:'suggestion')
205
+ self.suggestion = attributes[:'suggestion']
206
+ end
207
+
208
+ if attributes.key?(:'source')
209
+ self.source = attributes[:'source']
210
+ end
211
+
212
+ if attributes.key?(:'session')
213
+ self.session = attributes[:'session']
214
+ end
215
+
216
+ if attributes.key?(:'agent')
217
+ self.agent = attributes[:'agent']
218
+ end
219
+ end
220
+
221
+ # Show invalid properties with the reasons. Usually used together with valid?
222
+ # @return Array for valid properties with the reasons
223
+ def list_invalid_properties
224
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
225
+ invalid_properties = Array.new
226
+ if @title.nil?
227
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
228
+ end
229
+
230
+ if @kind.nil?
231
+ invalid_properties.push('invalid value for "kind", kind cannot be nil.')
232
+ end
233
+
234
+ if @description.nil?
235
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
236
+ end
237
+
238
+ invalid_properties
239
+ end
240
+
241
+ # Check to see if the all the properties in the model are valid
242
+ # @return true if the model is valid
243
+ def valid?
244
+ warn '[DEPRECATED] the `valid?` method is obsolete'
245
+ return false if @title.nil?
246
+ return false if @kind.nil?
247
+ return false if @description.nil?
248
+ true
249
+ end
250
+
251
+ # Custom attribute writer method with validation
252
+ # @param [Object] title Value to be assigned
253
+ def title=(title)
254
+ if title.nil?
255
+ fail ArgumentError, 'title cannot be nil'
256
+ end
257
+
258
+ @title = title
259
+ end
260
+
261
+ # Custom attribute writer method with validation
262
+ # @param [Object] kind Value to be assigned
263
+ def kind=(kind)
264
+ if kind.nil?
265
+ fail ArgumentError, 'kind cannot be nil'
266
+ end
267
+
268
+ @kind = kind
269
+ end
270
+
271
+ # Custom attribute writer method with validation
272
+ # @param [Object] description Value to be assigned
273
+ def description=(description)
274
+ if description.nil?
275
+ fail ArgumentError, 'description cannot be nil'
276
+ end
277
+
278
+ @description = description
279
+ end
280
+
281
+ # Checks equality by comparing each attribute.
282
+ # @param [Object] Object to be compared
283
+ def ==(o)
284
+ return true if self.equal?(o)
285
+ self.class == o.class &&
286
+ title == o.title &&
287
+ kind == o.kind &&
288
+ category == o.category &&
289
+ description == o.description &&
290
+ impact == o.impact &&
291
+ task == o.task &&
292
+ request_ids == o.request_ids &&
293
+ tool == o.tool &&
294
+ error == o.error &&
295
+ suggestion == o.suggestion &&
296
+ source == o.source &&
297
+ session == o.session &&
298
+ agent == o.agent
299
+ end
300
+
301
+ # @see the `==` method
302
+ # @param [Object] Object to be compared
303
+ def eql?(o)
304
+ self == o
305
+ end
306
+
307
+ # Calculates hash code according to all attributes.
308
+ # @return [Integer] Hash code
309
+ def hash
310
+ [title, kind, category, description, impact, task, request_ids, tool, error, suggestion, source, session, agent].hash
311
+ end
312
+
313
+ # Builds the object from hash
314
+ # @param [Hash] attributes Model attributes in the form of hash
315
+ # @return [Object] Returns the model itself
316
+ def self.build_from_hash(attributes)
317
+ return nil unless attributes.is_a?(Hash)
318
+ attributes = attributes.transform_keys(&:to_sym)
319
+ # include attributes inherited from allOf parents (the nearest declaration wins)
320
+ map = acceptable_attribute_map
321
+ transformed_hash = {}
322
+ acceptable_openapi_types.each_pair do |key, type|
323
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
324
+ transformed_hash["#{key}"] = nil
325
+ elsif type =~ /\AArray<(.*)>/i
326
+ # check to ensure the input is an array given that the attribute
327
+ # is documented as an array but the input is not
328
+ if attributes[map[key]].is_a?(Array)
329
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
330
+ end
331
+ elsif !attributes[map[key]].nil?
332
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
333
+ end
334
+ end
335
+ # Responses can include enum values added after this client was released, so the enum setters
336
+ # accept any value while the model is built from a response
337
+ allocate.tap do |model|
338
+ model.instance_variable_set(:@_skip_enum_validation, true)
339
+ model.send(:initialize, transformed_hash)
340
+ model.remove_instance_variable(:@_skip_enum_validation)
341
+ end
342
+ end
343
+
344
+ # Returns the object in the form of hash
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_hash
347
+ hash = {}
348
+ # include attributes inherited from allOf parents (the nearest declaration wins)
349
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
350
+ value = self.send(attr)
351
+ if value.nil?
352
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
353
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
354
+ end
355
+
356
+ hash[param] = _to_hash(value)
357
+ end
358
+ hash
359
+ end
360
+
361
+ end
362
+
363
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DocSpring
17
- # An image of one page of a PDF, a PNG of a submission's page or a JPEG of a template's.
17
+ # An image of one page of a PDF, a PNG of a submission's page or a JPEG of a template's. A blank page that was added to a template (its `page_list`) has no image file: it's a white page of this `width` and `height`.
18
18
  class PageImage < ApiModelBase
19
19
  # The page number, from 1.
20
20
  attr_accessor :page
@@ -25,7 +25,7 @@ module DocSpring
25
25
  # The image's height in pixels.
26
26
  attr_accessor :height
27
27
 
28
- # A temporary link to download the image. A submission's is null when your account turns off download links for submissions.
28
+ # A temporary link to download the image. A submission's is null when your account turns off download links for submissions, and so is a template's blank page's, which has no image file.
29
29
  attr_accessor :download_url
30
30
 
31
31
  # A link to download a submission's image that doesn't expire: it redirects to a new temporary link. It needs your API token or a signed-in session, except for a submission of a template that makes its submissions public. Null for a template's page images.
@@ -37,7 +37,7 @@ module DocSpring
37
37
  # The image's media type, `image/png` for a submission's pages or `image/jpeg` for a template's.
38
38
  attr_accessor :content_type
39
39
 
40
- # The image's size in bytes.
40
+ # The image's size in bytes. 0 for a template's blank page.
41
41
  attr_accessor :size
42
42
 
43
43
  # The SHA-256 hash of the image. Null for a template's page images.