groupdocs_signature_cloud 18.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/groupdocs_signature_cloud.rb +191 -0
- data/lib/groupdocs_signature_cloud/api/signature_api.rb +2590 -0
- data/lib/groupdocs_signature_cloud/api_client.rb +380 -0
- data/lib/groupdocs_signature_cloud/api_error.rb +58 -0
- data/lib/groupdocs_signature_cloud/configuration.rb +110 -0
- data/lib/groupdocs_signature_cloud/models/barcode_collection.rb +232 -0
- data/lib/groupdocs_signature_cloud/models/barcode_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/barcode_type.rb +230 -0
- data/lib/groupdocs_signature_cloud/models/base_signature_data.rb +230 -0
- data/lib/groupdocs_signature_cloud/models/border_line_data.rb +312 -0
- data/lib/groupdocs_signature_cloud/models/brush_data.rb +230 -0
- data/lib/groupdocs_signature_cloud/models/cells_barcode_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/cells_digital_signature_data.rb +307 -0
- data/lib/groupdocs_signature_cloud/models/cells_qr_code_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/cells_search_barcode_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/cells_search_digital_options_data.rb +265 -0
- data/lib/groupdocs_signature_cloud/models/cells_search_qr_code_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/cells_sign_barcode_options_data.rb +694 -0
- data/lib/groupdocs_signature_cloud/models/cells_sign_digital_options_data.rb +546 -0
- data/lib/groupdocs_signature_cloud/models/cells_sign_image_options_data.rb +526 -0
- data/lib/groupdocs_signature_cloud/models/cells_sign_qr_code_options_data.rb +704 -0
- data/lib/groupdocs_signature_cloud/models/cells_sign_stamp_options_data.rb +622 -0
- data/lib/groupdocs_signature_cloud/models/cells_sign_text_options_data.rb +736 -0
- data/lib/groupdocs_signature_cloud/models/cells_verify_barcode_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/cells_verify_digital_options_data.rb +315 -0
- data/lib/groupdocs_signature_cloud/models/cells_verify_qr_code_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/cells_verify_text_options_data.rb +285 -0
- data/lib/groupdocs_signature_cloud/models/color.rb +245 -0
- data/lib/groupdocs_signature_cloud/models/digital_signature_data.rb +307 -0
- data/lib/groupdocs_signature_cloud/models/document_info.rb +300 -0
- data/lib/groupdocs_signature_cloud/models/document_response.rb +302 -0
- data/lib/groupdocs_signature_cloud/models/format.rb +240 -0
- data/lib/groupdocs_signature_cloud/models/format_collection.rb +232 -0
- data/lib/groupdocs_signature_cloud/models/images_barcode_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/images_qr_code_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/images_search_barcode_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/images_search_qr_code_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/images_sign_barcode_options_data.rb +664 -0
- data/lib/groupdocs_signature_cloud/models/images_sign_image_options_data.rb +496 -0
- data/lib/groupdocs_signature_cloud/models/images_sign_qr_code_options_data.rb +674 -0
- data/lib/groupdocs_signature_cloud/models/images_sign_stamp_options_data.rb +592 -0
- data/lib/groupdocs_signature_cloud/models/images_sign_text_options_data.rb +706 -0
- data/lib/groupdocs_signature_cloud/models/images_verify_barcode_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/images_verify_qr_code_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/linear_gradient_brush_data.rb +260 -0
- data/lib/groupdocs_signature_cloud/models/padding_data.rb +295 -0
- data/lib/groupdocs_signature_cloud/models/page_info.rb +305 -0
- data/lib/groupdocs_signature_cloud/models/pages_info.rb +247 -0
- data/lib/groupdocs_signature_cloud/models/pages_setup_data.rb +292 -0
- data/lib/groupdocs_signature_cloud/models/pdf_barcode_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/pdf_digital_signature_data.rb +307 -0
- data/lib/groupdocs_signature_cloud/models/pdf_qr_code_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/pdf_search_barcode_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/pdf_search_digital_options_data.rb +265 -0
- data/lib/groupdocs_signature_cloud/models/pdf_search_qr_code_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/pdf_sign_barcode_options_data.rb +664 -0
- data/lib/groupdocs_signature_cloud/models/pdf_sign_digital_options_data.rb +556 -0
- data/lib/groupdocs_signature_cloud/models/pdf_sign_image_options_data.rb +496 -0
- data/lib/groupdocs_signature_cloud/models/pdf_sign_qr_code_options_data.rb +674 -0
- data/lib/groupdocs_signature_cloud/models/pdf_sign_stamp_options_data.rb +592 -0
- data/lib/groupdocs_signature_cloud/models/pdf_sign_text_options_data.rb +696 -0
- data/lib/groupdocs_signature_cloud/models/pdf_verify_barcode_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/pdf_verify_digital_options_data.rb +315 -0
- data/lib/groupdocs_signature_cloud/models/pdf_verify_qr_code_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/pdf_verify_text_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/qr_code_collection.rb +232 -0
- data/lib/groupdocs_signature_cloud/models/qr_code_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +230 -0
- data/lib/groupdocs_signature_cloud/models/radial_gradient_brush_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/requests/get_document_info_from_url_request.rb +55 -0
- data/lib/groupdocs_signature_cloud/models/requests/get_document_info_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_barcode_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_barcode_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_collection_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_collection_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_digital_from_url_request.rb +67 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_digital_request.rb +71 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_image_from_url_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_image_request.rb +67 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_qr_code_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_qr_code_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_search_barcode_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_search_barcode_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_search_collection_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_search_collection_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_search_digital_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_search_digital_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_search_qr_code_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_search_qr_code_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_stamp_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_stamp_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_text_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_text_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_barcode_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_barcode_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_collection_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_collection_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_digital_from_url_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_digital_request.rb +67 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_qr_code_from_url_request.rb +59 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_qr_code_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_text_from_url_request.rb +57 -0
- data/lib/groupdocs_signature_cloud/models/requests/post_verification_text_request.rb +63 -0
- data/lib/groupdocs_signature_cloud/models/search_barcode_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/search_digital_options_data.rb +265 -0
- data/lib/groupdocs_signature_cloud/models/search_document_response.rb +305 -0
- data/lib/groupdocs_signature_cloud/models/search_options_collection_data.rb +232 -0
- data/lib/groupdocs_signature_cloud/models/search_options_data.rb +265 -0
- data/lib/groupdocs_signature_cloud/models/search_qr_code_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/sign_barcode_options_data.rb +664 -0
- data/lib/groupdocs_signature_cloud/models/sign_digital_options_data.rb +516 -0
- data/lib/groupdocs_signature_cloud/models/sign_image_options_data.rb +496 -0
- data/lib/groupdocs_signature_cloud/models/sign_options_collection_data.rb +232 -0
- data/lib/groupdocs_signature_cloud/models/sign_options_data.rb +255 -0
- data/lib/groupdocs_signature_cloud/models/sign_qr_code_options_data.rb +674 -0
- data/lib/groupdocs_signature_cloud/models/sign_stamp_options_data.rb +592 -0
- data/lib/groupdocs_signature_cloud/models/sign_text_options_data.rb +562 -0
- data/lib/groupdocs_signature_cloud/models/signature_document_response.rb +290 -0
- data/lib/groupdocs_signature_cloud/models/signature_font_data.rb +290 -0
- data/lib/groupdocs_signature_cloud/models/slides_barcode_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/slides_qr_code_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/slides_search_barcode_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/slides_search_qr_code_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/slides_sign_barcode_options_data.rb +664 -0
- data/lib/groupdocs_signature_cloud/models/slides_sign_image_options_data.rb +496 -0
- data/lib/groupdocs_signature_cloud/models/slides_sign_qr_code_options_data.rb +674 -0
- data/lib/groupdocs_signature_cloud/models/slides_sign_stamp_options_data.rb +592 -0
- data/lib/groupdocs_signature_cloud/models/slides_sign_text_options_data.rb +670 -0
- data/lib/groupdocs_signature_cloud/models/slides_verify_barcode_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/slides_verify_qr_code_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/slides_verify_text_options_data.rb +285 -0
- data/lib/groupdocs_signature_cloud/models/solid_brush_data.rb +240 -0
- data/lib/groupdocs_signature_cloud/models/stamp_line_data.rb +377 -0
- data/lib/groupdocs_signature_cloud/models/texture_brush_data.rb +240 -0
- data/lib/groupdocs_signature_cloud/models/verified_document_response.rb +300 -0
- data/lib/groupdocs_signature_cloud/models/verify_barcode_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/verify_digital_options_data.rb +285 -0
- data/lib/groupdocs_signature_cloud/models/verify_options_collection_data.rb +247 -0
- data/lib/groupdocs_signature_cloud/models/verify_options_data.rb +265 -0
- data/lib/groupdocs_signature_cloud/models/verify_qr_code_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/verify_text_options_data.rb +285 -0
- data/lib/groupdocs_signature_cloud/models/words_barcode_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/words_digital_signature_data.rb +307 -0
- data/lib/groupdocs_signature_cloud/models/words_qr_code_signature_data.rb +250 -0
- data/lib/groupdocs_signature_cloud/models/words_search_barcode_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/words_search_digital_options_data.rb +265 -0
- data/lib/groupdocs_signature_cloud/models/words_search_qr_code_options_data.rb +332 -0
- data/lib/groupdocs_signature_cloud/models/words_sign_barcode_options_data.rb +664 -0
- data/lib/groupdocs_signature_cloud/models/words_sign_digital_options_data.rb +516 -0
- data/lib/groupdocs_signature_cloud/models/words_sign_image_options_data.rb +496 -0
- data/lib/groupdocs_signature_cloud/models/words_sign_qr_code_options_data.rb +674 -0
- data/lib/groupdocs_signature_cloud/models/words_sign_stamp_options_data.rb +592 -0
- data/lib/groupdocs_signature_cloud/models/words_sign_text_options_data.rb +696 -0
- data/lib/groupdocs_signature_cloud/models/words_verify_barcode_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/words_verify_digital_options_data.rb +315 -0
- data/lib/groupdocs_signature_cloud/models/words_verify_qr_code_options_data.rb +342 -0
- data/lib/groupdocs_signature_cloud/models/words_verify_text_options_data.rb +285 -0
- data/lib/groupdocs_signature_cloud/version.rb +29 -0
- metadata +290 -0
@@ -0,0 +1,706 @@
|
|
1
|
+
#
|
2
|
+
# --------------------------------------------------------------------------------------------------------------------
|
3
|
+
# <copyright company="Aspose Pty Ltd" file="images_sign_text_options_data.rb">
|
4
|
+
# Copyright (c) 2003-2018 Aspose Pty Ltd
|
5
|
+
# </copyright>
|
6
|
+
# <summary>
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
12
|
+
# furnished to do so, subject to the following conditions:
|
13
|
+
#
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
15
|
+
# copies or substantial portions of the Software.
|
16
|
+
#
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
# SOFTWARE.
|
24
|
+
# </summary>
|
25
|
+
# --------------------------------------------------------------------------------------------------------------------
|
26
|
+
#
|
27
|
+
|
28
|
+
require 'date'
|
29
|
+
|
30
|
+
module GroupDocsSignatureCloud
|
31
|
+
# Represents the Text Sign Options for Images Documents.
|
32
|
+
class ImagesSignTextOptionsData
|
33
|
+
|
34
|
+
# Gets or sets document page number for signing. This property can only be used for multi-frames image formats (Tiff). Minimal value is 1.
|
35
|
+
attr_accessor :document_page_number
|
36
|
+
|
37
|
+
# Options to specify pages to be signed. This property can only be used for multi-frames image formats (Tiff).
|
38
|
+
attr_accessor :pages_setup
|
39
|
+
|
40
|
+
# Internal property that specify the name of Options.
|
41
|
+
attr_accessor :options_type
|
42
|
+
|
43
|
+
# Left X position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType property)
|
44
|
+
attr_accessor :left
|
45
|
+
|
46
|
+
# Top Y Position of Signature on Document Page in Measure values (pixels or percent see LocationMeasureType property)
|
47
|
+
attr_accessor :top
|
48
|
+
|
49
|
+
# Width of Signature area on Document Page in Measure values (pixels or percent see SizeMeasureType property)
|
50
|
+
attr_accessor :width
|
51
|
+
|
52
|
+
# Height of Signature are on Document Page in Measure values (pixels or percent see SizeMeasureType property)
|
53
|
+
attr_accessor :height
|
54
|
+
|
55
|
+
# Measure type (pixels or percent) for Left and Top properties.
|
56
|
+
attr_accessor :location_measure_type
|
57
|
+
|
58
|
+
# Measure type (pixels or percent) for Width and Height properties.
|
59
|
+
attr_accessor :size_measure_type
|
60
|
+
|
61
|
+
# Stretch mode on Document Page
|
62
|
+
attr_accessor :stretch
|
63
|
+
|
64
|
+
# Rotation angle of signature on document page (clockwise).
|
65
|
+
attr_accessor :rotation_angle
|
66
|
+
|
67
|
+
# Horizontal alignment of signature on document page.
|
68
|
+
attr_accessor :horizontal_alignment
|
69
|
+
|
70
|
+
# Vertical alignment of signature on document page.
|
71
|
+
attr_accessor :vertical_alignment
|
72
|
+
|
73
|
+
# Gets or sets the space between Sign and Document edges. (works ONLY if horizontal or vertical alignment are specified).
|
74
|
+
attr_accessor :margin
|
75
|
+
|
76
|
+
# Gets or sets the measure type (pixels or percent) for Margin.
|
77
|
+
attr_accessor :margin_measure_type
|
78
|
+
|
79
|
+
# Text of signature
|
80
|
+
attr_accessor :text
|
81
|
+
|
82
|
+
# Put signature on all document pages. This property can only be used for multi-frames image formats (Tiff).
|
83
|
+
attr_accessor :sign_all_pages
|
84
|
+
|
85
|
+
# Gets or sets the font of signature.
|
86
|
+
attr_accessor :font
|
87
|
+
|
88
|
+
# Gets or sets the fore color of signature.
|
89
|
+
attr_accessor :fore_color
|
90
|
+
|
91
|
+
# Gets or sets the border color of signature.
|
92
|
+
attr_accessor :border_color
|
93
|
+
|
94
|
+
# Gets or sets the background color of signature.
|
95
|
+
attr_accessor :background_color
|
96
|
+
|
97
|
+
# Gets or sets the signature background brush. Value by default is null. When property has a value it is used instead BackgroundBrush property. It is not used for Watermark implementation.
|
98
|
+
attr_accessor :background_brush
|
99
|
+
|
100
|
+
# Gets or sets the signature border style.
|
101
|
+
attr_accessor :border_dash_style
|
102
|
+
|
103
|
+
# Gets or sets the signature border transparency (value from 0.0 (opaque) through 1.0 (clear)).
|
104
|
+
attr_accessor :border_transparency
|
105
|
+
|
106
|
+
# Gets or sets the weight of the signature border.
|
107
|
+
attr_accessor :border_weight
|
108
|
+
|
109
|
+
# Gets or sets the signature background transparency (value from 0.0 (opaque) through 1.0 (clear)).
|
110
|
+
attr_accessor :background_transparency
|
111
|
+
|
112
|
+
# Gets or sets the type of text signature implementation.
|
113
|
+
attr_accessor :signature_implementation
|
114
|
+
|
115
|
+
# Gets or sets the signature opacity (value from 0.0 (clear) through 1.0 (opaque)). By default the value is 1.0.
|
116
|
+
attr_accessor :opacity
|
117
|
+
|
118
|
+
# Horizontal alignment of text inside a signature.
|
119
|
+
attr_accessor :text_horizontal_alignment
|
120
|
+
|
121
|
+
# Vertical alignment of text inside a signature.
|
122
|
+
attr_accessor :text_vertical_alignment
|
123
|
+
class EnumAttributeValidator
|
124
|
+
attr_reader :datatype
|
125
|
+
attr_reader :allowable_values
|
126
|
+
|
127
|
+
def initialize(datatype, allowable_values)
|
128
|
+
@allowable_values = allowable_values.map do |value|
|
129
|
+
case datatype.to_s
|
130
|
+
when /Integer/i
|
131
|
+
value.to_i
|
132
|
+
when /Float/i
|
133
|
+
value.to_f
|
134
|
+
else
|
135
|
+
value
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
def valid?(value)
|
141
|
+
!value || allowable_values.include?(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
146
|
+
def self.attribute_map
|
147
|
+
{
|
148
|
+
:'document_page_number' => :'DocumentPageNumber',
|
149
|
+
:'pages_setup' => :'PagesSetup',
|
150
|
+
:'options_type' => :'OptionsType',
|
151
|
+
:'left' => :'Left',
|
152
|
+
:'top' => :'Top',
|
153
|
+
:'width' => :'Width',
|
154
|
+
:'height' => :'Height',
|
155
|
+
:'location_measure_type' => :'LocationMeasureType',
|
156
|
+
:'size_measure_type' => :'SizeMeasureType',
|
157
|
+
:'stretch' => :'Stretch',
|
158
|
+
:'rotation_angle' => :'RotationAngle',
|
159
|
+
:'horizontal_alignment' => :'HorizontalAlignment',
|
160
|
+
:'vertical_alignment' => :'VerticalAlignment',
|
161
|
+
:'margin' => :'Margin',
|
162
|
+
:'margin_measure_type' => :'MarginMeasureType',
|
163
|
+
:'text' => :'Text',
|
164
|
+
:'sign_all_pages' => :'SignAllPages',
|
165
|
+
:'font' => :'Font',
|
166
|
+
:'fore_color' => :'ForeColor',
|
167
|
+
:'border_color' => :'BorderColor',
|
168
|
+
:'background_color' => :'BackgroundColor',
|
169
|
+
:'background_brush' => :'BackgroundBrush',
|
170
|
+
:'border_dash_style' => :'BorderDashStyle',
|
171
|
+
:'border_transparency' => :'BorderTransparency',
|
172
|
+
:'border_weight' => :'BorderWeight',
|
173
|
+
:'background_transparency' => :'BackgroundTransparency',
|
174
|
+
:'signature_implementation' => :'SignatureImplementation',
|
175
|
+
:'opacity' => :'Opacity',
|
176
|
+
:'text_horizontal_alignment' => :'TextHorizontalAlignment',
|
177
|
+
:'text_vertical_alignment' => :'TextVerticalAlignment'
|
178
|
+
}
|
179
|
+
end
|
180
|
+
|
181
|
+
# Attribute type mapping.
|
182
|
+
def self.swagger_types
|
183
|
+
{
|
184
|
+
:'document_page_number' => :'Integer',
|
185
|
+
:'pages_setup' => :'PagesSetupData',
|
186
|
+
:'options_type' => :'String',
|
187
|
+
:'left' => :'Integer',
|
188
|
+
:'top' => :'Integer',
|
189
|
+
:'width' => :'Integer',
|
190
|
+
:'height' => :'Integer',
|
191
|
+
:'location_measure_type' => :'String',
|
192
|
+
:'size_measure_type' => :'String',
|
193
|
+
:'stretch' => :'String',
|
194
|
+
:'rotation_angle' => :'Integer',
|
195
|
+
:'horizontal_alignment' => :'String',
|
196
|
+
:'vertical_alignment' => :'String',
|
197
|
+
:'margin' => :'PaddingData',
|
198
|
+
:'margin_measure_type' => :'String',
|
199
|
+
:'text' => :'String',
|
200
|
+
:'sign_all_pages' => :'BOOLEAN',
|
201
|
+
:'font' => :'SignatureFontData',
|
202
|
+
:'fore_color' => :'Color',
|
203
|
+
:'border_color' => :'Color',
|
204
|
+
:'background_color' => :'Color',
|
205
|
+
:'background_brush' => :'BrushData',
|
206
|
+
:'border_dash_style' => :'String',
|
207
|
+
:'border_transparency' => :'Float',
|
208
|
+
:'border_weight' => :'Float',
|
209
|
+
:'background_transparency' => :'Float',
|
210
|
+
:'signature_implementation' => :'String',
|
211
|
+
:'opacity' => :'Float',
|
212
|
+
:'text_horizontal_alignment' => :'String',
|
213
|
+
:'text_vertical_alignment' => :'String'
|
214
|
+
}
|
215
|
+
end
|
216
|
+
|
217
|
+
# Initializes the object
|
218
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
219
|
+
def initialize(attributes = {})
|
220
|
+
return unless attributes.is_a?(Hash)
|
221
|
+
|
222
|
+
# convert string to symbol for hash key
|
223
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
224
|
+
|
225
|
+
if attributes.key?(:'DocumentPageNumber')
|
226
|
+
self.document_page_number = attributes[:'DocumentPageNumber']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'PagesSetup')
|
230
|
+
self.pages_setup = attributes[:'PagesSetup']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'OptionsType')
|
234
|
+
self.options_type = attributes[:'OptionsType']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'Left')
|
238
|
+
self.left = attributes[:'Left']
|
239
|
+
end
|
240
|
+
|
241
|
+
if attributes.key?(:'Top')
|
242
|
+
self.top = attributes[:'Top']
|
243
|
+
end
|
244
|
+
|
245
|
+
if attributes.key?(:'Width')
|
246
|
+
self.width = attributes[:'Width']
|
247
|
+
end
|
248
|
+
|
249
|
+
if attributes.key?(:'Height')
|
250
|
+
self.height = attributes[:'Height']
|
251
|
+
end
|
252
|
+
|
253
|
+
if attributes.key?(:'LocationMeasureType')
|
254
|
+
self.location_measure_type = attributes[:'LocationMeasureType']
|
255
|
+
end
|
256
|
+
|
257
|
+
if attributes.key?(:'SizeMeasureType')
|
258
|
+
self.size_measure_type = attributes[:'SizeMeasureType']
|
259
|
+
end
|
260
|
+
|
261
|
+
if attributes.key?(:'Stretch')
|
262
|
+
self.stretch = attributes[:'Stretch']
|
263
|
+
end
|
264
|
+
|
265
|
+
if attributes.key?(:'RotationAngle')
|
266
|
+
self.rotation_angle = attributes[:'RotationAngle']
|
267
|
+
end
|
268
|
+
|
269
|
+
if attributes.key?(:'HorizontalAlignment')
|
270
|
+
self.horizontal_alignment = attributes[:'HorizontalAlignment']
|
271
|
+
end
|
272
|
+
|
273
|
+
if attributes.key?(:'VerticalAlignment')
|
274
|
+
self.vertical_alignment = attributes[:'VerticalAlignment']
|
275
|
+
end
|
276
|
+
|
277
|
+
if attributes.key?(:'Margin')
|
278
|
+
self.margin = attributes[:'Margin']
|
279
|
+
end
|
280
|
+
|
281
|
+
if attributes.key?(:'MarginMeasureType')
|
282
|
+
self.margin_measure_type = attributes[:'MarginMeasureType']
|
283
|
+
end
|
284
|
+
|
285
|
+
if attributes.key?(:'Text')
|
286
|
+
self.text = attributes[:'Text']
|
287
|
+
end
|
288
|
+
|
289
|
+
if attributes.key?(:'SignAllPages')
|
290
|
+
self.sign_all_pages = attributes[:'SignAllPages']
|
291
|
+
end
|
292
|
+
|
293
|
+
if attributes.key?(:'Font')
|
294
|
+
self.font = attributes[:'Font']
|
295
|
+
end
|
296
|
+
|
297
|
+
if attributes.key?(:'ForeColor')
|
298
|
+
self.fore_color = attributes[:'ForeColor']
|
299
|
+
end
|
300
|
+
|
301
|
+
if attributes.key?(:'BorderColor')
|
302
|
+
self.border_color = attributes[:'BorderColor']
|
303
|
+
end
|
304
|
+
|
305
|
+
if attributes.key?(:'BackgroundColor')
|
306
|
+
self.background_color = attributes[:'BackgroundColor']
|
307
|
+
end
|
308
|
+
|
309
|
+
if attributes.key?(:'BackgroundBrush')
|
310
|
+
self.background_brush = attributes[:'BackgroundBrush']
|
311
|
+
end
|
312
|
+
|
313
|
+
if attributes.key?(:'BorderDashStyle')
|
314
|
+
self.border_dash_style = attributes[:'BorderDashStyle']
|
315
|
+
end
|
316
|
+
|
317
|
+
if attributes.key?(:'BorderTransparency')
|
318
|
+
self.border_transparency = attributes[:'BorderTransparency']
|
319
|
+
end
|
320
|
+
|
321
|
+
if attributes.key?(:'BorderWeight')
|
322
|
+
self.border_weight = attributes[:'BorderWeight']
|
323
|
+
end
|
324
|
+
|
325
|
+
if attributes.key?(:'BackgroundTransparency')
|
326
|
+
self.background_transparency = attributes[:'BackgroundTransparency']
|
327
|
+
end
|
328
|
+
|
329
|
+
if attributes.key?(:'SignatureImplementation')
|
330
|
+
self.signature_implementation = attributes[:'SignatureImplementation']
|
331
|
+
end
|
332
|
+
|
333
|
+
if attributes.key?(:'Opacity')
|
334
|
+
self.opacity = attributes[:'Opacity']
|
335
|
+
end
|
336
|
+
|
337
|
+
if attributes.key?(:'TextHorizontalAlignment')
|
338
|
+
self.text_horizontal_alignment = attributes[:'TextHorizontalAlignment']
|
339
|
+
end
|
340
|
+
|
341
|
+
if attributes.key?(:'TextVerticalAlignment')
|
342
|
+
self.text_vertical_alignment = attributes[:'TextVerticalAlignment']
|
343
|
+
end
|
344
|
+
|
345
|
+
|
346
|
+
if !((defined? options_type) == nil)
|
347
|
+
self.options_type = "ImagesSignTextOptionsData"
|
348
|
+
end
|
349
|
+
|
350
|
+
end
|
351
|
+
|
352
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
353
|
+
# @return Array for valid properies with the reasons
|
354
|
+
def list_invalid_properties
|
355
|
+
invalid_properties = []
|
356
|
+
if @document_page_number.nil?
|
357
|
+
invalid_properties.push("invalid value for 'document_page_number', document_page_number cannot be nil.")
|
358
|
+
end
|
359
|
+
|
360
|
+
return invalid_properties
|
361
|
+
end
|
362
|
+
|
363
|
+
# Check to see if the all the properties in the model are valid
|
364
|
+
# @return true if the model is valid
|
365
|
+
def valid?
|
366
|
+
return false if @document_page_number.nil?
|
367
|
+
location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
|
368
|
+
return false unless location_measure_type_validator.valid?(@location_measure_type)
|
369
|
+
size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
|
370
|
+
return false unless size_measure_type_validator.valid?(@size_measure_type)
|
371
|
+
stretch_validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
|
372
|
+
return false unless stretch_validator.valid?(@stretch)
|
373
|
+
horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
|
374
|
+
return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
|
375
|
+
vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
|
376
|
+
return false unless vertical_alignment_validator.valid?(@vertical_alignment)
|
377
|
+
margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
|
378
|
+
return false unless margin_measure_type_validator.valid?(@margin_measure_type)
|
379
|
+
border_dash_style_validator = EnumAttributeValidator.new('String', ["Default", "Solid", "ShortDash", "ShortDot", "ShortDashDot", "ShortDashDotDot", "Dot", "Dash", "LongDash", "DashDot", "LongDashDot", "LongDashDotDot"])
|
380
|
+
return false unless border_dash_style_validator.valid?(@border_dash_style)
|
381
|
+
signature_implementation_validator = EnumAttributeValidator.new('String', ["TextAsImage", "Watermark"])
|
382
|
+
return false unless signature_implementation_validator.valid?(@signature_implementation)
|
383
|
+
text_horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
|
384
|
+
return false unless text_horizontal_alignment_validator.valid?(@text_horizontal_alignment)
|
385
|
+
text_vertical_alignment_validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
|
386
|
+
return false unless text_vertical_alignment_validator.valid?(@text_vertical_alignment)
|
387
|
+
return true
|
388
|
+
end
|
389
|
+
|
390
|
+
# Custom attribute writer method checking allowed values (enum).
|
391
|
+
# @param [Object] location_measure_type Object to be assigned
|
392
|
+
def location_measure_type=(location_measure_type)
|
393
|
+
validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
|
394
|
+
if location_measure_type.to_i == 0
|
395
|
+
unless validator.valid?(location_measure_type)
|
396
|
+
raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
|
397
|
+
end
|
398
|
+
@location_measure_type = location_measure_type
|
399
|
+
else
|
400
|
+
@location_measure_type = validator.allowable_values[location_measure_type.to_i]
|
401
|
+
end
|
402
|
+
end
|
403
|
+
|
404
|
+
# Custom attribute writer method checking allowed values (enum).
|
405
|
+
# @param [Object] size_measure_type Object to be assigned
|
406
|
+
def size_measure_type=(size_measure_type)
|
407
|
+
validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
|
408
|
+
if size_measure_type.to_i == 0
|
409
|
+
unless validator.valid?(size_measure_type)
|
410
|
+
raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
|
411
|
+
end
|
412
|
+
@size_measure_type = size_measure_type
|
413
|
+
else
|
414
|
+
@size_measure_type = validator.allowable_values[size_measure_type.to_i]
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
# Custom attribute writer method checking allowed values (enum).
|
419
|
+
# @param [Object] stretch Object to be assigned
|
420
|
+
def stretch=(stretch)
|
421
|
+
validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
|
422
|
+
if stretch.to_i == 0
|
423
|
+
unless validator.valid?(stretch)
|
424
|
+
raise ArgumentError, "invalid value for 'stretch', must be one of #{validator.allowable_values}."
|
425
|
+
end
|
426
|
+
@stretch = stretch
|
427
|
+
else
|
428
|
+
@stretch = validator.allowable_values[stretch.to_i]
|
429
|
+
end
|
430
|
+
end
|
431
|
+
|
432
|
+
# Custom attribute writer method checking allowed values (enum).
|
433
|
+
# @param [Object] horizontal_alignment Object to be assigned
|
434
|
+
def horizontal_alignment=(horizontal_alignment)
|
435
|
+
validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
|
436
|
+
if horizontal_alignment.to_i == 0
|
437
|
+
unless validator.valid?(horizontal_alignment)
|
438
|
+
raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
|
439
|
+
end
|
440
|
+
@horizontal_alignment = horizontal_alignment
|
441
|
+
else
|
442
|
+
@horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
|
443
|
+
end
|
444
|
+
end
|
445
|
+
|
446
|
+
# Custom attribute writer method checking allowed values (enum).
|
447
|
+
# @param [Object] vertical_alignment Object to be assigned
|
448
|
+
def vertical_alignment=(vertical_alignment)
|
449
|
+
validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
|
450
|
+
if vertical_alignment.to_i == 0
|
451
|
+
unless validator.valid?(vertical_alignment)
|
452
|
+
raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
|
453
|
+
end
|
454
|
+
@vertical_alignment = vertical_alignment
|
455
|
+
else
|
456
|
+
@vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
|
457
|
+
end
|
458
|
+
end
|
459
|
+
|
460
|
+
# Custom attribute writer method checking allowed values (enum).
|
461
|
+
# @param [Object] margin_measure_type Object to be assigned
|
462
|
+
def margin_measure_type=(margin_measure_type)
|
463
|
+
validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
|
464
|
+
if margin_measure_type.to_i == 0
|
465
|
+
unless validator.valid?(margin_measure_type)
|
466
|
+
raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
|
467
|
+
end
|
468
|
+
@margin_measure_type = margin_measure_type
|
469
|
+
else
|
470
|
+
@margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
|
471
|
+
end
|
472
|
+
end
|
473
|
+
|
474
|
+
# Custom attribute writer method checking allowed values (enum).
|
475
|
+
# @param [Object] border_dash_style Object to be assigned
|
476
|
+
def border_dash_style=(border_dash_style)
|
477
|
+
validator = EnumAttributeValidator.new('String', ["Default", "Solid", "ShortDash", "ShortDot", "ShortDashDot", "ShortDashDotDot", "Dot", "Dash", "LongDash", "DashDot", "LongDashDot", "LongDashDotDot"])
|
478
|
+
if border_dash_style.to_i == 0
|
479
|
+
unless validator.valid?(border_dash_style)
|
480
|
+
raise ArgumentError, "invalid value for 'border_dash_style', must be one of #{validator.allowable_values}."
|
481
|
+
end
|
482
|
+
@border_dash_style = border_dash_style
|
483
|
+
else
|
484
|
+
@border_dash_style = validator.allowable_values[border_dash_style.to_i]
|
485
|
+
end
|
486
|
+
end
|
487
|
+
|
488
|
+
# Custom attribute writer method checking allowed values (enum).
|
489
|
+
# @param [Object] signature_implementation Object to be assigned
|
490
|
+
def signature_implementation=(signature_implementation)
|
491
|
+
validator = EnumAttributeValidator.new('String', ["TextAsImage", "Watermark"])
|
492
|
+
if signature_implementation.to_i == 0
|
493
|
+
unless validator.valid?(signature_implementation)
|
494
|
+
raise ArgumentError, "invalid value for 'signature_implementation', must be one of #{validator.allowable_values}."
|
495
|
+
end
|
496
|
+
@signature_implementation = signature_implementation
|
497
|
+
else
|
498
|
+
@signature_implementation = validator.allowable_values[signature_implementation.to_i]
|
499
|
+
end
|
500
|
+
end
|
501
|
+
|
502
|
+
# Custom attribute writer method checking allowed values (enum).
|
503
|
+
# @param [Object] text_horizontal_alignment Object to be assigned
|
504
|
+
def text_horizontal_alignment=(text_horizontal_alignment)
|
505
|
+
validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
|
506
|
+
if text_horizontal_alignment.to_i == 0
|
507
|
+
unless validator.valid?(text_horizontal_alignment)
|
508
|
+
raise ArgumentError, "invalid value for 'text_horizontal_alignment', must be one of #{validator.allowable_values}."
|
509
|
+
end
|
510
|
+
@text_horizontal_alignment = text_horizontal_alignment
|
511
|
+
else
|
512
|
+
@text_horizontal_alignment = validator.allowable_values[text_horizontal_alignment.to_i]
|
513
|
+
end
|
514
|
+
end
|
515
|
+
|
516
|
+
# Custom attribute writer method checking allowed values (enum).
|
517
|
+
# @param [Object] text_vertical_alignment Object to be assigned
|
518
|
+
def text_vertical_alignment=(text_vertical_alignment)
|
519
|
+
validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
|
520
|
+
if text_vertical_alignment.to_i == 0
|
521
|
+
unless validator.valid?(text_vertical_alignment)
|
522
|
+
raise ArgumentError, "invalid value for 'text_vertical_alignment', must be one of #{validator.allowable_values}."
|
523
|
+
end
|
524
|
+
@text_vertical_alignment = text_vertical_alignment
|
525
|
+
else
|
526
|
+
@text_vertical_alignment = validator.allowable_values[text_vertical_alignment.to_i]
|
527
|
+
end
|
528
|
+
end
|
529
|
+
|
530
|
+
# Checks equality by comparing each attribute.
|
531
|
+
# @param [Object] Object to be compared
|
532
|
+
def ==(other)
|
533
|
+
return true if self.equal?(other)
|
534
|
+
self.class == other.class &&
|
535
|
+
document_page_number == other.document_page_number &&
|
536
|
+
pages_setup == other.pages_setup &&
|
537
|
+
options_type == other.options_type &&
|
538
|
+
left == other.left &&
|
539
|
+
top == other.top &&
|
540
|
+
width == other.width &&
|
541
|
+
height == other.height &&
|
542
|
+
location_measure_type == other.location_measure_type &&
|
543
|
+
size_measure_type == other.size_measure_type &&
|
544
|
+
stretch == other.stretch &&
|
545
|
+
rotation_angle == other.rotation_angle &&
|
546
|
+
horizontal_alignment == other.horizontal_alignment &&
|
547
|
+
vertical_alignment == other.vertical_alignment &&
|
548
|
+
margin == other.margin &&
|
549
|
+
margin_measure_type == other.margin_measure_type &&
|
550
|
+
text == other.text &&
|
551
|
+
sign_all_pages == other.sign_all_pages &&
|
552
|
+
font == other.font &&
|
553
|
+
fore_color == other.fore_color &&
|
554
|
+
border_color == other.border_color &&
|
555
|
+
background_color == other.background_color &&
|
556
|
+
background_brush == other.background_brush &&
|
557
|
+
border_dash_style == other.border_dash_style &&
|
558
|
+
border_transparency == other.border_transparency &&
|
559
|
+
border_weight == other.border_weight &&
|
560
|
+
background_transparency == other.background_transparency &&
|
561
|
+
signature_implementation == other.signature_implementation &&
|
562
|
+
opacity == other.opacity &&
|
563
|
+
text_horizontal_alignment == other.text_horizontal_alignment &&
|
564
|
+
text_vertical_alignment == other.text_vertical_alignment
|
565
|
+
end
|
566
|
+
|
567
|
+
# @see the `==` method
|
568
|
+
# @param [Object] Object to be compared
|
569
|
+
def eql?(other)
|
570
|
+
self == other
|
571
|
+
end
|
572
|
+
|
573
|
+
# Calculates hash code according to all attributes.
|
574
|
+
# @return [Fixnum] Hash code
|
575
|
+
def hash
|
576
|
+
[document_page_number, pages_setup, options_type, left, top, width, height, location_measure_type, size_measure_type, stretch, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, text, sign_all_pages, font, fore_color, border_color, background_color, background_brush, border_dash_style, border_transparency, border_weight, background_transparency, signature_implementation, opacity, text_horizontal_alignment, text_vertical_alignment].hash
|
577
|
+
end
|
578
|
+
|
579
|
+
# Builds the object from hash
|
580
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
581
|
+
# @return [Object] Returns the model itself
|
582
|
+
def build_from_hash(attributes)
|
583
|
+
return nil unless attributes.is_a?(Hash)
|
584
|
+
self.class.swagger_types.each_pair do |key, type|
|
585
|
+
|
586
|
+
attributeName = self.class.attribute_map[key]
|
587
|
+
attributeNameLowerStr = attributeName.to_s
|
588
|
+
attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
|
589
|
+
attributeNameLower = attributeNameLowerStr.to_sym
|
590
|
+
attributeNameLowerStr2 = attributeName.to_s
|
591
|
+
attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
|
592
|
+
attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
|
593
|
+
attributeNameLower2 = attributeNameLowerStr2.to_sym
|
594
|
+
|
595
|
+
if type =~ /\AArray<(.*)>/i
|
596
|
+
# check to ensure the input is an array given that the the attribute
|
597
|
+
# is documented as an array but the input is not
|
598
|
+
if attributes[attributeName].is_a?(Array)
|
599
|
+
self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
|
600
|
+
end
|
601
|
+
if attributes[attributeNameLower].is_a?(Array)
|
602
|
+
self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
|
603
|
+
end
|
604
|
+
if attributes[attributeNameLower2].is_a?(Array)
|
605
|
+
self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
|
606
|
+
end
|
607
|
+
elsif !attributes[attributeName].nil?
|
608
|
+
self.send("#{key}=", _deserialize(type, attributes[attributeName]))
|
609
|
+
elsif !attributes[attributeNameLower].nil?
|
610
|
+
self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
|
611
|
+
elsif !attributes[attributeNameLower2].nil?
|
612
|
+
self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
|
613
|
+
end
|
614
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
615
|
+
end
|
616
|
+
self
|
617
|
+
end
|
618
|
+
|
619
|
+
# Deserializes the data based on type
|
620
|
+
# @param string type Data type
|
621
|
+
# @param string value Value to be deserialized
|
622
|
+
# @return [Object] Deserialized data
|
623
|
+
def _deserialize(type, value)
|
624
|
+
case type.to_sym
|
625
|
+
when :DateTime
|
626
|
+
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
627
|
+
when :Date
|
628
|
+
Time.at(/\d/.match(value)[0].to_f).to_date
|
629
|
+
when :String
|
630
|
+
value.to_s
|
631
|
+
when :Integer
|
632
|
+
value.to_i
|
633
|
+
when :Float
|
634
|
+
value.to_f
|
635
|
+
when :BOOLEAN
|
636
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
637
|
+
true
|
638
|
+
else
|
639
|
+
false
|
640
|
+
end
|
641
|
+
when :Object
|
642
|
+
# generic object (usually a Hash), return directly
|
643
|
+
value
|
644
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
645
|
+
inner_type = Regexp.last_match[:inner_type]
|
646
|
+
value.map { |v| _deserialize(inner_type, v) }
|
647
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
648
|
+
k_type = Regexp.last_match[:k_type]
|
649
|
+
v_type = Regexp.last_match[:v_type]
|
650
|
+
{}.tap do |hash|
|
651
|
+
value.each do |k, v|
|
652
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
653
|
+
end
|
654
|
+
end
|
655
|
+
else
|
656
|
+
# model
|
657
|
+
temp_model = GroupDocsSignatureCloud.const_get(type).new
|
658
|
+
temp_model.build_from_hash(value)
|
659
|
+
end
|
660
|
+
end
|
661
|
+
|
662
|
+
# Returns the string representation of the object
|
663
|
+
# @return [String] String presentation of the object
|
664
|
+
def to_s
|
665
|
+
to_hash.to_s
|
666
|
+
end
|
667
|
+
|
668
|
+
# to_body is an alias to to_hash (backward compatibility)
|
669
|
+
# @return [Hash] Returns the object in the form of hash
|
670
|
+
def to_body
|
671
|
+
to_hash
|
672
|
+
end
|
673
|
+
|
674
|
+
# Returns the object in the form of hash
|
675
|
+
# @return [Hash] Returns the object in the form of hash
|
676
|
+
def to_hash
|
677
|
+
hash = {}
|
678
|
+
self.class.attribute_map.each_pair do |attr, param|
|
679
|
+
value = self.send(attr)
|
680
|
+
next if value.nil?
|
681
|
+
hash[param] = _to_hash(value)
|
682
|
+
end
|
683
|
+
hash
|
684
|
+
end
|
685
|
+
|
686
|
+
# Outputs non-array value in the form of hash
|
687
|
+
# For object, use to_hash. Otherwise, just return the value
|
688
|
+
# @param [Object] value Any valid value
|
689
|
+
# @return [Hash] Returns the value in the form of hash
|
690
|
+
def _to_hash(value)
|
691
|
+
if value.is_a?(Array)
|
692
|
+
value.compact.map { |v| _to_hash(v) }
|
693
|
+
elsif value.is_a?(Hash)
|
694
|
+
{}.tap do |hash|
|
695
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
696
|
+
end
|
697
|
+
elsif value.respond_to? :to_hash
|
698
|
+
value.to_hash
|
699
|
+
else
|
700
|
+
value
|
701
|
+
end
|
702
|
+
end
|
703
|
+
|
704
|
+
end
|
705
|
+
|
706
|
+
end
|