docspring 1.4.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +26 -0
  3. data/.openapi-generator/FILES +220 -0
  4. data/.openapi-generator/VERSION +1 -1
  5. data/.rubocop.yml +6 -12
  6. data/.travis.yml +11 -0
  7. data/CHANGELOG.md +9 -0
  8. data/Gemfile +5 -1
  9. data/Gemfile.lock +85 -48
  10. data/README.md +47 -16
  11. data/docs/AddFieldsData.md +13 -3
  12. data/docs/AddFieldsTemplateResponse.md +17 -5
  13. data/docs/AuthenticationError.md +15 -4
  14. data/docs/AuthenticationSuccessResponse.md +13 -3
  15. data/docs/CombinePdfsData.md +23 -7
  16. data/docs/CombinedSubmission.md +37 -12
  17. data/docs/CombinedSubmissionAction.md +23 -8
  18. data/docs/CombinedSubmissionData.md +21 -6
  19. data/docs/CopyTemplateData.md +15 -4
  20. data/docs/CreateCombinedSubmissionResponse.md +17 -5
  21. data/docs/CreateCustomFileData.md +13 -3
  22. data/docs/CreateCustomFileResponse.md +17 -5
  23. data/docs/CreateFolderAttributes.md +20 -0
  24. data/docs/CreateFolderData.md +13 -3
  25. data/docs/CreateHtmlTemplateData.md +13 -3
  26. data/docs/CreateSubmissionBatchResponse.md +21 -7
  27. data/docs/CreateSubmissionBatchSubmissionsResponse.md +17 -5
  28. data/docs/CreateSubmissionData.md +36 -0
  29. data/docs/CreateSubmissionDataRequestData.md +37 -15
  30. data/docs/CreateSubmissionDataRequestEventRequest.md +24 -0
  31. data/docs/CreateSubmissionDataRequestEventResponse.md +22 -0
  32. data/docs/CreateSubmissionDataRequestTokenResponse.md +17 -5
  33. data/docs/CreateSubmissionResponse.md +17 -5
  34. data/docs/CreateTemplateFromUploadData.md +13 -3
  35. data/docs/DataRequestToken.md +24 -0
  36. data/docs/DeleteTemplateResponse.md +20 -0
  37. data/docs/ErrorResponse.md +20 -0
  38. data/docs/Folder.md +19 -6
  39. data/docs/FullTemplate.md +94 -0
  40. data/docs/HtmlTemplateData.md +51 -19
  41. data/docs/HtmlTemplateDataWebhookOptions.md +18 -0
  42. data/docs/InvalidRequest.md +15 -4
  43. data/docs/InvalidRequestSingleError.md +20 -0
  44. data/docs/ListSubmissionsResponse.md +22 -0
  45. data/docs/MoveFolderData.md +13 -3
  46. data/docs/MoveTemplateData.md +13 -3
  47. data/docs/PDFApi.md +1746 -495
  48. data/docs/PendingTemplate.md +45 -19
  49. data/docs/PreviewPdfResponse.md +20 -0
  50. data/docs/PublishTemplateVersion404Response.md +20 -0
  51. data/docs/PublishTemplateVersion422Response.md +20 -0
  52. data/docs/PublishTemplateVersionResponse.md +20 -0
  53. data/docs/PublishTemplateVersionResponseResult.md +24 -0
  54. data/docs/PublishVersionData.md +20 -0
  55. data/docs/RenameFolderData.md +13 -3
  56. data/docs/RestoreTemplateVersionResponse.md +18 -0
  57. data/docs/RestoreVersionData.md +18 -0
  58. data/docs/Submission.md +49 -21
  59. data/docs/SubmissionAction.md +23 -8
  60. data/docs/SubmissionBatch.md +29 -11
  61. data/docs/SubmissionBatchData.md +21 -6
  62. data/docs/SubmissionData.md +23 -9
  63. data/docs/SubmissionDataBatchRequest.md +25 -8
  64. data/docs/SubmissionDataRequest.md +53 -22
  65. data/docs/SubmissionDataRequestEvent.md +30 -0
  66. data/docs/Template.md +51 -22
  67. data/docs/TemplateData.md +49 -18
  68. data/docs/TemplateDefaults.md +22 -0
  69. data/docs/TemplateDocument.md +22 -0
  70. data/docs/TemplateDocumentMetadata.md +22 -0
  71. data/docs/TemplateSchema.md +34 -0
  72. data/docs/UpdateDataRequestResponse.md +17 -5
  73. data/docs/UpdateSubmissionDataRequestData.md +37 -15
  74. data/docs/UpdateTemplateData.md +13 -3
  75. data/docs/UpdateTemplateResponse.md +15 -4
  76. data/docs/UploadPresign.md +24 -0
  77. data/docs/UploadTemplateData.md +53 -20
  78. data/docspring.gemspec +14 -11
  79. data/git_push.sh +11 -9
  80. data/lib/docspring/api/pdf_api.rb +1485 -497
  81. data/lib/docspring/api_client.rb +106 -98
  82. data/lib/docspring/api_error.rb +22 -2
  83. data/lib/docspring/configuration.rb +127 -16
  84. data/lib/docspring/models/add_fields_data.rb +59 -26
  85. data/lib/docspring/models/add_fields_template_response.rb +81 -43
  86. data/lib/docspring/models/authentication_error.rb +62 -29
  87. data/lib/docspring/models/authentication_success_response.rb +66 -28
  88. data/lib/docspring/models/combine_pdfs_data.rb +74 -32
  89. data/lib/docspring/models/combined_submission.rb +167 -68
  90. data/lib/docspring/models/combined_submission_action.rb +83 -39
  91. data/lib/docspring/models/combined_submission_data.rb +72 -30
  92. data/lib/docspring/models/copy_template_data.rb +59 -26
  93. data/lib/docspring/models/create_combined_submission_response.rb +86 -41
  94. data/lib/docspring/models/create_custom_file_data.rb +58 -25
  95. data/lib/docspring/models/create_custom_file_response.rb +86 -41
  96. data/lib/docspring/models/create_folder_attributes.rb +230 -0
  97. data/lib/docspring/models/create_folder_data.rb +59 -26
  98. data/lib/docspring/models/create_html_template_data.rb +58 -25
  99. data/lib/docspring/models/create_submission_batch_response.rb +104 -52
  100. data/lib/docspring/models/create_submission_batch_submissions_response.rb +79 -41
  101. data/lib/docspring/models/create_submission_data.rb +304 -0
  102. data/lib/docspring/models/create_submission_data_request_data.rb +139 -90
  103. data/lib/docspring/models/create_submission_data_request_event_request.rb +297 -0
  104. data/lib/docspring/models/create_submission_data_request_event_response.rb +282 -0
  105. data/lib/docspring/models/create_submission_data_request_token_response.rb +85 -40
  106. data/lib/docspring/models/create_submission_response.rb +86 -41
  107. data/lib/docspring/models/create_template_from_upload_data.rb +58 -25
  108. data/lib/docspring/models/{custom_file.rb → data_request_token.rb} +110 -33
  109. data/lib/docspring/models/delete_template_response.rb +266 -0
  110. data/lib/docspring/models/{error.rb → error_response.rb} +65 -30
  111. data/lib/docspring/models/folder.rb +78 -46
  112. data/lib/docspring/models/full_template.rb +801 -0
  113. data/lib/docspring/models/html_template_data.rb +180 -110
  114. data/lib/docspring/models/{folders_folder.rb → html_template_data_webhook_options.rb} +63 -41
  115. data/lib/docspring/models/invalid_request.rb +64 -29
  116. data/lib/docspring/models/invalid_request_single_error.rb +271 -0
  117. data/lib/docspring/models/list_submissions_response.rb +251 -0
  118. data/lib/docspring/models/move_folder_data.rb +56 -25
  119. data/lib/docspring/models/move_template_data.rb +58 -25
  120. data/lib/docspring/models/pending_template.rb +221 -118
  121. data/lib/docspring/models/preview_pdf_response.rb +264 -0
  122. data/lib/docspring/models/publish_template_version404_response.rb +271 -0
  123. data/lib/docspring/models/publish_template_version422_response.rb +273 -0
  124. data/lib/docspring/models/publish_template_version_response.rb +271 -0
  125. data/lib/docspring/models/publish_template_version_response_result.rb +263 -0
  126. data/lib/docspring/models/publish_version_data.rb +230 -0
  127. data/lib/docspring/models/rename_folder_data.rb +58 -25
  128. data/lib/docspring/models/restore_template_version_response.rb +255 -0
  129. data/lib/docspring/models/{create_submission_data_request_token_response_token.rb → restore_version_data.rb} +69 -58
  130. data/lib/docspring/models/submission.rb +98 -49
  131. data/lib/docspring/models/submission_action.rb +83 -39
  132. data/lib/docspring/models/submission_batch.rb +158 -75
  133. data/lib/docspring/models/submission_batch_data.rb +74 -30
  134. data/lib/docspring/models/submission_data.rb +65 -41
  135. data/lib/docspring/models/submission_data_batch_request.rb +100 -49
  136. data/lib/docspring/models/submission_data_request.rb +123 -54
  137. data/lib/docspring/models/submission_data_request_event.rb +309 -0
  138. data/lib/docspring/models/template.rb +267 -132
  139. data/lib/docspring/models/template_data.rb +173 -105
  140. data/lib/docspring/models/template_defaults.rb +249 -0
  141. data/lib/docspring/models/{upload_template_data_document.rb → template_document.rb} +91 -39
  142. data/lib/docspring/models/{upload_template_data_document_metadata.rb → template_document_metadata.rb} +94 -42
  143. data/lib/docspring/models/template_schema.rb +288 -0
  144. data/lib/docspring/models/update_data_request_response.rb +86 -41
  145. data/lib/docspring/models/update_submission_data_request_data.rb +82 -43
  146. data/lib/docspring/models/update_template_data.rb +58 -25
  147. data/lib/docspring/models/update_template_response.rb +79 -41
  148. data/lib/docspring/models/upload_presign.rb +296 -0
  149. data/lib/docspring/models/upload_template_data.rb +186 -116
  150. data/lib/docspring/version.rb +3 -3
  151. data/lib/docspring.rb +30 -10
  152. data/spec/api/client_integration_spec.rb +26 -19
  153. data/spec/api/pdf_api_integration_spec.rb +21 -19
  154. data/spec/api/pdf_api_spec_original.skipped.rb +469 -98
  155. data/spec/models/add_fields_data_spec.rb +8 -13
  156. data/spec/models/add_fields_template_response_spec.rb +16 -21
  157. data/spec/models/authentication_error_spec.rb +10 -15
  158. data/spec/models/authentication_success_response_spec.rb +9 -14
  159. data/spec/models/combine_pdfs_data_spec.rb +18 -17
  160. data/spec/models/combined_submission_action_spec.rb +16 -21
  161. data/spec/models/combined_submission_data_spec.rb +17 -16
  162. data/spec/models/combined_submission_spec.rb +45 -32
  163. data/spec/models/copy_template_data_spec.rb +9 -14
  164. data/spec/models/create_combined_submission_response_spec.rb +16 -21
  165. data/spec/models/create_custom_file_data_spec.rb +8 -13
  166. data/spec/models/create_custom_file_response_spec.rb +16 -21
  167. data/spec/models/create_folder_attributes_spec.rb +42 -0
  168. data/spec/models/create_folder_data_spec.rb +8 -13
  169. data/spec/models/create_html_template_data_spec.rb +8 -13
  170. data/spec/models/create_submission_batch_response_spec.rb +21 -26
  171. data/spec/models/create_submission_batch_submissions_response_spec.rb +16 -21
  172. data/spec/models/create_submission_data_request_data_spec.rb +33 -38
  173. data/spec/models/create_submission_data_request_event_request_spec.rb +62 -0
  174. data/spec/models/create_submission_data_request_event_response_spec.rb +52 -0
  175. data/spec/models/create_submission_data_request_token_response_spec.rb +15 -20
  176. data/spec/models/create_submission_data_spec.rb +90 -0
  177. data/spec/models/create_submission_response_spec.rb +16 -21
  178. data/spec/models/create_template_from_upload_data_spec.rb +8 -13
  179. data/spec/models/data_request_token_spec.rb +54 -0
  180. data/spec/models/delete_template_response_spec.rb +46 -0
  181. data/spec/models/error_response_spec.rb +46 -0
  182. data/spec/models/folder_spec.rb +15 -20
  183. data/spec/models/full_template_spec.rb +268 -0
  184. data/spec/models/html_template_data_spec.rb +62 -49
  185. data/spec/models/html_template_data_webhook_options_spec.rb +36 -0
  186. data/spec/models/invalid_request_single_error_spec.rb +46 -0
  187. data/spec/models/invalid_request_spec.rb +10 -15
  188. data/spec/models/list_submissions_response_spec.rb +48 -0
  189. data/spec/models/move_folder_data_spec.rb +8 -13
  190. data/spec/models/move_template_data_spec.rb +8 -13
  191. data/spec/models/pending_template_spec.rb +45 -50
  192. data/spec/models/preview_pdf_response_spec.rb +46 -0
  193. data/spec/models/publish_template_version404_response_spec.rb +46 -0
  194. data/spec/models/publish_template_version422_response_spec.rb +46 -0
  195. data/spec/models/publish_template_version_response_result_spec.rb +54 -0
  196. data/spec/models/publish_template_version_response_spec.rb +46 -0
  197. data/spec/models/publish_version_data_spec.rb +42 -0
  198. data/spec/models/rename_folder_data_spec.rb +8 -13
  199. data/spec/models/restore_template_version_response_spec.rb +40 -0
  200. data/spec/models/restore_version_data_spec.rb +36 -0
  201. data/spec/models/submission_action_spec.rb +16 -21
  202. data/spec/models/submission_batch_data_spec.rb +17 -16
  203. data/spec/models/submission_batch_spec.rb +29 -34
  204. data/spec/models/submission_data_batch_request_spec.rb +24 -23
  205. data/spec/models/submission_data_request_event_spec.rb +72 -0
  206. data/spec/models/submission_data_request_spec.rb +36 -35
  207. data/spec/models/submission_data_spec.rb +13 -24
  208. data/spec/models/submission_spec.rb +27 -32
  209. data/spec/models/template_data_spec.rb +59 -46
  210. data/spec/models/template_defaults_spec.rb +48 -0
  211. data/spec/models/template_document_metadata_spec.rb +52 -0
  212. data/spec/models/template_document_spec.rb +52 -0
  213. data/spec/models/template_schema_spec.rb +84 -0
  214. data/spec/models/template_spec.rb +50 -55
  215. data/spec/models/update_data_request_response_spec.rb +16 -21
  216. data/spec/models/update_submission_data_request_data_spec.rb +22 -27
  217. data/spec/models/update_template_data_spec.rb +8 -13
  218. data/spec/models/update_template_response_spec.rb +14 -19
  219. data/spec/models/upload_presign_spec.rb +58 -0
  220. data/spec/models/upload_template_data_spec.rb +64 -51
  221. data/spec/spec_helper.rb +5 -5
  222. metadata +112 -124
  223. data/docs/CreateSubmissionDataRequestTokenResponseToken.md +0 -11
  224. data/docs/CustomFile.md +0 -9
  225. data/docs/Error.md +0 -9
  226. data/docs/FoldersFolder.md +0 -9
  227. data/docs/TemplatestemplateIdaddFieldsFields.md +0 -92
  228. data/docs/UploadTemplateDataDocument.md +0 -10
  229. data/docs/UploadTemplateDataDocumentMetadata.md +0 -10
  230. data/lib/docspring/models/templatestemplate_idadd_fields_fields.rb +0 -1306
  231. data/spec/api_client_spec.rb +0 -226
  232. data/spec/configuration_spec.rb +0 -53
  233. data/spec/models/create_submission_data_request_token_response_token_spec.rb +0 -59
  234. data/spec/models/custom_file_spec.rb +0 -47
  235. data/spec/models/error_spec.rb +0 -51
  236. data/spec/models/folders_folder_spec.rb +0 -47
  237. data/spec/models/templatestemplate_idadd_fields_fields_spec.rb +0 -589
  238. data/spec/models/upload_template_data_document_metadata_spec.rb +0 -57
  239. data/spec/models/upload_template_data_document_spec.rb +0 -57
