docspring 1.4.1 → 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 (243) 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 +5 -0
  8. data/Gemfile +5 -1
  9. data/Gemfile.lock +85 -48
  10. data/README.md +43 -18
  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 -8
  16. data/docs/CombinedSubmission.md +37 -13
  17. data/docs/CombinedSubmissionAction.md +23 -8
  18. data/docs/CombinedSubmissionData.md +21 -7
  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 +17 -5
  45. data/docs/MoveFolderData.md +13 -3
  46. data/docs/MoveTemplateData.md +13 -3
  47. data/docs/PDFApi.md +1598 -523
  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 -10
  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 +1344 -539
  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 +65 -32
  89. data/lib/docspring/models/combined_submission.rb +165 -75
  90. data/lib/docspring/models/combined_submission_action.rb +83 -39
  91. data/lib/docspring/models/combined_submission_data.rb +63 -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/{template1.rb → full_template.rb} +476 -240
  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 +87 -39
  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 -50
  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/{template1_defaults.rb → template_defaults.rb} +77 -29
  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 +29 -12
  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 +427 -118
  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 +13 -18
  160. data/spec/models/combined_submission_action_spec.rb +16 -21
  161. data/spec/models/combined_submission_data_spec.rb +12 -17
  162. data/spec/models/combined_submission_spec.rb +42 -35
  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 +13 -18
  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 -30
  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 +108 -132
  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/Template1.md +0 -46
  228. data/docs/Template1Defaults.md +0 -10
  229. data/docs/TemplatestemplateIdaddFieldsFields.md +0 -92
  230. data/docs/UploadTemplateDataDocument.md +0 -10
  231. data/docs/UploadTemplateDataDocumentMetadata.md +0 -10
  232. data/lib/docspring/models/templatestemplate_idadd_fields_fields.rb +0 -1306
  233. data/spec/api_client_spec.rb +0 -226
  234. data/spec/configuration_spec.rb +0 -53
  235. data/spec/models/create_submission_data_request_token_response_token_spec.rb +0 -59
  236. data/spec/models/custom_file_spec.rb +0 -47
  237. data/spec/models/error_spec.rb +0 -51
  238. data/spec/models/folders_folder_spec.rb +0 -47
  239. data/spec/models/template1_defaults_spec.rb +0 -53
  240. data/spec/models/template1_spec.rb +0 -273
  241. data/spec/models/templatestemplate_idadd_fields_fields_spec.rb +0 -589
  242. data/spec/models/upload_template_data_document_metadata_spec.rb +0 -57
  243. data/spec/models/upload_template_data_document_spec.rb +0 -57
@@ -3,95 +3,96 @@
3
3
 
4
4
  #DocSpring is a service that helps you fill out and sign PDF templates.
5
5
 
6
- OpenAPI spec version: v1
6
+ The version of the OpenAPI document: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0
9
+ Generator version: 7.11.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module DocSpring
16
- class Template1
17
- attr_accessor :document_processed
17
+ class FullTemplate
18
+ attr_accessor :name
18
19
 
19
- attr_accessor :expiration_interval
20
+ attr_accessor :description
20
21
 
21
- attr_accessor :scss
22
+ attr_accessor :public_web_form
22
23
 
23
- attr_accessor :document_state
24
+ attr_accessor :public_submissions
25
+
26
+ attr_accessor :expire_submissions
24
27
 
25
28
  attr_accessor :expire_after
26
29
 
27
- attr_accessor :description
30
+ attr_accessor :expiration_interval
28
31
 
29
- attr_accessor :slack_webhook_url
32
+ attr_accessor :allow_additional_properties
30
33
 
31
- attr_accessor :demo
34
+ attr_accessor :editable_submissions
32
35
 
33
- attr_accessor :path
36
+ attr_accessor :locked
34
37
 
35
- attr_accessor :header_html
38
+ attr_accessor :webhook_url
36
39
 
37
- attr_accessor :public_web_form
40
+ attr_accessor :slack_webhook_url
38
41
 
39
- attr_accessor :field_order
42
+ attr_accessor :redirect_url
40
43
 
41
- attr_accessor :permanent_document_url
44
+ attr_accessor :first_template
42
45
 
43
46
  attr_accessor :html
44
47
 
45
- attr_accessor :template_type
46
-
47
- attr_accessor :id
48
-
49
- attr_accessor :page_dimensions
48
+ attr_accessor :header_html
50
49
 
