docspring 1.1.0 → 1.3.2

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 (143) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/VERSION +1 -1
  3. data/CHANGELOG.md +20 -0
  4. data/Gemfile.lock +1 -1
  5. data/LICENSE +1 -1
  6. data/README.md +22 -15
  7. data/docs/AddFieldsData.md +8 -0
  8. data/docs/AddFieldsTemplateResponse.md +10 -0
  9. data/docs/CombinePdfsData.md +4 -4
  10. data/docs/CombinedSubmissionData.md +3 -3
  11. data/docs/CopyTemplateData.md +9 -0
  12. data/docs/CreateHtmlTemplateData.md +8 -0
  13. data/docs/CreateSubmissionDataRequestData.md +2 -2
  14. data/docs/CreateTemplateFromUploadData.md +8 -0
  15. data/docs/{TemplatesdesccachedUploadTemplate.md → HtmlTemplateData.md} +3 -4
  16. data/docs/MoveTemplateData.md +1 -1
  17. data/docs/PDFApi.md +113 -9
  18. data/docs/PendingTemplate.md +1 -0
  19. data/docs/Submission.md +4 -0
  20. data/docs/SubmissionBatchData.md +2 -2
  21. data/docs/SubmissionData.md +4 -4
  22. data/docs/SubmissionDataBatchRequest.md +2 -2
  23. data/docs/SubmissionDataRequest.md +1 -0
  24. data/docs/Template.md +1 -0
  25. data/docs/{TemplatestemplateIdTemplate.md → TemplateData.md} +3 -3
  26. data/docs/TemplatestemplateIdaddFieldsFields.md +92 -0
  27. data/docs/UpdateSubmissionDataRequestData.md +9 -9
  28. data/docs/UpdateTemplateData.md +1 -1
  29. data/docs/UploadTemplateData.md +25 -0
  30. data/docs/UploadTemplateDataDocument.md +10 -0
  31. data/docs/{TemplatesdesccachedUploadTemplateDocumentMetadata.md → UploadTemplateDataDocumentMetadata.md} +1 -1
  32. data/docspring.gemspec +2 -2
  33. data/lib/docspring.rb +12 -7
  34. data/lib/docspring/api/pdf_api.rb +137 -19
  35. data/lib/docspring/api_client.rb +1 -1
  36. data/lib/docspring/api_error.rb +1 -1
  37. data/lib/docspring/configuration.rb +1 -1
  38. data/lib/docspring/models/add_fields_data.rb +190 -0
  39. data/lib/docspring/models/add_fields_template_response.rb +239 -0
  40. data/lib/docspring/models/authentication_error.rb +1 -1
  41. data/lib/docspring/models/authentication_success_response.rb +1 -1
  42. data/lib/docspring/models/combine_pdfs_data.rb +28 -28
  43. data/lib/docspring/models/combined_submission.rb +1 -1
  44. data/lib/docspring/models/combined_submission_action.rb +1 -6
  45. data/lib/docspring/models/combined_submission_data.rb +23 -23
  46. data/lib/docspring/models/copy_template_data.rb +197 -0
  47. data/lib/docspring/models/create_combined_submission_response.rb +1 -1
  48. data/lib/docspring/models/create_custom_file_data.rb +1 -1
  49. data/lib/docspring/models/create_custom_file_response.rb +1 -1
  50. data/lib/docspring/models/create_folder_data.rb +1 -1
  51. data/lib/docspring/models/{create_template_data.rb → create_html_template_data.rb} +3 -3
  52. data/lib/docspring/models/create_submission_batch_response.rb +1 -1
  53. data/lib/docspring/models/create_submission_batch_submissions_response.rb +1 -1
  54. data/lib/docspring/models/create_submission_data_request_data.rb +20 -20
  55. data/lib/docspring/models/create_submission_data_request_token_response.rb +1 -1
  56. data/lib/docspring/models/create_submission_data_request_token_response_token.rb +1 -1
  57. data/lib/docspring/models/create_submission_response.rb +1 -1
  58. data/lib/docspring/models/{create_template_data1.rb → create_template_from_upload_data.rb} +3 -3
  59. data/lib/docspring/models/custom_file.rb +1 -1
  60. data/lib/docspring/models/error.rb +1 -1
  61. data/lib/docspring/models/folder.rb +1 -1
  62. data/lib/docspring/models/folders_folder.rb +1 -1
  63. data/lib/docspring/models/html_template_data.rb +373 -0
  64. data/lib/docspring/models/invalid_request.rb +1 -1
  65. data/lib/docspring/models/move_folder_data.rb +1 -1
  66. data/lib/docspring/models/move_template_data.rb +6 -1
  67. data/lib/docspring/models/pending_template.rb +11 -2
  68. data/lib/docspring/models/rename_folder_data.rb +1 -1
  69. data/lib/docspring/models/submission.rb +41 -5
  70. data/lib/docspring/models/submission_action.rb +1 -6
  71. data/lib/docspring/models/submission_batch.rb +1 -1
  72. data/lib/docspring/models/submission_batch_data.rb +16 -16
  73. data/lib/docspring/models/submission_data.rb +34 -34
  74. data/lib/docspring/models/submission_data_batch_request.rb +20 -20
  75. data/lib/docspring/models/submission_data_request.rb +14 -15
  76. data/lib/docspring/models/template.rb +11 -2
  77. data/lib/docspring/models/{templatestemplate_id_template.rb → template_data.rb} +21 -21
  78. data/lib/docspring/models/templatestemplate_idadd_fields_fields.rb +1306 -0
  79. data/lib/docspring/models/update_data_request_response.rb +1 -1
  80. data/lib/docspring/models/update_submission_data_request_data.rb +79 -79
  81. data/lib/docspring/models/update_template_data.rb +2 -2
  82. data/lib/docspring/models/update_template_response.rb +1 -1
  83. data/lib/docspring/models/{templatesdesccached_upload_template.rb → upload_template_data.rb} +22 -22
  84. data/lib/docspring/models/{templatesdesccached_upload_template_document.rb → upload_template_data_document.rb} +3 -3
  85. data/lib/docspring/models/{templatesdesccached_upload_template_document_metadata.rb → upload_template_data_document_metadata.rb} +2 -2
  86. data/lib/docspring/version.rb +2 -2
  87. data/spec/api/pdf_api_integration_spec.rb +49 -18
  88. data/spec/api/pdf_api_spec_original.skipped.rb +36 -8
  89. data/spec/api_client_spec.rb +1 -1
  90. data/spec/configuration_spec.rb +1 -1
  91. data/spec/models/add_fields_data_spec.rb +41 -0
  92. data/spec/models/add_fields_template_response_spec.rb +57 -0
  93. data/spec/models/authentication_error_spec.rb +1 -1
  94. data/spec/models/authentication_success_response_spec.rb +1 -1
  95. data/spec/models/combine_pdfs_data_spec.rb +5 -5
  96. data/spec/models/combined_submission_action_spec.rb +1 -1
  97. data/spec/models/combined_submission_data_spec.rb +5 -5
  98. data/spec/models/combined_submission_spec.rb +1 -1
  99. data/spec/models/copy_template_data_spec.rb +47 -0
  100. data/spec/models/create_combined_submission_response_spec.rb +1 -1
  101. data/spec/models/create_custom_file_data_spec.rb +1 -1
  102. data/spec/models/create_custom_file_response_spec.rb +1 -1
  103. data/spec/models/create_folder_data_spec.rb +1 -1
  104. data/spec/models/{create_template_data_spec.rb → create_html_template_data_spec.rb} +7 -7
  105. data/spec/models/create_submission_batch_response_spec.rb +1 -1
  106. data/spec/models/create_submission_batch_submissions_response_spec.rb +1 -1
  107. data/spec/models/create_submission_data_request_data_spec.rb +9 -9
  108. data/spec/models/create_submission_data_request_token_response_spec.rb +1 -1
  109. data/spec/models/create_submission_data_request_token_response_token_spec.rb +1 -1
  110. data/spec/models/create_submission_response_spec.rb +1 -1
  111. data/spec/models/{create_template_data1_spec.rb → create_template_from_upload_data_spec.rb} +7 -7
  112. data/spec/models/custom_file_spec.rb +1 -1
  113. data/spec/models/error_spec.rb +1 -1
  114. data/spec/models/folder_spec.rb +1 -1
  115. data/spec/models/folders_folder_spec.rb +1 -1
  116. data/spec/models/html_template_data_spec.rb +145 -0
  117. data/spec/models/invalid_request_spec.rb +1 -1
  118. data/spec/models/move_folder_data_spec.rb +1 -1
  119. data/spec/models/move_template_data_spec.rb +1 -1
  120. data/spec/models/pending_template_spec.rb +7 -1
  121. data/spec/models/rename_folder_data_spec.rb +1 -1
  122. data/spec/models/submission_action_spec.rb +1 -1
  123. data/spec/models/submission_batch_data_spec.rb +3 -3
  124. data/spec/models/submission_batch_spec.rb +1 -1
  125. data/spec/models/submission_data_batch_request_spec.rb +5 -5
  126. data/spec/models/submission_data_request_spec.rb +7 -1
  127. data/spec/models/submission_data_spec.rb +7 -7
  128. data/spec/models/submission_spec.rb +25 -1
  129. data/spec/models/{templatestemplate_id_template_spec.rb → template_data_spec.rb} +11 -11
  130. data/spec/models/template_spec.rb +7 -1
  131. data/spec/models/templatestemplate_idadd_fields_fields_spec.rb +589 -0
  132. data/spec/models/update_data_request_response_spec.rb +1 -1
  133. data/spec/models/update_submission_data_request_data_spec.rb +17 -17
  134. data/spec/models/update_template_data_spec.rb +1 -1
  135. data/spec/models/update_template_response_spec.rb +1 -1
  136. data/spec/models/{templatesdesccached_upload_template_document_metadata_spec.rb → upload_template_data_document_metadata_spec.rb} +7 -7
  137. data/spec/models/{templatesdesccached_upload_template_document_spec.rb → upload_template_data_document_spec.rb} +7 -7
  138. data/spec/models/{templatesdesccached_upload_template_spec.rb → upload_template_data_spec.rb} +12 -12
  139. data/spec/spec_helper.rb +1 -1
  140. metadata +50 -30
  141. data/docs/CreateTemplateData.md +0 -8
  142. data/docs/CreateTemplateData1.md +0 -8
  143. data/docs/TemplatesdesccachedUploadTemplateDocument.md +0 -10
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,14 +6,14 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module DocSpring
16
- class CreateTemplateData
16
+ class CreateHtmlTemplateData
17
17
  attr_accessor :template
