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.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +26 -0
- data/.openapi-generator/FILES +220 -0
- data/.openapi-generator/VERSION +1 -1
- data/.rubocop.yml +6 -12
- data/.travis.yml +11 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +5 -1
- data/Gemfile.lock +85 -48
- data/README.md +47 -16
- data/docs/AddFieldsData.md +13 -3
- data/docs/AddFieldsTemplateResponse.md +17 -5
- data/docs/AuthenticationError.md +15 -4
- data/docs/AuthenticationSuccessResponse.md +13 -3
- data/docs/CombinePdfsData.md +23 -7
- data/docs/CombinedSubmission.md +37 -12
- data/docs/CombinedSubmissionAction.md +23 -8
- data/docs/CombinedSubmissionData.md +21 -6
- data/docs/CopyTemplateData.md +15 -4
- data/docs/CreateCombinedSubmissionResponse.md +17 -5
- data/docs/CreateCustomFileData.md +13 -3
- data/docs/CreateCustomFileResponse.md +17 -5
- data/docs/CreateFolderAttributes.md +20 -0
- data/docs/CreateFolderData.md +13 -3
- data/docs/CreateHtmlTemplateData.md +13 -3
- data/docs/CreateSubmissionBatchResponse.md +21 -7
- data/docs/CreateSubmissionBatchSubmissionsResponse.md +17 -5
- data/docs/CreateSubmissionData.md +36 -0
- data/docs/CreateSubmissionDataRequestData.md +37 -15
- data/docs/CreateSubmissionDataRequestEventRequest.md +24 -0
- data/docs/CreateSubmissionDataRequestEventResponse.md +22 -0
- data/docs/CreateSubmissionDataRequestTokenResponse.md +17 -5
- data/docs/CreateSubmissionResponse.md +17 -5
- data/docs/CreateTemplateFromUploadData.md +13 -3
- data/docs/DataRequestToken.md +24 -0
- data/docs/DeleteTemplateResponse.md +20 -0
- data/docs/ErrorResponse.md +20 -0
- data/docs/Folder.md +19 -6
- data/docs/FullTemplate.md +94 -0
- data/docs/HtmlTemplateData.md +51 -19
- data/docs/HtmlTemplateDataWebhookOptions.md +18 -0
- data/docs/InvalidRequest.md +15 -4
- data/docs/InvalidRequestSingleError.md +20 -0
- data/docs/ListSubmissionsResponse.md +22 -0
- data/docs/MoveFolderData.md +13 -3
- data/docs/MoveTemplateData.md +13 -3
- data/docs/PDFApi.md +1746 -495
- data/docs/PendingTemplate.md +45 -19
- data/docs/PreviewPdfResponse.md +20 -0
- data/docs/PublishTemplateVersion404Response.md +20 -0
- data/docs/PublishTemplateVersion422Response.md +20 -0
- data/docs/PublishTemplateVersionResponse.md +20 -0
- data/docs/PublishTemplateVersionResponseResult.md +24 -0
- data/docs/PublishVersionData.md +20 -0
- data/docs/RenameFolderData.md +13 -3
- data/docs/RestoreTemplateVersionResponse.md +18 -0
- data/docs/RestoreVersionData.md +18 -0
- data/docs/Submission.md +49 -21
- data/docs/SubmissionAction.md +23 -8
- data/docs/SubmissionBatch.md +29 -11
- data/docs/SubmissionBatchData.md +21 -6
- data/docs/SubmissionData.md +23 -9
- data/docs/SubmissionDataBatchRequest.md +25 -8
- data/docs/SubmissionDataRequest.md +53 -22
- data/docs/SubmissionDataRequestEvent.md +30 -0
- data/docs/Template.md +51 -22
- data/docs/TemplateData.md +49 -18
- data/docs/TemplateDefaults.md +22 -0
- data/docs/TemplateDocument.md +22 -0
- data/docs/TemplateDocumentMetadata.md +22 -0
- data/docs/TemplateSchema.md +34 -0
- data/docs/UpdateDataRequestResponse.md +17 -5
- data/docs/UpdateSubmissionDataRequestData.md +37 -15
- data/docs/UpdateTemplateData.md +13 -3
- data/docs/UpdateTemplateResponse.md +15 -4
- data/docs/UploadPresign.md +24 -0
- data/docs/UploadTemplateData.md +53 -20
- data/docspring.gemspec +14 -11
- data/git_push.sh +11 -9
- data/lib/docspring/api/pdf_api.rb +1485 -497
- data/lib/docspring/api_client.rb +106 -98
- data/lib/docspring/api_error.rb +22 -2
- data/lib/docspring/configuration.rb +127 -16
- data/lib/docspring/models/add_fields_data.rb +59 -26
- data/lib/docspring/models/add_fields_template_response.rb +81 -43
- data/lib/docspring/models/authentication_error.rb +62 -29
- data/lib/docspring/models/authentication_success_response.rb +66 -28
- data/lib/docspring/models/combine_pdfs_data.rb +74 -32
- data/lib/docspring/models/combined_submission.rb +167 -68
- data/lib/docspring/models/combined_submission_action.rb +83 -39
- data/lib/docspring/models/combined_submission_data.rb +72 -30
- data/lib/docspring/models/copy_template_data.rb +59 -26
- data/lib/docspring/models/create_combined_submission_response.rb +86 -41
- data/lib/docspring/models/create_custom_file_data.rb +58 -25
- data/lib/docspring/models/create_custom_file_response.rb +86 -41
- data/lib/docspring/models/create_folder_attributes.rb +230 -0
- data/lib/docspring/models/create_folder_data.rb +59 -26
- data/lib/docspring/models/create_html_template_data.rb +58 -25
- data/lib/docspring/models/create_submission_batch_response.rb +104 -52
- data/lib/docspring/models/create_submission_batch_submissions_response.rb +79 -41
- data/lib/docspring/models/create_submission_data.rb +304 -0
- data/lib/docspring/models/create_submission_data_request_data.rb +139 -90
- data/lib/docspring/models/create_submission_data_request_event_request.rb +297 -0
- data/lib/docspring/models/create_submission_data_request_event_response.rb +282 -0
- data/lib/docspring/models/create_submission_data_request_token_response.rb +85 -40
- data/lib/docspring/models/create_submission_response.rb +86 -41
- data/lib/docspring/models/create_template_from_upload_data.rb +58 -25
- data/lib/docspring/models/{custom_file.rb → data_request_token.rb} +110 -33
- data/lib/docspring/models/delete_template_response.rb +266 -0
- data/lib/docspring/models/{error.rb → error_response.rb} +65 -30
- data/lib/docspring/models/folder.rb +78 -46
- data/lib/docspring/models/full_template.rb +801 -0
- data/lib/docspring/models/html_template_data.rb +180 -110
- data/lib/docspring/models/{folders_folder.rb → html_template_data_webhook_options.rb} +63 -41
- data/lib/docspring/models/invalid_request.rb +64 -29
- data/lib/docspring/models/invalid_request_single_error.rb +271 -0
- data/lib/docspring/models/list_submissions_response.rb +251 -0
- data/lib/docspring/models/move_folder_data.rb +56 -25
- data/lib/docspring/models/move_template_data.rb +58 -25
- data/lib/docspring/models/pending_template.rb +221 -118
- data/lib/docspring/models/preview_pdf_response.rb +264 -0
- data/lib/docspring/models/publish_template_version404_response.rb +271 -0
- data/lib/docspring/models/publish_template_version422_response.rb +273 -0
- data/lib/docspring/models/publish_template_version_response.rb +271 -0
- data/lib/docspring/models/publish_template_version_response_result.rb +263 -0
- data/lib/docspring/models/publish_version_data.rb +230 -0
- data/lib/docspring/models/rename_folder_data.rb +58 -25
- data/lib/docspring/models/restore_template_version_response.rb +255 -0
- data/lib/docspring/models/{create_submission_data_request_token_response_token.rb → restore_version_data.rb} +69 -58
- data/lib/docspring/models/submission.rb +98 -49
- data/lib/docspring/models/submission_action.rb +83 -39
- data/lib/docspring/models/submission_batch.rb +158 -75
- data/lib/docspring/models/submission_batch_data.rb +74 -30
- data/lib/docspring/models/submission_data.rb +65 -41
- data/lib/docspring/models/submission_data_batch_request.rb +100 -49
- data/lib/docspring/models/submission_data_request.rb +123 -54
- data/lib/docspring/models/submission_data_request_event.rb +309 -0
- data/lib/docspring/models/template.rb +267 -132
- data/lib/docspring/models/template_data.rb +173 -105
- data/lib/docspring/models/template_defaults.rb +249 -0
- data/lib/docspring/models/{upload_template_data_document.rb → template_document.rb} +91 -39
- data/lib/docspring/models/{upload_template_data_document_metadata.rb → template_document_metadata.rb} +94 -42
- data/lib/docspring/models/template_schema.rb +288 -0
- data/lib/docspring/models/update_data_request_response.rb +86 -41
- data/lib/docspring/models/update_submission_data_request_data.rb +82 -43
- data/lib/docspring/models/update_template_data.rb +58 -25
- data/lib/docspring/models/update_template_response.rb +79 -41
- data/lib/docspring/models/upload_presign.rb +296 -0
- data/lib/docspring/models/upload_template_data.rb +186 -116
- data/lib/docspring/version.rb +3 -3
- data/lib/docspring.rb +30 -10
- data/spec/api/client_integration_spec.rb +26 -19
- data/spec/api/pdf_api_integration_spec.rb +21 -19
- data/spec/api/pdf_api_spec_original.skipped.rb +469 -98
- data/spec/models/add_fields_data_spec.rb +8 -13
- data/spec/models/add_fields_template_response_spec.rb +16 -21
- data/spec/models/authentication_error_spec.rb +10 -15
- data/spec/models/authentication_success_response_spec.rb +9 -14
- data/spec/models/combine_pdfs_data_spec.rb +18 -17
- data/spec/models/combined_submission_action_spec.rb +16 -21
- data/spec/models/combined_submission_data_spec.rb +17 -16
- data/spec/models/combined_submission_spec.rb +45 -32
- data/spec/models/copy_template_data_spec.rb +9 -14
- data/spec/models/create_combined_submission_response_spec.rb +16 -21
- data/spec/models/create_custom_file_data_spec.rb +8 -13
- data/spec/models/create_custom_file_response_spec.rb +16 -21
- data/spec/models/create_folder_attributes_spec.rb +42 -0
- data/spec/models/create_folder_data_spec.rb +8 -13
- data/spec/models/create_html_template_data_spec.rb +8 -13
- data/spec/models/create_submission_batch_response_spec.rb +21 -26
- data/spec/models/create_submission_batch_submissions_response_spec.rb +16 -21
- data/spec/models/create_submission_data_request_data_spec.rb +33 -38
- data/spec/models/create_submission_data_request_event_request_spec.rb +62 -0
- data/spec/models/create_submission_data_request_event_response_spec.rb +52 -0
- data/spec/models/create_submission_data_request_token_response_spec.rb +15 -20
- data/spec/models/create_submission_data_spec.rb +90 -0
- data/spec/models/create_submission_response_spec.rb +16 -21
- data/spec/models/create_template_from_upload_data_spec.rb +8 -13
- data/spec/models/data_request_token_spec.rb +54 -0
- data/spec/models/delete_template_response_spec.rb +46 -0
- data/spec/models/error_response_spec.rb +46 -0
- data/spec/models/folder_spec.rb +15 -20
- data/spec/models/full_template_spec.rb +268 -0
- data/spec/models/html_template_data_spec.rb +62 -49
- data/spec/models/html_template_data_webhook_options_spec.rb +36 -0
- data/spec/models/invalid_request_single_error_spec.rb +46 -0
- data/spec/models/invalid_request_spec.rb +10 -15
- data/spec/models/list_submissions_response_spec.rb +48 -0
- data/spec/models/move_folder_data_spec.rb +8 -13
- data/spec/models/move_template_data_spec.rb +8 -13
- data/spec/models/pending_template_spec.rb +45 -50
- data/spec/models/preview_pdf_response_spec.rb +46 -0
- data/spec/models/publish_template_version404_response_spec.rb +46 -0
- data/spec/models/publish_template_version422_response_spec.rb +46 -0
- data/spec/models/publish_template_version_response_result_spec.rb +54 -0
- data/spec/models/publish_template_version_response_spec.rb +46 -0
- data/spec/models/publish_version_data_spec.rb +42 -0
- data/spec/models/rename_folder_data_spec.rb +8 -13
- data/spec/models/restore_template_version_response_spec.rb +40 -0
- data/spec/models/restore_version_data_spec.rb +36 -0
- data/spec/models/submission_action_spec.rb +16 -21
- data/spec/models/submission_batch_data_spec.rb +17 -16
- data/spec/models/submission_batch_spec.rb +29 -34
- data/spec/models/submission_data_batch_request_spec.rb +24 -23
- data/spec/models/submission_data_request_event_spec.rb +72 -0
- data/spec/models/submission_data_request_spec.rb +36 -35
- data/spec/models/submission_data_spec.rb +13 -24
- data/spec/models/submission_spec.rb +27 -32
- data/spec/models/template_data_spec.rb +59 -46
- data/spec/models/template_defaults_spec.rb +48 -0
- data/spec/models/template_document_metadata_spec.rb +52 -0
- data/spec/models/template_document_spec.rb +52 -0
- data/spec/models/template_schema_spec.rb +84 -0
- data/spec/models/template_spec.rb +50 -55
- data/spec/models/update_data_request_response_spec.rb +16 -21
- data/spec/models/update_submission_data_request_data_spec.rb +22 -27
- data/spec/models/update_template_data_spec.rb +8 -13
- data/spec/models/update_template_response_spec.rb +14 -19
- data/spec/models/upload_presign_spec.rb +58 -0
- data/spec/models/upload_template_data_spec.rb +64 -51
- data/spec/spec_helper.rb +5 -5
- metadata +112 -124
- data/docs/CreateSubmissionDataRequestTokenResponseToken.md +0 -11
- data/docs/CustomFile.md +0 -9
- data/docs/Error.md +0 -9
- data/docs/FoldersFolder.md +0 -9
- data/docs/TemplatestemplateIdaddFieldsFields.md +0 -92
- data/docs/UploadTemplateDataDocument.md +0 -10
- data/docs/UploadTemplateDataDocumentMetadata.md +0 -10
- data/lib/docspring/models/templatestemplate_idadd_fields_fields.rb +0 -1306
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -53
- data/spec/models/create_submission_data_request_token_response_token_spec.rb +0 -59
- data/spec/models/custom_file_spec.rb +0 -47
- data/spec/models/error_spec.rb +0 -51
- data/spec/models/folders_folder_spec.rb +0 -47
- data/spec/models/templatestemplate_idadd_fields_fields_spec.rb +0 -589
- data/spec/models/upload_template_data_document_metadata_spec.rb +0 -57
- 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
|