51
- attr_accessor :locked
50
+ attr_accessor :footer_html
52
51
 
53
- attr_accessor :page_count
52
+ attr_accessor :scss
54
53
 
55
54
  attr_accessor :encrypt_pdfs
56
55
 
57
- attr_accessor :webhook_url
58
-
59
- attr_accessor :embed_domains
60
-
61
- attr_accessor :parent_folder_id
62
-
63
- attr_accessor :allow_additional_properties
64
-
65
56
  attr_accessor :encrypt_pdfs_password
66
57
 
67
- attr_accessor :public_submissions
58
+ attr_accessor :defaults
59
+
60
+ attr_accessor :fields
68
61
 
69
62
  attr_accessor :shared_field_data
70
63
 
64
+ attr_accessor :field_order
65
+
71
66
  attr_accessor :document_md5
72
67
 
73
- attr_accessor :first_template
68
+ attr_accessor :document_filename
74
69
 
75
- attr_accessor :defaults
70
+ attr_accessor :document_parse_error
76
71
 
77
- attr_accessor :editable_submissions
72
+ attr_accessor :document_state
78
73
 
79
- attr_accessor :expire_submissions
74
+ attr_accessor :embed_domains
80
75
 
81
- attr_accessor :name
76
+ attr_accessor :page_count
82
77
 
83
- attr_accessor :footer_html
78
+ attr_accessor :document_processed
84
79
 
85
- attr_accessor :document_parse_error
80
+ attr_accessor :demo
86
81
 
87
- attr_accessor :fields
82
+ attr_accessor :id
88
83
 
89
- attr_accessor :document_filename
84
+ attr_accessor :template_type
90
85
 
91
- attr_accessor :redirect_url
86
+ attr_accessor :page_dimensions
92
87
 
93
88
  attr_accessor :document_url
94
89
 
90
+ attr_accessor :permanent_document_url
91
+
92
+ attr_accessor :path
93
+
94
+ attr_accessor :parent_folder_id
95
+
95
96
  class EnumAttributeValidator
96
97
  attr_reader :datatype
97
98
  attr_reader :allowable_values
@@ -117,285 +118,510 @@ module DocSpring
117
118
  # Attribute mapping from ruby-style variable name to JSON key.
118
119
  def self.attribute_map
119
120
  {
120
- :'document_processed' => :'document_processed',
121
- :'expiration_interval' => :'expiration_interval',
122
- :'scss' => :'scss',
123
- :'document_state' => :'document_state',
124
- :'expire_after' => :'expire_after',
121
+ :'name' => :'name',
125
122
  :'description' => :'description',
126
- :'slack_webhook_url' => :'slack_webhook_url',
127
- :'demo' => :'demo',
128
- :'path' => :'path',
129
- :'header_html' => :'header_html',
130
123
  :'public_web_form' => :'public_web_form',
131
- :'field_order' => :'field_order',
132
- :'permanent_document_url' => :'permanent_document_url',
133
- :'html' => :'html',
134
- :'template_type' => :'template_type',
135
- :'id' => :'id',
136
- :'page_dimensions' => :'page_dimensions',
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',
137
130
  :'locked' => :'locked',
138
- :'page_count' => :'page_count',
139
- :'encrypt_pdfs' => :'encrypt_pdfs',
140
131
  :'webhook_url' => :'webhook_url',
141
- :'embed_domains' => :'embed_domains',
142
- :'parent_folder_id' => :'parent_folder_id',
143
- :'allow_additional_properties' => :'allow_additional_properties',
144
- :'encrypt_pdfs_password' => :'encrypt_pdfs_password',
145
- :'public_submissions' => :'public_submissions',
146
- :'shared_field_data' => :'shared_field_data',
147
- :'document_md5' => :'document_md5',
132
+ :'slack_webhook_url' => :'slack_webhook_url',
133
+ :'redirect_url' => :'redirect_url',
148
134
  :'first_template' => :'first_template',
149
- :'defaults' => :'defaults',
150
- :'editable_submissions' => :'editable_submissions',
151
- :'expire_submissions' => :'expire_submissions',
152
- :'name' => :'name',
135
+ :'html' => :'html',
136
+ :'header_html' => :'header_html',
153
137
  :'footer_html' => :'footer_html',
154
- :'document_parse_error' => :'document_parse_error',
138
+ :'scss' => :'scss',
139
+ :'encrypt_pdfs' => :'encrypt_pdfs',
140
+ :'encrypt_pdfs_password' => :'encrypt_pdfs_password',
141
+ :'defaults' => :'defaults',
155
142
  :'fields' => :'fields',
143
+ :'shared_field_data' => :'shared_field_data',
144
+ :'field_order' => :'field_order',
145
+ :'document_md5' => :'document_md5',
156
146
  :'document_filename' => :'document_filename',
157
- :'redirect_url' => :'redirect_url',
158
- :'document_url' => :'document_url'
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'
159
160
  }
