docspring 1.4.0 → 2.0.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 (239) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +26 -0
  3. data/.openapi-generator/FILES +220 -0
  4. data/.openapi-generator/VERSION +1 -1
  5. data/.rubocop.yml +6 -12
  6. data/.travis.yml +11 -0
  7. data/CHANGELOG.md +9 -0
  8. data/Gemfile +5 -1
  9. data/Gemfile.lock +85 -48
  10. data/README.md +47 -16
  11. data/docs/AddFieldsData.md +13 -3
  12. data/docs/AddFieldsTemplateResponse.md +17 -5
  13. data/docs/AuthenticationError.md +15 -4
  14. data/docs/AuthenticationSuccessResponse.md +13 -3
  15. data/docs/CombinePdfsData.md +23 -7
  16. data/docs/CombinedSubmission.md +37 -12
  17. data/docs/CombinedSubmissionAction.md +23 -8
  18. data/docs/CombinedSubmissionData.md +21 -6
  19. data/docs/CopyTemplateData.md +15 -4
  20. data/docs/CreateCombinedSubmissionResponse.md +17 -5
  21. data/docs/CreateCustomFileData.md +13 -3
  22. data/docs/CreateCustomFileResponse.md +17 -5
  23. data/docs/CreateFolderAttributes.md +20 -0
  24. data/docs/CreateFolderData.md +13 -3
  25. data/docs/CreateHtmlTemplateData.md +13 -3
  26. data/docs/CreateSubmissionBatchResponse.md +21 -7
  27. data/docs/CreateSubmissionBatchSubmissionsResponse.md +17 -5
  28. data/docs/CreateSubmissionData.md +36 -0
  29. data/docs/CreateSubmissionDataRequestData.md +37 -15
  30. data/docs/CreateSubmissionDataRequestEventRequest.md +24 -0
  31. data/docs/CreateSubmissionDataRequestEventResponse.md +22 -0
  32. data/docs/CreateSubmissionDataRequestTokenResponse.md +17 -5
  33. data/docs/CreateSubmissionResponse.md +17 -5
  34. data/docs/CreateTemplateFromUploadData.md +13 -3
  35. data/docs/DataRequestToken.md +24 -0
  36. data/docs/DeleteTemplateResponse.md +20 -0
  37. data/docs/ErrorResponse.md +20 -0
  38. data/docs/Folder.md +19 -6
  39. data/docs/FullTemplate.md +94 -0
  40. data/docs/HtmlTemplateData.md +51 -19
  41. data/docs/HtmlTemplateDataWebhookOptions.md +18 -0
  42. data/docs/InvalidRequest.md +15 -4
  43. data/docs/InvalidRequestSingleError.md +20 -0
  44. data/docs/ListSubmissionsResponse.md +22 -0
  45. data/docs/MoveFolderData.md +13 -3
  46. data/docs/MoveTemplateData.md +13 -3
  47. data/docs/PDFApi.md +1746 -495
  48. data/docs/PendingTemplate.md +45 -19
  49. data/docs/PreviewPdfResponse.md +20 -0
  50. data/docs/PublishTemplateVersion404Response.md +20 -0
  51. data/docs/PublishTemplateVersion422Response.md +20 -0
  52. data/docs/PublishTemplateVersionResponse.md +20 -0
  53. data/docs/PublishTemplateVersionResponseResult.md +24 -0
  54. data/docs/PublishVersionData.md +20 -0
  55. data/docs/RenameFolderData.md +13 -3
  56. data/docs/RestoreTemplateVersionResponse.md +18 -0
  57. data/docs/RestoreVersionData.md +18 -0
  58. data/docs/Submission.md +49 -21
  59. data/docs/SubmissionAction.md +23 -8
  60. data/docs/SubmissionBatch.md +29 -11
  61. data/docs/SubmissionBatchData.md +21 -6
  62. data/docs/SubmissionData.md +23 -9
  63. data/docs/SubmissionDataBatchRequest.md +25 -8
  64. data/docs/SubmissionDataRequest.md +53 -22
  65. data/docs/SubmissionDataRequestEvent.md +30 -0
  66. data/docs/Template.md +51 -22
  67. data/docs/TemplateData.md +49 -18
  68. data/docs/TemplateDefaults.md +22 -0
  69. data/docs/TemplateDocument.md +22 -0
  70. data/docs/TemplateDocumentMetadata.md +22 -0
  71. data/docs/TemplateSchema.md +34 -0
  72. data/docs/UpdateDataRequestResponse.md +17 -5
  73. data/docs/UpdateSubmissionDataRequestData.md +37 -15
  74. data/docs/UpdateTemplateData.md +13 -3
  75. data/docs/UpdateTemplateResponse.md +15 -4
  76. data/docs/UploadPresign.md +24 -0
  77. data/docs/UploadTemplateData.md +53 -20
  78. data/docspring.gemspec +14 -11
  79. data/git_push.sh +11 -9
  80. data/lib/docspring/api/pdf_api.rb +1485 -497
  81. data/lib/docspring/api_client.rb +106 -98
  82. data/lib/docspring/api_error.rb +22 -2
  83. data/lib/docspring/configuration.rb +127 -16
  84. data/lib/docspring/models/add_fields_data.rb +59 -26
  85. data/lib/docspring/models/add_fields_template_response.rb +81 -43
  86. data/lib/docspring/models/authentication_error.rb +62 -29
  87. data/lib/docspring/models/authentication_success_response.rb +66 -28
  88. data/lib/docspring/models/combine_pdfs_data.rb +74 -32
  89. data/lib/docspring/models/combined_submission.rb +167 -68
  90. data/lib/docspring/models/combined_submission_action.rb +83 -39
  91. data/lib/docspring/models/combined_submission_data.rb +72 -30
  92. data/lib/docspring/models/copy_template_data.rb +59 -26
  93. data/lib/docspring/models/create_combined_submission_response.rb +86 -41
  94. data/lib/docspring/models/create_custom_file_data.rb +58 -25
  95. data/lib/docspring/models/create_custom_file_response.rb +86 -41
  96. data/lib/docspring/models/create_folder_attributes.rb +230 -0
  97. data/lib/docspring/models/create_folder_data.rb +59 -26
  98. data/lib/docspring/models/create_html_template_data.rb +58 -25
  99. data/lib/docspring/models/create_submission_batch_response.rb +104 -52
  100. data/lib/docspring/models/create_submission_batch_submissions_response.rb +79 -41
  101. data/lib/docspring/models/create_submission_data.rb +304 -0
  102. data/lib/docspring/models/create_submission_data_request_data.rb +139 -90
  103. data/lib/docspring/models/create_submission_data_request_event_request.rb +297 -0
  104. data/lib/docspring/models/create_submission_data_request_event_response.rb +282 -0
  105. data/lib/docspring/models/create_submission_data_request_token_response.rb +85 -40
  106. data/lib/docspring/models/create_submission_response.rb +86 -41
  107. data/lib/docspring/models/create_template_from_upload_data.rb +58 -25
  108. data/lib/docspring/models/{custom_file.rb → data_request_token.rb} +110 -33
  109. data/lib/docspring/models/delete_template_response.rb +266 -0
  110. data/lib/docspring/models/{error.rb → error_response.rb} +65 -30
  111. data/lib/docspring/models/folder.rb +78 -46
  112. data/lib/docspring/models/full_template.rb +801 -0
  113. data/lib/docspring/models/html_template_data.rb +180 -110
  114. data/lib/docspring/models/{folders_folder.rb → html_template_data_webhook_options.rb} +63 -41
  115. data/lib/docspring/models/invalid_request.rb +64 -29
  116. data/lib/docspring/models/invalid_request_single_error.rb +271 -0
  117. data/lib/docspring/models/list_submissions_response.rb +251 -0
  118. data/lib/docspring/models/move_folder_data.rb +56 -25
  119. data/lib/docspring/models/move_template_data.rb +58 -25
  120. data/lib/docspring/models/pending_template.rb +221 -118
  121. data/lib/docspring/models/preview_pdf_response.rb +264 -0
  122. data/lib/docspring/models/publish_template_version404_response.rb +271 -0
  123. data/lib/docspring/models/publish_template_version422_response.rb +273 -0
  124. data/lib/docspring/models/publish_template_version_response.rb +271 -0
  125. data/lib/docspring/models/publish_template_version_response_result.rb +263 -0
  126. data/lib/docspring/models/publish_version_data.rb +230 -0
  127. data/lib/docspring/models/rename_folder_data.rb +58 -25
  128. data/lib/docspring/models/restore_template_version_response.rb +255 -0
  129. data/lib/docspring/models/{create_submission_data_request_token_response_token.rb → restore_version_data.rb} +69 -58
  130. data/lib/docspring/models/submission.rb +98 -49
  131. data/lib/docspring/models/submission_action.rb +83 -39
  132. data/lib/docspring/models/submission_batch.rb +158 -75
  133. data/lib/docspring/models/submission_batch_data.rb +74 -30
  134. data/lib/docspring/models/submission_data.rb +65 -41
  135. data/lib/docspring/models/submission_data_batch_request.rb +100 -49
  136. data/lib/docspring/models/submission_data_request.rb +123 -54
  137. data/lib/docspring/models/submission_data_request_event.rb +309 -0
  138. data/lib/docspring/models/template.rb +267 -132
  139. data/lib/docspring/models/template_data.rb +173 -105
  140. data/lib/docspring/models/template_defaults.rb +249 -0
  141. data/lib/docspring/models/{upload_template_data_document.rb → template_document.rb} +91 -39
  142. data/lib/docspring/models/{upload_template_data_document_metadata.rb → template_document_metadata.rb} +94 -42
  143. data/lib/docspring/models/template_schema.rb +288 -0
  144. data/lib/docspring/models/update_data_request_response.rb +86 -41
  145. data/lib/docspring/models/update_submission_data_request_data.rb +82 -43
  146. data/lib/docspring/models/update_template_data.rb +58 -25
  147. data/lib/docspring/models/update_template_response.rb +79 -41
  148. data/lib/docspring/models/upload_presign.rb +296 -0
  149. data/lib/docspring/models/upload_template_data.rb +186 -116
  150. data/lib/docspring/version.rb +3 -3
  151. data/lib/docspring.rb +30 -10
  152. data/spec/api/client_integration_spec.rb +26 -19
  153. data/spec/api/pdf_api_integration_spec.rb +21 -19
  154. data/spec/api/pdf_api_spec_original.skipped.rb +469 -98
  155. data/spec/models/add_fields_data_spec.rb +8 -13
  156. data/spec/models/add_fields_template_response_spec.rb +16 -21
  157. data/spec/models/authentication_error_spec.rb +10 -15
  158. data/spec/models/authentication_success_response_spec.rb +9 -14
  159. data/spec/models/combine_pdfs_data_spec.rb +18 -17
  160. data/spec/models/combined_submission_action_spec.rb +16 -21
  161. data/spec/models/combined_submission_data_spec.rb +17 -16
  162. data/spec/models/combined_submission_spec.rb +45 -32
  163. data/spec/models/copy_template_data_spec.rb +9 -14
  164. data/spec/models/create_combined_submission_response_spec.rb +16 -21
  165. data/spec/models/create_custom_file_data_spec.rb +8 -13
  166. data/spec/models/create_custom_file_response_spec.rb +16 -21
  167. data/spec/models/create_folder_attributes_spec.rb +42 -0
  168. data/spec/models/create_folder_data_spec.rb +8 -13
  169. data/spec/models/create_html_template_data_spec.rb +8 -13
  170. data/spec/models/create_submission_batch_response_spec.rb +21 -26
  171. data/spec/models/create_submission_batch_submissions_response_spec.rb +16 -21
  172. data/spec/models/create_submission_data_request_data_spec.rb +33 -38
  173. data/spec/models/create_submission_data_request_event_request_spec.rb +62 -0
  174. data/spec/models/create_submission_data_request_event_response_spec.rb +52 -0
  175. data/spec/models/create_submission_data_request_token_response_spec.rb +15 -20
  176. data/spec/models/create_submission_data_spec.rb +90 -0
  177. data/spec/models/create_submission_response_spec.rb +16 -21
  178. data/spec/models/create_template_from_upload_data_spec.rb +8 -13
  179. data/spec/models/data_request_token_spec.rb +54 -0
  180. data/spec/models/delete_template_response_spec.rb +46 -0
  181. data/spec/models/error_response_spec.rb +46 -0
  182. data/spec/models/folder_spec.rb +15 -20
  183. data/spec/models/full_template_spec.rb +268 -0
  184. data/spec/models/html_template_data_spec.rb +62 -49
  185. data/spec/models/html_template_data_webhook_options_spec.rb +36 -0
  186. data/spec/models/invalid_request_single_error_spec.rb +46 -0
  187. data/spec/models/invalid_request_spec.rb +10 -15
  188. data/spec/models/list_submissions_response_spec.rb +48 -0
  189. data/spec/models/move_folder_data_spec.rb +8 -13
  190. data/spec/models/move_template_data_spec.rb +8 -13
  191. data/spec/models/pending_template_spec.rb +45 -50
  192. data/spec/models/preview_pdf_response_spec.rb +46 -0
  193. data/spec/models/publish_template_version404_response_spec.rb +46 -0
  194. data/spec/models/publish_template_version422_response_spec.rb +46 -0
  195. data/spec/models/publish_template_version_response_result_spec.rb +54 -0
  196. data/spec/models/publish_template_version_response_spec.rb +46 -0
  197. data/spec/models/publish_version_data_spec.rb +42 -0
  198. data/spec/models/rename_folder_data_spec.rb +8 -13
  199. data/spec/models/restore_template_version_response_spec.rb +40 -0
  200. data/spec/models/restore_version_data_spec.rb +36 -0
  201. data/spec/models/submission_action_spec.rb +16 -21
  202. data/spec/models/submission_batch_data_spec.rb +17 -16
  203. data/spec/models/submission_batch_spec.rb +29 -34
  204. data/spec/models/submission_data_batch_request_spec.rb +24 -23
  205. data/spec/models/submission_data_request_event_spec.rb +72 -0
  206. data/spec/models/submission_data_request_spec.rb +36 -35
  207. data/spec/models/submission_data_spec.rb +13 -24
  208. data/spec/models/submission_spec.rb +27 -32
  209. data/spec/models/template_data_spec.rb +59 -46
  210. data/spec/models/template_defaults_spec.rb +48 -0
  211. data/spec/models/template_document_metadata_spec.rb +52 -0
  212. data/spec/models/template_document_spec.rb +52 -0
  213. data/spec/models/template_schema_spec.rb +84 -0
  214. data/spec/models/template_spec.rb +50 -55
  215. data/spec/models/update_data_request_response_spec.rb +16 -21
  216. data/spec/models/update_submission_data_request_data_spec.rb +22 -27
  217. data/spec/models/update_template_data_spec.rb +8 -13
  218. data/spec/models/update_template_response_spec.rb +14 -19
  219. data/spec/models/upload_presign_spec.rb +58 -0
  220. data/spec/models/upload_template_data_spec.rb +64 -51
  221. data/spec/spec_helper.rb +5 -5
  222. metadata +112 -124
  223. data/docs/CreateSubmissionDataRequestTokenResponseToken.md +0 -11
  224. data/docs/CustomFile.md +0 -9
  225. data/docs/Error.md +0 -9
  226. data/docs/FoldersFolder.md +0 -9
  227. data/docs/TemplatestemplateIdaddFieldsFields.md +0 -92
  228. data/docs/UploadTemplateDataDocument.md +0 -10
  229. data/docs/UploadTemplateDataDocumentMetadata.md +0 -10
  230. data/lib/docspring/models/templatestemplate_idadd_fields_fields.rb +0 -1306
  231. data/spec/api_client_spec.rb +0 -226
  232. data/spec/configuration_spec.rb +0 -53
  233. data/spec/models/create_submission_data_request_token_response_token_spec.rb +0 -59
  234. data/spec/models/custom_file_spec.rb +0 -47
  235. data/spec/models/error_spec.rb +0 -51
  236. data/spec/models/folders_folder_spec.rb +0 -47
  237. data/spec/models/templatestemplate_idadd_fields_fields_spec.rb +0 -589
  238. data/spec/models/upload_template_data_document_metadata_spec.rb +0 -57
  239. data/spec/models/upload_template_data_document_spec.rb +0 -57