18
18
 
19
19
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -26,7 +26,7 @@ module DocSpring
26
26
  # Attribute type mapping.
27
27
  def self.openapi_types
28
28
  {
29
- :'template' => :'TemplatesdesccachedUploadTemplate'
29
+ :'template' => :'HtmlTemplateData'
30
30
  }
31
31
  end
32
32
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -14,10 +14,10 @@ require 'date'
14
14
 
15
15
  module DocSpring
16
16
  class CreateSubmissionDataRequestData
17
- attr_accessor :metadata
18
-
19
17
  attr_accessor :auth_type
20
18
 
19
+ attr_accessor :metadata
20
+
21
21
  attr_accessor :auth_second_factor_type
22
22
 
23
23
  attr_accessor :auth_phone_number_hash
@@ -34,10 +34,10 @@ module DocSpring
34
34
 
35
35
  attr_accessor :fields
36
36
 
37
- attr_accessor :email
38
-
39
37
  attr_accessor :auth_provider
40
38
 
39
+ attr_accessor :email
40
+
41
41
  attr_accessor :order
42
42
 
43
43
  class EnumAttributeValidator
@@ -65,8 +65,8 @@ module DocSpring
65
65
  # Attribute mapping from ruby-style variable name to JSON key.
66
66
  def self.attribute_map