160
161
  end
161
162
 
163
+ # Returns all the JSON keys this model knows about
164
+ def self.acceptable_attributes
165
+ attribute_map.values
166
+ end
167
+
162
168
  # Attribute type mapping.
163
169
  def self.openapi_types
164
170
  {
165
- :'document_processed' => :'BOOLEAN',
166
- :'expiration_interval' => :'String',
167
- :'scss' => :'String',
168
- :'document_state' => :'String',
169
- :'expire_after' => :'Float',
171
+ :'name' => :'String',
170
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',
171
182
  :'slack_webhook_url' => :'String',
172
- :'demo' => :'BOOLEAN',
173
- :'path' => :'String',
174
- :'header_html' => :'String',
175
- :'public_web_form' => :'BOOLEAN',
176
- :'field_order' => :'Array<Array<Float>>',
177
- :'permanent_document_url' => :'String',
183
+ :'redirect_url' => :'String',
184
+ :'first_template' => :'Boolean',
178
185
  :'html' => :'String',
179
- :'template_type' => :'String',
180
- :'id' => :'String',
181
- :'page_dimensions' => :'Array<Array<Float>>',
182
- :'locked' => :'BOOLEAN',
183
- :'page_count' => :'Float',
184
- :'encrypt_pdfs' => :'BOOLEAN',
185
- :'webhook_url' => :'String',
186
- :'embed_domains' => :'Array<String>',
187
- :'parent_folder_id' => :'String',
188
- :'allow_additional_properties' => :'BOOLEAN',
186
+ :'header_html' => :'String',
187
+ :'footer_html' => :'String',
188
+ :'scss' => :'String',
189
+ :'encrypt_pdfs' => :'Boolean',
189
190
  :'encrypt_pdfs_password' => :'String',
190
- :'public_submissions' => :'BOOLEAN',
191
+ :'defaults' => :'TemplateDefaults',
192
+ :'fields' => :'Object',
191
193
  :'shared_field_data' => :'Object',
194
+ :'field_order' => :'Array<Array<Float>>',
192
195
  :'document_md5' => :'String',
193
- :'first_template' => :'BOOLEAN',
194
- :'defaults' => :'Template1Defaults',
195
- :'editable_submissions' => :'BOOLEAN',
196
- :'expire_submissions' => :'BOOLEAN',
197
- :'name' => :'String',
198
- :'footer_html' => :'String',
199
- :'document_parse_error' => :'BOOLEAN',
200
- :'fields' => :'Object',
201
196
  :'document_filename' => :'String',
202
- :'redirect_url' => :'String',
203
- :'document_url' => :'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'
204
210
  }
205
211
  end
206
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
+
207
236
  # Initializes the object
208
237
  # @param [Hash] attributes Model attributes in the form of hash
209
238
  def initialize(attributes = {})
210
- return unless attributes.is_a?(Hash)
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
+ }
211
250
 
212
- # convert string to symbol for hash key
213
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
251
+ if attributes.key?(:'name')
252
+ self.name = attributes[:'name']
253
+ else
254
+ self.name = nil
255
+ end
214
256
 
215
- if attributes.has_key?(:'document_processed')
216
- self.document_processed = attributes[:'document_processed']
257
+ if attributes.key?(:'description')
258
+ self.description = attributes[:'description']
259
+ else
260
+ self.description = nil
217
261
  end
218
262
 
219
- if attributes.has_key?(:'expiration_interval')
220
- self.expiration_interval = attributes[:'expiration_interval']
263
+ if attributes.key?(:'public_web_form')
264
+ self.public_web_form = attributes[:'public_web_form']
265
+ else
266
+ self.public_web_form = nil
221
267
  end
222
268
 
