docspring 4.3.0 → 4.4.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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +80 -0
  3. data/.openapi-generator/FILES +84 -0
  4. data/CHANGELOG.md +55 -0
  5. data/Gemfile.lock +2 -2
  6. data/README.md +20 -1
  7. data/docs/AddTemplateFieldsRequest.md +1 -1
  8. data/docs/Client.md +2311 -766
  9. data/docs/CombinedPdfSource.md +1 -1
  10. data/docs/CreateAccountEmailActionRequest.md +54 -0
  11. data/docs/CreateEmailActionRequest.md +50 -0
  12. data/docs/CreateEmailDomainRequest.md +18 -0
  13. data/docs/CreateSubmissionBatchRequest.md +2 -2
  14. data/docs/CreateSubmissionRequest.md +22 -4
  15. data/docs/CreateTemplateRequest.md +22 -6
  16. data/docs/DnsRecordType.md +15 -0
  17. data/docs/EmailAction.md +76 -0
  18. data/docs/EmailActionConditions.md +20 -0
  19. data/docs/EmailActionConditionsInput.md +20 -0
  20. data/docs/EmailActionCustomization.md +36 -0
  21. data/docs/EmailActionDelivery.md +15 -0
  22. data/docs/EmailActionFileFormats.md +15 -0
  23. data/docs/EmailActionList.md +20 -0
  24. data/docs/EmailActionSetting.md +15 -0
  25. data/docs/EmailActionSubmissionType.md +15 -0
  26. data/docs/EmailActionTestEmail.md +18 -0
  27. data/docs/EmailDomain.md +38 -0
  28. data/docs/EmailDomainDnsRecord.md +24 -0
  29. data/docs/EmailDomainDnsRecordPurpose.md +15 -0
  30. data/docs/EmailDomainList.md +20 -0
  31. data/docs/EmailDomainRecordState.md +15 -0
  32. data/docs/EmailDomainState.md +15 -0
  33. data/docs/ErrorInfo.md +12 -6
  34. data/docs/Field.md +1 -1
  35. data/docs/FieldInput.md +1 -1
  36. data/docs/HtmlEngineOptions.md +1 -1
  37. data/docs/HtmlEngineOptionsInput.md +1 -1
  38. data/docs/SendAccountEmailActionTestEmailRequest.md +18 -0
  39. data/docs/SignatureRequest.md +9 -1
  40. data/docs/SignatureRequestEmailAttachments.md +15 -0
  41. data/docs/SignatureRequestEmailStatus.md +15 -0
  42. data/docs/SignatureRequestInput.md +7 -3
  43. data/docs/SignatureRequestReminders.md +20 -0
  44. data/docs/SigningOrder.md +15 -0
  45. data/docs/Submission.md +4 -2
  46. data/docs/SubmissionAction.md +5 -3
  47. data/docs/SubmissionInput.md +3 -3
  48. data/docs/SubmissionSummary.md +1 -1
  49. data/docs/Template.md +23 -7
  50. data/docs/TemplateSourcePdf.md +1 -1
  51. data/docs/TemplateSummary.md +4 -4
  52. data/docs/UpdateAccountEmailActionRequest.md +54 -0
  53. data/docs/UpdateEmailActionCustomizationRequest.md +46 -0
  54. data/docs/UpdateEmailActionRequest.md +50 -0
  55. data/docs/UpdateTemplateDocumentRequest.md +1 -1
  56. data/docs/UpdateTemplateRequest.md +21 -5
  57. data/docs/ValidateSubmissionRequest.md +22 -4
  58. data/lib/docspring/api/client.rb +1749 -314
  59. data/lib/docspring/api_client.rb +1 -1
  60. data/lib/docspring/models/add_template_fields_request.rb +1 -1
  61. data/lib/docspring/models/combined_pdf_source.rb +1 -1
  62. data/lib/docspring/models/create_account_email_action_request.rb +388 -0
  63. data/lib/docspring/models/create_email_action_request.rb +364 -0
  64. data/lib/docspring/models/create_email_domain_request.rb +185 -0
  65. data/lib/docspring/models/create_submission_batch_request.rb +2 -2
  66. data/lib/docspring/models/create_submission_request.rb +143 -7
  67. data/lib/docspring/models/create_template_request.rb +107 -7
  68. data/lib/docspring/models/dns_record_type.rb +42 -0
  69. data/lib/docspring/models/email_action.rb +790 -0
  70. data/lib/docspring/models/email_action_conditions.rb +219 -0
  71. data/lib/docspring/models/email_action_conditions_input.rb +219 -0
  72. data/lib/docspring/models/email_action_customization.rb +360 -0
  73. data/lib/docspring/models/email_action_delivery.rb +41 -0
  74. data/lib/docspring/models/email_action_file_formats.rb +43 -0
  75. data/lib/docspring/models/email_action_list.rb +200 -0
  76. data/lib/docspring/models/email_action_setting.rb +53 -0
  77. data/lib/docspring/models/email_action_submission_type.rb +42 -0
  78. data/lib/docspring/models/email_action_test_email.rb +185 -0
  79. data/lib/docspring/models/email_domain.rb +423 -0
  80. data/lib/docspring/models/email_domain_dns_record.rb +288 -0
  81. data/lib/docspring/models/email_domain_dns_record_purpose.rb +42 -0
  82. data/lib/docspring/models/email_domain_list.rb +200 -0
  83. data/lib/docspring/models/email_domain_record_state.rb +42 -0
  84. data/lib/docspring/models/email_domain_state.rb +42 -0
  85. data/lib/docspring/models/error_code.rb +3 -1
  86. data/lib/docspring/models/error_info.rb +39 -9
  87. data/lib/docspring/models/field.rb +1 -1
  88. data/lib/docspring/models/field_input.rb +1 -1
  89. data/lib/docspring/models/html_engine_options.rb +1 -1
  90. data/lib/docspring/models/html_engine_options_input.rb +1 -1
  91. data/lib/docspring/models/send_account_email_action_test_email_request.rb +168 -0
  92. data/lib/docspring/models/signature_request.rb +68 -2
  93. data/lib/docspring/models/signature_request_email_attachments.rb +41 -0
  94. data/lib/docspring/models/signature_request_email_status.rb +47 -0
  95. data/lib/docspring/models/signature_request_event_type.rb +3 -1
  96. data/lib/docspring/models/signature_request_input.rb +25 -22
  97. data/lib/docspring/models/signature_request_reminders.rb +212 -0
  98. data/lib/docspring/models/signing_order.rb +41 -0
  99. data/lib/docspring/models/string_condition_type.rb +8 -1
  100. data/lib/docspring/models/submission.rb +30 -3
  101. data/lib/docspring/models/submission_action.rb +18 -5
  102. data/lib/docspring/models/submission_input.rb +3 -3
  103. data/lib/docspring/models/submission_summary.rb +1 -1
  104. data/lib/docspring/models/template.rb +144 -8
  105. data/lib/docspring/models/template_source_pdf.rb +1 -1
  106. data/lib/docspring/models/template_summary.rb +4 -4
  107. data/lib/docspring/models/template_type.rb +2 -1
  108. data/lib/docspring/models/update_account_email_action_request.rb +388 -0
  109. data/lib/docspring/models/update_email_action_customization_request.rb +343 -0
  110. data/lib/docspring/models/update_email_action_request.rb +364 -0
  111. data/lib/docspring/models/update_template_document_request.rb +1 -1
  112. data/lib/docspring/models/update_template_request.rb +108 -8
  113. data/lib/docspring/models/validate_submission_request.rb +143 -7
  114. data/lib/docspring/models/webhook_event_type.rb +3 -1
  115. data/lib/docspring/request_schemas.json +1691 -145
  116. data/lib/docspring/request_validator.rb +4 -0
  117. data/lib/docspring/version.rb +1 -1
  118. data/lib/docspring.rb +28 -0
  119. data/spec/api/client_spec.rb +306 -18
  120. data/spec/models/create_account_email_action_request_spec.rb +144 -0
  121. data/spec/models/create_email_action_request_spec.rb +132 -0
  122. data/spec/models/create_email_domain_request_spec.rb +36 -0
  123. data/spec/models/create_submission_request_spec.rb +54 -0
  124. data/spec/models/create_template_request_spec.rb +48 -0
  125. data/spec/models/dns_record_type_spec.rb +30 -0
  126. data/spec/models/email_action_conditions_input_spec.rb +42 -0
  127. data/spec/models/email_action_conditions_spec.rb +42 -0
  128. data/spec/models/email_action_customization_spec.rb +90 -0
  129. data/spec/models/email_action_delivery_spec.rb +30 -0
  130. data/spec/models/email_action_file_formats_spec.rb +30 -0
  131. data/spec/models/email_action_list_spec.rb +42 -0
  132. data/spec/models/email_action_setting_spec.rb +30 -0
  133. data/spec/models/email_action_spec.rb +210 -0
  134. data/spec/models/email_action_submission_type_spec.rb +30 -0
  135. data/spec/models/email_action_test_email_spec.rb +36 -0
  136. data/spec/models/email_domain_dns_record_purpose_spec.rb +30 -0
  137. data/spec/models/email_domain_dns_record_spec.rb +54 -0
  138. data/spec/models/email_domain_list_spec.rb +42 -0
  139. data/spec/models/email_domain_record_state_spec.rb +30 -0
  140. data/spec/models/email_domain_spec.rb +96 -0
  141. data/spec/models/email_domain_state_spec.rb +30 -0
  142. data/spec/models/error_info_spec.rb +18 -0
  143. data/spec/models/send_account_email_action_test_email_request_spec.rb +36 -0
  144. data/spec/models/signature_request_email_attachments_spec.rb +30 -0
  145. data/spec/models/signature_request_email_status_spec.rb +30 -0
  146. data/spec/models/signature_request_input_spec.rb +12 -0
  147. data/spec/models/signature_request_reminders_spec.rb +42 -0
  148. data/spec/models/signature_request_spec.rb +24 -0
  149. data/spec/models/signing_order_spec.rb +30 -0
  150. data/spec/models/submission_action_spec.rb +6 -0
  151. data/spec/models/submission_spec.rb +6 -0
  152. data/spec/models/template_spec.rb +48 -0
  153. data/spec/models/update_account_email_action_request_spec.rb +144 -0
  154. data/spec/models/update_email_action_customization_request_spec.rb +120 -0
  155. data/spec/models/update_email_action_request_spec.rb +132 -0
  156. data/spec/models/update_template_request_spec.rb +48 -0
  157. data/spec/models/validate_submission_request_spec.rb +54 -0
  158. metadata +115 -4
  159. data/.gitlab-ci.yml +0 -26
  160. data/.travis.yml +0 -11