67
67
  {
68
- :'metadata' => :'metadata',
69
68
  :'auth_type' => :'auth_type',
69
+ :'metadata' => :'metadata',
70
70
  :'auth_second_factor_type' => :'auth_second_factor_type',
71
71
  :'auth_phone_number_hash' => :'auth_phone_number_hash',
72
72
  :'auth_session_started_at' => :'auth_session_started_at',
@@ -75,8 +75,8 @@ module DocSpring
75
75
  :'auth_username_hash' => :'auth_username_hash',
76
76
  :'name' => :'name',
77
77
  :'fields' => :'fields',
78
- :'email' => :'email',
79
78
  :'auth_provider' => :'auth_provider',
79
+ :'email' => :'email',
80
80
  :'order' => :'order'
81
81
  }
82
82
  end
@@ -84,8 +84,8 @@ module DocSpring
84
84
  # Attribute type mapping.
85
85
  def self.openapi_types
86
86
  {
87
- :'metadata' => :'Object',
88
87
  :'auth_type' => :'String',
88
+ :'metadata' => :'Object',
89
89
  :'auth_second_factor_type' => :'String',
90
90
  :'auth_phone_number_hash' => :'String',
91
91
  :'auth_session_started_at' => :'String',
@@ -94,8 +94,8 @@ module DocSpring
94
94
  :'auth_username_hash' => :'String',
95
95
  :'name' => :'String',
96
96
  :'fields' => :'Array<String>',
97
- :'email' => :'String',
98
97
  :'auth_provider' => :'String',
98
+ :'email' => :'String',
99
99
  :'order' => :'Integer'
100
100
  }
