groupdocs_signature_cloud 18.8.1 → 19.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +5 -5
  2. data/lib/groupdocs_signature_cloud.rb +99 -191
  3. data/lib/groupdocs_signature_cloud/api/file_api.rb +734 -0
  4. data/lib/groupdocs_signature_cloud/api/folder_api.rb +699 -0
  5. data/lib/groupdocs_signature_cloud/api/info_api.rb +364 -0
  6. data/lib/groupdocs_signature_cloud/api/sign_api.rb +411 -0
  7. data/lib/groupdocs_signature_cloud/api/storage_api.rb +544 -0
  8. data/lib/groupdocs_signature_cloud/api_client.rb +382 -380
  9. data/lib/groupdocs_signature_cloud/api_error.rb +58 -58
  10. data/lib/groupdocs_signature_cloud/configuration.rb +95 -110
  11. data/lib/groupdocs_signature_cloud/models/{digital_signature_data.rb → barcode_signature.rb} +312 -307
  12. data/lib/groupdocs_signature_cloud/models/barcode_type.rb +219 -230
  13. data/lib/groupdocs_signature_cloud/models/{barcode_collection.rb → barcodes_result.rb} +221 -232
  14. data/lib/groupdocs_signature_cloud/models/base_settings.rb +219 -0
  15. data/lib/groupdocs_signature_cloud/models/{border_line_data.rb → border_line.rb} +301 -312
  16. data/lib/groupdocs_signature_cloud/models/{brush_data.rb → brush.rb} +219 -230
  17. data/lib/groupdocs_signature_cloud/models/color.rb +219 -245
  18. data/lib/groupdocs_signature_cloud/models/{pdf_digital_signature_data.rb → digital_signature.rb} +363 -307
  19. data/lib/groupdocs_signature_cloud/models/disc_usage.rb +239 -0
  20. data/lib/groupdocs_signature_cloud/models/error.rb +249 -0
  21. data/lib/groupdocs_signature_cloud/models/error_details.rb +234 -0
  22. data/lib/groupdocs_signature_cloud/models/file_info.rb +249 -0
  23. data/lib/groupdocs_signature_cloud/models/{document_info.rb → file_version.rb} +294 -300
  24. data/lib/groupdocs_signature_cloud/models/file_versions.rb +221 -0
  25. data/lib/groupdocs_signature_cloud/models/files_list.rb +221 -0
  26. data/lib/groupdocs_signature_cloud/models/{base_signature_data.rb → files_upload_result.rb} +233 -230
  27. data/lib/groupdocs_signature_cloud/models/format.rb +229 -240
  28. data/lib/groupdocs_signature_cloud/models/{format_collection.rb → formats_result.rb} +221 -232
  29. data/lib/groupdocs_signature_cloud/models/{search_document_response.rb → info_result.rb} +339 -303
  30. data/lib/groupdocs_signature_cloud/models/info_settings.rb +219 -0
  31. data/lib/groupdocs_signature_cloud/models/{linear_gradient_brush_data.rb → linear_gradient_brush.rb} +254 -260
  32. data/lib/groupdocs_signature_cloud/models/object_exist.rb +239 -0
  33. data/lib/groupdocs_signature_cloud/models/options_base.rb +327 -0
  34. data/lib/groupdocs_signature_cloud/models/{padding_data.rb → padding.rb} +284 -295
  35. data/lib/groupdocs_signature_cloud/models/page_info.rb +294 -305
  36. data/lib/groupdocs_signature_cloud/models/{pages_setup_data.rb → pages_setup.rb} +281 -292
  37. data/lib/groupdocs_signature_cloud/models/{words_digital_signature_data.rb → qr_code_signature.rb} +312 -307
  38. data/lib/groupdocs_signature_cloud/models/qr_code_type.rb +219 -230
  39. data/lib/groupdocs_signature_cloud/models/{qr_code_collection.rb → qr_codes_result.rb} +221 -232
  40. data/lib/groupdocs_signature_cloud/models/{radial_gradient_brush_data.rb → radial_gradient_brush.rb} +239 -250
  41. data/lib/groupdocs_signature_cloud/models/save_options.rb +244 -0
  42. data/lib/groupdocs_signature_cloud/models/{search_barcode_options_data.rb → search_barcode_options.rb} +378 -332
  43. data/lib/groupdocs_signature_cloud/models/search_digital_options.rb +327 -0
  44. data/lib/groupdocs_signature_cloud/models/search_options.rb +327 -0
  45. data/lib/groupdocs_signature_cloud/models/{pdf_search_barcode_options_data.rb → search_qr_code_options.rb} +378 -332
  46. data/lib/groupdocs_signature_cloud/models/{sign_options_collection_data.rb → search_result.rb} +246 -232
  47. data/lib/groupdocs_signature_cloud/models/search_settings.rb +231 -0
  48. data/lib/groupdocs_signature_cloud/models/{images_sign_text_options_data.rb → sign_barcode_options.rb} +857 -706
  49. data/lib/groupdocs_signature_cloud/models/{sign_digital_options_data.rb → sign_digital_options.rb} +612 -516
  50. data/lib/groupdocs_signature_cloud/models/{sign_stamp_options_data.rb → sign_image_options.rb} +592 -592
  51. data/lib/groupdocs_signature_cloud/models/sign_options.rb +327 -0
  52. data/lib/groupdocs_signature_cloud/models/{words_sign_text_options_data.rb → sign_qr_code_options.rb} +872 -696
  53. data/lib/groupdocs_signature_cloud/models/sign_result.rb +244 -0
  54. data/lib/groupdocs_signature_cloud/models/sign_settings.rb +241 -0
  55. data/lib/groupdocs_signature_cloud/models/{slides_sign_stamp_options_data.rb → sign_stamp_options.rb} +698 -592
  56. data/lib/groupdocs_signature_cloud/models/{cells_sign_text_options_data.rb → sign_text_options.rb} +781 -736
  57. data/lib/groupdocs_signature_cloud/models/{signature_document_response.rb → signature.rb} +292 -290
  58. data/lib/groupdocs_signature_cloud/models/{signature_font_data.rb → signature_font.rb} +279 -290
  59. data/lib/groupdocs_signature_cloud/models/{solid_brush_data.rb → solid_brush.rb} +229 -240
  60. data/lib/groupdocs_signature_cloud/models/{stamp_line_data.rb → stamp_line.rb} +366 -377
  61. data/lib/groupdocs_signature_cloud/models/storage_exist.rb +224 -0
  62. data/lib/groupdocs_signature_cloud/models/{pdf_qr_code_signature_data.rb → storage_file.rb} +269 -250
  63. data/lib/groupdocs_signature_cloud/models/{texture_brush_data.rb → texture_brush.rb} +229 -240
  64. data/lib/groupdocs_signature_cloud/models/{verify_barcode_options_data.rb → verify_barcode_options.rb} +378 -342
  65. data/lib/groupdocs_signature_cloud/models/{cells_verify_digital_options_data.rb → verify_digital_options.rb} +407 -315
  66. data/lib/groupdocs_signature_cloud/models/{cells_digital_signature_data.rb → verify_options.rb} +327 -307
  67. data/lib/groupdocs_signature_cloud/models/{verify_qr_code_options_data.rb → verify_qr_code_options.rb} +378 -342
  68. data/lib/groupdocs_signature_cloud/models/verify_result.rb +249 -0
  69. data/lib/groupdocs_signature_cloud/models/verify_settings.rb +231 -0
  70. data/lib/groupdocs_signature_cloud/models/{cells_verify_barcode_options_data.rb → verify_text_options.rb} +368 -342
  71. data/lib/groupdocs_signature_cloud/version.rb +2 -2
  72. metadata +63 -171
  73. data/lib/groupdocs_signature_cloud/api/signature_api.rb +0 -2590
  74. data/lib/groupdocs_signature_cloud/models/barcode_signature_data.rb +0 -250
  75. data/lib/groupdocs_signature_cloud/models/cells_barcode_signature_data.rb +0 -250
  76. data/lib/groupdocs_signature_cloud/models/cells_qr_code_signature_data.rb +0 -250
  77. data/lib/groupdocs_signature_cloud/models/cells_search_barcode_options_data.rb +0 -332
  78. data/lib/groupdocs_signature_cloud/models/cells_search_digital_options_data.rb +0 -265
  79. data/lib/groupdocs_signature_cloud/models/cells_search_qr_code_options_data.rb +0 -332
  80. data/lib/groupdocs_signature_cloud/models/cells_sign_barcode_options_data.rb +0 -694
  81. data/lib/groupdocs_signature_cloud/models/cells_sign_digital_options_data.rb +0 -546
  82. data/lib/groupdocs_signature_cloud/models/cells_sign_image_options_data.rb +0 -526
  83. data/lib/groupdocs_signature_cloud/models/cells_sign_qr_code_options_data.rb +0 -704
  84. data/lib/groupdocs_signature_cloud/models/cells_sign_stamp_options_data.rb +0 -622
  85. data/lib/groupdocs_signature_cloud/models/cells_verify_qr_code_options_data.rb +0 -342
  86. data/lib/groupdocs_signature_cloud/models/cells_verify_text_options_data.rb +0 -285
  87. data/lib/groupdocs_signature_cloud/models/document_response.rb +0 -302
  88. data/lib/groupdocs_signature_cloud/models/images_barcode_signature_data.rb +0 -250
  89. data/lib/groupdocs_signature_cloud/models/images_qr_code_signature_data.rb +0 -250
  90. data/lib/groupdocs_signature_cloud/models/images_search_barcode_options_data.rb +0 -332
  91. data/lib/groupdocs_signature_cloud/models/images_search_qr_code_options_data.rb +0 -332
  92. data/lib/groupdocs_signature_cloud/models/images_sign_barcode_options_data.rb +0 -664
  93. data/lib/groupdocs_signature_cloud/models/images_sign_image_options_data.rb +0 -496
  94. data/lib/groupdocs_signature_cloud/models/images_sign_qr_code_options_data.rb +0 -674
  95. data/lib/groupdocs_signature_cloud/models/images_sign_stamp_options_data.rb +0 -592
  96. data/lib/groupdocs_signature_cloud/models/images_verify_barcode_options_data.rb +0 -342
  97. data/lib/groupdocs_signature_cloud/models/images_verify_qr_code_options_data.rb +0 -342
  98. data/lib/groupdocs_signature_cloud/models/pages_info.rb +0 -247
  99. data/lib/groupdocs_signature_cloud/models/pdf_barcode_signature_data.rb +0 -250
  100. data/lib/groupdocs_signature_cloud/models/pdf_search_digital_options_data.rb +0 -265
  101. data/lib/groupdocs_signature_cloud/models/pdf_search_qr_code_options_data.rb +0 -332
  102. data/lib/groupdocs_signature_cloud/models/pdf_sign_barcode_options_data.rb +0 -664
  103. data/lib/groupdocs_signature_cloud/models/pdf_sign_digital_options_data.rb +0 -556
  104. data/lib/groupdocs_signature_cloud/models/pdf_sign_image_options_data.rb +0 -496
  105. data/lib/groupdocs_signature_cloud/models/pdf_sign_qr_code_options_data.rb +0 -674
  106. data/lib/groupdocs_signature_cloud/models/pdf_sign_stamp_options_data.rb +0 -592
  107. data/lib/groupdocs_signature_cloud/models/pdf_sign_text_options_data.rb +0 -696
  108. data/lib/groupdocs_signature_cloud/models/pdf_verify_barcode_options_data.rb +0 -342
  109. data/lib/groupdocs_signature_cloud/models/pdf_verify_digital_options_data.rb +0 -315
  110. data/lib/groupdocs_signature_cloud/models/pdf_verify_qr_code_options_data.rb +0 -342
  111. data/lib/groupdocs_signature_cloud/models/pdf_verify_text_options_data.rb +0 -342
  112. data/lib/groupdocs_signature_cloud/models/qr_code_signature_data.rb +0 -250
  113. data/lib/groupdocs_signature_cloud/models/requests/get_document_info_from_url_request.rb +0 -55
  114. data/lib/groupdocs_signature_cloud/models/requests/get_document_info_request.rb +0 -59
  115. data/lib/groupdocs_signature_cloud/models/requests/post_barcode_from_url_request.rb +0 -59
  116. data/lib/groupdocs_signature_cloud/models/requests/post_barcode_request.rb +0 -63
  117. data/lib/groupdocs_signature_cloud/models/requests/post_collection_from_url_request.rb +0 -59
  118. data/lib/groupdocs_signature_cloud/models/requests/post_collection_request.rb +0 -63
  119. data/lib/groupdocs_signature_cloud/models/requests/post_digital_from_url_request.rb +0 -67
  120. data/lib/groupdocs_signature_cloud/models/requests/post_digital_request.rb +0 -71
  121. data/lib/groupdocs_signature_cloud/models/requests/post_image_from_url_request.rb +0 -63
  122. data/lib/groupdocs_signature_cloud/models/requests/post_image_request.rb +0 -67
  123. data/lib/groupdocs_signature_cloud/models/requests/post_qr_code_from_url_request.rb +0 -59
  124. data/lib/groupdocs_signature_cloud/models/requests/post_qr_code_request.rb +0 -63
  125. data/lib/groupdocs_signature_cloud/models/requests/post_search_barcode_from_url_request.rb +0 -59
  126. data/lib/groupdocs_signature_cloud/models/requests/post_search_barcode_request.rb +0 -63
  127. data/lib/groupdocs_signature_cloud/models/requests/post_search_collection_from_url_request.rb +0 -59
  128. data/lib/groupdocs_signature_cloud/models/requests/post_search_collection_request.rb +0 -63
  129. data/lib/groupdocs_signature_cloud/models/requests/post_search_digital_from_url_request.rb +0 -59
  130. data/lib/groupdocs_signature_cloud/models/requests/post_search_digital_request.rb +0 -63
  131. data/lib/groupdocs_signature_cloud/models/requests/post_search_qr_code_from_url_request.rb +0 -59
  132. data/lib/groupdocs_signature_cloud/models/requests/post_search_qr_code_request.rb +0 -63
  133. data/lib/groupdocs_signature_cloud/models/requests/post_stamp_from_url_request.rb +0 -59
  134. data/lib/groupdocs_signature_cloud/models/requests/post_stamp_request.rb +0 -63
  135. data/lib/groupdocs_signature_cloud/models/requests/post_text_from_url_request.rb +0 -59
  136. data/lib/groupdocs_signature_cloud/models/requests/post_text_request.rb +0 -63
  137. data/lib/groupdocs_signature_cloud/models/requests/post_verification_barcode_from_url_request.rb +0 -59
  138. data/lib/groupdocs_signature_cloud/models/requests/post_verification_barcode_request.rb +0 -63
  139. data/lib/groupdocs_signature_cloud/models/requests/post_verification_collection_from_url_request.rb +0 -59
  140. data/lib/groupdocs_signature_cloud/models/requests/post_verification_collection_request.rb +0 -63
  141. data/lib/groupdocs_signature_cloud/models/requests/post_verification_digital_from_url_request.rb +0 -63
  142. data/lib/groupdocs_signature_cloud/models/requests/post_verification_digital_request.rb +0 -67
  143. data/lib/groupdocs_signature_cloud/models/requests/post_verification_qr_code_from_url_request.rb +0 -59
  144. data/lib/groupdocs_signature_cloud/models/requests/post_verification_qr_code_request.rb +0 -63
  145. data/lib/groupdocs_signature_cloud/models/requests/post_verification_text_from_url_request.rb +0 -57
  146. data/lib/groupdocs_signature_cloud/models/requests/post_verification_text_request.rb +0 -63
  147. data/lib/groupdocs_signature_cloud/models/search_digital_options_data.rb +0 -265
  148. data/lib/groupdocs_signature_cloud/models/search_options_collection_data.rb +0 -232
  149. data/lib/groupdocs_signature_cloud/models/search_options_data.rb +0 -265
  150. data/lib/groupdocs_signature_cloud/models/search_qr_code_options_data.rb +0 -332
  151. data/lib/groupdocs_signature_cloud/models/sign_barcode_options_data.rb +0 -664
  152. data/lib/groupdocs_signature_cloud/models/sign_image_options_data.rb +0 -496
  153. data/lib/groupdocs_signature_cloud/models/sign_options_data.rb +0 -255
  154. data/lib/groupdocs_signature_cloud/models/sign_qr_code_options_data.rb +0 -674
  155. data/lib/groupdocs_signature_cloud/models/sign_text_options_data.rb +0 -562
  156. data/lib/groupdocs_signature_cloud/models/slides_barcode_signature_data.rb +0 -250
  157. data/lib/groupdocs_signature_cloud/models/slides_qr_code_signature_data.rb +0 -250
  158. data/lib/groupdocs_signature_cloud/models/slides_search_barcode_options_data.rb +0 -332
  159. data/lib/groupdocs_signature_cloud/models/slides_search_qr_code_options_data.rb +0 -332
  160. data/lib/groupdocs_signature_cloud/models/slides_sign_barcode_options_data.rb +0 -664
  161. data/lib/groupdocs_signature_cloud/models/slides_sign_image_options_data.rb +0 -496
  162. data/lib/groupdocs_signature_cloud/models/slides_sign_qr_code_options_data.rb +0 -674
  163. data/lib/groupdocs_signature_cloud/models/slides_sign_text_options_data.rb +0 -670
  164. data/lib/groupdocs_signature_cloud/models/slides_verify_barcode_options_data.rb +0 -342
  165. data/lib/groupdocs_signature_cloud/models/slides_verify_qr_code_options_data.rb +0 -342
  166. data/lib/groupdocs_signature_cloud/models/slides_verify_text_options_data.rb +0 -285
  167. data/lib/groupdocs_signature_cloud/models/verified_document_response.rb +0 -300
  168. data/lib/groupdocs_signature_cloud/models/verify_digital_options_data.rb +0 -285
  169. data/lib/groupdocs_signature_cloud/models/verify_options_collection_data.rb +0 -247
  170. data/lib/groupdocs_signature_cloud/models/verify_options_data.rb +0 -265
  171. data/lib/groupdocs_signature_cloud/models/verify_text_options_data.rb +0 -285
  172. data/lib/groupdocs_signature_cloud/models/words_barcode_signature_data.rb +0 -250
  173. data/lib/groupdocs_signature_cloud/models/words_qr_code_signature_data.rb +0 -250
  174. data/lib/groupdocs_signature_cloud/models/words_search_barcode_options_data.rb +0 -332
  175. data/lib/groupdocs_signature_cloud/models/words_search_digital_options_data.rb +0 -265
  176. data/lib/groupdocs_signature_cloud/models/words_search_qr_code_options_data.rb +0 -332
  177. data/lib/groupdocs_signature_cloud/models/words_sign_barcode_options_data.rb +0 -664
  178. data/lib/groupdocs_signature_cloud/models/words_sign_digital_options_data.rb +0 -516
  179. data/lib/groupdocs_signature_cloud/models/words_sign_image_options_data.rb +0 -496
  180. data/lib/groupdocs_signature_cloud/models/words_sign_qr_code_options_data.rb +0 -674
  181. data/lib/groupdocs_signature_cloud/models/words_sign_stamp_options_data.rb +0 -592
  182. data/lib/groupdocs_signature_cloud/models/words_verify_barcode_options_data.rb +0 -342
  183. data/lib/groupdocs_signature_cloud/models/words_verify_digital_options_data.rb +0 -315
  184. data/lib/groupdocs_signature_cloud/models/words_verify_qr_code_options_data.rb +0 -342
  185. data/lib/groupdocs_signature_cloud/models/words_verify_text_options_data.rb +0 -285