@@ -0,0 +1,790 @@
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
+ # Emails each submission's files (its PDF, and a Word template's Word document and OpenDocument file) to people when the submission has been processed. An email action belongs to a template's draft, or to your account (an account email action, with no `template_id`), which sends for every template or for the templates and folders it lists. Each template can turn an account email action off or change its settings for that template only (`customization`). Email actions email anyone on a paid plan (Starter or higher); without one, they only email your team (test emails, and test submissions). They send from DocSpring's shared address or from one of your verified email domains.
18
+ class EmailAction < ApiModelBase
19
+ # The email action's ID.
20
+ attr_accessor :id
21
+
22
+ # The ID of the template it belongs to. Null for an account email action, which sends for many templates.
23
+ attr_accessor :template_id
24
+
25
+ # For an account email action: the IDs of the templates it sends for. With `folder_ids`, it sends for a template that either list includes. Both empty sends for every template. Always empty for a template's own email action.
26
+ attr_accessor :template_ids
27
+
28
+ # For an account email action: the IDs of folders whose templates it sends for, including the templates in the folders inside them. Always empty for a template's own email action.
29
+ attr_accessor :folder_ids
30
+
31
+ # A name for the email action, shown in the dashboard. Null shows its recipients instead.
32
+ attr_accessor :name
33
+
34
+ # Whether it sends emails. DocSpring turns an email action off after 3 days of failed emails, or straight away when one of the addresses in `to`, `cc` or `bcc` (not one from a field or metadata) bounces or marks an email as spam.
35
+ attr_accessor :enabled
36
+
37
+ # Who gets each email: email addresses, and tags for an address that each submission gives, from one of the template's text or email fields (`{{ data.client_email }}`, or `{{ data["client email"] }}` for a name with spaces) or from its metadata (`{{ metadata.agent_email }}`, or `{{ metadata.agent.email }}` for a value in an object). A tag whose value is blank or isn't a valid address is skipped for that submission, and so is a field an account email action names that the template doesn't have. `{{ signer.email }}` sends each of the submission's signers their own email, to them alone, and everyone else in `to`, `cc` and `bcc` one email together, without the signers. An email needs at least one entry in `to`, `cc` or `bcc`, and at most 10 across them.
38
+ attr_accessor :to
39
+
40
+ # Who is copied on each email, as in `to` (but not `{{ signer.email }}`).
41
+ attr_accessor :cc
42
+
43
+ # Who is blind-copied on each email, as in `to` (but not `{{ signer.email }}`).
44
+ attr_accessor :bcc
45
+
46
+ # The sender's name. Null uses your account's name. From DocSpring's shared address, the name is followed by "via DocSpring".
47
+ attr_accessor :from_name
48
+
49
+ # The sender's address, at one of your verified email domains. Null sends from DocSpring's shared address.
50
+ attr_accessor :from_address
51
+
52
+ # Where replies go: a team member's email address, or an address at one of your verified email domains. Null sends without a reply address.
53
+ attr_accessor :reply_to
54
+
55
+ # The subject line, a Liquid template with the variables `account.name`, `template.name`, `template.id`, `submission.id`, the submission's values as `data.<field name>` (`data["field name"]` for a name with spaces) and its metadata as `metadata.<key>`, such as `Your {{ template.name }}`. Null uses the template's name followed by the file it sends, such as "Lease PDF", or by "files" when it sends several.
56
+ attr_accessor :subject
57
+
58
+ # The email's text, a Liquid template with the same variables as `subject`. `if`, `unless` and `case` tags work. Line breaks are kept. Null uses a short message that says the files are attached or ready to download.
59
+ attr_accessor :message
60
+
61
+ # The attached files' name, a Liquid template with the same variables as `subject`, such as `{{ data.last_name }} lease`. Each file's extension (`.pdf`, `.docx` or `.odt`) is added. Null uses the submission's `pdf_filename` metadata when it has one, and otherwise the template's name. A download link's files have the names their other downloads have: the submission's `pdf_filename`, or its ID.
62
+ attr_accessor :file_name
63
+
64
+ # Which of the submission's files the email sends: `all` sends every file the submission made (its PDF, and a Word template's Word document and OpenDocument file when it made them), and `docx`, `odt` or `pdf` sends only that file. A submission that made none of them sends nothing, and its email shows as skipped. Only Word templates make Word documents and OpenDocument files, so another template's email action takes `pdf` or `all`.
65
+ attr_accessor :file_formats
66
+
67
+ # `attachment` attaches the files, or sends a download link when together they're larger than `max_attachment_mb`. `link` sends a download link, which works for 7 days. Accounts with a BAA start with `link`.
68
+ attr_accessor :delivery
69
+
70
+ # With `delivery` `attachment`, files larger than this many megabytes in all (1 MB is 1,000,000 bytes) are sent as a download link instead. Emailing a file makes it about 38% larger, and many company mail servers refuse emails over 10 MB, so the default is 7. Raise it only when every recipient's mail server accepts larger emails, such as Microsoft 365 (up to 36 MB) or Gmail (50 MB).
71
+ attr_accessor :max_attachment_mb
72
+
73
+ # Which submissions send emails: `live`, `test` or `all`. Test submissions only email your team's members, and skip every other recipient.
74
+ attr_accessor :submission_type
75
+
76
+ # Sends the email only when the submission's values meet these conditions, which work as a conditional logic rule's do. The values are the ones the PDF has: formulas worked out, and blank for a field that a rule hides. A field the template doesn't have (in an account email action's conditions) counts as blank. A submission that doesn't meet them sends nothing, and its email shows as skipped. Null sends for every submission.
77
+ attr_accessor :send_when
78
+
79
+ # Whether the account's owner gets an email when the email action's emails keep failing.
80
+ attr_accessor :failure_notifications_enabled
81
+
82
+ # How many emails in a row have failed.
83
+ attr_accessor :consecutive_failures
84
+
85
+ # When the current run of failures started. Null when the last email was sent.
86
+ attr_accessor :failing_since
87
+
88
+ # When an email last failed.
89
+ attr_accessor :last_failure_at
90
+
91
+ # Why the last failed email failed.
92
+ attr_accessor :last_failure_message
93
+
94
+ # When the email action was turned off. Null while it is on.
95
+ attr_accessor :disabled_at
96
+
97
+ # Why DocSpring turned the email action off, such as after 3 days of failed emails or an address that bounced.
98
+ attr_accessor :disabled_reason
99
+
100
+ # In a template's list of email actions, its changes to an account email action, or null when it changes nothing. The email action's settings are then the ones it sends for that template. Null everywhere else.
101
+ attr_accessor :customization
102
+
103
+ # When the email action was created.
104
+ attr_accessor :created_at
105
+
106
+ # When the email action was last changed.
107
+ attr_accessor :updated_at
108
+
109
+ class EnumAttributeValidator
110
+ attr_reader :datatype
111
+ attr_reader :allowable_values
112
+
113
+ def initialize(datatype, allowable_values)
114
+ @allowable_values = allowable_values.map do |value|
115
+ case datatype.to_s
116
+ when /Integer/i
117
+ value.to_i
118
+ when /Float/i
119
+ value.to_f
120
+ else
121
+ value
122
+ end
123
+ end
124
+ end
125
+
126
+ def valid?(value)
127
+ !value || allowable_values.include?(value)
128
+ end
129
+ end
130
+
131
+ # Attribute mapping from ruby-style variable name to JSON key.
132
+ def self.attribute_map
133
+ {
134
+ :'id' => :'id',
135
+ :'template_id' => :'template_id',
136
+ :'template_ids' => :'template_ids',
137
+ :'folder_ids' => :'folder_ids',
138
+ :'name' => :'name',
139
+ :'enabled' => :'enabled',
140
+ :'to' => :'to',
141
+ :'cc' => :'cc',
142
+ :'bcc' => :'bcc',
143
+ :'from_name' => :'from_name',
144
+ :'from_address' => :'from_address',
145
+ :'reply_to' => :'reply_to',
146
+ :'subject' => :'subject',
147
+ :'message' => :'message',
148
+ :'file_name' => :'file_name',
149
+ :'file_formats' => :'file_formats',
150
+ :'delivery' => :'delivery',
151
+ :'max_attachment_mb' => :'max_attachment_mb',
152
+ :'submission_type' => :'submission_type',
153
+ :'send_when' => :'send_when',
154
+ :'failure_notifications_enabled' => :'failure_notifications_enabled',
155
+ :'consecutive_failures' => :'consecutive_failures',
156
+ :'failing_since' => :'failing_since',
157
+ :'last_failure_at' => :'last_failure_at',
158
+ :'last_failure_message' => :'last_failure_message',
159
+ :'disabled_at' => :'disabled_at',
160
+ :'disabled_reason' => :'disabled_reason',
161
+ :'customization' => :'customization',
162
+ :'created_at' => :'created_at',
163
+ :'updated_at' => :'updated_at'
164
+ }
165
+ end
166
+
167
+ # Returns attribute mapping this model knows about
168
+ def self.acceptable_attribute_map
169
+ attribute_map
170
+ end
171
+
172
+ # Returns all the JSON keys this model knows about
173
+ def self.acceptable_attributes
174
+ acceptable_attribute_map.values
175
+ end
176
+
177
+ # Attribute type mapping.
178
+ def self.openapi_types
179
+ {
180
+ :'id' => :'String',
181
+ :'template_id' => :'String',
182
+ :'template_ids' => :'Array<String>',
183
+ :'folder_ids' => :'Array<String>',
184
+ :'name' => :'String',
185
+ :'enabled' => :'Boolean',
186
+ :'to' => :'Array<String>',
187
+ :'cc' => :'Array<String>',
188
+ :'bcc' => :'Array<String>',
189
+ :'from_name' => :'String',
190
+ :'from_address' => :'String',
191
+ :'reply_to' => :'String',
192
+ :'subject' => :'String',
193
+ :'message' => :'String',
194
+ :'file_name' => :'String',
195
+ :'file_formats' => :'EmailActionFileFormats',
196
+ :'delivery' => :'EmailActionDelivery',
197
+ :'max_attachment_mb' => :'Integer',
198
+ :'submission_type' => :'EmailActionSubmissionType',
199
+ :'send_when' => :'EmailActionConditions',
200
+ :'failure_notifications_enabled' => :'Boolean',
201
+ :'consecutive_failures' => :'Integer',
202
+ :'failing_since' => :'Time',
203
+ :'last_failure_at' => :'Time',
204
+ :'last_failure_message' => :'String',
205
+ :'disabled_at' => :'Time',
206
+ :'disabled_reason' => :'String',
207
+ :'customization' => :'EmailActionCustomization',
208
+ :'created_at' => :'Time',
209
+ :'updated_at' => :'Time'
210
+ }
211
+ end
212
+
213
+ # List of attributes with nullable: true
214
+ def self.openapi_nullable
215
+ Set.new([
216
+ :'template_id',
217
+ :'name',
218
+ :'from_name',
219
+ :'from_address',
220
+ :'reply_to',
221
+ :'subject',
222
+ :'message',
223
+ :'file_name',
224
+ :'send_when',
225
+ :'failing_since',
226
+ :'last_failure_at',
227
+ :'last_failure_message',
228
+ :'disabled_at',
229
+ :'disabled_reason',
230
+ :'customization',
231
+ ])
232
+ end
233
+
234
+ # Returns attribute type mapping
235
+ def self.acceptable_openapi_types
236
+ openapi_types
237
+ end
238
+
239
+ # Returns the nullable attributes
240
+ def self.acceptable_openapi_nullable
241
+ openapi_nullable
242
+ end
243
+
244
+ # Initializes the object
245
+ # @param [Hash] attributes Model attributes in the form of hash
246
+ def initialize(attributes = {})
247
+ if (!attributes.is_a?(Hash))
248
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::EmailAction` initialize method"
249
+ end
250
+
251
+ # check to see if the attribute exists and convert string to symbol for hash key
252
+ acceptable_attribute_map = self.class.acceptable_attribute_map
253
+ attributes = attributes.each_with_object({}) { |(k, v), h|
254
+ if (!acceptable_attribute_map.key?(k.to_sym))
255
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::EmailAction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
256
+ end
257
+ h[k.to_sym] = v
258
+ }
259
+
260
+ if attributes.key?(:'id')
261
+ self.id = attributes[:'id']
262
+ else
263
+ self.id = nil
264
+ end
265
+
266
+ if attributes.key?(:'template_id')
267
+ self.template_id = attributes[:'template_id']
268
+ else
269
+ self.template_id = nil
270
+ end
271
+
272
+ if attributes.key?(:'template_ids')
273
+ if (value = attributes[:'template_ids']).is_a?(Array)
274
+ self.template_ids = value
275
+ end
276
+ else
277
+ self.template_ids = nil
278
+ end
279
+
280
+ if attributes.key?(:'folder_ids')
281
+ if (value = attributes[:'folder_ids']).is_a?(Array)
282
+ self.folder_ids = value
283
+ end
284
+ else
285
+ self.folder_ids = nil
286
+ end
287
+
288
+ if attributes.key?(:'name')
289
+ self.name = attributes[:'name']
290
+ else
291
+ self.name = nil
292
+ end
293
+
294
+ if attributes.key?(:'enabled')
295
+ self.enabled = attributes[:'enabled']
296
+ else
297
+ self.enabled = nil
298
+ end
299
+
300
+ if attributes.key?(:'to')
301
+ if (value = attributes[:'to']).is_a?(Array)
302
+ self.to = value
303
+ end
304
+ else
305
+ self.to = nil
306
+ end
307
+
308
+ if attributes.key?(:'cc')
309
+ if (value = attributes[:'cc']).is_a?(Array)
310
+ self.cc = value
311
+ end
312
+ else
313
+ self.cc = nil
314
+ end
315
+
316
+ if attributes.key?(:'bcc')
317
+ if (value = attributes[:'bcc']).is_a?(Array)
318
+ self.bcc = value
319
+ end
320
+ else
321
+ self.bcc = nil
322
+ end
323
+
324
+ if attributes.key?(:'from_name')
325
+ self.from_name = attributes[:'from_name']
326
+ else
327
+ self.from_name = nil
328
+ end
329
+
330
+ if attributes.key?(:'from_address')
331
+ self.from_address = attributes[:'from_address']
332
+ else
333
+ self.from_address = nil
334
+ end
335
+
336
+ if attributes.key?(:'reply_to')
337
+ self.reply_to = attributes[:'reply_to']
338
+ else
339
+ self.reply_to = nil
340
+ end
341
+
342
+ if attributes.key?(:'subject')
343
+ self.subject = attributes[:'subject']
344
+ else
345
+ self.subject = nil
346
+ end
347
+
348
+ if attributes.key?(:'message')
349
+ self.message = attributes[:'message']
350
+ else
351
+ self.message = nil
352
+ end
353
+
354
+ if attributes.key?(:'file_name')
355
+ self.file_name = attributes[:'file_name']
356
+ else
357
+ self.file_name = nil
358
+ end
359
+
360
+ if attributes.key?(:'file_formats')
361
+ self.file_formats = attributes[:'file_formats']
362
+ else
363
+ self.file_formats = nil
364
+ end
365
+
366
+ if attributes.key?(:'delivery')
367
+ self.delivery = attributes[:'delivery']
368
+ else
369
+ self.delivery = nil
370
+ end
371
+
372
+ if attributes.key?(:'max_attachment_mb')
373
+ self.max_attachment_mb = attributes[:'max_attachment_mb']
374
+ else
375
+ self.max_attachment_mb = nil
376
+ end
377
+
378
+ if attributes.key?(:'submission_type')
379
+ self.submission_type = attributes[:'submission_type']
380
+ else
381
+ self.submission_type = nil
382
+ end
383
+
384
+ if attributes.key?(:'send_when')
385
+ self.send_when = attributes[:'send_when']
386
+ else
387
+ self.send_when = nil
388
+ end
389
+
390
+ if attributes.key?(:'failure_notifications_enabled')
391
+ self.failure_notifications_enabled = attributes[:'failure_notifications_enabled']
392
+ else
393
+ self.failure_notifications_enabled = nil
394
+ end
395
+
396
+ if attributes.key?(:'consecutive_failures')
397
+ self.consecutive_failures = attributes[:'consecutive_failures']
398
+ else
399
+ self.consecutive_failures = nil
400
+ end
401
+
402
+ if attributes.key?(:'failing_since')
403
+ self.failing_since = attributes[:'failing_since']
404
+ else
405
+ self.failing_since = nil
406
+ end
407
+
408
+ if attributes.key?(:'last_failure_at')
409
+ self.last_failure_at = attributes[:'last_failure_at']
410
+ else
411
+ self.last_failure_at = nil
412
+ end
413
+
414
+ if attributes.key?(:'last_failure_message')
415
+ self.last_failure_message = attributes[:'last_failure_message']
416
+ else
417
+ self.last_failure_message = nil
418
+ end
419
+
420
+ if attributes.key?(:'disabled_at')
421
+ self.disabled_at = attributes[:'disabled_at']
422
+ else
423
+ self.disabled_at = nil
424
+ end
425
+
426
+ if attributes.key?(:'disabled_reason')
427
+ self.disabled_reason = attributes[:'disabled_reason']
428
+ else
429
+ self.disabled_reason = nil
430
+ end
431
+
432
+ if attributes.key?(:'customization')
433
+ self.customization = attributes[:'customization']
434
+ else
435
+ self.customization = nil
436
+ end
437
+
438
+ if attributes.key?(:'created_at')
439
+ self.created_at = attributes[:'created_at']
440
+ else
441
+ self.created_at = nil
442
+ end
443
+
444
+ if attributes.key?(:'updated_at')
445
+ self.updated_at = attributes[:'updated_at']
446
+ else
447
+ self.updated_at = nil
448
+ end
449
+ end
450
+
451
+ # Show invalid properties with the reasons. Usually used together with valid?
452
+ # @return Array for valid properties with the reasons
453
+ def list_invalid_properties
454
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
455
+ invalid_properties = Array.new
456
+ if @id.nil?
457
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
458
+ end
459
+
460
+ if @template_ids.nil?
461
+ invalid_properties.push('invalid value for "template_ids", template_ids cannot be nil.')
462
+ end
463
+
464
+ if @folder_ids.nil?
465
+ invalid_properties.push('invalid value for "folder_ids", folder_ids cannot be nil.')
466
+ end
467
+
468
+ if @enabled.nil?
469
+ invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
470
+ end
471
+
472
+ if @to.nil?
473
+ invalid_properties.push('invalid value for "to", to cannot be nil.')
474
+ end
475
+
476
+ if @cc.nil?
477
+ invalid_properties.push('invalid value for "cc", cc cannot be nil.')
478
+ end
479
+
480
+ if @bcc.nil?
481
+ invalid_properties.push('invalid value for "bcc", bcc cannot be nil.')
482
+ end
483
+
484
+ if @file_formats.nil?
485
+ invalid_properties.push('invalid value for "file_formats", file_formats cannot be nil.')
486
+ end
487
+
488
+ if @delivery.nil?
489
+ invalid_properties.push('invalid value for "delivery", delivery cannot be nil.')
490
+ end
491
+
492
+ if @max_attachment_mb.nil?
493
+ invalid_properties.push('invalid value for "max_attachment_mb", max_attachment_mb cannot be nil.')
494
+ end
495
+
496
+ if @submission_type.nil?
497
+ invalid_properties.push('invalid value for "submission_type", submission_type cannot be nil.')
498
+ end
499
+
500
+ if @failure_notifications_enabled.nil?
501
+ invalid_properties.push('invalid value for "failure_notifications_enabled", failure_notifications_enabled cannot be nil.')
502
+ end
503
+
504
+ if @consecutive_failures.nil?
505
+ invalid_properties.push('invalid value for "consecutive_failures", consecutive_failures cannot be nil.')
506
+ end
507
+
508
+ if @created_at.nil?
509
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
510
+ end
511
+
512
+ if @updated_at.nil?
513
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
514
+ end
515
+
516
+ invalid_properties
517
+ end
518
+
519
+ # Check to see if the all the properties in the model are valid
520
+ # @return true if the model is valid
521
+ def valid?
522
+ warn '[DEPRECATED] the `valid?` method is obsolete'
523
+ return false if @id.nil?
524
+ return false if @template_ids.nil?
525
+ return false if @folder_ids.nil?
526
+ return false if @enabled.nil?
527
+ return false if @to.nil?
528
+ return false if @cc.nil?
529
+ return false if @bcc.nil?
530
+ return false if @file_formats.nil?
531
+ return false if @delivery.nil?
532
+ return false if @max_attachment_mb.nil?
533
+ return false if @submission_type.nil?
534
+ return false if @failure_notifications_enabled.nil?
535
+ return false if @consecutive_failures.nil?
536
+ return false if @created_at.nil?
537
+ return false if @updated_at.nil?
538
+ true
539
+ end
540
+
541
+ # Custom attribute writer method with validation
542
+ # @param [Object] id Value to be assigned
543
+ def id=(id)
544
+ if id.nil?
545
+ fail ArgumentError, 'id cannot be nil'
546
+ end
547
+
548
+ @id = id
549
+ end
550
+
551
+ # Custom attribute writer method with validation
552
+ # @param [Object] template_ids Value to be assigned
553
+ def template_ids=(template_ids)
554
+ if template_ids.nil?
555
+ fail ArgumentError, 'template_ids cannot be nil'
556
+ end
557
+
558
+ @template_ids = template_ids
559
+ end
560
+
561
+ # Custom attribute writer method with validation
562
+ # @param [Object] folder_ids Value to be assigned
563
+ def folder_ids=(folder_ids)
564
+ if folder_ids.nil?
565
+ fail ArgumentError, 'folder_ids cannot be nil'
566
+ end
567
+
568
+ @folder_ids = folder_ids
569
+ end
570
+
571
+ # Custom attribute writer method with validation
572
+ # @param [Object] enabled Value to be assigned
573
+ def enabled=(enabled)
574
+ if enabled.nil?
575
+ fail ArgumentError, 'enabled cannot be nil'
576
+ end
577
+
578
+ @enabled = enabled
579
+ end
580
+
581
+ # Custom attribute writer method with validation
582
+ # @param [Object] to Value to be assigned
583
+ def to=(to)
584
+ if to.nil?
585
+ fail ArgumentError, 'to cannot be nil'
586
+ end
587
+
588
+ @to = to
589
+ end
590
+
591
+ # Custom attribute writer method with validation
592
+ # @param [Object] cc Value to be assigned
593
+ def cc=(cc)
594
+ if cc.nil?
595
+ fail ArgumentError, 'cc cannot be nil'
596
+ end
597
+
598
+ @cc = cc
599
+ end
600
+
601
+ # Custom attribute writer method with validation
602
+ # @param [Object] bcc Value to be assigned
603
+ def bcc=(bcc)
604
+ if bcc.nil?
605
+ fail ArgumentError, 'bcc cannot be nil'
606
+ end
607
+
608
+ @bcc = bcc
609
+ end
610
+
611
+ # Custom attribute writer method with validation
612
+ # @param [Object] file_formats Value to be assigned
613
+ def file_formats=(file_formats)
614
+ if file_formats.nil?
615
+ fail ArgumentError, 'file_formats cannot be nil'
616
+ end
617
+
618
+ @file_formats = file_formats
619
+ end
620
+
621
+ # Custom attribute writer method with validation
622
+ # @param [Object] delivery Value to be assigned
623
+ def delivery=(delivery)
624
+ if delivery.nil?
625
+ fail ArgumentError, 'delivery cannot be nil'
626
+ end
627
+
628
+ @delivery = delivery
629
+ end
630
+
631
+ # Custom attribute writer method with validation
632
+ # @param [Object] max_attachment_mb Value to be assigned
633
+ def max_attachment_mb=(max_attachment_mb)
634
+ if max_attachment_mb.nil?
635
+ fail ArgumentError, 'max_attachment_mb cannot be nil'
636
+ end
637
+
638
+ @max_attachment_mb = max_attachment_mb
639
+ end
640
+
641
+ # Custom attribute writer method with validation
642
+ # @param [Object] submission_type Value to be assigned
643
+ def submission_type=(submission_type)
644
+ if submission_type.nil?
645
+ fail ArgumentError, 'submission_type cannot be nil'
646
+ end
647
+
648
+ @submission_type = submission_type
649
+ end
650
+
651
+ # Custom attribute writer method with validation
652
+ # @param [Object] failure_notifications_enabled Value to be assigned
653
+ def failure_notifications_enabled=(failure_notifications_enabled)
654
+ if failure_notifications_enabled.nil?
655
+ fail ArgumentError, 'failure_notifications_enabled cannot be nil'
656
+ end
657
+
658
+ @failure_notifications_enabled = failure_notifications_enabled
659
+ end
660
+
661
+ # Custom attribute writer method with validation
662
+ # @param [Object] consecutive_failures Value to be assigned
663
+ def consecutive_failures=(consecutive_failures)
664
+ if consecutive_failures.nil?
665
+ fail ArgumentError, 'consecutive_failures cannot be nil'
666
+ end
667
+
668
+ @consecutive_failures = consecutive_failures
669
+ end
670
+
671
+ # Custom attribute writer method with validation
672
+ # @param [Object] created_at Value to be assigned
673
+ def created_at=(created_at)
674
+ if created_at.nil?
675
+ fail ArgumentError, 'created_at cannot be nil'
676
+ end
677
+
678
+ @created_at = created_at
679
+ end
680
+
681
+ # Custom attribute writer method with validation
682
+ # @param [Object] updated_at Value to be assigned
683
+ def updated_at=(updated_at)
684
+ if updated_at.nil?
685
+ fail ArgumentError, 'updated_at cannot be nil'
686
+ end
687
+
688
+ @updated_at = updated_at
689
+ end
690
+
691
+ # Checks equality by comparing each attribute.
692
+ # @param [Object] Object to be compared
693
+ def ==(o)
694
+ return true if self.equal?(o)
695
+ self.class == o.class &&
696
+ id == o.id &&
697
+ template_id == o.template_id &&
698
+ template_ids == o.template_ids &&
699
+ folder_ids == o.folder_ids &&
700
+ name == o.name &&
701
+ enabled == o.enabled &&
702
+ to == o.to &&
703
+ cc == o.cc &&
704
+ bcc == o.bcc &&
705
+ from_name == o.from_name &&
706
+ from_address == o.from_address &&
707
+ reply_to == o.reply_to &&
708
+ subject == o.subject &&
709
+ message == o.message &&
710
+ file_name == o.file_name &&
711
+ file_formats == o.file_formats &&
712
+ delivery == o.delivery &&
713
+ max_attachment_mb == o.max_attachment_mb &&
714
+ submission_type == o.submission_type &&
715
+ send_when == o.send_when &&
716
+ failure_notifications_enabled == o.failure_notifications_enabled &&
717
+ consecutive_failures == o.consecutive_failures &&
718
+ failing_since == o.failing_since &&
719
+ last_failure_at == o.last_failure_at &&
720
+ last_failure_message == o.last_failure_message &&
721
+ disabled_at == o.disabled_at &&
722
+ disabled_reason == o.disabled_reason &&
723
+ customization == o.customization &&
724
+ created_at == o.created_at &&
725
+ updated_at == o.updated_at
726
+ end
727
+
728
+ # @see the `==` method
729
+ # @param [Object] Object to be compared
730
+ def eql?(o)
731
+ self == o
732
+ end
733
+
734
+ # Calculates hash code according to all attributes.
735
+ # @return [Integer] Hash code
736
+ def hash
737
+ [id, template_id, template_ids, folder_ids, name, enabled, to, cc, bcc, from_name, from_address, reply_to, subject, message, file_name, file_formats, delivery, max_attachment_mb, submission_type, send_when, failure_notifications_enabled, consecutive_failures, failing_since, last_failure_at, last_failure_message, disabled_at, disabled_reason, customization, created_at, updated_at].hash
738
+ end
739
+
740
+ # Builds the object from hash
741
+ # @param [Hash] attributes Model attributes in the form of hash
742
+ # @return [Object] Returns the model itself
743
+ def self.build_from_hash(attributes)
744
+ return nil unless attributes.is_a?(Hash)
745
+ attributes = attributes.transform_keys(&:to_sym)
746
+ # include attributes inherited from allOf parents (the nearest declaration wins)
747
+ map = acceptable_attribute_map
748
+ transformed_hash = {}
749
+ acceptable_openapi_types.each_pair do |key, type|
750
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
751
+ transformed_hash["#{key}"] = nil
752
+ elsif type =~ /\AArray<(.*)>/i
753
+ # check to ensure the input is an array given that the attribute
754
+ # is documented as an array but the input is not
755
+ if attributes[map[key]].is_a?(Array)
756
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
757
+ end
758
+ elsif !attributes[map[key]].nil?
759
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
760
+ end
761
+ end
762
+ # Responses can include enum values added after this client was released, so the enum setters
763
+ # accept any value while the model is built from a response
764
+ allocate.tap do |model|
765
+ model.instance_variable_set(:@_skip_enum_validation, true)
766
+ model.send(:initialize, transformed_hash)
767
+ model.remove_instance_variable(:@_skip_enum_validation)
768
+ end
769
+ end
770
+
771
+ # Returns the object in the form of hash
772
+ # @return [Hash] Returns the object in the form of hash
773
+ def to_hash
774
+ hash = {}
775
+ # include attributes inherited from allOf parents (the nearest declaration wins)
776
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
777
+ value = self.send(attr)
778
+ if value.nil?
779
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
780
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
781
+ end
782
+
783
+ hash[param] = _to_hash(value)
784
+ end
785
+ hash
786
+ end
787
+
788
+ end
789
+
790
+ end