101
101
  end
@@ -108,14 +108,14 @@ module DocSpring
108
108
  # convert string to symbol for hash key
109
109
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
110
110
 
111
- if attributes.has_key?(:'metadata')
112
- self.metadata = attributes[:'metadata']
113
- end
114
-
115
111
  if attributes.has_key?(:'auth_type')
116
112
  self.auth_type = attributes[:'auth_type']
117
113
  end
118
114
 
115
+ if attributes.has_key?(:'metadata')
116
+ self.metadata = attributes[:'metadata']
117
+ end
118
+
119
119
  if attributes.has_key?(:'auth_second_factor_type')
120
120
  self.auth_second_factor_type = attributes[:'auth_second_factor_type']
121
121
  end
@@ -150,14 +150,14 @@ module DocSpring
150
150
  end
151
151
  end
152
152
 
153
- if attributes.has_key?(:'email')
154
- self.email = attributes[:'email']
155
- end
156
-
157
153
  if attributes.has_key?(:'auth_provider')
158
154
  self.auth_provider = attributes[:'auth_provider']
159
155
  end
160
156
 
157
+ if attributes.has_key?(:'email')
158
+ self.email = attributes[:'email']
159
+ end
160
+
161
161
  if attributes.has_key?(:'order')
162
162
  self.order = attributes[:'order']
163
163
  end
@@ -205,8 +205,8 @@ module DocSpring
205
205
  def ==(o)
206
206
  return true if self.equal?(o)
207
207
  self.class == o.class &&
208
- metadata == o.metadata &&
209
208
  auth_type == o.auth_type &&
209
+ metadata == o.metadata &&
210
210
  auth_second_factor_type == o.auth_second_factor_type &&
211
211
  auth_phone_number_hash == o.auth_phone_number_hash &&
212
212
  auth_session_started_at == o.auth_session_started_at &&
@@ -215,8 +215,8 @@ module DocSpring
215
215
  auth_username_hash == o.auth_username_hash &&
216
216
  name == o.name &&
217
217
  fields == o.fields &&
218
- email == o.email &&
219
218
  auth_provider == o.auth_provider &&
219
+ email == o.email &&
220
220
  order == o.order
221
221
  end
222
222
 
@@ -229,7 +229,7 @@ module DocSpring
229
229
  # Calculates hash code according to all attributes.
230
230
  # @return [Fixnum] Hash code
231
231
  def hash
232
- [metadata, auth_type, auth_second_factor_type, auth_phone_number_hash, auth_session_started_at, auth_user_id_hash, auth_session_id_hash, auth_username_hash, name, fields, email, auth_provider, order].hash
232
+ [auth_type, metadata, auth_second_factor_type, auth_phone_number_hash, auth_session_started_at, auth_user_id_hash, auth_session_id_hash, auth_username_hash, name, fields, auth_provider, email, order].hash
233
233
  end
234
234
 
235
235
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,14 +6,14 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module DocSpring
16
- class CreateTemplateData1
16
+ class CreateTemplateFromUploadData
17
17
  attr_accessor :template
18
18
 
19
19
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -26,7 +26,7 @@ module DocSpring
26
26
  # Attribute type mapping.
27
27
  def self.openapi_types