@@ -1,1306 +0,0 @@
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 TemplatestemplateIdaddFieldsFields
17
- attr_accessor :background_color_field_name
18
-
19
- attr_accessor :uppercase
20
-
21
- attr_accessor :metadata
22
-
23
- attr_accessor :barcode_symbology
24
-
25
- attr_accessor :min_length
26
-
27
- attr_accessor :integer
28
-
29
- attr_accessor :type
30
-
31
- attr_accessor :required
32
-
33
- attr_accessor :comb_value_offset
34
-
35
- attr_accessor :image_gravity
36
-
37
- attr_accessor :overflow
38
-
39
- attr_accessor :qrcode_color
40
-
41
- attr_accessor :color_field_required
42
-
43
- attr_accessor :background_color_field_required
44
-
45
- attr_accessor :id
46
-
47
- attr_accessor :image_scale_type
48
-
49
- attr_accessor :exclusive_minimum
50
-
51
- attr_accessor :height
52
-
53
- attr_accessor :number_condition_range_exclusive_max
54
-
55
- attr_accessor :invert_boolean_condition
56
-
57
- attr_accessor :shape_fill_color_field_name
58
-
59
- attr_accessor :static
60
-
61
- attr_accessor :shape_border_color_field_name
62
-
63
- attr_accessor :v_alignment
64
-
65
- attr_accessor :bold
66
-
67
- attr_accessor :shape_border_width
68
-
69
- attr_accessor :comb_number_of_cells
70
-
71
- attr_accessor :shape_border_color
72
-
73
- attr_accessor :comb
74
-
75
- attr_accessor :typeface
76
-
77
- attr_accessor :shape_type
78
-
79
- attr_accessor :condition
80
-
81
- attr_accessor :display_type
82
-
83
- attr_accessor :check_color
84
-
85
- attr_accessor :multiline_lines
86
-
87
- attr_accessor :multiline
88
-
89
- attr_accessor :true_text
90
-
91
- attr_accessor :name
92
-
93
- attr_accessor :font_size
94
-
95
- attr_accessor :page
96
-
97
- attr_accessor :alignment
98
-
99
- attr_accessor :max_length
100
-
101
- attr_accessor :auto_calculate_max_length
102
-
103
- attr_accessor :color_field_name
104
-
105
- attr_accessor :qrcode_color_field_name
106
-
107
- attr_accessor :number_condition_range_min
108
-
109
- attr_accessor :color
110
-
111
- attr_accessor :hidden
112
-
113
- attr_accessor :check_color_field_required
114
-
115
- attr_accessor :combined_field_format
116
-
117
- attr_accessor :description
118
-
119
- attr_accessor :shape_border_color_field_required
120
-
121
- attr_accessor :combined_field_names
122
-
123
- attr_accessor :title
124
-
125
- attr_accessor :number_condition_range_exclusive_min
126
-
127
- attr_accessor :combined_field_separator
128
-
129
- attr_accessor :exclusive_maximum
130
-
131
- attr_accessor :default
132
-
133
- attr_accessor :combined_field_type
134
-
135
- attr_accessor :date_time_format
136
-
137
- attr_accessor :qrcode_color_field_required
138
-
139
- attr_accessor :currency
140
-
141
- attr_accessor :false_text
142
-
143
- attr_accessor :strikethrough
144
-
145
- attr_accessor :character_spacing
146
-
147
- attr_accessor :number_condition_range_max
148
-
149
- attr_accessor :background_color
150
-
151
- attr_accessor :check_color_field_name
152
-
153
- attr_accessor :check_character
154
-
155
- attr_accessor :rotation
156
-
157
- attr_accessor :option_list
158
-
159
- attr_accessor :shape_fill_color
160
-
161
- attr_accessor :string_condition_type
162
-
163
- attr_accessor :shape_fill_color_field_required
164
-
165
- attr_accessor :decimal_places
166
-
167
- attr_accessor :include_time
168
-
169
- attr_accessor :width
170
-
171
- attr_accessor :x
172
-
173
- attr_accessor :maximum
174
-
175
- attr_accessor :y
176
-
177
- attr_accessor :signature_allow_draw
178
-
179
- attr_accessor :number_condition_type
180
-
181
- attr_accessor :opacity
182
-
183
- attr_accessor :minimum
184
-
185
- attr_accessor :signature_allow_type
186
-
187
- class EnumAttributeValidator
188
- attr_reader :datatype
189
- attr_reader :allowable_values
190
-
191
- def initialize(datatype, allowable_values)
192
- @allowable_values = allowable_values.map do |value|
193
- case datatype.to_s
194
- when /Integer/i
195
- value.to_i
196
- when /Float/i
197
- value.to_f
198
- else
199
- value
200
- end
201
- end
202
- end
203
-
204
- def valid?(value)
205
- !value || allowable_values.include?(value)
206
- end
207
- end
208
-
209
- # Attribute mapping from ruby-style variable name to JSON key.
210
- def self.attribute_map
211
- {
212
- :'background_color_field_name' => :'backgroundColorFieldName',
213
- :'uppercase' => :'uppercase',
214
- :'metadata' => :'metadata',
215
- :'barcode_symbology' => :'barcodeSymbology',
216
- :'min_length' => :'minLength',
217
- :'integer' => :'integer',
218
- :'type' => :'type',
219
- :'required' => :'required',
220
- :'comb_value_offset' => :'combValueOffset',
221
- :'image_gravity' => :'imageGravity',
222
- :'overflow' => :'overflow',
223
- :'qrcode_color' => :'qrcodeColor',
224
- :'color_field_required' => :'colorFieldRequired',
225
- :'background_color_field_required' => :'backgroundColorFieldRequired',
226
- :'id' => :'id',
227
- :'image_scale_type' => :'imageScaleType',
228
- :'exclusive_minimum' => :'exclusiveMinimum',
229
- :'height' => :'height',
230
- :'number_condition_range_exclusive_max' => :'numberConditionRangeExclusiveMax',
231
- :'invert_boolean_condition' => :'invertBooleanCondition',
232
- :'shape_fill_color_field_name' => :'shapeFillColorFieldName',
233
- :'static' => :'static',
234
- :'shape_border_color_field_name' => :'shapeBorderColorFieldName',
235
- :'v_alignment' => :'vAlignment',
236
- :'bold' => :'bold',
237
- :'shape_border_width' => :'shapeBorderWidth',
238
- :'comb_number_of_cells' => :'combNumberOfCells',
239
- :'shape_border_color' => :'shapeBorderColor',
240
- :'comb' => :'comb',
241
- :'typeface' => :'typeface',
242
- :'shape_type' => :'shapeType',
243
- :'condition' => :'condition',
244
- :'display_type' => :'displayType',
245
- :'check_color' => :'checkColor',
246
- :'multiline_lines' => :'multilineLines',
247
- :'multiline' => :'multiline',
248
- :'true_text' => :'trueText',
249
- :'name' => :'name',
250
- :'font_size' => :'fontSize',
251
- :'page' => :'page',
252
- :'alignment' => :'alignment',
253
- :'max_length' => :'maxLength',
254
- :'auto_calculate_max_length' => :'autoCalculateMaxLength',
255
- :'color_field_name' => :'colorFieldName',
256
- :'qrcode_color_field_name' => :'qrcodeColorFieldName',
257
- :'number_condition_range_min' => :'numberConditionRangeMin',
258
- :'color' => :'color',
259
- :'hidden' => :'hidden',
260
- :'check_color_field_required' => :'checkColorFieldRequired',
261
- :'combined_field_format' => :'combinedFieldFormat',
262
- :'description' => :'description',
263
- :'shape_border_color_field_required' => :'shapeBorderColorFieldRequired',
264
- :'combined_field_names' => :'combinedFieldNames',
265
- :'title' => :'title',
266
- :'number_condition_range_exclusive_min' => :'numberConditionRangeExclusiveMin',
267
- :'combined_field_separator' => :'combinedFieldSeparator',
268
- :'exclusive_maximum' => :'exclusiveMaximum',
269
- :'default' => :'default',
270
- :'combined_field_type' => :'combinedFieldType',
271
- :'date_time_format' => :'dateTimeFormat',
272
- :'qrcode_color_field_required' => :'qrcodeColorFieldRequired',
273
- :'currency' => :'currency',
274
- :'false_text' => :'falseText',
275
- :'strikethrough' => :'strikethrough',
276
- :'character_spacing' => :'characterSpacing',
277
- :'number_condition_range_max' => :'numberConditionRangeMax',
278
- :'background_color' => :'backgroundColor',
279
- :'check_color_field_name' => :'checkColorFieldName',
280
- :'check_character' => :'checkCharacter',
281
- :'rotation' => :'rotation',
282
- :'option_list' => :'optionList',
283
- :'shape_fill_color' => :'shapeFillColor',
284
- :'string_condition_type' => :'stringConditionType',
285
- :'shape_fill_color_field_required' => :'shapeFillColorFieldRequired',
286
- :'decimal_places' => :'decimalPlaces',
287
- :'include_time' => :'includeTime',
288
- :'width' => :'width',
289
- :'x' => :'x',
290
- :'maximum' => :'maximum',
291
- :'y' => :'y',
292
- :'signature_allow_draw' => :'signatureAllowDraw',
293
- :'number_condition_type' => :'numberConditionType',
294
- :'opacity' => :'opacity',
295
- :'minimum' => :'minimum',
296
- :'signature_allow_type' => :'signatureAllowType'
297
- }
298
- end
299
-
300
- # Attribute type mapping.
301
- def self.openapi_types
302
- {
303
- :'background_color_field_name' => :'String',
304
- :'uppercase' => :'BOOLEAN',
305
- :'metadata' => :'String',
306
- :'barcode_symbology' => :'String',
307
- :'min_length' => :'Float',
308
- :'integer' => :'BOOLEAN',
309
- :'type' => :'String',
310
- :'required' => :'BOOLEAN',
311
- :'comb_value_offset' => :'Float',
312
- :'image_gravity' => :'String',
313
- :'overflow' => :'String',
314
- :'qrcode_color' => :'String',
315
- :'color_field_required' => :'BOOLEAN',
316
- :'background_color_field_required' => :'BOOLEAN',
317
- :'id' => :'Float',
318
- :'image_scale_type' => :'String',
319
- :'exclusive_minimum' => :'BOOLEAN',
320
- :'height' => :'Float',
321
- :'number_condition_range_exclusive_max' => :'BOOLEAN',
322
- :'invert_boolean_condition' => :'BOOLEAN',
323
- :'shape_fill_color_field_name' => :'String',
324
- :'static' => :'BOOLEAN',
325
- :'shape_border_color_field_name' => :'String',
326
- :'v_alignment' => :'String',
327
- :'bold' => :'BOOLEAN',
328
- :'shape_border_width' => :'Float',
329
- :'comb_number_of_cells' => :'Float',
330
- :'shape_border_color' => :'String',
331
- :'comb' => :'BOOLEAN',
332
- :'typeface' => :'String',
333
- :'shape_type' => :'String',
334
- :'condition' => :'String',
335
- :'display_type' => :'String',
336
- :'check_color' => :'String',
337
- :'multiline_lines' => :'Float',
338
- :'multiline' => :'BOOLEAN',
339
- :'true_text' => :'String',
340
- :'name' => :'String',
341
- :'font_size' => :'Float',
342
- :'page' => :'Float',
343
- :'alignment' => :'String',
344
- :'max_length' => :'Float',
345
- :'auto_calculate_max_length' => :'BOOLEAN',
346
- :'color_field_name' => :'String',
347
- :'qrcode_color_field_name' => :'String',
348
- :'number_condition_range_min' => :'Float',
349
- :'color' => :'String',
350
- :'hidden' => :'BOOLEAN',
351
- :'check_color_field_required' => :'BOOLEAN',
352
- :'combined_field_format' => :'String',
353
- :'description' => :'String',
354
- :'shape_border_color_field_required' => :'BOOLEAN',
355
- :'combined_field_names' => :'String',
356
- :'title' => :'String',
357
- :'number_condition_range_exclusive_min' => :'BOOLEAN',
358
- :'combined_field_separator' => :'String',
359
- :'exclusive_maximum' => :'BOOLEAN',
360
- :'default' => :'String',
361
- :'combined_field_type' => :'String',
362
- :'date_time_format' => :'String',
363
- :'qrcode_color_field_required' => :'BOOLEAN',
364
- :'currency' => :'BOOLEAN',
365
- :'false_text' => :'String',
366
- :'strikethrough' => :'BOOLEAN',
367
- :'character_spacing' => :'Float',
368
- :'number_condition_range_max' => :'Float',
369
- :'background_color' => :'String',
370
- :'check_color_field_name' => :'String',
371
- :'check_character' => :'String',
372
- :'rotation' => :'Float',
373
- :'option_list' => :'String',
374
- :'shape_fill_color' => :'String',
375
- :'string_condition_type' => :'String',
376
- :'shape_fill_color_field_required' => :'BOOLEAN',
377
- :'decimal_places' => :'Float',
378
- :'include_time' => :'BOOLEAN',
379
- :'width' => :'Float',
380
- :'x' => :'Float',
381
- :'maximum' => :'Float',
382
- :'y' => :'Float',
383
- :'signature_allow_draw' => :'BOOLEAN',
384
- :'number_condition_type' => :'String',
385
- :'opacity' => :'Float',
386
- :'minimum' => :'Float',
387
- :'signature_allow_type' => :'BOOLEAN'
388
- }
389
- end
390
-
391
- # Initializes the object
392
- # @param [Hash] attributes Model attributes in the form of hash
393
- def initialize(attributes = {})
394
- return unless attributes.is_a?(Hash)
395
-
396
- # convert string to symbol for hash key
397
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
398
-
399
- if attributes.has_key?(:'backgroundColorFieldName')
400
- self.background_color_field_name = attributes[:'backgroundColorFieldName']
401
- end
402
-
403
- if attributes.has_key?(:'uppercase')
404
- self.uppercase = attributes[:'uppercase']
405
- end
406
-
407
- if attributes.has_key?(:'metadata')
408
- self.metadata = attributes[:'metadata']
409
- end
410
-
411
- if attributes.has_key?(:'barcodeSymbology')
412
- self.barcode_symbology = attributes[:'barcodeSymbology']
413
- end
414
-
415
- if attributes.has_key?(:'minLength')
416
- self.min_length = attributes[:'minLength']
417
- end
418
-
419
- if attributes.has_key?(:'integer')
420
- self.integer = attributes[:'integer']
421
- end
422
-
423
- if attributes.has_key?(:'type')
424
- self.type = attributes[:'type']
425
- end
426
-
427
- if attributes.has_key?(:'required')
428
- self.required = attributes[:'required']
429
- end
430
-
431
- if attributes.has_key?(:'combValueOffset')
432
- self.comb_value_offset = attributes[:'combValueOffset']
433
- end
434
-
435
- if attributes.has_key?(:'imageGravity')
436
- self.image_gravity = attributes[:'imageGravity']
437
- end
438
-
439
- if attributes.has_key?(:'overflow')
440
- self.overflow = attributes[:'overflow']
441
- end
442
-
443
- if attributes.has_key?(:'qrcodeColor')
444
- self.qrcode_color = attributes[:'qrcodeColor']
445
- end
446
-
447
- if attributes.has_key?(:'colorFieldRequired')
448
- self.color_field_required = attributes[:'colorFieldRequired']
449
- end
450
-
451
- if attributes.has_key?(:'backgroundColorFieldRequired')
452
- self.background_color_field_required = attributes[:'backgroundColorFieldRequired']
453
- end
454
-
455
- if attributes.has_key?(:'id')
456
- self.id = attributes[:'id']
457
- end
458
-
459
- if attributes.has_key?(:'imageScaleType')
460
- self.image_scale_type = attributes[:'imageScaleType']
461
- end
462
-
463
- if attributes.has_key?(:'exclusiveMinimum')
464
- self.exclusive_minimum = attributes[:'exclusiveMinimum']
465
- end
466
-
467
- if attributes.has_key?(:'height')
468
- self.height = attributes[:'height']
469
- end
470
-
471
- if attributes.has_key?(:'numberConditionRangeExclusiveMax')
472
- self.number_condition_range_exclusive_max = attributes[:'numberConditionRangeExclusiveMax']
473
- end
474
-
475
- if attributes.has_key?(:'invertBooleanCondition')
476
- self.invert_boolean_condition = attributes[:'invertBooleanCondition']
477
- end
478
-
479
- if attributes.has_key?(:'shapeFillColorFieldName')
480
- self.shape_fill_color_field_name = attributes[:'shapeFillColorFieldName']
481
- end
482
-
483
- if attributes.has_key?(:'static')
484
- self.static = attributes[:'static']
485
- end
486
-
487
- if attributes.has_key?(:'shapeBorderColorFieldName')
488
- self.shape_border_color_field_name = attributes[:'shapeBorderColorFieldName']
489
- end
490
-
491
- if attributes.has_key?(:'vAlignment')
492
- self.v_alignment = attributes[:'vAlignment']
493
- end
494
-
495
- if attributes.has_key?(:'bold')
496
- self.bold = attributes[:'bold']
497
- end
498
-
499
- if attributes.has_key?(:'shapeBorderWidth')
500
- self.shape_border_width = attributes[:'shapeBorderWidth']
501
- end
502
-
503
- if attributes.has_key?(:'combNumberOfCells')
504
- self.comb_number_of_cells = attributes[:'combNumberOfCells']
505
- end
506
-
507
- if attributes.has_key?(:'shapeBorderColor')
508
- self.shape_border_color = attributes[:'shapeBorderColor']
509
- end
510
-
511
- if attributes.has_key?(:'comb')
512
- self.comb = attributes[:'comb']
513
- end
514
-
515
- if attributes.has_key?(:'typeface')
516
- self.typeface = attributes[:'typeface']
517
- end
518
-
519
- if attributes.has_key?(:'shapeType')
520
- self.shape_type = attributes[:'shapeType']
521
- end
522
-
523
- if attributes.has_key?(:'condition')
524
- self.condition = attributes[:'condition']
525
- end
526
-
527
- if attributes.has_key?(:'displayType')
528
- self.display_type = attributes[:'displayType']
529
- end
530
-
531
- if attributes.has_key?(:'checkColor')
532
- self.check_color = attributes[:'checkColor']
533
- end
534
-
535
- if attributes.has_key?(:'multilineLines')
536
- self.multiline_lines = attributes[:'multilineLines']
537
- end
538
-
539
- if attributes.has_key?(:'multiline')
540
- self.multiline = attributes[:'multiline']
541
- end
542
-
543
- if attributes.has_key?(:'trueText')
544
- self.true_text = attributes[:'trueText']
545
- end
546
-
547
- if attributes.has_key?(:'name')
548
- self.name = attributes[:'name']
549
- end
550
-
551
- if attributes.has_key?(:'fontSize')
552
- self.font_size = attributes[:'fontSize']
553
- end
554
-
555
- if attributes.has_key?(:'page')
556
- self.page = attributes[:'page']
557
- end
558
-
559
- if attributes.has_key?(:'alignment')
560
- self.alignment = attributes[:'alignment']
561
- end
562
-
563
- if attributes.has_key?(:'maxLength')
564
- self.max_length = attributes[:'maxLength']
565
- end
566
-
567
- if attributes.has_key?(:'autoCalculateMaxLength')
568
- self.auto_calculate_max_length = attributes[:'autoCalculateMaxLength']
569
- end
570
-
571
- if attributes.has_key?(:'colorFieldName')
572
- self.color_field_name = attributes[:'colorFieldName']
573
- end
574
-
575
- if attributes.has_key?(:'qrcodeColorFieldName')
576
- self.qrcode_color_field_name = attributes[:'qrcodeColorFieldName']
577
- end
578
-
579
- if attributes.has_key?(:'numberConditionRangeMin')
580
- self.number_condition_range_min = attributes[:'numberConditionRangeMin']
581
- end
582
-
583
- if attributes.has_key?(:'color')
584
- self.color = attributes[:'color']
585
- end
586
-
587
- if attributes.has_key?(:'hidden')
588
- self.hidden = attributes[:'hidden']
589
- end
590
-
591
- if attributes.has_key?(:'checkColorFieldRequired')
592
- self.check_color_field_required = attributes[:'checkColorFieldRequired']
593
- end
594
-
595
- if attributes.has_key?(:'combinedFieldFormat')
596
- self.combined_field_format = attributes[:'combinedFieldFormat']
597
- end
598
-
599
- if attributes.has_key?(:'description')
600
- self.description = attributes[:'description']
601
- end
602
-
603
- if attributes.has_key?(:'shapeBorderColorFieldRequired')
604
- self.shape_border_color_field_required = attributes[:'shapeBorderColorFieldRequired']
605
- end
606
-
607
- if attributes.has_key?(:'combinedFieldNames')
608
- self.combined_field_names = attributes[:'combinedFieldNames']
609
- end
610
-
611
- if attributes.has_key?(:'title')
612
- self.title = attributes[:'title']
613
- end
614
-
615
- if attributes.has_key?(:'numberConditionRangeExclusiveMin')
616
- self.number_condition_range_exclusive_min = attributes[:'numberConditionRangeExclusiveMin']
617
- end
618
-
619
- if attributes.has_key?(:'combinedFieldSeparator')
620
- self.combined_field_separator = attributes[:'combinedFieldSeparator']
621
- end
622
-
623
- if attributes.has_key?(:'exclusiveMaximum')
624
- self.exclusive_maximum = attributes[:'exclusiveMaximum']
625
- end
626
-
627
- if attributes.has_key?(:'default')
628
- self.default = attributes[:'default']
629
- end
630
-
631
- if attributes.has_key?(:'combinedFieldType')
632
- self.combined_field_type = attributes[:'combinedFieldType']
633
- end
634
-
635
- if attributes.has_key?(:'dateTimeFormat')
636
- self.date_time_format = attributes[:'dateTimeFormat']
637
- end
638
-
639
- if attributes.has_key?(:'qrcodeColorFieldRequired')
640
- self.qrcode_color_field_required = attributes[:'qrcodeColorFieldRequired']
641
- end
642
-
643
- if attributes.has_key?(:'currency')
644
- self.currency = attributes[:'currency']
645
- end
646
-
647
- if attributes.has_key?(:'falseText')
648
- self.false_text = attributes[:'falseText']
649
- end
650
-
651
- if attributes.has_key?(:'strikethrough')
652
- self.strikethrough = attributes[:'strikethrough']
653
- end
654
-
655
- if attributes.has_key?(:'characterSpacing')
656
- self.character_spacing = attributes[:'characterSpacing']
657
- end
658
-
659
- if attributes.has_key?(:'numberConditionRangeMax')
660
- self.number_condition_range_max = attributes[:'numberConditionRangeMax']
661
- end
662
-
663
- if attributes.has_key?(:'backgroundColor')
664
- self.background_color = attributes[:'backgroundColor']
665
- end
666
-
667
- if attributes.has_key?(:'checkColorFieldName')
668
- self.check_color_field_name = attributes[:'checkColorFieldName']
669
- end
670
-
671
- if attributes.has_key?(:'checkCharacter')
672
- self.check_character = attributes[:'checkCharacter']
673
- end
674
-
675
- if attributes.has_key?(:'rotation')
676
- self.rotation = attributes[:'rotation']
677
- end
678
-
679
- if attributes.has_key?(:'optionList')
680
- self.option_list = attributes[:'optionList']
681
- end
682
-
683
- if attributes.has_key?(:'shapeFillColor')
684
- self.shape_fill_color = attributes[:'shapeFillColor']
685
- end
686
-
687
- if attributes.has_key?(:'stringConditionType')
688
- self.string_condition_type = attributes[:'stringConditionType']
689
- end
690
-
691
- if attributes.has_key?(:'shapeFillColorFieldRequired')
692
- self.shape_fill_color_field_required = attributes[:'shapeFillColorFieldRequired']
693
- end
694
-
695
- if attributes.has_key?(:'decimalPlaces')
696
- self.decimal_places = attributes[:'decimalPlaces']
697
- end
698
-
699
- if attributes.has_key?(:'includeTime')
700
- self.include_time = attributes[:'includeTime']
701
- end
702
-
703
- if attributes.has_key?(:'width')
704
- self.width = attributes[:'width']
705
- end
706
-
707
- if attributes.has_key?(:'x')
708
- self.x = attributes[:'x']
709
- end
710
-
711
- if attributes.has_key?(:'maximum')
712
- self.maximum = attributes[:'maximum']
713
- end
714
-
715
- if attributes.has_key?(:'y')
716
- self.y = attributes[:'y']
717
- end
718
-
719
- if attributes.has_key?(:'signatureAllowDraw')
720
- self.signature_allow_draw = attributes[:'signatureAllowDraw']
721
- end
722
-
723
- if attributes.has_key?(:'numberConditionType')
724
- self.number_condition_type = attributes[:'numberConditionType']
725
- end
726
-
727
- if attributes.has_key?(:'opacity')
728
- self.opacity = attributes[:'opacity']
729
- end
730
-
731
- if attributes.has_key?(:'minimum')
732
- self.minimum = attributes[:'minimum']
733
- end
734
-
735
- if attributes.has_key?(:'signatureAllowType')
736
- self.signature_allow_type = attributes[:'signatureAllowType']
737
- end
738
- end
739
-
740
- # Show invalid properties with the reasons. Usually used together with valid?
741
- # @return Array for valid properties with the reasons
742
- def list_invalid_properties
743
- invalid_properties = Array.new
744
- if !@id.nil? && @id < 0
745
- invalid_properties.push('invalid value for "id", must be greater than or equal to 0.')
746
- end
747
-
748
- if !@height.nil? && @height < 0
749
- invalid_properties.push('invalid value for "height", must be greater than or equal to 0.')
750
- end
751
-
752
- if !@shape_border_width.nil? && @shape_border_width < 0
753
- invalid_properties.push('invalid value for "shape_border_width", must be greater than or equal to 0.')
754
- end
755
-
756
- if !@comb_number_of_cells.nil? && @comb_number_of_cells < 0
757
- invalid_properties.push('invalid value for "comb_number_of_cells", must be greater than or equal to 0.')
758
- end
759
-
760
- if !@multiline_lines.nil? && @multiline_lines < 0
761
- invalid_properties.push('invalid value for "multiline_lines", must be greater than or equal to 0.')
762
- end
763
-
764
- if !@font_size.nil? && @font_size < 0
765
- invalid_properties.push('invalid value for "font_size", must be greater than or equal to 0.')
766
- end
767
-
768
- if !@page.nil? && @page < 1
769
- invalid_properties.push('invalid value for "page", must be greater than or equal to 1.')
770
- end
771
-
772
- if !@rotation.nil? && @rotation > 3.6E+2
773
- invalid_properties.push('invalid value for "rotation", must be smaller than or equal to 3.6E+2.')
774
- end
775
-
776
- if !@rotation.nil? && @rotation < 0
777
- invalid_properties.push('invalid value for "rotation", must be greater than or equal to 0.')
778
- end
779
-
780
- if !@decimal_places.nil? && @decimal_places < 0
781
- invalid_properties.push('invalid value for "decimal_places", must be greater than or equal to 0.')
782
- end
783
-
784
- if !@width.nil? && @width < 0
785
- invalid_properties.push('invalid value for "width", must be greater than or equal to 0.')
786
- end
787
-
788
- if !@x.nil? && @x < 0
789
- invalid_properties.push('invalid value for "x", must be greater than or equal to 0.')
790
- end
791
-
792
- if !@y.nil? && @y < 0
793
- invalid_properties.push('invalid value for "y", must be greater than or equal to 0.')
794
- end
795
-
796
- if !@opacity.nil? && @opacity > 1
797
- invalid_properties.push('invalid value for "opacity", must be smaller than or equal to 1.')
798
- end
799
-
800
- if !@opacity.nil? && @opacity < 0
801
- invalid_properties.push('invalid value for "opacity", must be greater than or equal to 0.')
802
- end
803
-
804
- invalid_properties
805
- end
806
-
807
- # Check to see if the all the properties in the model are valid
808
- # @return true if the model is valid
809
- def valid?
810
- type_validator = EnumAttributeValidator.new('String', ['string', 'number', 'boolean', 'date', 'address', 'country', 'email', 'url', 'image', 'signature', 'barcode', 'combined'])
811
- return false unless type_validator.valid?(@type)
812
- image_gravity_validator = EnumAttributeValidator.new('String', ['NorthWest', 'North', 'NorthEast', 'West', 'Center', 'East', 'SouthWest', 'South', 'SouthEast'])
813
- return false unless image_gravity_validator.valid?(@image_gravity)
814
- overflow_validator = EnumAttributeValidator.new('String', ['shrink_to_fit', 'truncate'])
815
- return false unless overflow_validator.valid?(@overflow)
816
- return false if !@id.nil? && @id < 0
817
- image_scale_type_validator = EnumAttributeValidator.new('String', ['fit', 'fill', 'stretch'])
818
- return false unless image_scale_type_validator.valid?(@image_scale_type)
819
- return false if !@height.nil? && @height < 0
820
- v_alignment_validator = EnumAttributeValidator.new('String', ['bottom', 'center', 'top'])
821
- return false unless v_alignment_validator.valid?(@v_alignment)
822
- return false if !@shape_border_width.nil? && @shape_border_width < 0
823
- return false if !@comb_number_of_cells.nil? && @comb_number_of_cells < 0
824
- shape_type_validator = EnumAttributeValidator.new('String', ['square', 'rectangle', 'circle', 'ellipse'])
825
- return false unless shape_type_validator.valid?(@shape_type)
826
- display_type_validator = EnumAttributeValidator.new('String', ['text', 'check', 'qrcode', 'barcode', 'image', 'shape'])
827
- return false unless display_type_validator.valid?(@display_type)
828
- return false if !@multiline_lines.nil? && @multiline_lines < 0
829
- return false if !@font_size.nil? && @font_size < 0
830
- return false if !@page.nil? && @page < 1
831
- alignment_validator = EnumAttributeValidator.new('String', ['left', 'center', 'right'])
832
- return false unless alignment_validator.valid?(@alignment)
833
- check_character_validator = EnumAttributeValidator.new('String', ['&#10003;', '&#10004;', '&#10006;', '&#10007;', '&#10008;'])
834
- return false unless check_character_validator.valid?(@check_character)
835
- return false if !@rotation.nil? && @rotation > 3.6E+2
836
- return false if !@rotation.nil? && @rotation < 0
837
- string_condition_type_validator = EnumAttributeValidator.new('String', ['equals', 'contains', 'starts_with', 'ends_with', 'regex'])
838
- return false unless string_condition_type_validator.valid?(@string_condition_type)
839
- return false if !@decimal_places.nil? && @decimal_places < 0
840
- return false if !@width.nil? && @width < 0
841
- return false if !@x.nil? && @x < 0
842
- return false if !@y.nil? && @y < 0
843
- number_condition_type_validator = EnumAttributeValidator.new('String', ['equals', 'range', 'gte', 'gt', 'lte', 'lt'])
844
- return false unless number_condition_type_validator.valid?(@number_condition_type)
845
- return false if !@opacity.nil? && @opacity > 1
846
- return false if !@opacity.nil? && @opacity < 0
847
- true
848
- end
849
-
850
- # Custom attribute writer method checking allowed values (enum).
851
- # @param [Object] type Object to be assigned
852
- def type=(type)
853
- validator = EnumAttributeValidator.new('String', ['string', 'number', 'boolean', 'date', 'address', 'country', 'email', 'url', 'image', 'signature', 'barcode', 'combined'])
854
- unless validator.valid?(type)
855
- fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
856
- end
857
- @type = type
858
- end
859
-
860
- # Custom attribute writer method checking allowed values (enum).
861
- # @param [Object] image_gravity Object to be assigned
862
- def image_gravity=(image_gravity)
863
- validator = EnumAttributeValidator.new('String', ['NorthWest', 'North', 'NorthEast', 'West', 'Center', 'East', 'SouthWest', 'South', 'SouthEast'])
864
- unless validator.valid?(image_gravity)
865
- fail ArgumentError, 'invalid value for "image_gravity", must be one of #{validator.allowable_values}.'
866
- end
867
- @image_gravity = image_gravity
868
- end
869
-
870
- # Custom attribute writer method checking allowed values (enum).
871
- # @param [Object] overflow Object to be assigned
872
- def overflow=(overflow)
873
- validator = EnumAttributeValidator.new('String', ['shrink_to_fit', 'truncate'])
874
- unless validator.valid?(overflow)
875
- fail ArgumentError, 'invalid value for "overflow", must be one of #{validator.allowable_values}.'
876
- end
877
- @overflow = overflow
878
- end
879
-
880
- # Custom attribute writer method with validation
881
- # @param [Object] id Value to be assigned
882
- def id=(id)
883
- if !id.nil? && id < 0
884
- fail ArgumentError, 'invalid value for "id", must be greater than or equal to 0.'
885
- end
886
-
887
- @id = id
888
- end
889
-
890
- # Custom attribute writer method checking allowed values (enum).
891
- # @param [Object] image_scale_type Object to be assigned
892
- def image_scale_type=(image_scale_type)
893
- validator = EnumAttributeValidator.new('String', ['fit', 'fill', 'stretch'])
894
- unless validator.valid?(image_scale_type)
895
- fail ArgumentError, 'invalid value for "image_scale_type", must be one of #{validator.allowable_values}.'
896
- end
897
- @image_scale_type = image_scale_type
898
- end
899
-
900
- # Custom attribute writer method with validation
901
- # @param [Object] height Value to be assigned
902
- def height=(height)
903
- if !height.nil? && height < 0
904
- fail ArgumentError, 'invalid value for "height", must be greater than or equal to 0.'
905
- end
906
-
907
- @height = height
908
- end
909
-
910
- # Custom attribute writer method checking allowed values (enum).
911
- # @param [Object] v_alignment Object to be assigned
912
- def v_alignment=(v_alignment)
913
- validator = EnumAttributeValidator.new('String', ['bottom', 'center', 'top'])
914
- unless validator.valid?(v_alignment)
915
- fail ArgumentError, 'invalid value for "v_alignment", must be one of #{validator.allowable_values}.'
916
- end
917
- @v_alignment = v_alignment
918
- end
919
-
920
- # Custom attribute writer method with validation
921
- # @param [Object] shape_border_width Value to be assigned
922
- def shape_border_width=(shape_border_width)
923
- if !shape_border_width.nil? && shape_border_width < 0
924
- fail ArgumentError, 'invalid value for "shape_border_width", must be greater than or equal to 0.'
925
- end
926
-
927
- @shape_border_width = shape_border_width
928
- end
929
-
930
- # Custom attribute writer method with validation
931
- # @param [Object] comb_number_of_cells Value to be assigned
932
- def comb_number_of_cells=(comb_number_of_cells)
933
- if !comb_number_of_cells.nil? && comb_number_of_cells < 0
934
- fail ArgumentError, 'invalid value for "comb_number_of_cells", must be greater than or equal to 0.'
935
- end
936
-
937
- @comb_number_of_cells = comb_number_of_cells
938
- end
939
-
940
- # Custom attribute writer method checking allowed values (enum).
941
- # @param [Object] shape_type Object to be assigned
942
- def shape_type=(shape_type)
943
- validator = EnumAttributeValidator.new('String', ['square', 'rectangle', 'circle', 'ellipse'])
944
- unless validator.valid?(shape_type)
945
- fail ArgumentError, 'invalid value for "shape_type", must be one of #{validator.allowable_values}.'
946
- end
947
- @shape_type = shape_type
948
- end
949
-
950
- # Custom attribute writer method checking allowed values (enum).
951
- # @param [Object] display_type Object to be assigned
952
- def display_type=(display_type)
953
- validator = EnumAttributeValidator.new('String', ['text', 'check', 'qrcode', 'barcode', 'image', 'shape'])
954
- unless validator.valid?(display_type)
955
- fail ArgumentError, 'invalid value for "display_type", must be one of #{validator.allowable_values}.'
956
- end
957
- @display_type = display_type
958
- end
959
-
960
- # Custom attribute writer method with validation
961
- # @param [Object] multiline_lines Value to be assigned
962
- def multiline_lines=(multiline_lines)
963
- if !multiline_lines.nil? && multiline_lines < 0
964
- fail ArgumentError, 'invalid value for "multiline_lines", must be greater than or equal to 0.'
965
- end
966
-
967
- @multiline_lines = multiline_lines
968
- end
969
-
970
- # Custom attribute writer method with validation
971
- # @param [Object] font_size Value to be assigned
972
- def font_size=(font_size)
973
- if !font_size.nil? && font_size < 0
974
- fail ArgumentError, 'invalid value for "font_size", must be greater than or equal to 0.'
975
- end
976
-
977
- @font_size = font_size
978
- end
979
-
980
- # Custom attribute writer method with validation
981
- # @param [Object] page Value to be assigned
982
- def page=(page)
983
- if !page.nil? && page < 1
984
- fail ArgumentError, 'invalid value for "page", must be greater than or equal to 1.'
985
- end
986
-
987
- @page = page
988
- end
989
-
990
- # Custom attribute writer method checking allowed values (enum).
991
- # @param [Object] alignment Object to be assigned
992
- def alignment=(alignment)
993
- validator = EnumAttributeValidator.new('String', ['left', 'center', 'right'])
994
- unless validator.valid?(alignment)
995
- fail ArgumentError, 'invalid value for "alignment", must be one of #{validator.allowable_values}.'
996
- end
997
- @alignment = alignment
998
- end
999
-
1000
- # Custom attribute writer method checking allowed values (enum).
1001
- # @param [Object] check_character Object to be assigned
1002
- def check_character=(check_character)
1003
- validator = EnumAttributeValidator.new('String', ['&#10003;', '&#10004;', '&#10006;', '&#10007;', '&#10008;'])
1004
- unless validator.valid?(check_character)
1005
- fail ArgumentError, 'invalid value for "check_character", must be one of #{validator.allowable_values}.'
1006
- end
1007
- @check_character = check_character
1008
- end
1009
-
1010
- # Custom attribute writer method with validation
1011
- # @param [Object] rotation Value to be assigned
1012
- def rotation=(rotation)
1013
- if !rotation.nil? && rotation > 3.6E+2
1014
- fail ArgumentError, 'invalid value for "rotation", must be smaller than or equal to 3.6E+2.'
1015
- end
1016
-
1017
- if !rotation.nil? && rotation < 0
1018
- fail ArgumentError, 'invalid value for "rotation", must be greater than or equal to 0.'
1019
- end
1020
-
1021
- @rotation = rotation
1022
- end
1023
-
1024
- # Custom attribute writer method checking allowed values (enum).
1025
- # @param [Object] string_condition_type Object to be assigned
1026
- def string_condition_type=(string_condition_type)
1027
- validator = EnumAttributeValidator.new('String', ['equals', 'contains', 'starts_with', 'ends_with', 'regex'])
1028
- unless validator.valid?(string_condition_type)
1029
- fail ArgumentError, 'invalid value for "string_condition_type", must be one of #{validator.allowable_values}.'
1030
- end
1031
- @string_condition_type = string_condition_type
1032
- end
1033
-
1034
- # Custom attribute writer method with validation
1035
- # @param [Object] decimal_places Value to be assigned
1036
- def decimal_places=(decimal_places)
1037
- if !decimal_places.nil? && decimal_places < 0
1038
- fail ArgumentError, 'invalid value for "decimal_places", must be greater than or equal to 0.'
1039
- end
1040
-
1041
- @decimal_places = decimal_places
1042
- end
1043
-
1044
- # Custom attribute writer method with validation
1045
- # @param [Object] width Value to be assigned
1046
- def width=(width)
1047
- if !width.nil? && width < 0
1048
- fail ArgumentError, 'invalid value for "width", must be greater than or equal to 0.'
1049
- end
1050
-
1051
- @width = width
1052
- end
1053
-
1054
- # Custom attribute writer method with validation
1055
- # @param [Object] x Value to be assigned
1056
- def x=(x)
1057
- if !x.nil? && x < 0
1058
- fail ArgumentError, 'invalid value for "x", must be greater than or equal to 0.'
1059
- end
1060
-
1061
- @x = x
1062
- end
1063
-
1064
- # Custom attribute writer method with validation
1065
- # @param [Object] y Value to be assigned
1066
- def y=(y)
1067
- if !y.nil? && y < 0
1068
- fail ArgumentError, 'invalid value for "y", must be greater than or equal to 0.'
1069
- end
1070
-
1071
- @y = y
1072
- end
1073
-
1074
- # Custom attribute writer method checking allowed values (enum).
1075
- # @param [Object] number_condition_type Object to be assigned
1076
- def number_condition_type=(number_condition_type)
1077
- validator = EnumAttributeValidator.new('String', ['equals', 'range', 'gte', 'gt', 'lte', 'lt'])
1078
- unless validator.valid?(number_condition_type)
1079
- fail ArgumentError, 'invalid value for "number_condition_type", must be one of #{validator.allowable_values}.'
1080
- end
1081
- @number_condition_type = number_condition_type
1082
- end
1083
-
1084
- # Custom attribute writer method with validation
1085
- # @param [Object] opacity Value to be assigned
1086
- def opacity=(opacity)
1087
- if !opacity.nil? && opacity > 1
1088
- fail ArgumentError, 'invalid value for "opacity", must be smaller than or equal to 1.'
1089
- end
1090
-
1091
- if !opacity.nil? && opacity < 0
1092
- fail ArgumentError, 'invalid value for "opacity", must be greater than or equal to 0.'
1093
- end
1094
-
1095
- @opacity = opacity
1096
- end
1097
-
1098
- # Checks equality by comparing each attribute.
1099
- # @param [Object] Object to be compared
1100
- def ==(o)
1101
- return true if self.equal?(o)
1102
- self.class == o.class &&
1103
- background_color_field_name == o.background_color_field_name &&
1104
- uppercase == o.uppercase &&
1105
- metadata == o.metadata &&
1106
- barcode_symbology == o.barcode_symbology &&
1107
- min_length == o.min_length &&
1108
- integer == o.integer &&
1109
- type == o.type &&
1110
- required == o.required &&
1111
- comb_value_offset == o.comb_value_offset &&
1112
- image_gravity == o.image_gravity &&
1113
- overflow == o.overflow &&
1114
- qrcode_color == o.qrcode_color &&
1115
- color_field_required == o.color_field_required &&
1116
- background_color_field_required == o.background_color_field_required &&
1117
- id == o.id &&
1118
- image_scale_type == o.image_scale_type &&
1119
- exclusive_minimum == o.exclusive_minimum &&
1120
- height == o.height &&
1121
- number_condition_range_exclusive_max == o.number_condition_range_exclusive_max &&
1122
- invert_boolean_condition == o.invert_boolean_condition &&
1123
- shape_fill_color_field_name == o.shape_fill_color_field_name &&
1124
- static == o.static &&
1125
- shape_border_color_field_name == o.shape_border_color_field_name &&
1126
- v_alignment == o.v_alignment &&
1127
- bold == o.bold &&
1128
- shape_border_width == o.shape_border_width &&
1129
- comb_number_of_cells == o.comb_number_of_cells &&
1130
- shape_border_color == o.shape_border_color &&
1131
- comb == o.comb &&
1132
- typeface == o.typeface &&
1133
- shape_type == o.shape_type &&
1134
- condition == o.condition &&
1135
- display_type == o.display_type &&
1136
- check_color == o.check_color &&
1137
- multiline_lines == o.multiline_lines &&
1138
- multiline == o.multiline &&
1139
- true_text == o.true_text &&
1140
- name == o.name &&
1141
- font_size == o.font_size &&
1142
- page == o.page &&
1143
- alignment == o.alignment &&
1144
- max_length == o.max_length &&
1145
- auto_calculate_max_length == o.auto_calculate_max_length &&
1146
- color_field_name == o.color_field_name &&
1147
- qrcode_color_field_name == o.qrcode_color_field_name &&
1148
- number_condition_range_min == o.number_condition_range_min &&
1149
- color == o.color &&
1150
- hidden == o.hidden &&
1151
- check_color_field_required == o.check_color_field_required &&
1152
- combined_field_format == o.combined_field_format &&
1153
- description == o.description &&
1154
- shape_border_color_field_required == o.shape_border_color_field_required &&
1155
- combined_field_names == o.combined_field_names &&
1156
- title == o.title &&
1157
- number_condition_range_exclusive_min == o.number_condition_range_exclusive_min &&
1158
- combined_field_separator == o.combined_field_separator &&
1159
- exclusive_maximum == o.exclusive_maximum &&
1160
- default == o.default &&
1161
- combined_field_type == o.combined_field_type &&
1162
- date_time_format == o.date_time_format &&
1163
- qrcode_color_field_required == o.qrcode_color_field_required &&
1164
- currency == o.currency &&
1165
- false_text == o.false_text &&
1166
- strikethrough == o.strikethrough &&
1167
- character_spacing == o.character_spacing &&
1168
- number_condition_range_max == o.number_condition_range_max &&
1169
- background_color == o.background_color &&
1170
- check_color_field_name == o.check_color_field_name &&
1171
- check_character == o.check_character &&
1172
- rotation == o.rotation &&
1173
- option_list == o.option_list &&
1174
- shape_fill_color == o.shape_fill_color &&
1175
- string_condition_type == o.string_condition_type &&
1176
- shape_fill_color_field_required == o.shape_fill_color_field_required &&
1177
- decimal_places == o.decimal_places &&
1178
- include_time == o.include_time &&
1179
- width == o.width &&
1180
- x == o.x &&
1181
- maximum == o.maximum &&
1182
- y == o.y &&
1183
- signature_allow_draw == o.signature_allow_draw &&
1184
- number_condition_type == o.number_condition_type &&
1185
- opacity == o.opacity &&
1186
- minimum == o.minimum &&
1187
- signature_allow_type == o.signature_allow_type
1188
- end
1189
-
1190
- # @see the `==` method
1191
- # @param [Object] Object to be compared
1192
- def eql?(o)
1193
- self == o
1194
- end
1195
-
1196
- # Calculates hash code according to all attributes.
1197
- # @return [Fixnum] Hash code
1198
- def hash
1199
- [background_color_field_name, uppercase, metadata, barcode_symbology, min_length, integer, type, required, comb_value_offset, image_gravity, overflow, qrcode_color, color_field_required, background_color_field_required, id, image_scale_type, exclusive_minimum, height, number_condition_range_exclusive_max, invert_boolean_condition, shape_fill_color_field_name, static, shape_border_color_field_name, v_alignment, bold, shape_border_width, comb_number_of_cells, shape_border_color, comb, typeface, shape_type, condition, display_type, check_color, multiline_lines, multiline, true_text, name, font_size, page, alignment, max_length, auto_calculate_max_length, color_field_name, qrcode_color_field_name, number_condition_range_min, color, hidden, check_color_field_required, combined_field_format, description, shape_border_color_field_required, combined_field_names, title, number_condition_range_exclusive_min, combined_field_separator, exclusive_maximum, default, combined_field_type, date_time_format, qrcode_color_field_required, currency, false_text, strikethrough, character_spacing, number_condition_range_max, background_color, check_color_field_name, check_character, rotation, option_list, shape_fill_color, string_condition_type, shape_fill_color_field_required, decimal_places, include_time, width, x, maximum, y, signature_allow_draw, number_condition_type, opacity, minimum, signature_allow_type].hash
1200
- end
1201
-
1202
- # Builds the object from hash
1203
- # @param [Hash] attributes Model attributes in the form of hash
1204
- # @return [Object] Returns the model itself
1205
- def build_from_hash(attributes)
1206
- return nil unless attributes.is_a?(Hash)
1207
- self.class.openapi_types.each_pair do |key, type|
1208
- if type =~ /\AArray<(.*)>/i
1209
- # check to ensure the input is an array given that the the attribute
1210
- # is documented as an array but the input is not
1211
- if attributes[self.class.attribute_map[key]].is_a?(Array)
1212
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
1213
- end
1214
- elsif !attributes[self.class.attribute_map[key]].nil?
1215
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
1216
- end # or else data not found in attributes(hash), not an issue as the data can be optional
1217
- end
1218
-
1219
- self
1220
- end
1221
-
1222
- # Deserializes the data based on type
1223
- # @param string type Data type
1224
- # @param string value Value to be deserialized
1225
- # @return [Object] Deserialized data
1226
- def _deserialize(type, value)
1227
- case type.to_sym
1228
- when :DateTime
1229
- DateTime.parse(value)
1230
- when :Date
1231
- Date.parse(value)
1232
- when :String
1233
- value.to_s
1234
- when :Integer
1235
- value.to_i
1236
- when :Float
1237
- value.to_f
1238
- when :BOOLEAN
1239
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1240
- true
1241
- else
1242
- false
1243
- end
1244
- when :Object
1245
- # generic object (usually a Hash), return directly
1246
- value
1247
- when /\AArray<(?<inner_type>.+)>\z/
1248
- inner_type = Regexp.last_match[:inner_type]
1249
- value.map { |v| _deserialize(inner_type, v) }
1250
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1251
- k_type = Regexp.last_match[:k_type]
1252
- v_type = Regexp.last_match[:v_type]
1253
- {}.tap do |hash|
1254
- value.each do |k, v|
1255
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1256
- end
1257
- end
1258
- else # model
1259
- temp_model = DocSpring.const_get(type).new
1260
- temp_model.build_from_hash(value)
1261
- end
1262
- end
1263
-
1264
- # Returns the string representation of the object
1265
- # @return [String] String presentation of the object
1266
- def to_s
1267
- to_hash.to_s
1268
- end
1269
-
1270
- # to_body is an alias to to_hash (backward compatibility)
1271
- # @return [Hash] Returns the object in the form of hash
1272
- def to_body
1273
- to_hash
1274
- end
1275
-
1276
- # Returns the object in the form of hash
1277
- # @return [Hash] Returns the object in the form of hash
1278
- def to_hash
1279
- hash = {}
1280
- self.class.attribute_map.each_pair do |attr, param|
1281
- value = self.send(attr)
1282
- next if value.nil?
1283
- hash[param] = _to_hash(value)
1284
- end
1285
- hash
1286
- end
1287
-
1288
- # Outputs non-array value in the form of hash
1289
- # For object, use to_hash. Otherwise, just return the value
1290
- # @param [Object] value Any valid value
1291
- # @return [Hash] Returns the value in the form of hash
1292
- def _to_hash(value)
1293
- if value.is_a?(Array)
1294
- value.compact.map { |v| _to_hash(v) }
1295
- elsif value.is_a?(Hash)
1296
- {}.tap do |hash|
1297
- value.each { |k, v| hash[k] = _to_hash(v) }
1298
- end
1299
- elsif value.respond_to? :to_hash
1300
- value.to_hash
1301
- else
1302
- value
1303
- end
1304
- end
1305
- end
1306
- end