docspring 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +20 -15
- data/docs/AddFieldsData.md +8 -0
- data/docs/AddFieldsTemplateResponse.md +10 -0
- data/docs/CreateHtmlTemplateData.md +8 -0
- data/docs/CreateTemplateFromUploadData.md +8 -0
- data/docs/{TemplatesdesccachedUploadTemplate.md → HtmlTemplateData.md} +1 -2
- data/docs/PDFApi.md +60 -8
- data/docs/PendingTemplate.md +1 -0
- data/docs/Submission.md +1 -0
- data/docs/Template.md +1 -0
- data/docs/{TemplatestemplateIdTemplate.md → TemplateData.md} +1 -1
- data/docs/TemplatestemplateIdaddFieldsFields.md +92 -0
- data/docs/UpdateTemplateData.md +1 -1
- data/docs/UploadTemplateData.md +25 -0
- data/docs/UploadTemplateDataDocument.md +10 -0
- data/docs/{TemplatesdesccachedUploadTemplateDocumentMetadata.md → UploadTemplateDataDocumentMetadata.md} +1 -1
- data/lib/docspring.rb +10 -6
- data/lib/docspring/api/pdf_api.rb +77 -18
- data/lib/docspring/models/add_fields_data.rb +190 -0
- data/lib/docspring/models/add_fields_template_response.rb +239 -0
- data/lib/docspring/models/{create_template_data.rb → create_html_template_data.rb} +2 -2
- data/lib/docspring/models/{create_template_data1.rb → create_template_from_upload_data.rb} +2 -2
- data/lib/docspring/models/html_template_data.rb +373 -0
- data/lib/docspring/models/pending_template.rb +10 -1
- data/lib/docspring/models/submission.rb +10 -1
- data/lib/docspring/models/template.rb +10 -1
- data/lib/docspring/models/{templatestemplate_id_template.rb → template_data.rb} +1 -1
- data/lib/docspring/models/templatestemplate_idadd_fields_fields.rb +1306 -0
- data/lib/docspring/models/update_template_data.rb +1 -1
- data/lib/docspring/models/{templatesdesccached_upload_template.rb → upload_template_data.rb} +2 -2
- data/lib/docspring/models/{templatesdesccached_upload_template_document.rb → upload_template_data_document.rb} +2 -2
- data/lib/docspring/models/{templatesdesccached_upload_template_document_metadata.rb → upload_template_data_document_metadata.rb} +1 -1
- data/lib/docspring/version.rb +1 -1
- data/spec/api/pdf_api_integration_spec.rb +49 -18
- data/spec/api/pdf_api_spec_original.skipped.rb +20 -6
- data/spec/models/add_fields_data_spec.rb +41 -0
- data/spec/models/add_fields_template_response_spec.rb +57 -0
- data/spec/models/{create_template_data_spec.rb → create_html_template_data_spec.rb} +6 -6
- data/spec/models/{create_template_data1_spec.rb → create_template_from_upload_data_spec.rb} +6 -6
- data/spec/models/html_template_data_spec.rb +145 -0
- data/spec/models/pending_template_spec.rb +6 -0
- data/spec/models/submission_spec.rb +6 -0
- data/spec/models/{templatestemplate_id_template_spec.rb → template_data_spec.rb} +6 -6
- data/spec/models/template_spec.rb +6 -0
- data/spec/models/templatestemplate_idadd_fields_fields_spec.rb +589 -0
- data/spec/models/{templatesdesccached_upload_template_document_metadata_spec.rb → upload_template_data_document_metadata_spec.rb} +6 -6
- data/spec/models/{templatesdesccached_upload_template_document_spec.rb → upload_template_data_document_spec.rb} +6 -6
- data/spec/models/{templatesdesccached_upload_template_spec.rb → upload_template_data_spec.rb} +6 -6
- metadata +42 -26
- data/docs/CreateTemplateData.md +0 -8
- data/docs/CreateTemplateData1.md +0 -8
- data/docs/TemplatesdesccachedUploadTemplateDocument.md +0 -10
@@ -32,6 +32,8 @@ module DocSpring
|
|
32
32
|
|
33
33
|
attr_accessor :metadata
|
34
34
|
|
35
|
+
attr_accessor :truncated_text
|
36
|
+
|
35
37
|
attr_accessor :pdf_hash
|
36
38
|
|
37
39
|
attr_accessor :download_url
|
@@ -78,6 +80,7 @@ module DocSpring
|
|
78
80
|
:'processed_at' => :'processed_at',
|
79
81
|
:'state' => :'state',
|
80
82
|
:'metadata' => :'metadata',
|
83
|
+
:'truncated_text' => :'truncated_text',
|
81
84
|
:'pdf_hash' => :'pdf_hash',
|
82
85
|
:'download_url' => :'download_url',
|
83
86
|
:'permanent_download_url' => :'permanent_download_url',
|
@@ -99,6 +102,7 @@ module DocSpring
|
|
99
102
|
:'processed_at' => :'String',
|
100
103
|
:'state' => :'String',
|
101
104
|
:'metadata' => :'Object',
|
105
|
+
:'truncated_text' => :'Object',
|
102
106
|
:'pdf_hash' => :'String',
|
103
107
|
:'download_url' => :'String',
|
104
108
|
:'permanent_download_url' => :'String',
|
@@ -152,6 +156,10 @@ module DocSpring
|
|
152
156
|
self.metadata = attributes[:'metadata']
|
153
157
|
end
|
154
158
|
|
159
|
+
if attributes.has_key?(:'truncated_text')
|
160
|
+
self.truncated_text = attributes[:'truncated_text']
|
161
|
+
end
|
162
|
+
|
155
163
|
if attributes.has_key?(:'pdf_hash')
|
156
164
|
self.pdf_hash = attributes[:'pdf_hash']
|
157
165
|
end
|
@@ -240,6 +248,7 @@ module DocSpring
|
|
240
248
|
processed_at == o.processed_at &&
|
241
249
|
state == o.state &&
|
242
250
|
metadata == o.metadata &&
|
251
|
+
truncated_text == o.truncated_text &&
|
243
252
|
pdf_hash == o.pdf_hash &&
|
244
253
|
download_url == o.download_url &&
|
245
254
|
permanent_download_url == o.permanent_download_url &&
|
@@ -257,7 +266,7 @@ module DocSpring
|
|
257
266
|
# Calculates hash code according to all attributes.
|
258
267
|
# @return [Fixnum] Hash code
|
259
268
|
def hash
|
260
|
-
[id, template_id, test, editable, expired, expires_at, processed_at, state, metadata, pdf_hash, download_url, permanent_download_url, batch_id, data_requests, actions].hash
|
269
|
+
[id, template_id, test, editable, expired, expires_at, processed_at, state, metadata, truncated_text, pdf_hash, download_url, permanent_download_url, batch_id, data_requests, actions].hash
|
261
270
|
end
|
262
271
|
|
263
272
|
# Builds the object from hash
|
@@ -48,6 +48,8 @@ module DocSpring
|
|
48
48
|
|
49
49
|
attr_accessor :page_dimensions
|
50
50
|
|
51
|
+
attr_accessor :locked
|
52
|
+
|
51
53
|
attr_accessor :redirect_url
|
52
54
|
|
53
55
|
attr_accessor :document_url
|
@@ -94,6 +96,7 @@ module DocSpring
|
|
94
96
|
:'template_type' => :'template_type',
|
95
97
|
:'id' => :'id',
|
96
98
|
:'page_dimensions' => :'page_dimensions',
|
99
|
+
:'locked' => :'locked',
|
97
100
|
:'redirect_url' => :'redirect_url',
|
98
101
|
:'document_url' => :'document_url'
|
99
102
|
}
|
@@ -119,6 +122,7 @@ module DocSpring
|
|
119
122
|
:'template_type' => :'String',
|
120
123
|
:'id' => :'String',
|
121
124
|
:'page_dimensions' => :'Array<Array<Float>>',
|
125
|
+
:'locked' => :'BOOLEAN',
|
122
126
|
:'redirect_url' => :'String',
|
123
127
|
:'document_url' => :'String'
|
124
128
|
}
|
@@ -202,6 +206,10 @@ module DocSpring
|
|
202
206
|
end
|
203
207
|
end
|
204
208
|
|
209
|
+
if attributes.has_key?(:'locked')
|
210
|
+
self.locked = attributes[:'locked']
|
211
|
+
end
|
212
|
+
|
205
213
|
if attributes.has_key?(:'redirect_url')
|
206
214
|
self.redirect_url = attributes[:'redirect_url']
|
207
215
|
end
|
@@ -258,6 +266,7 @@ module DocSpring
|
|
258
266
|
template_type == o.template_type &&
|
259
267
|
id == o.id &&
|
260
268
|
page_dimensions == o.page_dimensions &&
|
269
|
+
locked == o.locked &&
|
261
270
|
redirect_url == o.redirect_url &&
|
262
271
|
document_url == o.document_url
|
263
272
|
end
|
@@ -271,7 +280,7 @@ module DocSpring
|
|
271
280
|
# Calculates hash code according to all attributes.
|
272
281
|
# @return [Fixnum] Hash code
|
273
282
|
def hash
|
274
|
-
[expiration_interval, webhook_url, parent_folder_id, expire_after, allow_additional_properties, description, public_submissions, slack_webhook_url, path, public_web_form, editable_submissions, expire_submissions, name, permanent_document_url, template_type, id, page_dimensions, redirect_url, document_url].hash
|
283
|
+
[expiration_interval, webhook_url, parent_folder_id, expire_after, allow_additional_properties, description, public_submissions, slack_webhook_url, path, public_web_form, editable_submissions, expire_submissions, name, permanent_document_url, template_type, id, page_dimensions, locked, redirect_url, document_url].hash
|
275
284
|
end
|
276
285
|
|
277
286
|
# Builds the object from hash
|
@@ -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-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module DocSpring
|
16
|
+
class TemplatestemplateIdaddFieldsFields
|
17
|
+
attr_accessor :uppercase
|
18
|
+
|
19
|
+
attr_accessor :background_color_field_name
|
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 :static
|
58
|
+
|
59
|
+
attr_accessor :shape_fill_color_field_name
|
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 :typeface
|
74
|
+
|
75
|
+
attr_accessor :comb
|
76
|
+
|
77
|
+
attr_accessor :shape_type
|
78
|
+
|
79
|
+
attr_accessor :display_type
|
80
|
+
|
81
|
+
attr_accessor :condition
|
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 :hidden
|
110
|
+
|
111
|
+
attr_accessor :color
|
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 :strikethrough
|
142
|
+
|
143
|
+
attr_accessor :false_text
|
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 :include_time
|
166
|
+
|
167
|
+
attr_accessor :decimal_places
|
168
|
+
|
169
|
+
attr_accessor :x
|
170
|
+
|
171
|
+
attr_accessor :width
|
172
|
+
|
173
|
+
attr_accessor :maximum
|
174
|
+
|
175
|
+
attr_accessor :y
|
176
|
+
|
177
|
+
attr_accessor :signature_allow_draw
|
178
|
+
|
179
|
+
attr_accessor :opacity
|
180
|
+
|
181
|
+
attr_accessor :number_condition_type
|
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
|
+
:'uppercase' => :'uppercase',
|
213
|
+
:'background_color_field_name' => :'backgroundColorFieldName',
|
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
|
+
:'static' => :'static',
|
233
|
+
:'shape_fill_color_field_name' => :'shapeFillColorFieldName',
|
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
|
+
:'typeface' => :'typeface',
|
241
|
+
:'comb' => :'comb',
|
242
|
+
:'shape_type' => :'shapeType',
|
243
|
+
:'display_type' => :'displayType',
|
244
|
+
:'condition' => :'condition',
|
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
|
+
:'hidden' => :'hidden',
|
259
|
+
:'color' => :'color',
|
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
|
+
:'strikethrough' => :'strikethrough',
|
275
|
+
:'false_text' => :'falseText',
|
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
|
+
:'include_time' => :'includeTime',
|
287
|
+
:'decimal_places' => :'decimalPlaces',
|
288
|
+
:'x' => :'x',
|
289
|
+
:'width' => :'width',
|
290
|
+
:'maximum' => :'maximum',
|
291
|
+
:'y' => :'y',
|
292
|
+
:'signature_allow_draw' => :'signatureAllowDraw',
|
293
|
+
:'opacity' => :'opacity',
|
294
|
+
:'number_condition_type' => :'numberConditionType',
|
295
|
+
:'minimum' => :'minimum',
|
296
|
+
:'signature_allow_type' => :'signatureAllowType'
|
297
|
+
}
|
298
|
+
end
|
299
|
+
|
300
|
+
# Attribute type mapping.
|
301
|
+
def self.openapi_types
|
302
|
+
{
|
303
|
+
:'uppercase' => :'BOOLEAN',
|
304
|
+
:'background_color_field_name' => :'String',
|
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
|
+
:'static' => :'BOOLEAN',
|
324
|
+
:'shape_fill_color_field_name' => :'String',
|
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
|
+
:'typeface' => :'String',
|
332
|
+
:'comb' => :'BOOLEAN',
|
333
|
+
:'shape_type' => :'String',
|
334
|
+
:'display_type' => :'String',
|
335
|
+
:'condition' => :'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
|
+
:'hidden' => :'BOOLEAN',
|
350
|
+
:'color' => :'String',
|
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
|
+
:'strikethrough' => :'BOOLEAN',
|
366
|
+
:'false_text' => :'String',
|
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
|
+
:'include_time' => :'BOOLEAN',
|
378
|
+
:'decimal_places' => :'Float',
|
379
|
+
:'x' => :'Float',
|
380
|
+
:'width' => :'Float',
|
381
|
+
:'maximum' => :'Float',
|
382
|
+
:'y' => :'Float',
|
383
|
+
:'signature_allow_draw' => :'BOOLEAN',
|
384
|
+
:'opacity' => :'Float',
|
385
|
+
:'number_condition_type' => :'String',
|
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?(:'uppercase')
|
400
|
+
self.uppercase = attributes[:'uppercase']
|
401
|
+
end
|
402
|
+
|
403
|
+
if attributes.has_key?(:'backgroundColorFieldName')
|
404
|
+
self.background_color_field_name = attributes[:'backgroundColorFieldName']
|
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?(:'static')
|
480
|
+
self.static = attributes[:'static']
|
481
|
+
end
|
482
|
+
|
483
|
+
if attributes.has_key?(:'shapeFillColorFieldName')
|
484
|
+
self.shape_fill_color_field_name = attributes[:'shapeFillColorFieldName']
|
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?(:'typeface')
|
512
|
+
self.typeface = attributes[:'typeface']
|
513
|
+
end
|
514
|
+
|
515
|
+
if attributes.has_key?(:'comb')
|
516
|
+
self.comb = attributes[:'comb']
|
517
|
+
end
|
518
|
+
|
519
|
+
if attributes.has_key?(:'shapeType')
|
520
|
+
self.shape_type = attributes[:'shapeType']
|
521
|
+
end
|
522
|
+
|
523
|
+
if attributes.has_key?(:'displayType')
|
524
|
+
self.display_type = attributes[:'displayType']
|
525
|
+
end
|
526
|
+
|
527
|
+
if attributes.has_key?(:'condition')
|
528
|
+
self.condition = attributes[:'condition']
|
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?(:'hidden')
|
584
|
+
self.hidden = attributes[:'hidden']
|
585
|
+
end
|
586
|
+
|
587
|
+
if attributes.has_key?(:'color')
|
588
|
+
self.color = attributes[:'color']
|
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?(:'strikethrough')
|
648
|
+
self.strikethrough = attributes[:'strikethrough']
|
649
|
+
end
|
650
|
+
|
651
|
+
if attributes.has_key?(:'falseText')
|
652
|
+
self.false_text = attributes[:'falseText']
|
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?(:'includeTime')
|
696
|
+
self.include_time = attributes[:'includeTime']
|
697
|
+
end
|
698
|
+
|
699
|
+
if attributes.has_key?(:'decimalPlaces')
|
700
|
+
self.decimal_places = attributes[:'decimalPlaces']
|
701
|
+
end
|
702
|
+
|
703
|
+
if attributes.has_key?(:'x')
|
704
|
+
self.x = attributes[:'x']
|
705
|
+
end
|
706
|
+
|
707
|
+
if attributes.has_key?(:'width')
|
708
|
+
self.width = attributes[:'width']
|
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?(:'opacity')
|
724
|
+
self.opacity = attributes[:'opacity']
|
725
|
+
end
|
726
|
+
|
727
|
+
if attributes.has_key?(:'numberConditionType')
|
728
|
+
self.number_condition_type = attributes[:'numberConditionType']
|
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 !@x.nil? && @x < 0
|
785
|
+
invalid_properties.push('invalid value for "x", must be greater than or equal to 0.')
|
786
|
+
end
|
787
|
+
|
788
|
+
if !@width.nil? && @width < 0
|
789
|
+
invalid_properties.push('invalid value for "width", 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', ['✓', '✔', '✖', '✗', '✘'])
|
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 !@x.nil? && @x < 0
|
841
|
+
return false if !@width.nil? && @width < 0
|
842
|
+
return false if !@y.nil? && @y < 0
|
843
|
+
return false if !@opacity.nil? && @opacity > 1
|
844
|
+
return false if !@opacity.nil? && @opacity < 0
|
845
|
+
number_condition_type_validator = EnumAttributeValidator.new('String', ['equals', 'range', 'gte', 'gt', 'lte', 'lt'])
|
846
|
+
return false unless number_condition_type_validator.valid?(@number_condition_type)
|
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', ['✓', '✔', '✖', '✗', '✘'])
|
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] x Value to be assigned
|
1046
|
+
def x=(x)
|
1047
|
+
if !x.nil? && x < 0
|
1048
|
+
fail ArgumentError, 'invalid value for "x", must be greater than or equal to 0.'
|
1049
|
+
end
|
1050
|
+
|
1051
|
+
@x = x
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
# Custom attribute writer method with validation
|
1055
|
+
# @param [Object] width Value to be assigned
|
1056
|
+
def width=(width)
|
1057
|
+
if !width.nil? && width < 0
|
1058
|
+
fail ArgumentError, 'invalid value for "width", must be greater than or equal to 0.'
|
1059
|
+
end
|
1060
|
+
|
1061
|
+
@width = width
|
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 with validation
|
1075
|
+
# @param [Object] opacity Value to be assigned
|
1076
|
+
def opacity=(opacity)
|
1077
|
+
if !opacity.nil? && opacity > 1
|
1078
|
+
fail ArgumentError, 'invalid value for "opacity", must be smaller than or equal to 1.'
|
1079
|
+
end
|
1080
|
+
|
1081
|
+
if !opacity.nil? && opacity < 0
|
1082
|
+
fail ArgumentError, 'invalid value for "opacity", must be greater than or equal to 0.'
|
1083
|
+
end
|
1084
|
+
|
1085
|
+
@opacity = opacity
|
1086
|
+
end
|
1087
|
+
|
1088
|
+
# Custom attribute writer method checking allowed values (enum).
|
1089
|
+
# @param [Object] number_condition_type Object to be assigned
|
1090
|
+
def number_condition_type=(number_condition_type)
|
1091
|
+
validator = EnumAttributeValidator.new('String', ['equals', 'range', 'gte', 'gt', 'lte', 'lt'])
|
1092
|
+
unless validator.valid?(number_condition_type)
|
1093
|
+
fail ArgumentError, 'invalid value for "number_condition_type", must be one of #{validator.allowable_values}.'
|
1094
|
+
end
|
1095
|
+
@number_condition_type = number_condition_type
|
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
|
+
uppercase == o.uppercase &&
|
1104
|
+
background_color_field_name == o.background_color_field_name &&
|
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
|
+
static == o.static &&
|
1124
|
+
shape_fill_color_field_name == o.shape_fill_color_field_name &&
|
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
|
+
typeface == o.typeface &&
|
1132
|
+
comb == o.comb &&
|
1133
|
+
shape_type == o.shape_type &&
|
1134
|
+
display_type == o.display_type &&
|
1135
|
+
condition == o.condition &&
|
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
|
+
hidden == o.hidden &&
|
1150
|
+
color == o.color &&
|
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
|
+
strikethrough == o.strikethrough &&
|
1166
|
+
false_text == o.false_text &&
|
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
|
+
include_time == o.include_time &&
|
1178
|
+
decimal_places == o.decimal_places &&
|
1179
|
+
x == o.x &&
|
1180
|
+
width == o.width &&
|
1181
|
+
maximum == o.maximum &&
|
1182
|
+
y == o.y &&
|
1183
|
+
signature_allow_draw == o.signature_allow_draw &&
|
1184
|
+
opacity == o.opacity &&
|
1185
|
+
number_condition_type == o.number_condition_type &&
|
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
|
+
[uppercase, background_color_field_name, 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, static, shape_fill_color_field_name, shape_border_color_field_name, v_alignment, bold, shape_border_width, comb_number_of_cells, shape_border_color, typeface, comb, shape_type, display_type, condition, 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, hidden, color, 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, strikethrough, false_text, 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, include_time, decimal_places, x, width, maximum, y, signature_allow_draw, opacity, number_condition_type, 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
|