@@ -0,0 +1,327 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="sign_options.rb">
4
+ # Copyright (c) 2003-2019 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
+ # Base container class for signature options data
32
+ class SignOptions
33
+
34
+ # Specifies the type of document to process
35
+ attr_accessor :document_type
36
+
37
+ # Specifies the signature type of processing
38
+ attr_accessor :signature_type
39
+
40
+ # Gets or sets a document page number for processing. Value is optional
41
+ attr_accessor :page
42
+
43
+ # Process all document pages. Type of processing depends on SignatureType For Images Document Type it can be used only for multi-frames images like .tiff
44
+ attr_accessor :all_pages
45
+
46
+ # Options to specify pages for processing
47
+ attr_accessor :pages_setup
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
64
+
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'document_type' => :'DocumentType',
74
+ :'signature_type' => :'SignatureType',
75
+ :'page' => :'Page',
76
+ :'all_pages' => :'AllPages',
77
+ :'pages_setup' => :'PagesSetup'
78
+ }
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.swagger_types
83
+ {
84
+ :'document_type' => :'String',
85
+ :'signature_type' => :'String',
86
+ :'page' => :'Integer',
87
+ :'all_pages' => :'BOOLEAN',
88
+ :'pages_setup' => :'PagesSetup'
89
+ }
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ return unless attributes.is_a?(Hash)
96
+
97
+ # convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
99
+
100
+ if attributes.key?(:'DocumentType')
101
+ self.document_type = attributes[:'DocumentType']
102
+ end
103
+
104
+ if attributes.key?(:'SignatureType')
105
+ self.signature_type = attributes[:'SignatureType']
106
+ end
107
+
108
+ if attributes.key?(:'Page')
109
+ self.page = attributes[:'Page']
110
+ end
111
+
112
+ if attributes.key?(:'AllPages')
113
+ self.all_pages = attributes[:'AllPages']
114
+ end
115
+
116
+ if attributes.key?(:'PagesSetup')
117
+ self.pages_setup = attributes[:'PagesSetup']
118
+ end
119
+
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properies with the reasons
124
+ def list_invalid_properties
125
+ invalid_properties = []
126
+ if @document_type.nil?
127
+ invalid_properties.push("invalid value for 'document_type', document_type cannot be nil.")
128
+ end
129
+
130
+ if @signature_type.nil?
131
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
132
+ end
133
+
134
+ if @all_pages.nil?
135
+ invalid_properties.push("invalid value for 'all_pages', all_pages cannot be nil.")
136
+ end
137
+
138
+ return invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ return false if @document_type.nil?
145
+ document_type_validator = EnumAttributeValidator.new('String', ["Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
146
+ return false unless document_type_validator.valid?(@document_type)
147
+ return false if @signature_type.nil?
148
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
149
+ return false unless signature_type_validator.valid?(@signature_type)
150
+ return false if @all_pages.nil?
151
+ return true
152
+ end
153
+
154
+ # Custom attribute writer method checking allowed values (enum).
155
+ # @param [Object] document_type Object to be assigned
156
+ def document_type=(document_type)
157
+ validator = EnumAttributeValidator.new('String', ["Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
158
+ if document_type.to_i == 0
159
+ unless validator.valid?(document_type)
160
+ raise ArgumentError, "invalid value for 'document_type', must be one of #{validator.allowable_values}."
161
+ end
162
+ @document_type = document_type
163
+ else
164
+ @document_type = validator.allowable_values[document_type.to_i]
165
+ end
166
+ end
167
+
168
+ # Custom attribute writer method checking allowed values (enum).
169
+ # @param [Object] signature_type Object to be assigned
170
+ def signature_type=(signature_type)
171
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
172
+ if signature_type.to_i == 0
173
+ unless validator.valid?(signature_type)
174
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
175
+ end
176
+ @signature_type = signature_type
177
+ else
178
+ @signature_type = validator.allowable_values[signature_type.to_i]
179
+ end
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(other)
185
+ return true if self.equal?(other)
186
+ self.class == other.class &&
187
+ document_type == other.document_type &&
188
+ signature_type == other.signature_type &&
189
+ page == other.page &&
190
+ all_pages == other.all_pages &&
191
+ pages_setup == other.pages_setup
192
+ end
193
+
194
+ # @see the `==` method
195
+ # @param [Object] Object to be compared
196
+ def eql?(other)
197
+ self == other
198
+ end
199
+
200
+ # Calculates hash code according to all attributes.
201
+ # @return [Fixnum] Hash code
202
+ def hash
203
+ [document_type, signature_type, page, all_pages, pages_setup].hash
204
+ end
205
+
206
+ # Downcases first letter.
207
+ # @return downcased string
208
+ def uncap(str)
209
+ str[0, 1].downcase + str[1..-1]
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ self.class.swagger_types.each_pair do |key, type|
218
+ pname = uncap(self.class.attribute_map[key]).intern
219
+ value = attributes[pname]
220
+ if type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the the attribute
222
+ # is documented as an array but the input is not
223
+ if value.is_a?(Array)
224
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
225
+ end
226
+ elsif !value.nil?
227
+ self.send("#{key}=", _deserialize(type, value))
228
+ end
229
+ # or else data not found in attributes(hash), not an issue as the data can be optional
230
+ end
231
+
232
+ self
233
+ end
234
+
235
+ # Deserializes the data based on type
236
+ # @param string type Data type
237
+ # @param string value Value to be deserialized
238
+ # @return [Object] Deserialized data
239
+ def _deserialize(type, value)
240
+ case type.to_sym
241
+ when :DateTime
242
+ Date.parse value
243
+ when :Date
244
+ Date.parse value
245
+ when :String
246
+ value.to_s
247
+ when :Integer
248
+ value.to_i
249
+ when :Float
250
+ value.to_f
251
+ when :BOOLEAN
252
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ true
254
+ else
255
+ false
256
+ end
257
+ when :Object
258
+ # generic object (usually a Hash), return directly
259
+ value
260
+ when /\AArray<(?<inner_type>.+)>\z/
261
+ inner_type = Regexp.last_match[:inner_type]
262
+ value.map { |v| _deserialize(inner_type, v) }
263
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ k_type = Regexp.last_match[:k_type]
265
+ v_type = Regexp.last_match[:v_type]
266
+ {}.tap do |hash|
267
+ value.each do |k, v|
268
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
269
+ end
270
+ end
271
+ else
272
+ # model
273
+ # Signature type fix
274
+ ttype = type
275
+ if value.is_a?(Hash) and !value[:signatureType].nil?
276
+ ttype = value[:signatureType] + 'Signature'
277
+ end
278
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
279
+ temp_model.build_from_hash(value)
280
+ end
281
+ end
282
+
283
+ # Returns the string representation of the object
284
+ # @return [String] String presentation of the object
285
+ def to_s
286
+ to_hash.to_s
287
+ end
288
+
289
+ # to_body is an alias to to_hash (backward compatibility)
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_body
292
+ to_hash
293
+ end
294
+
295
+ # Returns the object in the form of hash
296
+ # @return [Hash] Returns the object in the form of hash
297
+ def to_hash
298
+ hash = {}
299
+ self.class.attribute_map.each_pair do |attr, param|
300
+ value = self.send(attr)
301
+ next if value.nil?
302
+ hash[param] = _to_hash(value)
303
+ end
304
+ hash
305
+ end
306
+
307
+ # Outputs non-array value in the form of hash
308
+ # For object, use to_hash. Otherwise, just return the value
309
+ # @param [Object] value Any valid value
310
+ # @return [Hash] Returns the value in the form of hash
311
+ def _to_hash(value)
312
+ if value.is_a?(Array)
313
+ value.compact.map { |v| _to_hash(v) }
314
+ elsif value.is_a?(Hash)
315
+ {}.tap do |hash|
316
+ value.each { |k, v| hash[k] = _to_hash(v) }
317
+ end
318
+ elsif value.respond_to? :to_hash
319
+ value.to_hash
320
+ else
321
+ value
322
+ end
323
+ end
324
+
325
+ end
326
+
327
+ end
@@ -1,696 +1,872 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="words_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 Words Documents.
32
- class WordsSignTextOptionsData
33
-
34
- # Gets or sets a document page number to put signature Value starts from 1
35
- attr_accessor :document_page_number
36
-
37
- # Page Options to specify pages to be verified.
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.
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. For TextStamp implementation LinearGradientBrush (ColorStart) and RadialGradientBrush (ColorInner) are used as SolidBrush. It is not used for TextToFormField and Watermark implementations.
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
- # Horizontal alignment of text inside a signature.
116
- attr_accessor :text_horizontal_alignment
117
-
118
- # Vertical alignment of text inside a signature. This feature is supported only for Image signature implementation (see SignatureImplementation property).
119
- attr_accessor :text_vertical_alignment
120
- class EnumAttributeValidator
121
- attr_reader :datatype
122
- attr_reader :allowable_values
123
-
124
- def initialize(datatype, allowable_values)
125
- @allowable_values = allowable_values.map do |value|
126
- case datatype.to_s
127
- when /Integer/i
128
- value.to_i
129
- when /Float/i
130
- value.to_f
131
- else
132
- value
133
- end
134
- end
135
- end
136
-
137
- def valid?(value)
138
- !value || allowable_values.include?(value)
139
- end
140
- end
141
-
142
- # Attribute mapping from ruby-style variable name to JSON key.
143
- def self.attribute_map
144
- {
145
- :'document_page_number' => :'DocumentPageNumber',
146
- :'pages_setup' => :'PagesSetup',
147
- :'options_type' => :'OptionsType',
148
- :'left' => :'Left',
149
- :'top' => :'Top',
150
- :'width' => :'Width',
151
- :'height' => :'Height',
152
- :'location_measure_type' => :'LocationMeasureType',
153
- :'size_measure_type' => :'SizeMeasureType',
154
- :'stretch' => :'Stretch',
155
- :'rotation_angle' => :'RotationAngle',
156
- :'horizontal_alignment' => :'HorizontalAlignment',
157
- :'vertical_alignment' => :'VerticalAlignment',
158
- :'margin' => :'Margin',
159
- :'margin_measure_type' => :'MarginMeasureType',
160
- :'text' => :'Text',
161
- :'sign_all_pages' => :'SignAllPages',
162
- :'font' => :'Font',
163
- :'fore_color' => :'ForeColor',
164
- :'border_color' => :'BorderColor',
165
- :'background_color' => :'BackgroundColor',
166
- :'background_brush' => :'BackgroundBrush',
167
- :'border_dash_style' => :'BorderDashStyle',
168
- :'border_transparency' => :'BorderTransparency',
169
- :'border_weight' => :'BorderWeight',
170
- :'background_transparency' => :'BackgroundTransparency',
171
- :'signature_implementation' => :'SignatureImplementation',
172
- :'text_horizontal_alignment' => :'TextHorizontalAlignment',
173
- :'text_vertical_alignment' => :'TextVerticalAlignment'
174
- }
175
- end
176
-
177
- # Attribute type mapping.
178
- def self.swagger_types
179
- {
180
- :'document_page_number' => :'Integer',
181
- :'pages_setup' => :'PagesSetupData',
182
- :'options_type' => :'String',
183
- :'left' => :'Integer',
184
- :'top' => :'Integer',
185
- :'width' => :'Integer',
186
- :'height' => :'Integer',
187
- :'location_measure_type' => :'String',
188
- :'size_measure_type' => :'String',
189
- :'stretch' => :'String',
190
- :'rotation_angle' => :'Integer',
191
- :'horizontal_alignment' => :'String',
192
- :'vertical_alignment' => :'String',
193
- :'margin' => :'PaddingData',
194
- :'margin_measure_type' => :'String',
195
- :'text' => :'String',
196
- :'sign_all_pages' => :'BOOLEAN',
197
- :'font' => :'SignatureFontData',
198
- :'fore_color' => :'Color',
199
- :'border_color' => :'Color',
200
- :'background_color' => :'Color',
201
- :'background_brush' => :'BrushData',
202
- :'border_dash_style' => :'String',
203
- :'border_transparency' => :'Float',
204
- :'border_weight' => :'Float',
205
- :'background_transparency' => :'Float',
206
- :'signature_implementation' => :'String',
207
- :'text_horizontal_alignment' => :'String',
208
- :'text_vertical_alignment' => :'String'
209
- }
210
- end
211
-
212
- # Initializes the object
213
- # @param [Hash] attributes Model attributes in the form of hash
214
- def initialize(attributes = {})
215
- return unless attributes.is_a?(Hash)
216
-
217
- # convert string to symbol for hash key
218
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
219
-
220
- if attributes.key?(:'DocumentPageNumber')
221
- self.document_page_number = attributes[:'DocumentPageNumber']
222
- end
223
-
224
- if attributes.key?(:'PagesSetup')
225
- self.pages_setup = attributes[:'PagesSetup']
226
- end
227
-
228
- if attributes.key?(:'OptionsType')
229
- self.options_type = attributes[:'OptionsType']
230
- end
231
-
232
- if attributes.key?(:'Left')
233
- self.left = attributes[:'Left']
234
- end
235
-
236
- if attributes.key?(:'Top')
237
- self.top = attributes[:'Top']
238
- end
239
-
240
- if attributes.key?(:'Width')
241
- self.width = attributes[:'Width']
242
- end
243
-
244
- if attributes.key?(:'Height')
245
- self.height = attributes[:'Height']
246
- end
247
-
248
- if attributes.key?(:'LocationMeasureType')
249
- self.location_measure_type = attributes[:'LocationMeasureType']
250
- end
251
-
252
- if attributes.key?(:'SizeMeasureType')
253
- self.size_measure_type = attributes[:'SizeMeasureType']
254
- end
255
-
256
- if attributes.key?(:'Stretch')
257
- self.stretch = attributes[:'Stretch']
258
- end
259
-
260
- if attributes.key?(:'RotationAngle')
261
- self.rotation_angle = attributes[:'RotationAngle']
262
- end
263
-
264
- if attributes.key?(:'HorizontalAlignment')
265
- self.horizontal_alignment = attributes[:'HorizontalAlignment']
266
- end
267
-
268
- if attributes.key?(:'VerticalAlignment')
269
- self.vertical_alignment = attributes[:'VerticalAlignment']
270
- end
271
-
272
- if attributes.key?(:'Margin')
273
- self.margin = attributes[:'Margin']
274
- end
275
-
276
- if attributes.key?(:'MarginMeasureType')
277
- self.margin_measure_type = attributes[:'MarginMeasureType']
278
- end
279
-
280
- if attributes.key?(:'Text')
281
- self.text = attributes[:'Text']
282
- end
283
-
284
- if attributes.key?(:'SignAllPages')
285
- self.sign_all_pages = attributes[:'SignAllPages']
286
- end
287
-
288
- if attributes.key?(:'Font')
289
- self.font = attributes[:'Font']
290
- end
291
-
292
- if attributes.key?(:'ForeColor')
293
- self.fore_color = attributes[:'ForeColor']
294
- end
295
-
296
- if attributes.key?(:'BorderColor')
297
- self.border_color = attributes[:'BorderColor']
298
- end
299
-
300
- if attributes.key?(:'BackgroundColor')
301
- self.background_color = attributes[:'BackgroundColor']
302
- end
303
-
304
- if attributes.key?(:'BackgroundBrush')
305
- self.background_brush = attributes[:'BackgroundBrush']
306
- end
307
-
308
- if attributes.key?(:'BorderDashStyle')
309
- self.border_dash_style = attributes[:'BorderDashStyle']
310
- end
311
-
312
- if attributes.key?(:'BorderTransparency')
313
- self.border_transparency = attributes[:'BorderTransparency']
314
- end
315
-
316
- if attributes.key?(:'BorderWeight')
317
- self.border_weight = attributes[:'BorderWeight']
318
- end
319
-
320
- if attributes.key?(:'BackgroundTransparency')
321
- self.background_transparency = attributes[:'BackgroundTransparency']
322
- end
323
-
324
- if attributes.key?(:'SignatureImplementation')
325
- self.signature_implementation = attributes[:'SignatureImplementation']
326
- end
327
-
328
- if attributes.key?(:'TextHorizontalAlignment')
329
- self.text_horizontal_alignment = attributes[:'TextHorizontalAlignment']
330
- end
331
-
332
- if attributes.key?(:'TextVerticalAlignment')
333
- self.text_vertical_alignment = attributes[:'TextVerticalAlignment']
334
- end
335
-
336
-
337
- if !((defined? options_type) == nil)
338
- self.options_type = "WordsSignTextOptionsData"
339
- end
340
-
341
- end
342
-
343
- # Show invalid properties with the reasons. Usually used together with valid?
344
- # @return Array for valid properies with the reasons
345
- def list_invalid_properties
346
- invalid_properties = []
347
- if @document_page_number.nil?
348
- invalid_properties.push("invalid value for 'document_page_number', document_page_number cannot be nil.")
349
- end
350
-
351
- return invalid_properties
352
- end
353
-
354
- # Check to see if the all the properties in the model are valid
355
- # @return true if the model is valid
356
- def valid?
357
- return false if @document_page_number.nil?
358
- location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
359
- return false unless location_measure_type_validator.valid?(@location_measure_type)
360
- size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
361
- return false unless size_measure_type_validator.valid?(@size_measure_type)
362
- stretch_validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
363
- return false unless stretch_validator.valid?(@stretch)
364
- horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
365
- return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
366
- vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
367
- return false unless vertical_alignment_validator.valid?(@vertical_alignment)
368
- margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
369
- return false unless margin_measure_type_validator.valid?(@margin_measure_type)
370
- border_dash_style_validator = EnumAttributeValidator.new('String', ["Default", "Solid", "ShortDash", "ShortDot", "ShortDashDot", "ShortDashDotDot", "Dot", "Dash", "LongDash", "DashDot", "LongDashDot", "LongDashDotDot"])
371
- return false unless border_dash_style_validator.valid?(@border_dash_style)
372
- signature_implementation_validator = EnumAttributeValidator.new('String', ["TextStamp", "TextAsImage"])
373
- return false unless signature_implementation_validator.valid?(@signature_implementation)
374
- text_horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
375
- return false unless text_horizontal_alignment_validator.valid?(@text_horizontal_alignment)
376
- text_vertical_alignment_validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
377
- return false unless text_vertical_alignment_validator.valid?(@text_vertical_alignment)
378
- return true
379
- end
380
-
381
- # Custom attribute writer method checking allowed values (enum).
382
- # @param [Object] location_measure_type Object to be assigned
383
- def location_measure_type=(location_measure_type)
384
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
385
- if location_measure_type.to_i == 0
386
- unless validator.valid?(location_measure_type)
387
- raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
388
- end
389
- @location_measure_type = location_measure_type
390
- else
391
- @location_measure_type = validator.allowable_values[location_measure_type.to_i]
392
- end
393
- end
394
-
395
- # Custom attribute writer method checking allowed values (enum).
396
- # @param [Object] size_measure_type Object to be assigned
397
- def size_measure_type=(size_measure_type)
398
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
399
- if size_measure_type.to_i == 0
400
- unless validator.valid?(size_measure_type)
401
- raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
402
- end
403
- @size_measure_type = size_measure_type
404
- else
405
- @size_measure_type = validator.allowable_values[size_measure_type.to_i]
406
- end
407
- end
408
-
409
- # Custom attribute writer method checking allowed values (enum).
410
- # @param [Object] stretch Object to be assigned
411
- def stretch=(stretch)
412
- validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
413
- if stretch.to_i == 0
414
- unless validator.valid?(stretch)
415
- raise ArgumentError, "invalid value for 'stretch', must be one of #{validator.allowable_values}."
416
- end
417
- @stretch = stretch
418
- else
419
- @stretch = validator.allowable_values[stretch.to_i]
420
- end
421
- end
422
-
423
- # Custom attribute writer method checking allowed values (enum).
424
- # @param [Object] horizontal_alignment Object to be assigned
425
- def horizontal_alignment=(horizontal_alignment)
426
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
427
- if horizontal_alignment.to_i == 0
428
- unless validator.valid?(horizontal_alignment)
429
- raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
430
- end
431
- @horizontal_alignment = horizontal_alignment
432
- else
433
- @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
434
- end
435
- end
436
-
437
- # Custom attribute writer method checking allowed values (enum).
438
- # @param [Object] vertical_alignment Object to be assigned
439
- def vertical_alignment=(vertical_alignment)
440
- validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
441
- if vertical_alignment.to_i == 0
442
- unless validator.valid?(vertical_alignment)
443
- raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
444
- end
445
- @vertical_alignment = vertical_alignment
446
- else
447
- @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
448
- end
449
- end
450
-
451
- # Custom attribute writer method checking allowed values (enum).
452
- # @param [Object] margin_measure_type Object to be assigned
453
- def margin_measure_type=(margin_measure_type)
454
- validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
455
- if margin_measure_type.to_i == 0
456
- unless validator.valid?(margin_measure_type)
457
- raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
458
- end
459
- @margin_measure_type = margin_measure_type
460
- else
461
- @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
462
- end
463
- end
464
-
465
- # Custom attribute writer method checking allowed values (enum).
466
- # @param [Object] border_dash_style Object to be assigned
467
- def border_dash_style=(border_dash_style)
468
- validator = EnumAttributeValidator.new('String', ["Default", "Solid", "ShortDash", "ShortDot", "ShortDashDot", "ShortDashDotDot", "Dot", "Dash", "LongDash", "DashDot", "LongDashDot", "LongDashDotDot"])
469
- if border_dash_style.to_i == 0
470
- unless validator.valid?(border_dash_style)
471
- raise ArgumentError, "invalid value for 'border_dash_style', must be one of #{validator.allowable_values}."
472
- end
473
- @border_dash_style = border_dash_style
474
- else
475
- @border_dash_style = validator.allowable_values[border_dash_style.to_i]
476
- end
477
- end
478
-
479
- # Custom attribute writer method checking allowed values (enum).
480
- # @param [Object] signature_implementation Object to be assigned
481
- def signature_implementation=(signature_implementation)
482
- validator = EnumAttributeValidator.new('String', ["TextStamp", "TextAsImage"])
483
- if signature_implementation.to_i == 0
484
- unless validator.valid?(signature_implementation)
485
- raise ArgumentError, "invalid value for 'signature_implementation', must be one of #{validator.allowable_values}."
486
- end
487
- @signature_implementation = signature_implementation
488
- else
489
- @signature_implementation = validator.allowable_values[signature_implementation.to_i]
490
- end
491
- end
492
-
493
- # Custom attribute writer method checking allowed values (enum).
494
- # @param [Object] text_horizontal_alignment Object to be assigned
495
- def text_horizontal_alignment=(text_horizontal_alignment)
496
- validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
497
- if text_horizontal_alignment.to_i == 0
498
- unless validator.valid?(text_horizontal_alignment)
499
- raise ArgumentError, "invalid value for 'text_horizontal_alignment', must be one of #{validator.allowable_values}."
500
- end
501
- @text_horizontal_alignment = text_horizontal_alignment
502
- else
503
- @text_horizontal_alignment = validator.allowable_values[text_horizontal_alignment.to_i]
504
- end
505
- end
506
-
507
- # Custom attribute writer method checking allowed values (enum).
508
- # @param [Object] text_vertical_alignment Object to be assigned
509
- def text_vertical_alignment=(text_vertical_alignment)
510
- validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
511
- if text_vertical_alignment.to_i == 0
512
- unless validator.valid?(text_vertical_alignment)
513
- raise ArgumentError, "invalid value for 'text_vertical_alignment', must be one of #{validator.allowable_values}."
514
- end
515
- @text_vertical_alignment = text_vertical_alignment
516
- else
517
- @text_vertical_alignment = validator.allowable_values[text_vertical_alignment.to_i]
518
- end
519
- end
520
-
521
- # Checks equality by comparing each attribute.
522
- # @param [Object] Object to be compared
523
- def ==(other)
524
- return true if self.equal?(other)
525
- self.class == other.class &&
526
- document_page_number == other.document_page_number &&
527
- pages_setup == other.pages_setup &&
528
- options_type == other.options_type &&
529
- left == other.left &&
530
- top == other.top &&
531
- width == other.width &&
532
- height == other.height &&
533
- location_measure_type == other.location_measure_type &&
534
- size_measure_type == other.size_measure_type &&
535
- stretch == other.stretch &&
536
- rotation_angle == other.rotation_angle &&
537
- horizontal_alignment == other.horizontal_alignment &&
538
- vertical_alignment == other.vertical_alignment &&
539
- margin == other.margin &&
540
- margin_measure_type == other.margin_measure_type &&
541
- text == other.text &&
542
- sign_all_pages == other.sign_all_pages &&
543
- font == other.font &&
544
- fore_color == other.fore_color &&
545
- border_color == other.border_color &&
546
- background_color == other.background_color &&
547
- background_brush == other.background_brush &&
548
- border_dash_style == other.border_dash_style &&
549
- border_transparency == other.border_transparency &&
550
- border_weight == other.border_weight &&
551
- background_transparency == other.background_transparency &&
552
- signature_implementation == other.signature_implementation &&
553
- text_horizontal_alignment == other.text_horizontal_alignment &&
554
- text_vertical_alignment == other.text_vertical_alignment
555
- end
556
-
557
- # @see the `==` method
558
- # @param [Object] Object to be compared
559
- def eql?(other)
560
- self == other
561
- end
562
-
563
- # Calculates hash code according to all attributes.
564
- # @return [Fixnum] Hash code
565
- def hash
566
- [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, text_horizontal_alignment, text_vertical_alignment].hash
567
- end
568
-
569
- # Builds the object from hash
570
- # @param [Hash] attributes Model attributes in the form of hash
571
- # @return [Object] Returns the model itself
572
- def build_from_hash(attributes)
573
- return nil unless attributes.is_a?(Hash)
574
- self.class.swagger_types.each_pair do |key, type|
575
-
576
- attributeName = self.class.attribute_map[key]
577
- attributeNameLowerStr = attributeName.to_s
578
- attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
579
- attributeNameLower = attributeNameLowerStr.to_sym
580
- attributeNameLowerStr2 = attributeName.to_s
581
- attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
582
- attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
583
- attributeNameLower2 = attributeNameLowerStr2.to_sym
584
-
585
- if type =~ /\AArray<(.*)>/i
586
- # check to ensure the input is an array given that the the attribute
587
- # is documented as an array but the input is not
588
- if attributes[attributeName].is_a?(Array)
589
- self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
590
- end
591
- if attributes[attributeNameLower].is_a?(Array)
592
- self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
593
- end
594
- if attributes[attributeNameLower2].is_a?(Array)
595
- self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
596
- end
597
- elsif !attributes[attributeName].nil?
598
- self.send("#{key}=", _deserialize(type, attributes[attributeName]))
599
- elsif !attributes[attributeNameLower].nil?
600
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
601
- elsif !attributes[attributeNameLower2].nil?
602
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
603
- end
604
- # or else data not found in attributes(hash), not an issue as the data can be optional
605
- end
606
- self
607
- end
608
-
609
- # Deserializes the data based on type
610
- # @param string type Data type
611
- # @param string value Value to be deserialized
612
- # @return [Object] Deserialized data
613
- def _deserialize(type, value)
614
- case type.to_sym
615
- when :DateTime
616
- Time.at(/\d/.match(value)[0].to_f).to_datetime
617
- when :Date
618
- Time.at(/\d/.match(value)[0].to_f).to_date
619
- when :String
620
- value.to_s
621
- when :Integer
622
- value.to_i
623
- when :Float
624
- value.to_f
625
- when :BOOLEAN
626
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
627
- true
628
- else
629
- false
630
- end
631
- when :Object
632
- # generic object (usually a Hash), return directly
633
- value
634
- when /\AArray<(?<inner_type>.+)>\z/
635
- inner_type = Regexp.last_match[:inner_type]
636
- value.map { |v| _deserialize(inner_type, v) }
637
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
638
- k_type = Regexp.last_match[:k_type]
639
- v_type = Regexp.last_match[:v_type]
640
- {}.tap do |hash|
641
- value.each do |k, v|
642
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
643
- end
644
- end
645
- else
646
- # model
647
- temp_model = GroupDocsSignatureCloud.const_get(type).new
648
- temp_model.build_from_hash(value)
649
- end
650
- end
651
-
652
- # Returns the string representation of the object
653
- # @return [String] String presentation of the object
654
- def to_s
655
- to_hash.to_s
656
- end
657
-
658
- # to_body is an alias to to_hash (backward compatibility)
659
- # @return [Hash] Returns the object in the form of hash
660
- def to_body
661
- to_hash
662
- end
663
-
664
- # Returns the object in the form of hash
665
- # @return [Hash] Returns the object in the form of hash
666
- def to_hash
667
- hash = {}
668
- self.class.attribute_map.each_pair do |attr, param|
669
- value = self.send(attr)
670
- next if value.nil?
671
- hash[param] = _to_hash(value)
672
- end
673
- hash
674
- end
675
-
676
- # Outputs non-array value in the form of hash
677
- # For object, use to_hash. Otherwise, just return the value
678
- # @param [Object] value Any valid value
679
- # @return [Hash] Returns the value in the form of hash
680
- def _to_hash(value)
681
- if value.is_a?(Array)
682
- value.compact.map { |v| _to_hash(v) }
683
- elsif value.is_a?(Hash)
684
- {}.tap do |hash|
685
- value.each { |k, v| hash[k] = _to_hash(v) }
686
- end
687
- elsif value.respond_to? :to_hash
688
- value.to_hash
689
- else
690
- value
691
- end
692
- end
693
-
694
- end
695
-
696
- end
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="sign_qr_code_options.rb">
4
+ # Copyright (c) 2003-2019 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 QR-code signature options
32
+ class SignQRCodeOptions
33
+
34
+ # Specifies the type of document to process
35
+ attr_accessor :document_type
36
+
37
+ # Specifies the signature type of processing
38
+ attr_accessor :signature_type
39
+
40
+ # Gets or sets a document page number for processing. Value is optional
41
+ attr_accessor :page
42
+
43
+ # Process all document pages. Type of processing depends on SignatureType For Images Document Type it can be used only for multi-frames images like .tiff
44
+ attr_accessor :all_pages
45
+
46
+ # Options to specify pages for processing
47
+ attr_accessor :pages_setup
48
+
49
+ # Left X position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType property)
50
+ attr_accessor :left
51
+
52
+ # Top Y Position of Signature on Document Page in Measure values (pixels or percent see MeasureType LocationMeasureType property)
53
+ attr_accessor :top
54
+
55
+ # Width of Signature area on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType property)
56
+ attr_accessor :width
57
+
58
+ # Height of Signature are on Document Page in Measure values (pixels or percent see MeasureType SizeMeasureType property)
59
+ attr_accessor :height
60
+
61
+ # Measure type (pixels or percent) for Left and Top properties
62
+ attr_accessor :location_measure_type
63
+
64
+ # Measure type (pixels or percent) for Width and Height properties
65
+ attr_accessor :size_measure_type
66
+
67
+ # Stretch mode on document page
68
+ attr_accessor :stretch
69
+
70
+ # Rotation angle of signature on document page (clockwise)
71
+ attr_accessor :rotation_angle
72
+
73
+ # Horizontal alignment of signature on document page
74
+ attr_accessor :horizontal_alignment
75
+
76
+ # Vertical alignment of signature on document page
77
+ attr_accessor :vertical_alignment
78
+
79
+ # Gets or sets the space between Sign and Document edges (works ONLY if horizontal or vertical alignment are specified)
80
+ attr_accessor :margin
81
+
82
+ # Gets or sets the measure type (pixels or percent) for Margin
83
+ attr_accessor :margin_measure_type
84
+
85
+ # Text of signature
86
+ attr_accessor :text
87
+
88
+ # Gets or sets the font of signature
89
+ attr_accessor :font
90
+
91
+ # Gets or sets the fore color of signature
92
+ attr_accessor :fore_color
93
+
94
+ # Gets or sets the border color of signature
95
+ attr_accessor :border_color
96
+
97
+ # Gets or sets the background color of signature
98
+ attr_accessor :background_color
99
+
100
+ # Gets or sets the signature background brush. Value by default is null. If this property has a value it will be used instead BackgroundBrush property. For Spreadsheet documents TextStamp implementation RadialGradientBrush is not applicable, it is replaced by LinearGradientBrush. Spreadsheets, Images, Presentations It is not used for Watermark implementation. PDF For Stamp implementation LinearGradientBrush (ColorStart) and RadialGradientBrush (ColorInner) are used as SolidBrush. PDF It is not used for Annotation, Sticker, TextToFormField and Watermark implementations. Presentations For TextStamp implementation RadialGradientBrush is not applicable, it is replaced by LinearGradientBrush. Word Processing For TextStamp implementation LinearGradientBrush (ColorStart) and RadialGradientBrush (ColorInner) are used as SolidBrush. Word Processing It is not used for TextToFormField and Watermark implementations
101
+ attr_accessor :background_brush
102
+
103
+ # Gets or sets the signature border visibility It is not suitable for PDF
104
+ attr_accessor :border_visiblity
105
+
106
+ # Gets or sets the signature border style It is not suitable for PDF
107
+ attr_accessor :border_dash_style
108
+
109
+ # Gets or sets the signature border transparency (value from 0.0 (opaque) through 1.0 (clear)) It is not suitable for PDF
110
+ attr_accessor :border_transparency
111
+
112
+ # Horizontal alignment of text inside a signature
113
+ attr_accessor :text_horizontal_alignment
114
+
115
+ # Vertical alignment of text inside a signature
116
+ attr_accessor :text_vertical_alignment
117
+
118
+ # Get or set QRCode type. Value should be one from supported QRCode types list
119
+ attr_accessor :qr_code_type
120
+
121
+ # Gets or sets the weight of the signature border
122
+ attr_accessor :border_weight
123
+
124
+ # Gets or sets the signature opacity (value from 0.0 (clear) through 1.0 (opaque)) By default the value is 1.0
125
+ attr_accessor :opacity
126
+
127
+ # Gets or sets the alignment of text in the result QR-code Default value is None
128
+ attr_accessor :code_text_alignment
129
+
130
+ # Gets or sets the space between QRCode elements and result image borders
131
+ attr_accessor :inner_margins
132
+
133
+ # Gets or sets the QR-code logo image file name. This property in use only if LogoStream is not specified. Using of this property could cause problems with verification. Use it carefully
134
+ attr_accessor :logo_guid
135
+ class EnumAttributeValidator
136
+ attr_reader :datatype
137
+ attr_reader :allowable_values
138
+
139
+ def initialize(datatype, allowable_values)
140
+ @allowable_values = allowable_values.map do |value|
141
+ case datatype.to_s
142
+ when /Integer/i
143
+ value.to_i
144
+ when /Float/i
145
+ value.to_f
146
+ else
147
+ value
148
+ end
149
+ end
150
+ end
151
+
152
+ def valid?(value)
153
+ !value || allowable_values.include?(value)
154
+ end
155
+ end
156
+
157
+ # Attribute mapping from ruby-style variable name to JSON key.
158
+ def self.attribute_map
159
+ {
160
+ :'document_type' => :'DocumentType',
161
+ :'signature_type' => :'SignatureType',
162
+ :'page' => :'Page',
163
+ :'all_pages' => :'AllPages',
164
+ :'pages_setup' => :'PagesSetup',
165
+ :'left' => :'Left',
166
+ :'top' => :'Top',
167
+ :'width' => :'Width',
168
+ :'height' => :'Height',
169
+ :'location_measure_type' => :'LocationMeasureType',
170
+ :'size_measure_type' => :'SizeMeasureType',
171
+ :'stretch' => :'Stretch',
172
+ :'rotation_angle' => :'RotationAngle',
173
+ :'horizontal_alignment' => :'HorizontalAlignment',
174
+ :'vertical_alignment' => :'VerticalAlignment',
175
+ :'margin' => :'Margin',
176
+ :'margin_measure_type' => :'MarginMeasureType',
177
+ :'text' => :'Text',
178
+ :'font' => :'Font',
179
+ :'fore_color' => :'ForeColor',
180
+ :'border_color' => :'BorderColor',
181
+ :'background_color' => :'BackgroundColor',
182
+ :'background_brush' => :'BackgroundBrush',
183
+ :'border_visiblity' => :'BorderVisiblity',
184
+ :'border_dash_style' => :'BorderDashStyle',
185
+ :'border_transparency' => :'BorderTransparency',
186
+ :'text_horizontal_alignment' => :'TextHorizontalAlignment',
187
+ :'text_vertical_alignment' => :'TextVerticalAlignment',
188
+ :'qr_code_type' => :'QRCodeType',
189
+ :'border_weight' => :'BorderWeight',
190
+ :'opacity' => :'Opacity',
191
+ :'code_text_alignment' => :'CodeTextAlignment',
192
+ :'inner_margins' => :'InnerMargins',
193
+ :'logo_guid' => :'LogoGuid'
194
+ }
195
+ end
196
+
197
+ # Attribute type mapping.
198
+ def self.swagger_types
199
+ {
200
+ :'document_type' => :'String',
201
+ :'signature_type' => :'String',
202
+ :'page' => :'Integer',
203
+ :'all_pages' => :'BOOLEAN',
204
+ :'pages_setup' => :'PagesSetup',
205
+ :'left' => :'Integer',
206
+ :'top' => :'Integer',
207
+ :'width' => :'Integer',
208
+ :'height' => :'Integer',
209
+ :'location_measure_type' => :'String',
210
+ :'size_measure_type' => :'String',
211
+ :'stretch' => :'String',
212
+ :'rotation_angle' => :'Integer',
213
+ :'horizontal_alignment' => :'String',
214
+ :'vertical_alignment' => :'String',
215
+ :'margin' => :'Padding',
216
+ :'margin_measure_type' => :'String',
217
+ :'text' => :'String',
218
+ :'font' => :'SignatureFont',
219
+ :'fore_color' => :'Color',
220
+ :'border_color' => :'Color',
221
+ :'background_color' => :'Color',
222
+ :'background_brush' => :'Brush',
223
+ :'border_visiblity' => :'BOOLEAN',
224
+ :'border_dash_style' => :'String',
225
+ :'border_transparency' => :'Float',
226
+ :'text_horizontal_alignment' => :'String',
227
+ :'text_vertical_alignment' => :'String',
228
+ :'qr_code_type' => :'String',
229
+ :'border_weight' => :'Float',
230
+ :'opacity' => :'Float',
231
+ :'code_text_alignment' => :'String',
232
+ :'inner_margins' => :'Padding',
233
+ :'logo_guid' => :'String'
234
+ }
235
+ end
236
+
237
+ # Initializes the object
238
+ # @param [Hash] attributes Model attributes in the form of hash
239
+ def initialize(attributes = {})
240
+ return unless attributes.is_a?(Hash)
241
+
242
+ # convert string to symbol for hash key
243
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
244
+
245
+ if attributes.key?(:'DocumentType')
246
+ self.document_type = attributes[:'DocumentType']
247
+ end
248
+
249
+ if attributes.key?(:'SignatureType')
250
+ self.signature_type = attributes[:'SignatureType']
251
+ end
252
+
253
+ if attributes.key?(:'Page')
254
+ self.page = attributes[:'Page']
255
+ end
256
+
257
+ if attributes.key?(:'AllPages')
258
+ self.all_pages = attributes[:'AllPages']
259
+ end
260
+
261
+ if attributes.key?(:'PagesSetup')
262
+ self.pages_setup = attributes[:'PagesSetup']
263
+ end
264
+
265
+ if attributes.key?(:'Left')
266
+ self.left = attributes[:'Left']
267
+ end
268
+
269
+ if attributes.key?(:'Top')
270
+ self.top = attributes[:'Top']
271
+ end
272
+
273
+ if attributes.key?(:'Width')
274
+ self.width = attributes[:'Width']
275
+ end
276
+
277
+ if attributes.key?(:'Height')
278
+ self.height = attributes[:'Height']
279
+ end
280
+
281
+ if attributes.key?(:'LocationMeasureType')
282
+ self.location_measure_type = attributes[:'LocationMeasureType']
283
+ end
284
+
285
+ if attributes.key?(:'SizeMeasureType')
286
+ self.size_measure_type = attributes[:'SizeMeasureType']
287
+ end
288
+
289
+ if attributes.key?(:'Stretch')
290
+ self.stretch = attributes[:'Stretch']
291
+ end
292
+
293
+ if attributes.key?(:'RotationAngle')
294
+ self.rotation_angle = attributes[:'RotationAngle']
295
+ end
296
+
297
+ if attributes.key?(:'HorizontalAlignment')
298
+ self.horizontal_alignment = attributes[:'HorizontalAlignment']
299
+ end
300
+
301
+ if attributes.key?(:'VerticalAlignment')
302
+ self.vertical_alignment = attributes[:'VerticalAlignment']
303
+ end
304
+
305
+ if attributes.key?(:'Margin')
306
+ self.margin = attributes[:'Margin']
307
+ end
308
+
309
+ if attributes.key?(:'MarginMeasureType')
310
+ self.margin_measure_type = attributes[:'MarginMeasureType']
311
+ end
312
+
313
+ if attributes.key?(:'Text')
314
+ self.text = attributes[:'Text']
315
+ end
316
+
317
+ if attributes.key?(:'Font')
318
+ self.font = attributes[:'Font']
319
+ end
320
+
321
+ if attributes.key?(:'ForeColor')
322
+ self.fore_color = attributes[:'ForeColor']
323
+ end
324
+
325
+ if attributes.key?(:'BorderColor')
326
+ self.border_color = attributes[:'BorderColor']
327
+ end
328
+
329
+ if attributes.key?(:'BackgroundColor')
330
+ self.background_color = attributes[:'BackgroundColor']
331
+ end
332
+
333
+ if attributes.key?(:'BackgroundBrush')
334
+ self.background_brush = attributes[:'BackgroundBrush']
335
+ end
336
+
337
+ if attributes.key?(:'BorderVisiblity')
338
+ self.border_visiblity = attributes[:'BorderVisiblity']
339
+ end
340
+
341
+ if attributes.key?(:'BorderDashStyle')
342
+ self.border_dash_style = attributes[:'BorderDashStyle']
343
+ end
344
+
345
+ if attributes.key?(:'BorderTransparency')
346
+ self.border_transparency = attributes[:'BorderTransparency']
347
+ end
348
+
349
+ if attributes.key?(:'TextHorizontalAlignment')
350
+ self.text_horizontal_alignment = attributes[:'TextHorizontalAlignment']
351
+ end
352
+
353
+ if attributes.key?(:'TextVerticalAlignment')
354
+ self.text_vertical_alignment = attributes[:'TextVerticalAlignment']
355
+ end
356
+
357
+ if attributes.key?(:'QRCodeType')
358
+ self.qr_code_type = attributes[:'QRCodeType']
359
+ end
360
+
361
+ if attributes.key?(:'BorderWeight')
362
+ self.border_weight = attributes[:'BorderWeight']
363
+ end
364
+
365
+ if attributes.key?(:'Opacity')
366
+ self.opacity = attributes[:'Opacity']
367
+ end
368
+
369
+ if attributes.key?(:'CodeTextAlignment')
370
+ self.code_text_alignment = attributes[:'CodeTextAlignment']
371
+ end
372
+
373
+ if attributes.key?(:'InnerMargins')
374
+ self.inner_margins = attributes[:'InnerMargins']
375
+ end
376
+
377
+ if attributes.key?(:'LogoGuid')
378
+ self.logo_guid = attributes[:'LogoGuid']
379
+ end
380
+
381
+ end
382
+
383
+ # Show invalid properties with the reasons. Usually used together with valid?
384
+ # @return Array for valid properies with the reasons
385
+ def list_invalid_properties
386
+ invalid_properties = []
387
+ if @document_type.nil?
388
+ invalid_properties.push("invalid value for 'document_type', document_type cannot be nil.")
389
+ end
390
+
391
+ if @signature_type.nil?
392
+ invalid_properties.push("invalid value for 'signature_type', signature_type cannot be nil.")
393
+ end
394
+
395
+ if @all_pages.nil?
396
+ invalid_properties.push("invalid value for 'all_pages', all_pages cannot be nil.")
397
+ end
398
+
399
+ if @left.nil?
400
+ invalid_properties.push("invalid value for 'left', left cannot be nil.")
401
+ end
402
+
403
+ if @top.nil?
404
+ invalid_properties.push("invalid value for 'top', top cannot be nil.")
405
+ end
406
+
407
+ if @width.nil?
408
+ invalid_properties.push("invalid value for 'width', width cannot be nil.")
409
+ end
410
+
411
+ if @height.nil?
412
+ invalid_properties.push("invalid value for 'height', height cannot be nil.")
413
+ end
414
+
415
+ if @location_measure_type.nil?
416
+ invalid_properties.push("invalid value for 'location_measure_type', location_measure_type cannot be nil.")
417
+ end
418
+
419
+ if @size_measure_type.nil?
420
+ invalid_properties.push("invalid value for 'size_measure_type', size_measure_type cannot be nil.")
421
+ end
422
+
423
+ if @stretch.nil?
424
+ invalid_properties.push("invalid value for 'stretch', stretch cannot be nil.")
425
+ end
426
+
427
+ if @rotation_angle.nil?
428
+ invalid_properties.push("invalid value for 'rotation_angle', rotation_angle cannot be nil.")
429
+ end
430
+
431
+ if @horizontal_alignment.nil?
432
+ invalid_properties.push("invalid value for 'horizontal_alignment', horizontal_alignment cannot be nil.")
433
+ end
434
+
435
+ if @vertical_alignment.nil?
436
+ invalid_properties.push("invalid value for 'vertical_alignment', vertical_alignment cannot be nil.")
437
+ end
438
+
439
+ if @margin_measure_type.nil?
440
+ invalid_properties.push("invalid value for 'margin_measure_type', margin_measure_type cannot be nil.")
441
+ end
442
+
443
+ if @border_visiblity.nil?
444
+ invalid_properties.push("invalid value for 'border_visiblity', border_visiblity cannot be nil.")
445
+ end
446
+
447
+ if @border_dash_style.nil?
448
+ invalid_properties.push("invalid value for 'border_dash_style', border_dash_style cannot be nil.")
449
+ end
450
+
451
+ if @border_transparency.nil?
452
+ invalid_properties.push("invalid value for 'border_transparency', border_transparency cannot be nil.")
453
+ end
454
+
455
+ if @text_horizontal_alignment.nil?
456
+ invalid_properties.push("invalid value for 'text_horizontal_alignment', text_horizontal_alignment cannot be nil.")
457
+ end
458
+
459
+ if @text_vertical_alignment.nil?
460
+ invalid_properties.push("invalid value for 'text_vertical_alignment', text_vertical_alignment cannot be nil.")
461
+ end
462
+
463
+ if @border_weight.nil?
464
+ invalid_properties.push("invalid value for 'border_weight', border_weight cannot be nil.")
465
+ end
466
+
467
+ if @opacity.nil?
468
+ invalid_properties.push("invalid value for 'opacity', opacity cannot be nil.")
469
+ end
470
+
471
+ if @code_text_alignment.nil?
472
+ invalid_properties.push("invalid value for 'code_text_alignment', code_text_alignment cannot be nil.")
473
+ end
474
+
475
+ return invalid_properties
476
+ end
477
+
478
+ # Check to see if the all the properties in the model are valid
479
+ # @return true if the model is valid
480
+ def valid?
481
+ return false if @document_type.nil?
482
+ document_type_validator = EnumAttributeValidator.new('String', ["Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
483
+ return false unless document_type_validator.valid?(@document_type)
484
+ return false if @signature_type.nil?
485
+ signature_type_validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
486
+ return false unless signature_type_validator.valid?(@signature_type)
487
+ return false if @all_pages.nil?
488
+ return false if @left.nil?
489
+ return false if @top.nil?
490
+ return false if @width.nil?
491
+ return false if @height.nil?
492
+ return false if @location_measure_type.nil?
493
+ location_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
494
+ return false unless location_measure_type_validator.valid?(@location_measure_type)
495
+ return false if @size_measure_type.nil?
496
+ size_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
497
+ return false unless size_measure_type_validator.valid?(@size_measure_type)
498
+ return false if @stretch.nil?
499
+ stretch_validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
500
+ return false unless stretch_validator.valid?(@stretch)
501
+ return false if @rotation_angle.nil?
502
+ return false if @horizontal_alignment.nil?
503
+ horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
504
+ return false unless horizontal_alignment_validator.valid?(@horizontal_alignment)
505
+ return false if @vertical_alignment.nil?
506
+ vertical_alignment_validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
507
+ return false unless vertical_alignment_validator.valid?(@vertical_alignment)
508
+ return false if @margin_measure_type.nil?
509
+ margin_measure_type_validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
510
+ return false unless margin_measure_type_validator.valid?(@margin_measure_type)
511
+ return false if @border_visiblity.nil?
512
+ return false if @border_dash_style.nil?
513
+ border_dash_style_validator = EnumAttributeValidator.new('String', ["Dash", "DashDot", "DashDotDot", "DashLongDash", "DashLongDashDot", "RoundDot", "Solid", "SquareDot"])
514
+ return false unless border_dash_style_validator.valid?(@border_dash_style)
515
+ return false if @border_transparency.nil?
516
+ return false if @text_horizontal_alignment.nil?
517
+ text_horizontal_alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
518
+ return false unless text_horizontal_alignment_validator.valid?(@text_horizontal_alignment)
519
+ return false if @text_vertical_alignment.nil?
520
+ text_vertical_alignment_validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
521
+ return false unless text_vertical_alignment_validator.valid?(@text_vertical_alignment)
522
+ return false if @border_weight.nil?
523
+ return false if @opacity.nil?
524
+ return false if @code_text_alignment.nil?
525
+ code_text_alignment_validator = EnumAttributeValidator.new('String', ["None", "Above", "Below", "Right"])
526
+ return false unless code_text_alignment_validator.valid?(@code_text_alignment)
527
+ return true
528
+ end
529
+
530
+ # Custom attribute writer method checking allowed values (enum).
531
+ # @param [Object] document_type Object to be assigned
532
+ def document_type=(document_type)
533
+ validator = EnumAttributeValidator.new('String', ["Image", "Pdf", "Presentation", "Spreadsheet", "WordProcessing"])
534
+ if document_type.to_i == 0
535
+ unless validator.valid?(document_type)
536
+ raise ArgumentError, "invalid value for 'document_type', must be one of #{validator.allowable_values}."
537
+ end
538
+ @document_type = document_type
539
+ else
540
+ @document_type = validator.allowable_values[document_type.to_i]
541
+ end
542
+ end
543
+
544
+ # Custom attribute writer method checking allowed values (enum).
545
+ # @param [Object] signature_type Object to be assigned
546
+ def signature_type=(signature_type)
547
+ validator = EnumAttributeValidator.new('String', ["None", "Text", "Image", "Digital", "Barcode", "QRCode", "Stamp"])
548
+ if signature_type.to_i == 0
549
+ unless validator.valid?(signature_type)
550
+ raise ArgumentError, "invalid value for 'signature_type', must be one of #{validator.allowable_values}."
551
+ end
552
+ @signature_type = signature_type
553
+ else
554
+ @signature_type = validator.allowable_values[signature_type.to_i]
555
+ end
556
+ end
557
+
558
+ # Custom attribute writer method checking allowed values (enum).
559
+ # @param [Object] location_measure_type Object to be assigned
560
+ def location_measure_type=(location_measure_type)
561
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
562
+ if location_measure_type.to_i == 0
563
+ unless validator.valid?(location_measure_type)
564
+ raise ArgumentError, "invalid value for 'location_measure_type', must be one of #{validator.allowable_values}."
565
+ end
566
+ @location_measure_type = location_measure_type
567
+ else
568
+ @location_measure_type = validator.allowable_values[location_measure_type.to_i]
569
+ end
570
+ end
571
+
572
+ # Custom attribute writer method checking allowed values (enum).
573
+ # @param [Object] size_measure_type Object to be assigned
574
+ def size_measure_type=(size_measure_type)
575
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
576
+ if size_measure_type.to_i == 0
577
+ unless validator.valid?(size_measure_type)
578
+ raise ArgumentError, "invalid value for 'size_measure_type', must be one of #{validator.allowable_values}."
579
+ end
580
+ @size_measure_type = size_measure_type
581
+ else
582
+ @size_measure_type = validator.allowable_values[size_measure_type.to_i]
583
+ end
584
+ end
585
+
586
+ # Custom attribute writer method checking allowed values (enum).
587
+ # @param [Object] stretch Object to be assigned
588
+ def stretch=(stretch)
589
+ validator = EnumAttributeValidator.new('String', ["None", "PageWidth", "PageHeight", "PageArea"])
590
+ if stretch.to_i == 0
591
+ unless validator.valid?(stretch)
592
+ raise ArgumentError, "invalid value for 'stretch', must be one of #{validator.allowable_values}."
593
+ end
594
+ @stretch = stretch
595
+ else
596
+ @stretch = validator.allowable_values[stretch.to_i]
597
+ end
598
+ end
599
+
600
+ # Custom attribute writer method checking allowed values (enum).
601
+ # @param [Object] horizontal_alignment Object to be assigned
602
+ def horizontal_alignment=(horizontal_alignment)
603
+ validator = EnumAttributeValidator.new('String', ["Default", "None", "Left", "Center", "Right"])
604
+ if horizontal_alignment.to_i == 0
605
+ unless validator.valid?(horizontal_alignment)
606
+ raise ArgumentError, "invalid value for 'horizontal_alignment', must be one of #{validator.allowable_values}."
607
+ end
608
+ @horizontal_alignment = horizontal_alignment
609
+ else
610
+ @horizontal_alignment = validator.allowable_values[horizontal_alignment.to_i]
611
+ end
612
+ end
613
+
614
+ # Custom attribute writer method checking allowed values (enum).
615
+ # @param [Object] vertical_alignment Object to be assigned
616
+ def vertical_alignment=(vertical_alignment)
617
+ validator = EnumAttributeValidator.new('String', ["Default", "None", "Top", "Center", "Bottom"])
618
+ if vertical_alignment.to_i == 0
619
+ unless validator.valid?(vertical_alignment)
620
+ raise ArgumentError, "invalid value for 'vertical_alignment', must be one of #{validator.allowable_values}."
621
+ end
622
+ @vertical_alignment = vertical_alignment
623
+ else
624
+ @vertical_alignment = validator.allowable_values[vertical_alignment.to_i]
625
+ end
626
+ end
627
+
628
+ # Custom attribute writer method checking allowed values (enum).
629
+ # @param [Object] margin_measure_type Object to be assigned
630
+ def margin_measure_type=(margin_measure_type)
631
+ validator = EnumAttributeValidator.new('String', ["Pixels", "Percents", "Millimeters"])
632
+ if margin_measure_type.to_i == 0
633
+ unless validator.valid?(margin_measure_type)
634
+ raise ArgumentError, "invalid value for 'margin_measure_type', must be one of #{validator.allowable_values}."
635
+ end
636
+ @margin_measure_type = margin_measure_type
637
+ else
638
+ @margin_measure_type = validator.allowable_values[margin_measure_type.to_i]
639
+ end
640
+ end
641
+
642
+ # Custom attribute writer method checking allowed values (enum).
643
+ # @param [Object] border_dash_style Object to be assigned
644
+ def border_dash_style=(border_dash_style)
645
+ validator = EnumAttributeValidator.new('String', ["Dash", "DashDot", "DashDotDot", "DashLongDash", "DashLongDashDot", "RoundDot", "Solid", "SquareDot"])
646
+ if border_dash_style.to_i == 0
647
+ unless validator.valid?(border_dash_style)
648
+ raise ArgumentError, "invalid value for 'border_dash_style', must be one of #{validator.allowable_values}."
649
+ end
650
+ @border_dash_style = border_dash_style
651
+ else
652
+ @border_dash_style = validator.allowable_values[border_dash_style.to_i]
653
+ end
654
+ end
655
+
656
+ # Custom attribute writer method checking allowed values (enum).
657
+ # @param [Object] text_horizontal_alignment Object to be assigned
658
+ def text_horizontal_alignment=(text_horizontal_alignment)
659
+ validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
660
+ if text_horizontal_alignment.to_i == 0
661
+ unless validator.valid?(text_horizontal_alignment)
662
+ raise ArgumentError, "invalid value for 'text_horizontal_alignment', must be one of #{validator.allowable_values}."
663
+ end
664
+ @text_horizontal_alignment = text_horizontal_alignment
665
+ else
666
+ @text_horizontal_alignment = validator.allowable_values[text_horizontal_alignment.to_i]
667
+ end
668
+ end
669
+
670
+ # Custom attribute writer method checking allowed values (enum).
671
+ # @param [Object] text_vertical_alignment Object to be assigned
672
+ def text_vertical_alignment=(text_vertical_alignment)
673
+ validator = EnumAttributeValidator.new('String', ["Top", "Center", "Bottom"])
674
+ if text_vertical_alignment.to_i == 0
675
+ unless validator.valid?(text_vertical_alignment)
676
+ raise ArgumentError, "invalid value for 'text_vertical_alignment', must be one of #{validator.allowable_values}."
677
+ end
678
+ @text_vertical_alignment = text_vertical_alignment
679
+ else
680
+ @text_vertical_alignment = validator.allowable_values[text_vertical_alignment.to_i]
681
+ end
682
+ end
683
+
684
+ # Custom attribute writer method checking allowed values (enum).
685
+ # @param [Object] code_text_alignment Object to be assigned
686
+ def code_text_alignment=(code_text_alignment)
687
+ validator = EnumAttributeValidator.new('String', ["None", "Above", "Below", "Right"])
688
+ if code_text_alignment.to_i == 0
689
+ unless validator.valid?(code_text_alignment)
690
+ raise ArgumentError, "invalid value for 'code_text_alignment', must be one of #{validator.allowable_values}."
691
+ end
692
+ @code_text_alignment = code_text_alignment
693
+ else
694
+ @code_text_alignment = validator.allowable_values[code_text_alignment.to_i]
695
+ end
696
+ end
697
+
698
+ # Checks equality by comparing each attribute.
699
+ # @param [Object] Object to be compared
700
+ def ==(other)
701
+ return true if self.equal?(other)
702
+ self.class == other.class &&
703
+ document_type == other.document_type &&
704
+ signature_type == other.signature_type &&
705
+ page == other.page &&
706
+ all_pages == other.all_pages &&
707
+ pages_setup == other.pages_setup &&
708
+ left == other.left &&
709
+ top == other.top &&
710
+ width == other.width &&
711
+ height == other.height &&
712
+ location_measure_type == other.location_measure_type &&
713
+ size_measure_type == other.size_measure_type &&
714
+ stretch == other.stretch &&
715
+ rotation_angle == other.rotation_angle &&
716
+ horizontal_alignment == other.horizontal_alignment &&
717
+ vertical_alignment == other.vertical_alignment &&
718
+ margin == other.margin &&
719
+ margin_measure_type == other.margin_measure_type &&
720
+ text == other.text &&
721
+ font == other.font &&
722
+ fore_color == other.fore_color &&
723
+ border_color == other.border_color &&
724
+ background_color == other.background_color &&
725
+ background_brush == other.background_brush &&
726
+ border_visiblity == other.border_visiblity &&
727
+ border_dash_style == other.border_dash_style &&
728
+ border_transparency == other.border_transparency &&
729
+ text_horizontal_alignment == other.text_horizontal_alignment &&
730
+ text_vertical_alignment == other.text_vertical_alignment &&
731
+ qr_code_type == other.qr_code_type &&
732
+ border_weight == other.border_weight &&
733
+ opacity == other.opacity &&
734
+ code_text_alignment == other.code_text_alignment &&
735
+ inner_margins == other.inner_margins &&
736
+ logo_guid == other.logo_guid
737
+ end
738
+
739
+ # @see the `==` method
740
+ # @param [Object] Object to be compared
741
+ def eql?(other)
742
+ self == other
743
+ end
744
+
745
+ # Calculates hash code according to all attributes.
746
+ # @return [Fixnum] Hash code
747
+ def hash
748
+ [document_type, signature_type, page, all_pages, pages_setup, left, top, width, height, location_measure_type, size_measure_type, stretch, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, text, font, fore_color, border_color, background_color, background_brush, border_visiblity, border_dash_style, border_transparency, text_horizontal_alignment, text_vertical_alignment, qr_code_type, border_weight, opacity, code_text_alignment, inner_margins, logo_guid].hash
749
+ end
750
+
751
+ # Downcases first letter.
752
+ # @return downcased string
753
+ def uncap(str)
754
+ str[0, 1].downcase + str[1..-1]
755
+ end
756
+
757
+ # Builds the object from hash
758
+ # @param [Hash] attributes Model attributes in the form of hash
759
+ # @return [Object] Returns the model itself
760
+ def build_from_hash(attributes)
761
+ return nil unless attributes.is_a?(Hash)
762
+ self.class.swagger_types.each_pair do |key, type|
763
+ pname = uncap(self.class.attribute_map[key]).intern
764
+ value = attributes[pname]
765
+ if type =~ /\AArray<(.*)>/i
766
+ # check to ensure the input is an array given that the the attribute
767
+ # is documented as an array but the input is not
768
+ if value.is_a?(Array)
769
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
770
+ end
771
+ elsif !value.nil?
772
+ self.send("#{key}=", _deserialize(type, value))
773
+ end
774
+ # or else data not found in attributes(hash), not an issue as the data can be optional
775
+ end
776
+
777
+ self
778
+ end
779
+
780
+ # Deserializes the data based on type
781
+ # @param string type Data type
782
+ # @param string value Value to be deserialized
783
+ # @return [Object] Deserialized data
784
+ def _deserialize(type, value)
785
+ case type.to_sym
786
+ when :DateTime
787
+ Date.parse value
788
+ when :Date
789
+ Date.parse value
790
+ when :String
791
+ value.to_s
792
+ when :Integer
793
+ value.to_i
794
+ when :Float
795
+ value.to_f
796
+ when :BOOLEAN
797
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
798
+ true
799
+ else
800
+ false
801
+ end
802
+ when :Object
803
+ # generic object (usually a Hash), return directly
804
+ value
805
+ when /\AArray<(?<inner_type>.+)>\z/
806
+ inner_type = Regexp.last_match[:inner_type]
807
+ value.map { |v| _deserialize(inner_type, v) }
808
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
809
+ k_type = Regexp.last_match[:k_type]
810
+ v_type = Regexp.last_match[:v_type]
811
+ {}.tap do |hash|
812
+ value.each do |k, v|
813
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
814
+ end
815
+ end
816
+ else
817
+ # model
818
+ # Signature type fix
819
+ ttype = type
820
+ if value.is_a?(Hash) and !value[:signatureType].nil?
821
+ ttype = value[:signatureType] + 'Signature'
822
+ end
823
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
824
+ temp_model.build_from_hash(value)
825
+ end
826
+ end
827
+
828
+ # Returns the string representation of the object
829
+ # @return [String] String presentation of the object
830
+ def to_s
831
+ to_hash.to_s
832
+ end
833
+
834
+ # to_body is an alias to to_hash (backward compatibility)
835
+ # @return [Hash] Returns the object in the form of hash
836
+ def to_body
837
+ to_hash
838
+ end
839
+
840
+ # Returns the object in the form of hash
841
+ # @return [Hash] Returns the object in the form of hash
842
+ def to_hash
843
+ hash = {}
844
+ self.class.attribute_map.each_pair do |attr, param|
845
+ value = self.send(attr)
846
+ next if value.nil?
847
+ hash[param] = _to_hash(value)
848
+ end
849
+ hash
850
+ end
851
+
852
+ # Outputs non-array value in the form of hash
853
+ # For object, use to_hash. Otherwise, just return the value
854
+ # @param [Object] value Any valid value
855
+ # @return [Hash] Returns the value in the form of hash
856
+ def _to_hash(value)
857
+ if value.is_a?(Array)
858
+ value.compact.map { |v| _to_hash(v) }
859
+ elsif value.is_a?(Hash)
860
+ {}.tap do |hash|
861
+ value.each { |k, v| hash[k] = _to_hash(v) }
862
+ end
863
+ elsif value.respond_to? :to_hash
864
+ value.to_hash
865
+ else
866
+ value
867
+ end
868
+ end
869
+
870
+ end
871
+
872
+ end