28
28
  {
29
- :'template' => :'TemplatesdesccachedUploadTemplate'
29
+ :'template' => :'UploadTemplateData'
30
30
  }
31
31
  end
32
32
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  OpenAPI spec version: v1
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 3.3.0-SNAPSHOT
9
+ OpenAPI Generator version: 3.3.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,373 @@
1
+ =begin
2
+ #API v1
3
+
4
+ #DocSpring is a service that helps you fill out and sign PDF templates.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module DocSpring
16
+ class HtmlTemplateData
17
+ attr_accessor :expiration_interval
18
+
19
+ attr_accessor :webhook_url
20
+
21
+ attr_accessor :scss
22
+
23
+ attr_accessor :allow_additional_properties
24
+
25
+ attr_accessor :expire_after
26
+
27
+ attr_accessor :description
28
+
29
+ attr_accessor :public_submissions
30
+
31
+ attr_accessor :slack_webhook_url
32
+
33
+ attr_accessor :header_html
34
+
35
+ attr_accessor :public_web_form
36
+
37
+ attr_accessor :editable_submissions
38
+
39
+ attr_accessor :expire_submissions
40
+
41
+ attr_accessor :name
42
+
43
+ attr_accessor :footer_html
44
+
45
+ attr_accessor :html
46
+
47
+ attr_accessor :template_type
48
+
49
+ attr_accessor :redirect_url
50
+
51
+ class EnumAttributeValidator
52
+ attr_reader :datatype
53
+ attr_reader :allowable_values
54
+
55
+ def initialize(datatype, allowable_values)
56
+ @allowable_values = allowable_values.map do |value|
57
+ case datatype.to_s
58
+ when /Integer/i
59
+ value.to_i
60
+ when /Float/i
61
+ value.to_f
62
+ else
63
+ value
64
+ end
65
+ end
66
+ end
67
+
68
+ def valid?(value)
69
+ !value || allowable_values.include?(value)
70
+ end
71
+ end
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'expiration_interval' => :'expiration_interval',
77
+ :'webhook_url' => :'webhook_url',
78
+ :'scss' => :'scss',
79
+ :'allow_additional_properties' => :'allow_additional_properties',
80
+ :'expire_after' => :'expire_after',
81
+ :'description' => :'description',
82
+ :'public_submissions' => :'public_submissions',
83
+ :'slack_webhook_url' => :'slack_webhook_url',
84
+ :'header_html' => :'header_html',
85
+ :'public_web_form' => :'public_web_form',
86
+ :'editable_submissions' => :'editable_submissions',
87
+ :'expire_submissions' => :'expire_submissions',
88
+ :'name' => :'name',
89
+ :'footer_html' => :'footer_html',
90
+ :'html' => :'html',
91
+ :'template_type' => :'template_type',
92
+ :'redirect_url' => :'redirect_url'
93
+ }
94
+ end
95
+
96
+ # Attribute type mapping.
97
+ def self.openapi_types
98
+ {
99
+ :'expiration_interval' => :'String',
100
+ :'webhook_url' => :'String',
101
+ :'scss' => :'String',
102
+ :'allow_additional_properties' => :'BOOLEAN',
103
+ :'expire_after' => :'Float',
104
+ :'description' => :'String',
105
+ :'public_submissions' => :'BOOLEAN',
106
+ :'slack_webhook_url' => :'String',
107
+ :'header_html' => :'String',
108
+ :'public_web_form' => :'BOOLEAN',
109
+ :'editable_submissions' => :'BOOLEAN',
110
+ :'expire_submissions' => :'BOOLEAN',
111
+ :'name' => :'String',
112
+ :'footer_html' => :'String',
113
+ :'html' => :'String',
114
+ :'template_type' => :'String',
115
+ :'redirect_url' => :'String'
116
+ }
117
+ end
118
+
119
+ # Initializes the object
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ def initialize(attributes = {})
122
+ return unless attributes.is_a?(Hash)
123
+
124
+ # convert string to symbol for hash key
125
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
126
+
127
+ if attributes.has_key?(:'expiration_interval')
128
+ self.expiration_interval = attributes[:'expiration_interval']
129
+ end
130
+
131
+ if attributes.has_key?(:'webhook_url')
132
+ self.webhook_url = attributes[:'webhook_url']
133
+ end
134
+
135
+ if attributes.has_key?(:'scss')
136
+ self.scss = attributes[:'scss']
137
+ end
138
+
139
+ if attributes.has_key?(:'allow_additional_properties')
140
+ self.allow_additional_properties = attributes[:'allow_additional_properties']
141
+ end
142
+
143
+ if attributes.has_key?(:'expire_after')
144
+ self.expire_after = attributes[:'expire_after']
145
+ end
146
+
147
+ if attributes.has_key?(:'description')
148
+ self.description = attributes[:'description']
149
+ end
150
+
151
+ if attributes.has_key?(:'public_submissions')
152
+ self.public_submissions = attributes[:'public_submissions']
153
+ end
154
+
155
+ if attributes.has_key?(:'slack_webhook_url')
156
+ self.slack_webhook_url = attributes[:'slack_webhook_url']
157
+ end
158
+
159
+ if attributes.has_key?(:'header_html')
160
+ self.header_html = attributes[:'header_html']
161
+ end
162
+
163
+ if attributes.has_key?(:'public_web_form')
164
+ self.public_web_form = attributes[:'public_web_form']
165
+ end
166
+
167
+ if attributes.has_key?(:'editable_submissions')
168
+ self.editable_submissions = attributes[:'editable_submissions']
169
+ end
170
+
171
+ if attributes.has_key?(:'expire_submissions')
172
+ self.expire_submissions = attributes[:'expire_submissions']
173
+ end
174
+
175
+ if attributes.has_key?(:'name')
176
+ self.name = attributes[:'name']
177
+ end
178
+
179
+ if attributes.has_key?(:'footer_html')
180
+ self.footer_html = attributes[:'footer_html']
181
+ end
182
+
183
+ if attributes.has_key?(:'html')
184
+ self.html = attributes[:'html']
185
+ end
186
+
187
+ if attributes.has_key?(:'template_type')
188
+ self.template_type = attributes[:'template_type']
189
+ end
190
+
191
+ if attributes.has_key?(:'redirect_url')
192
+ self.redirect_url = attributes[:'redirect_url']
193
+ end
194
+ end
195
+
196
+ # Show invalid properties with the reasons. Usually used together with valid?
197
+ # @return Array for valid properties with the reasons
198
+ def list_invalid_properties
199
+ invalid_properties = Array.new
200
+ invalid_properties
201
+ end
202
+
203
+ # Check to see if the all the properties in the model are valid
204
+ # @return true if the model is valid
205
+ def valid?
206
+ expiration_interval_validator = EnumAttributeValidator.new('String', ['minutes', 'hours', 'days'])
207
+ return false unless expiration_interval_validator.valid?(@expiration_interval)
208
+ template_type_validator = EnumAttributeValidator.new('String', ['pdf', 'html'])
209
+ return false unless template_type_validator.valid?(@template_type)
210
+ true
211
+ end
212
+
213
+ # Custom attribute writer method checking allowed values (enum).
214
+ # @param [Object] expiration_interval Object to be assigned
215
+ def expiration_interval=(expiration_interval)
216
+ validator = EnumAttributeValidator.new('String', ['minutes', 'hours', 'days'])
217
+ unless validator.valid?(expiration_interval)
218
+ fail ArgumentError, 'invalid value for "expiration_interval", must be one of #{validator.allowable_values}.'
219
+ end
220
+ @expiration_interval = expiration_interval
221
+ end
222
+
223
+ # Custom attribute writer method checking allowed values (enum).
224
+ # @param [Object] template_type Object to be assigned
225
+ def template_type=(template_type)
226
+ validator = EnumAttributeValidator.new('String', ['pdf', 'html'])
227
+ unless validator.valid?(template_type)
228
+ fail ArgumentError, 'invalid value for "template_type", must be one of #{validator.allowable_values}.'
229
+ end
230
+ @template_type = template_type
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ expiration_interval == o.expiration_interval &&
239
+ webhook_url == o.webhook_url &&
240
+ scss == o.scss &&
241
+ allow_additional_properties == o.allow_additional_properties &&
242
+ expire_after == o.expire_after &&
243
+ description == o.description &&
244
+ public_submissions == o.public_submissions &&
245
+ slack_webhook_url == o.slack_webhook_url &&
246
+ header_html == o.header_html &&
247
+ public_web_form == o.public_web_form &&
248
+ editable_submissions == o.editable_submissions &&
249
+ expire_submissions == o.expire_submissions &&
250
+ name == o.name &&
251
+ footer_html == o.footer_html &&
252
+ html == o.html &&
253
+ template_type == o.template_type &&
254
+ redirect_url == o.redirect_url
255
+ end
256
+
257
+ # @see the `==` method
258
+ # @param [Object] Object to be compared
259
+ def eql?(o)
260
+ self == o
261
+ end
262
+
263
+ # Calculates hash code according to all attributes.
264
+ # @return [Fixnum] Hash code
265
+ def hash
266
+ [expiration_interval, webhook_url, scss, allow_additional_properties, expire_after, description, public_submissions, slack_webhook_url, header_html, public_web_form, editable_submissions, expire_submissions, name, footer_html, html, template_type, redirect_url].hash
267
+ end
268
+
269
+ # Builds the object from hash
270
+ # @param [Hash] attributes Model attributes in the form of hash
271
+ # @return [Object] Returns the model itself
272
+ def build_from_hash(attributes)
273
+ return nil unless attributes.is_a?(Hash)
274
+ self.class.openapi_types.each_pair do |key, type|
275
+ if type =~ /\AArray<(.*)>/i
276
+ # check to ensure the input is an array given that the the attribute
277
+ # is documented as an array but the input is not
278
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
279
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
280
+ end
281
+ elsif !attributes[self.class.attribute_map[key]].nil?
282
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
283
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
284
+ end
285
+
286
+ self
287
+ end
288
+
289
+ # Deserializes the data based on type
290
+ # @param string type Data type
291
+ # @param string value Value to be deserialized
292
+ # @return [Object] Deserialized data
293
+ def _deserialize(type, value)
294
+ case type.to_sym
295
+ when :DateTime
296
+ DateTime.parse(value)
297
+ when :Date
298
+ Date.parse(value)
299
+ when :String
300
+ value.to_s
301
+ when :Integer
302
+ value.to_i
303
+ when :Float
304
+ value.to_f
305
+ when :BOOLEAN
306
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
307
+ true
308
+ else
309
+ false
310
+ end
311
+ when :Object
312
+ # generic object (usually a Hash), return directly
313
+ value
314
+ when /\AArray<(?<inner_type>.+)>\z/
315
+ inner_type = Regexp.last_match[:inner_type]
316
+ value.map { |v| _deserialize(inner_type, v) }
317
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
318
+ k_type = Regexp.last_match[:k_type]
319
+ v_type = Regexp.last_match[:v_type]
320
+ {}.tap do |hash|
321
+ value.each do |k, v|
322
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
323
+ end
324
+ end
325
+ else # model
326
+ temp_model = DocSpring.const_get(type).new
327
+ temp_model.build_from_hash(value)
328
+ end
329
+ end
330
+
331
+ # Returns the string representation of the object
332
+ # @return [String] String presentation of the object
333
+ def to_s
334
+ to_hash.to_s
335
+ end
336
+
337
+ # to_body is an alias to to_hash (backward compatibility)
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_body
340
+ to_hash
341
+ end
342
+
343
+ # Returns the object in the form of hash
344
+ # @return [Hash] Returns the object in the form of hash
345
+ def to_hash
346
+ hash = {}
347
+ self.class.attribute_map.each_pair do |attr, param|
348
+ value = self.send(attr)
349
+ next if value.nil?
350
+ hash[param] = _to_hash(value)
351
+ end
352
+ hash
353
+ end
354
+
355
+ # Outputs non-array value in the form of hash
356
+ # For object, use to_hash. Otherwise, just return the value
357
+ # @param [Object] value Any valid value
358
+ # @return [Hash] Returns the value in the form of hash
359
+ def _to_hash(value)
360
+ if value.is_a?(Array)
361
+ value.compact.map { |v| _to_hash(v) }
362
+ elsif value.is_a?(Hash)
363
+ {}.tap do |hash|
364
+ value.each { |k, v| hash[k] = _to_hash(v) }
365
+ end
366
+ elsif value.respond_to? :to_hash
367
+ value.to_hash
368
+ else
369
+ value
370
+ end
371
+ end
372
+ end
373
+ end