docspring 1.0.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/.openapi-generator/VERSION +1 -1
  3. data/CHANGELOG.md +14 -37
  4. data/Gemfile +2 -1
  5. data/Gemfile.lock +37 -32
  6. data/LICENSE +1 -1
  7. data/README.md +26 -15
  8. data/docs/AddFieldsData.md +8 -0
  9. data/docs/AddFieldsTemplateResponse.md +10 -0
  10. data/docs/CombinePdfsData.md +4 -4
  11. data/docs/CombinedSubmission.md +1 -0
  12. data/docs/CombinedSubmissionData.md +3 -3
  13. data/docs/{CreateTemplateData.md → CreateHtmlTemplateData.md} +2 -2
  14. data/docs/CreateSubmissionDataRequestData.md +2 -2
  15. data/docs/CreateTemplateFromUploadData.md +8 -0
  16. data/docs/HtmlTemplateData.md +24 -0
  17. data/docs/PDFApi.md +169 -15
  18. data/docs/PendingTemplate.md +2 -0
  19. data/docs/Submission.md +5 -0
  20. data/docs/SubmissionBatchData.md +2 -2
  21. data/docs/SubmissionData.md +4 -3
  22. data/docs/SubmissionDataBatchRequest.md +2 -2
  23. data/docs/SubmissionDataRequest.md +2 -0
  24. data/docs/Template.md +2 -0
  25. data/docs/{Templatesv2Template.md → TemplateData.md} +11 -7
  26. data/docs/TemplatestemplateIdaddFieldsFields.md +92 -0
  27. data/docs/UpdateSubmissionDataRequestData.md +9 -9
  28. data/docs/UpdateTemplateData.md +8 -0
  29. data/docs/UpdateTemplateResponse.md +9 -0
  30. data/docs/UploadTemplateData.md +25 -0
  31. data/docs/{Templatesv2TemplateDocument.md → UploadTemplateDataDocument.md} +2 -2
  32. data/docs/{Templatesv2TemplateDocumentMetadata.md → UploadTemplateDataDocumentMetadata.md} +1 -1
  33. data/docspring.gemspec +3 -3
  34. data/lib/docspring.rb +13 -5
  35. data/lib/docspring/api/pdf_api.rb +193 -22
  36. data/lib/docspring/api_client.rb +1 -1
  37. data/lib/docspring/api_error.rb +1 -1
  38. data/lib/docspring/configuration.rb +1 -1
  39. data/lib/docspring/models/add_fields_data.rb +190 -0
  40. data/lib/docspring/models/add_fields_template_response.rb +239 -0
  41. data/lib/docspring/models/authentication_error.rb +1 -1
  42. data/lib/docspring/models/authentication_success_response.rb +1 -1
  43. data/lib/docspring/models/combine_pdfs_data.rb +28 -28
  44. data/lib/docspring/models/combined_submission.rb +11 -2
  45. data/lib/docspring/models/combined_submission_action.rb +1 -6
  46. data/lib/docspring/models/combined_submission_data.rb +23 -23
  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_from_upload_data.rb +188 -0
  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 +1 -1
  67. data/lib/docspring/models/pending_template.rb +20 -2
  68. data/lib/docspring/models/rename_folder_data.rb +1 -1
  69. data/lib/docspring/models/submission.rb +52 -7
  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 -25
  74. data/lib/docspring/models/submission_data_batch_request.rb +20 -20
  75. data/lib/docspring/models/submission_data_request.rb +23 -20
  76. data/lib/docspring/models/template.rb +20 -2
  77. data/lib/docspring/models/{templatesv2_template.rb → template_data.rb} +81 -45
  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 +188 -0
  82. data/lib/docspring/models/update_template_response.rb +228 -0
  83. data/lib/docspring/models/upload_template_data.rb +382 -0
  84. data/lib/docspring/models/{templatesv2_template_document.rb → upload_template_data_document.rb} +3 -3
  85. data/lib/docspring/models/{templatesv2_template_document_metadata.rb → upload_template_data_document_metadata.rb} +2 -2
  86. data/lib/docspring/version.rb +2 -2
  87. data/spec/api/client_integration_spec.rb +14 -2
  88. data/spec/api/pdf_api_integration_spec.rb +49 -18
  89. data/spec/api/pdf_api_spec_original.skipped.rb +51 -11
  90. data/spec/api_client_spec.rb +1 -1
  91. data/spec/configuration_spec.rb +1 -1
  92. data/spec/models/add_fields_data_spec.rb +41 -0
  93. data/spec/models/add_fields_template_response_spec.rb +57 -0
  94. data/spec/models/authentication_error_spec.rb +1 -1
  95. data/spec/models/authentication_success_response_spec.rb +1 -1
  96. data/spec/models/combine_pdfs_data_spec.rb +5 -5
  97. data/spec/models/combined_submission_action_spec.rb +1 -1
  98. data/spec/models/combined_submission_data_spec.rb +5 -5
  99. data/spec/models/combined_submission_spec.rb +7 -1
  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_html_template_data_spec.rb +41 -0
  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_data_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 +13 -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 +13 -1
  127. data/spec/models/submission_data_spec.rb +11 -5
  128. data/spec/models/submission_spec.rb +32 -2
  129. data/spec/models/{templatesv2_template_spec.rb → template_data_spec.rb} +40 -16
  130. data/spec/models/template_spec.rb +13 -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 +41 -0
  135. data/spec/models/update_template_response_spec.rb +51 -0
  136. data/spec/models/{templatesv2_template_document_metadata_spec.rb → upload_template_data_document_metadata_spec.rb} +7 -7
  137. data/spec/models/{templatesv2_template_document_spec.rb → upload_template_data_document_spec.rb} +7 -7
  138. data/spec/models/upload_template_data_spec.rb +151 -0
  139. data/spec/spec_helper.rb +1 -1
  140. metadata +60 -32
  141. data/.swagger-codegen-ignore +0 -31
  142. data/.swagger-codegen/VERSION +0 -1
  143. data/.swagger-revision +0 -1
  144. data/.travis.yml +0 -8
@@ -0,0 +1,1306 @@
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