223
- if attributes.has_key?(:'scss')
224
- self.scss = attributes[:'scss']
269
+ if attributes.key?(:'public_submissions')
270
+ self.public_submissions = attributes[:'public_submissions']
271
+ else
272
+ self.public_submissions = nil
225
273
  end
226
274
 
227
- if attributes.has_key?(:'document_state')
228
- self.document_state = attributes[:'document_state']
275
+ if attributes.key?(:'expire_submissions')
276
+ self.expire_submissions = attributes[:'expire_submissions']
277
+ else
278
+ self.expire_submissions = nil
229
279
  end
230
280
 
231
- if attributes.has_key?(:'expire_after')
281
+ if attributes.key?(:'expire_after')
232
282
  self.expire_after = attributes[:'expire_after']
283
+ else
284
+ self.expire_after = nil
233
285
  end
234
286
 
235
- if attributes.has_key?(:'description')
236
- self.description = attributes[:'description']
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
237
309
  end
238
310
 
239
- if attributes.has_key?(:'slack_webhook_url')
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')
240
318
  self.slack_webhook_url = attributes[:'slack_webhook_url']
319
+ else
320
+ self.slack_webhook_url = nil
241
321
  end
242
322
 
243
- if attributes.has_key?(:'demo')
244
- self.demo = attributes[:'demo']
323
+ if attributes.key?(:'redirect_url')
324
+ self.redirect_url = attributes[:'redirect_url']
325
+ else
326
+ self.redirect_url = nil
245
327
  end
246
328
 
247
- if attributes.has_key?(:'path')
248
- self.path = attributes[:'path']
329
+ if attributes.key?(:'first_template')
330
+ self.first_template = attributes[:'first_template']
331
+ else
332
+ self.first_template = nil
249
333
  end
250
334
 
251
- if attributes.has_key?(:'header_html')
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')
252
342
  self.header_html = attributes[:'header_html']
343
+ else
344
+ self.header_html = nil
253
345
  end
254
346
 
255
- if attributes.has_key?(:'public_web_form')
256
- self.public_web_form = attributes[:'public_web_form']
347
+ if attributes.key?(:'footer_html')
348
+ self.footer_html = attributes[:'footer_html']
349
+ else
350
+ self.footer_html = nil
257
351
  end
258
352
 
259
- if attributes.has_key?(:'field_order')
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')
260
390
  if (value = attributes[:'field_order']).is_a?(Array)
261
391
  self.field_order = value
262
392
  end
393
+ else
394
+ self.field_order = nil
263
395
  end
264
396
 
265
- if attributes.has_key?(:'permanent_document_url')
266
- self.permanent_document_url = attributes[:'permanent_document_url']
397
+ if attributes.key?(:'document_md5')
398
+ self.document_md5 = attributes[:'document_md5']
399
+ else
400
+ self.document_md5 = nil
267
401
  end
268
402
 
269
- if attributes.has_key?(:'html')
270
- self.html = attributes[:'html']
403
+ if attributes.key?(:'document_filename')
404
+ self.document_filename = attributes[:'document_filename']
405
+ else
406
+ self.document_filename = nil
271
407
  end
272
408
 
273
- if attributes.has_key?(:'template_type')
274
- self.template_type = attributes[:'template_type']
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
275
439
  end
276
440
 
277
- if attributes.has_key?(:'id')
441
+ if attributes.key?(:'demo')
442
+ self.demo = attributes[:'demo']
443
+ else
444
+ self.demo = nil
445
+ end
446
+
447
+ if attributes.key?(:'id')
278
448
  self.id = attributes[:'id']
449
+ else
450
+ self.id = nil
279
451
  end
280
452
 
281
- if attributes.has_key?(:'page_dimensions')
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')
282
460
  if (value = attributes[:'page_dimensions']).is_a?(Array)
283
461
  self.page_dimensions = value
284
462
  end
463
+ else
464
+ self.page_dimensions = nil
285
465
  end
286
466
 
287
- if attributes.has_key?(:'locked')
288
- self.locked = attributes[:'locked']
467
+ if attributes.key?(:'document_url')
468
+ self.document_url = attributes[:'document_url']
469
+ else
470
+ self.document_url = nil
289
471
  end
290
472
 