@@ -0,0 +1,801 @@
1
+ =begin
2
+ #API v1
3
+
4
+ #DocSpring is a service that helps you fill out and sign PDF templates.
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DocSpring
17
+ class FullTemplate
18
+ attr_accessor :name
19
+
20
+ attr_accessor :description
21
+
22
+ attr_accessor :public_web_form
23
+
24
+ attr_accessor :public_submissions
25
+
26
+ attr_accessor :expire_submissions
27
+
28
+ attr_accessor :expire_after
29
+
30
+ attr_accessor :expiration_interval
31
+
32
+ attr_accessor :allow_additional_properties
33
+
34
+ attr_accessor :editable_submissions
35
+
36
+ attr_accessor :locked
37
+
38
+ attr_accessor :webhook_url
39
+
40
+ attr_accessor :slack_webhook_url
41
+
42
+ attr_accessor :redirect_url
43
+
44
+ attr_accessor :first_template
45
+
46
+ attr_accessor :html
47
+
48
+ attr_accessor :header_html
49
+
50
+ attr_accessor :footer_html
51
+
52
+ attr_accessor :scss
53
+
54
+ attr_accessor :encrypt_pdfs
55
+
56
+ attr_accessor :encrypt_pdfs_password
57
+
58
+ attr_accessor :defaults
59
+
60
+ attr_accessor :fields
61
+
62
+ attr_accessor :shared_field_data
63
+
64
+ attr_accessor :field_order
65
+
66
+ attr_accessor :document_md5
67
+
68
+ attr_accessor :document_filename
69
+
70
+ attr_accessor :document_parse_error
71
+
72
+ attr_accessor :document_state
73
+
74
+ attr_accessor :embed_domains
75
+
76
+ attr_accessor :page_count
77
+
78
+ attr_accessor :document_processed
79
+
80
+ attr_accessor :demo
81
+
82
+ attr_accessor :id
83
+
84
+ attr_accessor :template_type
85
+
86
+ attr_accessor :page_dimensions
87
+
88
+ attr_accessor :document_url
89
+
90
+ attr_accessor :permanent_document_url
91
+
92
+ attr_accessor :path
93
+
94
+ attr_accessor :parent_folder_id
95
+
96
+ class EnumAttributeValidator
97
+ attr_reader :datatype
98
+ attr_reader :allowable_values
99
+
100
+ def initialize(datatype, allowable_values)
101
+ @allowable_values = allowable_values.map do |value|
102
+ case datatype.to_s
103
+ when /Integer/i
104
+ value.to_i
105
+ when /Float/i
106
+ value.to_f
107
+ else
108
+ value
109
+ end
110
+ end
111
+ end
112
+
113
+ def valid?(value)
114
+ !value || allowable_values.include?(value)
115
+ end
116
+ end
117
+
118
+ # Attribute mapping from ruby-style variable name to JSON key.
119
+ def self.attribute_map
120
+ {
121
+ :'name' => :'name',
122
+ :'description' => :'description',
123
+ :'public_web_form' => :'public_web_form',
124
+ :'public_submissions' => :'public_submissions',
125
+ :'expire_submissions' => :'expire_submissions',
126
+ :'expire_after' => :'expire_after',
127
+ :'expiration_interval' => :'expiration_interval',
128
+ :'allow_additional_properties' => :'allow_additional_properties',
129
+ :'editable_submissions' => :'editable_submissions',
130
+ :'locked' => :'locked',
131
+ :'webhook_url' => :'webhook_url',
132
+ :'slack_webhook_url' => :'slack_webhook_url',
133
+ :'redirect_url' => :'redirect_url',
134
+ :'first_template' => :'first_template',
135
+ :'html' => :'html',
136
+ :'header_html' => :'header_html',
137
+ :'footer_html' => :'footer_html',
138
+ :'scss' => :'scss',
139
+ :'encrypt_pdfs' => :'encrypt_pdfs',
140
+ :'encrypt_pdfs_password' => :'encrypt_pdfs_password',
141
+ :'defaults' => :'defaults',
142
+ :'fields' => :'fields',
143
+ :'shared_field_data' => :'shared_field_data',
144
+ :'field_order' => :'field_order',
145
+ :'document_md5' => :'document_md5',
146
+ :'document_filename' => :'document_filename',
147
+ :'document_parse_error' => :'document_parse_error',
148
+ :'document_state' => :'document_state',
149
+ :'embed_domains' => :'embed_domains',
150
+ :'page_count' => :'page_count',
151
+ :'document_processed' => :'document_processed',
152
+ :'demo' => :'demo',
153
+ :'id' => :'id',
154
+ :'template_type' => :'template_type',
155
+ :'page_dimensions' => :'page_dimensions',
156
+ :'document_url' => :'document_url',
157
+ :'permanent_document_url' => :'permanent_document_url',
158
+ :'path' => :'path',
159
+ :'parent_folder_id' => :'parent_folder_id'
160
+ }
161
+ end
162
+
163
+ # Returns all the JSON keys this model knows about
164
+ def self.acceptable_attributes
165
+ attribute_map.values
166
+ end
167
+
168
+ # Attribute type mapping.
169
+ def self.openapi_types
170
+ {
171
+ :'name' => :'String',
172
+ :'description' => :'String',
173
+ :'public_web_form' => :'Boolean',
174
+ :'public_submissions' => :'Boolean',
175
+ :'expire_submissions' => :'Boolean',
176
+ :'expire_after' => :'Float',
177
+ :'expiration_interval' => :'String',
178
+ :'allow_additional_properties' => :'Boolean',
179
+ :'editable_submissions' => :'Boolean',
180
+ :'locked' => :'Boolean',
181
+ :'webhook_url' => :'String',
182
+ :'slack_webhook_url' => :'String',
183
+ :'redirect_url' => :'String',
184
+ :'first_template' => :'Boolean',
185
+ :'html' => :'String',
186
+ :'header_html' => :'String',
187
+ :'footer_html' => :'String',
188
+ :'scss' => :'String',
189
+ :'encrypt_pdfs' => :'Boolean',
190
+ :'encrypt_pdfs_password' => :'String',
191
+ :'defaults' => :'TemplateDefaults',
192
+ :'fields' => :'Object',
193
+ :'shared_field_data' => :'Object',
194
+ :'field_order' => :'Array<Array<Float>>',
195
+ :'document_md5' => :'String',
196
+ :'document_filename' => :'String',
197
+ :'document_parse_error' => :'Boolean',
198
+ :'document_state' => :'String',
199
+ :'embed_domains' => :'Array<String>',
200
+ :'page_count' => :'Float',
201
+ :'document_processed' => :'Boolean',
202
+ :'demo' => :'Boolean',
203
+ :'id' => :'String',
204
+ :'template_type' => :'String',
205
+ :'page_dimensions' => :'Array<Array<Float>>',
206
+ :'document_url' => :'String',
207
+ :'permanent_document_url' => :'String',
208
+ :'path' => :'String',
209
+ :'parent_folder_id' => :'String'
210
+ }
211
+ end
212
+
213
+ # List of attributes with nullable: true
214
+ def self.openapi_nullable
215
+ Set.new([
216
+ :'name',
217
+ :'description',
218
+ :'webhook_url',
219
+ :'slack_webhook_url',
220
+ :'redirect_url',
221
+ :'html',
222
+ :'header_html',
223
+ :'footer_html',
224
+ :'scss',
225
+ :'encrypt_pdfs_password',
226
+ :'document_md5',
227
+ :'document_filename',
228
+ :'embed_domains',
229
+ :'page_dimensions',
230
+ :'document_url',
231
+ :'permanent_document_url',
232
+ :'parent_folder_id'
233
+ ])
234
+ end
235
+
236
+ # Initializes the object
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ def initialize(attributes = {})
239
+ if (!attributes.is_a?(Hash))
240
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::FullTemplate` initialize method"
241
+ end
242
+
243
+ # check to see if the attribute exists and convert string to symbol for hash key
244
+ attributes = attributes.each_with_object({}) { |(k, v), h|
245
+ if (!self.class.attribute_map.key?(k.to_sym))
246
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::FullTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
247
+ end
248
+ h[k.to_sym] = v
249
+ }
250
+
251
+ if attributes.key?(:'name')
252
+ self.name = attributes[:'name']
253
+ else
254
+ self.name = nil
255
+ end
256
+
257
+ if attributes.key?(:'description')
258
+ self.description = attributes[:'description']
259
+ else
260
+ self.description = nil
261
+ end
262
+
263
+ if attributes.key?(:'public_web_form')
264
+ self.public_web_form = attributes[:'public_web_form']
265
+ else
266
+ self.public_web_form = nil
267
+ end
268
+
269
+ if attributes.key?(:'public_submissions')
270
+ self.public_submissions = attributes[:'public_submissions']
271
+ else
272
+ self.public_submissions = nil
273
+ end
274
+
275
+ if attributes.key?(:'expire_submissions')
276
+ self.expire_submissions = attributes[:'expire_submissions']
277
+ else
278
+ self.expire_submissions = nil
279
+ end
280
+
281
+ if attributes.key?(:'expire_after')
282
+ self.expire_after = attributes[:'expire_after']
283
+ else
284
+ self.expire_after = nil
285
+ end
286
+
287
+ if attributes.key?(:'expiration_interval')
288
+ self.expiration_interval = attributes[:'expiration_interval']
289
+ else
290
+ self.expiration_interval = nil
291
+ end
292
+
293
+ if attributes.key?(:'allow_additional_properties')
294
+ self.allow_additional_properties = attributes[:'allow_additional_properties']
295
+ else
296
+ self.allow_additional_properties = nil
297
+ end
298
+
299
+ if attributes.key?(:'editable_submissions')
300
+ self.editable_submissions = attributes[:'editable_submissions']
301
+ else
302
+ self.editable_submissions = nil
303
+ end
304
+
305
+ if attributes.key?(:'locked')
306
+ self.locked = attributes[:'locked']
307
+ else
308
+ self.locked = nil
309
+ end
310
+
311
+ if attributes.key?(:'webhook_url')
312
+ self.webhook_url = attributes[:'webhook_url']
313
+ else
314
+ self.webhook_url = nil
315
+ end
316
+
317
+ if attributes.key?(:'slack_webhook_url')
318
+ self.slack_webhook_url = attributes[:'slack_webhook_url']
319
+ else
320
+ self.slack_webhook_url = nil
321
+ end
322
+
323
+ if attributes.key?(:'redirect_url')
324
+ self.redirect_url = attributes[:'redirect_url']
325
+ else
326
+ self.redirect_url = nil
327
+ end
328
+
329
+ if attributes.key?(:'first_template')
330
+ self.first_template = attributes[:'first_template']
331
+ else
332
+ self.first_template = nil
333
+ end
334
+
335
+ if attributes.key?(:'html')
336
+ self.html = attributes[:'html']
337
+ else
338
+ self.html = nil
339
+ end
340
+
341
+ if attributes.key?(:'header_html')
342
+ self.header_html = attributes[:'header_html']
343
+ else
344
+ self.header_html = nil
345
+ end
346
+
347
+ if attributes.key?(:'footer_html')
348
+ self.footer_html = attributes[:'footer_html']
349
+ else
350
+ self.footer_html = nil
351
+ end
352
+
353
+ if attributes.key?(:'scss')
354
+ self.scss = attributes[:'scss']
355
+ else
356
+ self.scss = nil
357
+ end
358
+
359
+ if attributes.key?(:'encrypt_pdfs')
360
+ self.encrypt_pdfs = attributes[:'encrypt_pdfs']
361
+ else
362
+ self.encrypt_pdfs = nil
363
+ end
364
+
365
+ if attributes.key?(:'encrypt_pdfs_password')
366
+ self.encrypt_pdfs_password = attributes[:'encrypt_pdfs_password']
367
+ else
368
+ self.encrypt_pdfs_password = nil
369
+ end
370
+
371
+ if attributes.key?(:'defaults')
372
+ self.defaults = attributes[:'defaults']
373
+ else
374
+ self.defaults = nil
375
+ end
376
+
377
+ if attributes.key?(:'fields')
378
+ self.fields = attributes[:'fields']
379
+ else
380
+ self.fields = nil
381
+ end
382
+
383
+ if attributes.key?(:'shared_field_data')
384
+ self.shared_field_data = attributes[:'shared_field_data']
385
+ else
386
+ self.shared_field_data = nil
387
+ end
388
+
389
+ if attributes.key?(:'field_order')
390
+ if (value = attributes[:'field_order']).is_a?(Array)
391
+ self.field_order = value
392
+ end
393
+ else
394
+ self.field_order = nil
395
+ end
396
+
397
+ if attributes.key?(:'document_md5')
398
+ self.document_md5 = attributes[:'document_md5']
399
+ else
400
+ self.document_md5 = nil
401
+ end
402
+
403
+ if attributes.key?(:'document_filename')
404
+ self.document_filename = attributes[:'document_filename']
405
+ else
406
+ self.document_filename = nil
407
+ end
408
+
409
+ if attributes.key?(:'document_parse_error')
410
+ self.document_parse_error = attributes[:'document_parse_error']
411
+ else
412
+ self.document_parse_error = nil
413
+ end
414
+
415
+ if attributes.key?(:'document_state')
416
+ self.document_state = attributes[:'document_state']
417
+ else
418
+ self.document_state = nil
419
+ end
420
+
421
+ if attributes.key?(:'embed_domains')
422
+ if (value = attributes[:'embed_domains']).is_a?(Array)
423
+ self.embed_domains = value
424
+ end
425
+ else
426
+ self.embed_domains = nil
427
+ end
428
+
429
+ if attributes.key?(:'page_count')
430
+ self.page_count = attributes[:'page_count']
431
+ else
432
+ self.page_count = nil
433
+ end
434
+
435
+ if attributes.key?(:'document_processed')
436
+ self.document_processed = attributes[:'document_processed']
437
+ else
438
+ self.document_processed = nil
439
+ end
440
+
441
+ if attributes.key?(:'demo')
442
+ self.demo = attributes[:'demo']
443
+ else
444
+ self.demo = nil
445
+ end
446
+
447
+ if attributes.key?(:'id')
448
+ self.id = attributes[:'id']
449
+ else
450
+ self.id = nil
451
+ end
452
+
453
+ if attributes.key?(:'template_type')
454
+ self.template_type = attributes[:'template_type']
455
+ else
456
+ self.template_type = nil
457
+ end
458
+
459
+ if attributes.key?(:'page_dimensions')
460
+ if (value = attributes[:'page_dimensions']).is_a?(Array)
461
+ self.page_dimensions = value
462
+ end
463
+ else
464
+ self.page_dimensions = nil
465
+ end
466
+
467
+ if attributes.key?(:'document_url')
468
+ self.document_url = attributes[:'document_url']
469
+ else
470
+ self.document_url = nil
471
+ end
472
+
473
+ if attributes.key?(:'permanent_document_url')
474
+ self.permanent_document_url = attributes[:'permanent_document_url']
475
+ else
476
+ self.permanent_document_url = nil
477
+ end
478
+
479
+ if attributes.key?(:'path')
480
+ self.path = attributes[:'path']
481
+ else
482
+ self.path = nil
483
+ end
484
+
485
+ if attributes.key?(:'parent_folder_id')
486
+ self.parent_folder_id = attributes[:'parent_folder_id']
487
+ else
488
+ self.parent_folder_id = nil
489
+ end
490
+ end
491
+
492
+ # Show invalid properties with the reasons. Usually used together with valid?
493
+ # @return Array for valid properties with the reasons
494
+ def list_invalid_properties
495
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
496
+ invalid_properties = Array.new
497
+ if @public_web_form.nil?
498
+ invalid_properties.push('invalid value for "public_web_form", public_web_form cannot be nil.')
499
+ end
500
+
501
+ if @public_submissions.nil?
502
+ invalid_properties.push('invalid value for "public_submissions", public_submissions cannot be nil.')
503
+ end
504
+
505
+ if @expire_submissions.nil?
506
+ invalid_properties.push('invalid value for "expire_submissions", expire_submissions cannot be nil.')
507
+ end
508
+
509
+ if @expire_after.nil?
510
+ invalid_properties.push('invalid value for "expire_after", expire_after cannot be nil.')
511
+ end
512
+
513
+ if @expiration_interval.nil?
514
+ invalid_properties.push('invalid value for "expiration_interval", expiration_interval cannot be nil.')
515
+ end
516
+
517
+ if @allow_additional_properties.nil?
518
+ invalid_properties.push('invalid value for "allow_additional_properties", allow_additional_properties cannot be nil.')
519
+ end
520
+
521
+ if @editable_submissions.nil?
522
+ invalid_properties.push('invalid value for "editable_submissions", editable_submissions cannot be nil.')
523
+ end
524
+
525
+ if @locked.nil?
526
+ invalid_properties.push('invalid value for "locked", locked cannot be nil.')
527
+ end
528
+
529
+ if @first_template.nil?
530
+ invalid_properties.push('invalid value for "first_template", first_template cannot be nil.')
531
+ end
532
+
533
+ if @encrypt_pdfs.nil?
534
+ invalid_properties.push('invalid value for "encrypt_pdfs", encrypt_pdfs cannot be nil.')
535
+ end
536
+
537
+ if @defaults.nil?
538
+ invalid_properties.push('invalid value for "defaults", defaults cannot be nil.')
539
+ end
540
+
541
+ if @fields.nil?
542
+ invalid_properties.push('invalid value for "fields", fields cannot be nil.')
543
+ end
544
+
545
+ if @shared_field_data.nil?
546
+ invalid_properties.push('invalid value for "shared_field_data", shared_field_data cannot be nil.')
547
+ end
548
+
549
+ if @field_order.nil?
550
+ invalid_properties.push('invalid value for "field_order", field_order cannot be nil.')
551
+ end
552
+
553
+ if @document_parse_error.nil?
554
+ invalid_properties.push('invalid value for "document_parse_error", document_parse_error cannot be nil.')
555
+ end
556
+
557
+ if @document_state.nil?
558
+ invalid_properties.push('invalid value for "document_state", document_state cannot be nil.')
559
+ end
560
+
561
+ if @page_count.nil?
562
+ invalid_properties.push('invalid value for "page_count", page_count cannot be nil.')
563
+ end
564
+
565
+ if @document_processed.nil?
566
+ invalid_properties.push('invalid value for "document_processed", document_processed cannot be nil.')
567
+ end
568
+
569
+ if @demo.nil?
570
+ invalid_properties.push('invalid value for "demo", demo cannot be nil.')
571
+ end
572
+
573
+ if @id.nil?
574
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
575
+ end
576
+
577
+ if @template_type.nil?
578
+ invalid_properties.push('invalid value for "template_type", template_type cannot be nil.')
579
+ end
580
+
581
+ if @path.nil?
582
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
583
+ end
584
+
585
+ invalid_properties
586
+ end
587
+
588
+ # Check to see if the all the properties in the model are valid
589
+ # @return true if the model is valid
590
+ def valid?
591
+ warn '[DEPRECATED] the `valid?` method is obsolete'
592
+ return false if @public_web_form.nil?
593
+ return false if @public_submissions.nil?
594
+ return false if @expire_submissions.nil?
595
+ return false if @expire_after.nil?
596
+ return false if @expiration_interval.nil?
597
+ expiration_interval_validator = EnumAttributeValidator.new('String', ["minutes", "hours", "days"])
598
+ return false unless expiration_interval_validator.valid?(@expiration_interval)
599
+ return false if @allow_additional_properties.nil?
600
+ return false if @editable_submissions.nil?
601
+ return false if @locked.nil?
602
+ return false if @first_template.nil?
603
+ return false if @encrypt_pdfs.nil?
604
+ return false if @defaults.nil?
605
+ return false if @fields.nil?
606
+ return false if @shared_field_data.nil?
607
+ return false if @field_order.nil?
608
+ return false if @document_parse_error.nil?
609
+ return false if @document_state.nil?
610
+ return false if @page_count.nil?
611
+ return false if @document_processed.nil?
612
+ return false if @demo.nil?
613
+ return false if @id.nil?
614
+ return false if @template_type.nil?
615
+ return false if @path.nil?
616
+ true
617
+ end
618
+
619
+ # Custom attribute writer method checking allowed values (enum).
620
+ # @param [Object] expiration_interval Object to be assigned
621
+ def expiration_interval=(expiration_interval)
622
+ validator = EnumAttributeValidator.new('String', ["minutes", "hours", "days"])
623
+ unless validator.valid?(expiration_interval)
624
+ fail ArgumentError, "invalid value for \"expiration_interval\", must be one of #{validator.allowable_values}."
625
+ end
626
+ @expiration_interval = expiration_interval
627
+ end
628
+
629
+ # Checks equality by comparing each attribute.
630
+ # @param [Object] Object to be compared
631
+ def ==(o)
632
+ return true if self.equal?(o)
633
+ self.class == o.class &&
634
+ name == o.name &&
635
+ description == o.description &&
636
+ public_web_form == o.public_web_form &&
637
+ public_submissions == o.public_submissions &&
638
+ expire_submissions == o.expire_submissions &&
639
+ expire_after == o.expire_after &&
640
+ expiration_interval == o.expiration_interval &&
641
+ allow_additional_properties == o.allow_additional_properties &&
642
+ editable_submissions == o.editable_submissions &&
643
+ locked == o.locked &&
644
+ webhook_url == o.webhook_url &&
645
+ slack_webhook_url == o.slack_webhook_url &&
646
+ redirect_url == o.redirect_url &&
647
+ first_template == o.first_template &&
648
+ html == o.html &&
649
+ header_html == o.header_html &&
650
+ footer_html == o.footer_html &&
651
+ scss == o.scss &&
652
+ encrypt_pdfs == o.encrypt_pdfs &&
653
+ encrypt_pdfs_password == o.encrypt_pdfs_password &&
654
+ defaults == o.defaults &&
655
+ fields == o.fields &&
656
+ shared_field_data == o.shared_field_data &&
657
+ field_order == o.field_order &&
658
+ document_md5 == o.document_md5 &&
659
+ document_filename == o.document_filename &&
660
+ document_parse_error == o.document_parse_error &&
661
+ document_state == o.document_state &&
662
+ embed_domains == o.embed_domains &&
663
+ page_count == o.page_count &&
664
+ document_processed == o.document_processed &&
665
+ demo == o.demo &&
666
+ id == o.id &&
667
+ template_type == o.template_type &&
668
+ page_dimensions == o.page_dimensions &&
669
+ document_url == o.document_url &&
670
+ permanent_document_url == o.permanent_document_url &&
671
+ path == o.path &&
672
+ parent_folder_id == o.parent_folder_id
673
+ end
674
+
675
+ # @see the `==` method
676
+ # @param [Object] Object to be compared
677
+ def eql?(o)
678
+ self == o
679
+ end
680
+
681
+ # Calculates hash code according to all attributes.
682
+ # @return [Integer] Hash code
683
+ def hash
684
+ [name, description, public_web_form, public_submissions, expire_submissions, expire_after, expiration_interval, allow_additional_properties, editable_submissions, locked, webhook_url, slack_webhook_url, redirect_url, first_template, html, header_html, footer_html, scss, encrypt_pdfs, encrypt_pdfs_password, defaults, fields, shared_field_data, field_order, document_md5, document_filename, document_parse_error, document_state, embed_domains, page_count, document_processed, demo, id, template_type, page_dimensions, document_url, permanent_document_url, path, parent_folder_id].hash
685
+ end
686
+
687
+ # Builds the object from hash
688
+ # @param [Hash] attributes Model attributes in the form of hash
689
+ # @return [Object] Returns the model itself
690
+ def self.build_from_hash(attributes)
691
+ return nil unless attributes.is_a?(Hash)
692
+ attributes = attributes.transform_keys(&:to_sym)
693
+ transformed_hash = {}
694
+ openapi_types.each_pair do |key, type|
695
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
696
+ transformed_hash["#{key}"] = nil
697
+ elsif type =~ /\AArray<(.*)>/i
698
+ # check to ensure the input is an array given that the attribute
699
+ # is documented as an array but the input is not
700
+ if attributes[attribute_map[key]].is_a?(Array)
701
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
702
+ end
703
+ elsif !attributes[attribute_map[key]].nil?
704
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
705
+ end
706
+ end
707
+ new(transformed_hash)
708
+ end
709
+
710
+ # Deserializes the data based on type
711
+ # @param string type Data type
712
+ # @param string value Value to be deserialized
713
+ # @return [Object] Deserialized data
714
+ def self._deserialize(type, value)
715
+ case type.to_sym
716
+ when :Time
717
+ Time.parse(value)
718
+ when :Date
719
+ Date.parse(value)
720
+ when :String
721
+ value.to_s
722
+ when :Integer
723
+ value.to_i
724
+ when :Float
725
+ value.to_f
726
+ when :Boolean
727
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
728
+ true
729
+ else
730
+ false
731
+ end
732
+ when :Object
733
+ # generic object (usually a Hash), return directly
734
+ value
735
+ when /\AArray<(?<inner_type>.+)>\z/
736
+ inner_type = Regexp.last_match[:inner_type]
737
+ value.map { |v| _deserialize(inner_type, v) }
738
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
739
+ k_type = Regexp.last_match[:k_type]
740
+ v_type = Regexp.last_match[:v_type]
741
+ {}.tap do |hash|
742
+ value.each do |k, v|
743
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
744
+ end
745
+ end
746
+ else # model
747
+ # models (e.g. Pet) or oneOf
748
+ klass = DocSpring.const_get(type)
749
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
750
+ end
751
+ end
752
+
753
+ # Returns the string representation of the object
754
+ # @return [String] String presentation of the object
755
+ def to_s
756
+ to_hash.to_s
757
+ end
758
+
759
+ # to_body is an alias to to_hash (backward compatibility)
760
+ # @return [Hash] Returns the object in the form of hash
761
+ def to_body
762
+ to_hash
763
+ end
764
+
765
+ # Returns the object in the form of hash
766
+ # @return [Hash] Returns the object in the form of hash
767
+ def to_hash
768
+ hash = {}
769
+ self.class.attribute_map.each_pair do |attr, param|
770
+ value = self.send(attr)
771
+ if value.nil?
772
+ is_nullable = self.class.openapi_nullable.include?(attr)
773
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
774
+ end
775
+
776
+ hash[param] = _to_hash(value)
777
+ end
778
+ hash
779
+ end
780
+
781
+ # Outputs non-array value in the form of hash
782
+ # For object, use to_hash. Otherwise, just return the value
783
+ # @param [Object] value Any valid value
784
+ # @return [Hash] Returns the value in the form of hash
785
+ def _to_hash(value)
786
+ if value.is_a?(Array)
787
+ value.compact.map { |v| _to_hash(v) }
788
+ elsif value.is_a?(Hash)
789
+ {}.tap do |hash|
790
+ value.each { |k, v| hash[k] = _to_hash(v) }
791
+ end
792
+ elsif value.respond_to? :to_hash
793
+ value.to_hash
794
+ else
795
+ value
796
+ end
797
+ end
798
+
799
+ end
800
+
801
+ end