291
- if attributes.has_key?(:'page_count')
292
- self.page_count = attributes[:'page_count']
473
+ if attributes.key?(:'permanent_document_url')
474
+ self.permanent_document_url = attributes[:'permanent_document_url']
475
+ else
476
+ self.permanent_document_url = nil
293
477
  end
294
478
 
295
- if attributes.has_key?(:'encrypt_pdfs')
296
- self.encrypt_pdfs = attributes[:'encrypt_pdfs']
479
+ if attributes.key?(:'path')
480
+ self.path = attributes[:'path']
481
+ else
482
+ self.path = nil
297
483
  end
298
484
 
299
- if attributes.has_key?(:'webhook_url')
300
- self.webhook_url = attributes[:'webhook_url']
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.')
301
499
  end
302
500
 
303
- if attributes.has_key?(:'embed_domains')
304
- if (value = attributes[:'embed_domains']).is_a?(Array)
305
- self.embed_domains = value
306
- end
501
+ if @public_submissions.nil?
502
+ invalid_properties.push('invalid value for "public_submissions", public_submissions cannot be nil.')
307
503
  end
308
504
 
309
- if attributes.has_key?(:'parent_folder_id')
310
- self.parent_folder_id = attributes[:'parent_folder_id']
505
+ if @expire_submissions.nil?
506
+ invalid_properties.push('invalid value for "expire_submissions", expire_submissions cannot be nil.')
311
507
  end
312
508
 
313
- if attributes.has_key?(:'allow_additional_properties')
314
- self.allow_additional_properties = attributes[:'allow_additional_properties']
509
+ if @expire_after.nil?
510
+ invalid_properties.push('invalid value for "expire_after", expire_after cannot be nil.')
315
511
  end
316
512
 
317
- if attributes.has_key?(:'encrypt_pdfs_password')
318
- self.encrypt_pdfs_password = attributes[:'encrypt_pdfs_password']
513
+ if @expiration_interval.nil?
514
+ invalid_properties.push('invalid value for "expiration_interval", expiration_interval cannot be nil.')
319
515
  end
320
516
 
321
- if attributes.has_key?(:'public_submissions')
322
- self.public_submissions = attributes[:'public_submissions']
517
+ if @allow_additional_properties.nil?
518
+ invalid_properties.push('invalid value for "allow_additional_properties", allow_additional_properties cannot be nil.')
323
519
  end
324
520
 
325
- if attributes.has_key?(:'shared_field_data')
326
- self.shared_field_data = attributes[:'shared_field_data']
521
+ if @editable_submissions.nil?
522
+ invalid_properties.push('invalid value for "editable_submissions", editable_submissions cannot be nil.')
327
523
  end
328
524
 
329
- if attributes.has_key?(:'document_md5')
330
- self.document_md5 = attributes[:'document_md5']
525
+ if @locked.nil?
526
+ invalid_properties.push('invalid value for "locked", locked cannot be nil.')
331
527
  end
332
528
 
333
- if attributes.has_key?(:'first_template')
334
- self.first_template = attributes[:'first_template']
529
+ if @first_template.nil?
530
+ invalid_properties.push('invalid value for "first_template", first_template cannot be nil.')
335
531
  end
336
532
 
337
- if attributes.has_key?(:'defaults')
338
- self.defaults = attributes[:'defaults']
533
+ if @encrypt_pdfs.nil?
534
+ invalid_properties.push('invalid value for "encrypt_pdfs", encrypt_pdfs cannot be nil.')
339
535
  end
340
536
 
341
- if attributes.has_key?(:'editable_submissions')
342
- self.editable_submissions = attributes[:'editable_submissions']
537
+ if @defaults.nil?
538
+ invalid_properties.push('invalid value for "defaults", defaults cannot be nil.')
343
539
  end
344
540
 
345
- if attributes.has_key?(:'expire_submissions')
346
- self.expire_submissions = attributes[:'expire_submissions']
541
+ if @fields.nil?
542
+ invalid_properties.push('invalid value for "fields", fields cannot be nil.')
347
543
  end
348
544
 
349
- if attributes.has_key?(:'name')
350
- self.name = attributes[:'name']
545
+ if @shared_field_data.nil?
546
+ invalid_properties.push('invalid value for "shared_field_data", shared_field_data cannot be nil.')
351
547
  end
352
548
 
353
- if attributes.has_key?(:'footer_html')
354
- self.footer_html = attributes[:'footer_html']
549
+ if @field_order.nil?
550
+ invalid_properties.push('invalid value for "field_order", field_order cannot be nil.')
355
551
  end
356
552
 
357
- if attributes.has_key?(:'document_parse_error')
358
- self.document_parse_error = attributes[:'document_parse_error']
553
+ if @document_parse_error.nil?
554
+ invalid_properties.push('invalid value for "document_parse_error", document_parse_error cannot be nil.')
359
555
  end
360
556
 
361
- if attributes.has_key?(:'fields')
362
- self.fields = attributes[:'fields']
557
+ if @document_state.nil?
558
+ invalid_properties.push('invalid value for "document_state", document_state cannot be nil.')
363
559
  end
364
560
 
365
- if attributes.has_key?(:'document_filename')
366
- self.document_filename = attributes[:'document_filename']
561
+ if @page_count.nil?
562
+ invalid_properties.push('invalid value for "page_count", page_count cannot be nil.')
367
563
  end
368
564
 
369
- if attributes.has_key?(:'redirect_url')
370
- self.redirect_url = attributes[:'redirect_url']
565
+ if @document_processed.nil?
566
+ invalid_properties.push('invalid value for "document_processed", document_processed cannot be nil.')
371
567
  end
372
568
 
373
- if attributes.has_key?(:'document_url')
374
- self.document_url = attributes[:'document_url']
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.')
375
583
  end
376
- end
377
584
 
378
- # Show invalid properties with the reasons. Usually used together with valid?
379
- # @return Array for valid properties with the reasons
380
- def list_invalid_properties
381
- invalid_properties = Array.new
382
585
  invalid_properties
383
586
  end
384
587
 
385
588
  # Check to see if the all the properties in the model are valid
386
589
  # @return true if the model is valid
387
590
  def valid?
388
- expiration_interval_validator = EnumAttributeValidator.new('String', ['minutes', 'hours', 'days'])
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"])
389
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?
390
616
  true
391
617
  end
392
618
 
393
619
  # Custom attribute writer method checking allowed values (enum).
394
620
  # @param [Object] expiration_interval Object to be assigned
395
621
  def expiration_interval=(expiration_interval)
396
- validator = EnumAttributeValidator.new('String', ['minutes', 'hours', 'days'])
622
+ validator = EnumAttributeValidator.new('String', ["minutes", "hours", "days"])
397
623
  unless validator.valid?(expiration_interval)
398
- fail ArgumentError, 'invalid value for "expiration_interval", must be one of #{validator.allowable_values}.'
624
+ fail ArgumentError, "invalid value for \"expiration_interval\", must be one of #{validator.allowable_values}."
399
625
  end
400
626
  @expiration_interval = expiration_interval
401
627
  end
@@ -405,45 +631,45 @@ module DocSpring
405
631
  def ==(o)
406
632
  return true if self.equal?(o)
407
633
  self.class == o.class &&
408
- document_processed == o.document_processed &&
409
- expiration_interval == o.expiration_interval &&
410
- scss == o.scss &&
411
- document_state == o.document_state &&
412
- expire_after == o.expire_after &&
634
+ name == o.name &&
413
635
  description == o.description &&
414
- slack_webhook_url == o.slack_webhook_url &&
415
- demo == o.demo &&
416
- path == o.path &&
417
- header_html == o.header_html &&
418
636
  public_web_form == o.public_web_form &&
419
- field_order == o.field_order &&
420
- permanent_document_url == o.permanent_document_url &&
421
- html == o.html &&
422
- template_type == o.template_type &&
423
- id == o.id &&
424
- page_dimensions == o.page_dimensions &&
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 &&
425
643
  locked == o.locked &&
426
- page_count == o.page_count &&
427
- encrypt_pdfs == o.encrypt_pdfs &&
428
644
  webhook_url == o.webhook_url &&
429
- embed_domains == o.embed_domains &&
430
- parent_folder_id == o.parent_folder_id &&
431
- allow_additional_properties == o.allow_additional_properties &&
432
- encrypt_pdfs_password == o.encrypt_pdfs_password &&
433
- public_submissions == o.public_submissions &&
434
- shared_field_data == o.shared_field_data &&
435
- document_md5 == o.document_md5 &&
645
+ slack_webhook_url == o.slack_webhook_url &&
646
+ redirect_url == o.redirect_url &&
436
647
  first_template == o.first_template &&
437
- defaults == o.defaults &&
438
- editable_submissions == o.editable_submissions &&
439
- expire_submissions == o.expire_submissions &&
440
- name == o.name &&
648
+ html == o.html &&
649
+ header_html == o.header_html &&
441
650
  footer_html == o.footer_html &&
442
- document_parse_error == o.document_parse_error &&
651
+ scss == o.scss &&
652
+ encrypt_pdfs == o.encrypt_pdfs &&
653
+ encrypt_pdfs_password == o.encrypt_pdfs_password &&
654
+ defaults == o.defaults &&
443
655
  fields == o.fields &&
656
+ shared_field_data == o.shared_field_data &&
657
+ field_order == o.field_order &&
658
+ document_md5 == o.document_md5 &&
444
659
  document_filename == o.document_filename &&
445
- redirect_url == o.redirect_url &&
446
- document_url == o.document_url
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
447
673
  end
448
674
 
449
675
  # @see the `==` method
@@ -453,39 +679,42 @@ module DocSpring
453
679
  end
454
680
 
455
681
  # Calculates hash code according to all attributes.
456
- # @return [Fixnum] Hash code
682
+ # @return [Integer] Hash code
457
683
  def hash
458
- [document_processed, expiration_interval, scss, document_state, expire_after, description, slack_webhook_url, demo, path, header_html, public_web_form, field_order, permanent_document_url, html, template_type, id, page_dimensions, locked, page_count, encrypt_pdfs, webhook_url, embed_domains, parent_folder_id, allow_additional_properties, encrypt_pdfs_password, public_submissions, shared_field_data, document_md5, first_template, defaults, editable_submissions, expire_submissions, name, footer_html, document_parse_error, fields, document_filename, redirect_url, document_url].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
459
685
  end
460
686
 
461
687
  # Builds the object from hash
462
688
  # @param [Hash] attributes Model attributes in the form of hash
463
689
  # @return [Object] Returns the model itself
464
- def build_from_hash(attributes)
690
+ def self.build_from_hash(attributes)
465
691
  return nil unless attributes.is_a?(Hash)
466
- self.class.openapi_types.each_pair do |key, type|
467
- if type =~ /\AArray<(.*)>/i
468
- # check to ensure the input is an array given that the the attribute
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
469
699
  # is documented as an array but the input is not
470
- if attributes[self.class.attribute_map[key]].is_a?(Array)
471
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
700
+ if attributes[attribute_map[key]].is_a?(Array)
701
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
472
702
  end
473
- elsif !attributes[self.class.attribute_map[key]].nil?
474
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
475
- end # or else data not found in attributes(hash), not an issue as the data can be optional
703
+ elsif !attributes[attribute_map[key]].nil?
704
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
705
+ end
476
706
  end
477
-
478
- self
707
+ new(transformed_hash)
479
708
  end
480
709
 
481
710
  # Deserializes the data based on type
482
711
  # @param string type Data type
483
712
  # @param string value Value to be deserialized
484
713
  # @return [Object] Deserialized data
485
- def _deserialize(type, value)
714
+ def self._deserialize(type, value)
486
715
  case type.to_sym
487
- when :DateTime
488
- DateTime.parse(value)
716
+ when :Time
717
+ Time.parse(value)
489
718
  when :Date
490
719
  Date.parse(value)
491
720
  when :String
@@ -494,7 +723,7 @@ module DocSpring
494
723
  value.to_i
495
724
  when :Float
496
725
  value.to_f
497
- when :BOOLEAN
726
+ when :Boolean
498
727
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
499
728
  true
500
729
  else
@@ -515,8 +744,9 @@ module DocSpring
515
744
  end
516
745
  end
517
746
  else # model
518
- temp_model = DocSpring.const_get(type).new
519
- temp_model.build_from_hash(value)
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)
520
750
  end
521
751
  end
522
752
 
@@ -538,7 +768,11 @@ module DocSpring
538
768
  hash = {}
539
769
  self.class.attribute_map.each_pair do |attr, param|
540
770
  value = self.send(attr)
541
- next if value.nil?
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
+
542
776
  hash[param] = _to_hash(value)
543
777
  end
544
778
  hash
@@ -561,5 +795,7 @@ module DocSpring
561
795
  value
562
796
  end
563
797
  end
798
+
564
799
  end
800
+
565
801
  end