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
@@ -1,230 +1,219 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="qr_code_type.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
- # Describes QRCode type.
32
- class QRCodeType
33
-
34
- # QRCode Type Name
35
- attr_accessor :name
36
-
37
- # Attribute mapping from ruby-style variable name to JSON key.
38
- def self.attribute_map
39
- {
40
- :'name' => :'Name'
41
- }
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.swagger_types
46
- {
47
- :'name' => :'String'
48
- }
49
- end
50
-
51
- # Initializes the object
52
- # @param [Hash] attributes Model attributes in the form of hash
53
- def initialize(attributes = {})
54
- return unless attributes.is_a?(Hash)
55
-
56
- # convert string to symbol for hash key
57
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
-
59
- if attributes.key?(:'Name')
60
- self.name = attributes[:'Name']
61
- end
62
-
63
-
64
- if !((defined? options_type) == nil)
65
- self.options_type = "QRCodeType"
66
- end
67
-
68
- end
69
-
70
- # Show invalid properties with the reasons. Usually used together with valid?
71
- # @return Array for valid properies with the reasons
72
- def list_invalid_properties
73
- invalid_properties = []
74
- return invalid_properties
75
- end
76
-
77
- # Check to see if the all the properties in the model are valid
78
- # @return true if the model is valid
79
- def valid?
80
- return true
81
- end
82
-
83
- # Checks equality by comparing each attribute.
84
- # @param [Object] Object to be compared
85
- def ==(other)
86
- return true if self.equal?(other)
87
- self.class == other.class &&
88
- name == other.name
89
- end
90
-
91
- # @see the `==` method
92
- # @param [Object] Object to be compared
93
- def eql?(other)
94
- self == other
95
- end
96
-
97
- # Calculates hash code according to all attributes.
98
- # @return [Fixnum] Hash code
99
- def hash
100
- [name].hash
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
- return nil unless attributes.is_a?(Hash)
108
- self.class.swagger_types.each_pair do |key, type|
109
-
110
- attributeName = self.class.attribute_map[key]
111
- attributeNameLowerStr = attributeName.to_s
112
- attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
113
- attributeNameLower = attributeNameLowerStr.to_sym
114
- attributeNameLowerStr2 = attributeName.to_s
115
- attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
116
- attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
117
- attributeNameLower2 = attributeNameLowerStr2.to_sym
118
-
119
- if type =~ /\AArray<(.*)>/i
120
- # check to ensure the input is an array given that the the attribute
121
- # is documented as an array but the input is not
122
- if attributes[attributeName].is_a?(Array)
123
- self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
124
- end
125
- if attributes[attributeNameLower].is_a?(Array)
126
- self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
127
- end
128
- if attributes[attributeNameLower2].is_a?(Array)
129
- self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
130
- end
131
- elsif !attributes[attributeName].nil?
132
- self.send("#{key}=", _deserialize(type, attributes[attributeName]))
133
- elsif !attributes[attributeNameLower].nil?
134
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
135
- elsif !attributes[attributeNameLower2].nil?
136
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
137
- end
138
- # or else data not found in attributes(hash), not an issue as the data can be optional
139
- end
140
- self
141
- end
142
-
143
- # Deserializes the data based on type
144
- # @param string type Data type
145
- # @param string value Value to be deserialized
146
- # @return [Object] Deserialized data
147
- def _deserialize(type, value)
148
- case type.to_sym
149
- when :DateTime
150
- Time.at(/\d/.match(value)[0].to_f).to_datetime
151
- when :Date
152
- Time.at(/\d/.match(value)[0].to_f).to_date
153
- when :String
154
- value.to_s
155
- when :Integer
156
- value.to_i
157
- when :Float
158
- value.to_f
159
- when :BOOLEAN
160
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
- true
162
- else
163
- false
164
- end
165
- when :Object
166
- # generic object (usually a Hash), return directly
167
- value
168
- when /\AArray<(?<inner_type>.+)>\z/
169
- inner_type = Regexp.last_match[:inner_type]
170
- value.map { |v| _deserialize(inner_type, v) }
171
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
- k_type = Regexp.last_match[:k_type]
173
- v_type = Regexp.last_match[:v_type]
174
- {}.tap do |hash|
175
- value.each do |k, v|
176
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
- end
178
- end
179
- else
180
- # model
181
- temp_model = GroupDocsSignatureCloud.const_get(type).new
182
- temp_model.build_from_hash(value)
183
- end
184
- end
185
-
186
- # Returns the string representation of the object
187
- # @return [String] String presentation of the object
188
- def to_s
189
- to_hash.to_s
190
- end
191
-
192
- # to_body is an alias to to_hash (backward compatibility)
193
- # @return [Hash] Returns the object in the form of hash
194
- def to_body
195
- to_hash
196
- end
197
-
198
- # Returns the object in the form of hash
199
- # @return [Hash] Returns the object in the form of hash
200
- def to_hash
201
- hash = {}
202
- self.class.attribute_map.each_pair do |attr, param|
203
- value = self.send(attr)
204
- next if value.nil?
205
- hash[param] = _to_hash(value)
206
- end
207
- hash
208
- end
209
-
210
- # Outputs non-array value in the form of hash
211
- # For object, use to_hash. Otherwise, just return the value
212
- # @param [Object] value Any valid value
213
- # @return [Hash] Returns the value in the form of hash
214
- def _to_hash(value)
215
- if value.is_a?(Array)
216
- value.compact.map { |v| _to_hash(v) }
217
- elsif value.is_a?(Hash)
218
- {}.tap do |hash|
219
- value.each { |k, v| hash[k] = _to_hash(v) }
220
- end
221
- elsif value.respond_to? :to_hash
222
- value.to_hash
223
- else
224
- value
225
- end
226
- end
227
-
228
- end
229
-
230
- end
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="qr_code_type.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
+ # Describes QR-code type
32
+ class QRCodeType
33
+
34
+ # QR-code type name
35
+ attr_accessor :name
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'name' => :'Name'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'name' => :'String'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+
59
+ if attributes.key?(:'Name')
60
+ self.name = attributes[:'Name']
61
+ end
62
+
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properies with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = []
69
+ return invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(other)
81
+ return true if self.equal?(other)
82
+ self.class == other.class &&
83
+ name == other.name
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(other)
89
+ self == other
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Fixnum] Hash code
94
+ def hash
95
+ [name].hash
96
+ end
97
+
98
+ # Downcases first letter.
99
+ # @return downcased string
100
+ def uncap(str)
101
+ str[0, 1].downcase + str[1..-1]
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.swagger_types.each_pair do |key, type|
110
+ pname = uncap(self.class.attribute_map[key]).intern
111
+ value = attributes[pname]
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the the attribute
114
+ # is documented as an array but the input is not
115
+ if value.is_a?(Array)
116
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
117
+ end
118
+ elsif !value.nil?
119
+ self.send("#{key}=", _deserialize(type, value))
120
+ end
121
+ # or else data not found in attributes(hash), not an issue as the data can be optional
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :DateTime
134
+ Date.parse value
135
+ when :Date
136
+ Date.parse value
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :BOOLEAN
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else
164
+ # model
165
+ # Signature type fix
166
+ ttype = type
167
+ if value.is_a?(Hash) and !value[:signatureType].nil?
168
+ ttype = value[:signatureType] + 'Signature'
169
+ end
170
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
171
+ temp_model.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ next if value.nil?
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -1,232 +1,221 @@
1
- #
2
- # --------------------------------------------------------------------------------------------------------------------
3
- # <copyright company="Aspose Pty Ltd" file="qr_code_collection.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
- # Describes collection of supported QRCode types.
32
- class QRCodeCollection
33
-
34
- # List of QRCode Types.
35
- attr_accessor :qr_code_types
36
-
37
- # Attribute mapping from ruby-style variable name to JSON key.
38
- def self.attribute_map
39
- {
40
- :'qr_code_types' => :'QRCodeTypes'
41
- }
42
- end
43
-
44
- # Attribute type mapping.
45
- def self.swagger_types
46
- {
47
- :'qr_code_types' => :'Array<QRCodeType>'
48
- }
49
- end
50
-
51
- # Initializes the object
52
- # @param [Hash] attributes Model attributes in the form of hash
53
- def initialize(attributes = {})
54
- return unless attributes.is_a?(Hash)
55
-
56
- # convert string to symbol for hash key
57
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
-
59
- if attributes.key?(:'QRCodeTypes')
60
- if (value = attributes[:'QRCodeTypes']).is_a?(Array)
61
- self.qr_code_types = value
62
- end
63
- end
64
-
65
-
66
- if !((defined? options_type) == nil)
67
- self.options_type = "QRCodeCollection"
68
- end
69
-
70
- end
71
-
72
- # Show invalid properties with the reasons. Usually used together with valid?
73
- # @return Array for valid properies with the reasons
74
- def list_invalid_properties
75
- invalid_properties = []
76
- return invalid_properties
77
- end
78
-
79
- # Check to see if the all the properties in the model are valid
80
- # @return true if the model is valid
81
- def valid?
82
- return true
83
- end
84
-
85
- # Checks equality by comparing each attribute.
86
- # @param [Object] Object to be compared
87
- def ==(other)
88
- return true if self.equal?(other)
89
- self.class == other.class &&
90
- qr_code_types == other.qr_code_types
91
- end
92
-
93
- # @see the `==` method
94
- # @param [Object] Object to be compared
95
- def eql?(other)
96
- self == other
97
- end
98
-
99
- # Calculates hash code according to all attributes.
100
- # @return [Fixnum] Hash code
101
- def hash
102
- [qr_code_types].hash
103
- end
104
-
105
- # Builds the object from hash
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- # @return [Object] Returns the model itself
108
- def build_from_hash(attributes)
109
- return nil unless attributes.is_a?(Hash)
110
- self.class.swagger_types.each_pair do |key, type|
111
-
112
- attributeName = self.class.attribute_map[key]
113
- attributeNameLowerStr = attributeName.to_s
114
- attributeNameLowerStr[0] = attributeNameLowerStr[0].downcase
115
- attributeNameLower = attributeNameLowerStr.to_sym
116
- attributeNameLowerStr2 = attributeName.to_s
117
- attributeNameLowerStr2[0] = attributeNameLowerStr[0].downcase
118
- attributeNameLowerStr2[1] = attributeNameLowerStr[1].downcase
119
- attributeNameLower2 = attributeNameLowerStr2.to_sym
120
-
121
- if type =~ /\AArray<(.*)>/i
122
- # check to ensure the input is an array given that the the attribute
123
- # is documented as an array but the input is not
124
- if attributes[attributeName].is_a?(Array)
125
- self.send("#{key}=", attributes[attributeName].map { |v| _deserialize($1, v) })
126
- end
127
- if attributes[attributeNameLower].is_a?(Array)
128
- self.send("#{key}=", attributes[attributeNameLower].map { |v| _deserialize($1, v) })
129
- end
130
- if attributes[attributeNameLower2].is_a?(Array)
131
- self.send("#{key}=", attributes[attributeNameLower2].map { |v| _deserialize($1, v) })
132
- end
133
- elsif !attributes[attributeName].nil?
134
- self.send("#{key}=", _deserialize(type, attributes[attributeName]))
135
- elsif !attributes[attributeNameLower].nil?
136
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower]))
137
- elsif !attributes[attributeNameLower2].nil?
138
- self.send("#{key}=", _deserialize(type, attributes[attributeNameLower2]))
139
- end
140
- # or else data not found in attributes(hash), not an issue as the data can be optional
141
- end
142
- self
143
- end
144
-
145
- # Deserializes the data based on type
146
- # @param string type Data type
147
- # @param string value Value to be deserialized
148
- # @return [Object] Deserialized data
149
- def _deserialize(type, value)
150
- case type.to_sym
151
- when :DateTime
152
- Time.at(/\d/.match(value)[0].to_f).to_datetime
153
- when :Date
154
- Time.at(/\d/.match(value)[0].to_f).to_date
155
- when :String
156
- value.to_s
157
- when :Integer
158
- value.to_i
159
- when :Float
160
- value.to_f
161
- when :BOOLEAN
162
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
- true
164
- else
165
- false
166
- end
167
- when :Object
168
- # generic object (usually a Hash), return directly
169
- value
170
- when /\AArray<(?<inner_type>.+)>\z/
171
- inner_type = Regexp.last_match[:inner_type]
172
- value.map { |v| _deserialize(inner_type, v) }
173
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
- k_type = Regexp.last_match[:k_type]
175
- v_type = Regexp.last_match[:v_type]
176
- {}.tap do |hash|
177
- value.each do |k, v|
178
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
- end
180
- end
181
- else
182
- # model
183
- temp_model = GroupDocsSignatureCloud.const_get(type).new
184
- temp_model.build_from_hash(value)
185
- end
186
- end
187
-
188
- # Returns the string representation of the object
189
- # @return [String] String presentation of the object
190
- def to_s
191
- to_hash.to_s
192
- end
193
-
194
- # to_body is an alias to to_hash (backward compatibility)
195
- # @return [Hash] Returns the object in the form of hash
196
- def to_body
197
- to_hash
198
- end
199
-
200
- # Returns the object in the form of hash
201
- # @return [Hash] Returns the object in the form of hash
202
- def to_hash
203
- hash = {}
204
- self.class.attribute_map.each_pair do |attr, param|
205
- value = self.send(attr)
206
- next if value.nil?
207
- hash[param] = _to_hash(value)
208
- end
209
- hash
210
- end
211
-
212
- # Outputs non-array value in the form of hash
213
- # For object, use to_hash. Otherwise, just return the value
214
- # @param [Object] value Any valid value
215
- # @return [Hash] Returns the value in the form of hash
216
- def _to_hash(value)
217
- if value.is_a?(Array)
218
- value.compact.map { |v| _to_hash(v) }
219
- elsif value.is_a?(Hash)
220
- {}.tap do |hash|
221
- value.each { |k, v| hash[k] = _to_hash(v) }
222
- end
223
- elsif value.respond_to? :to_hash
224
- value.to_hash
225
- else
226
- value
227
- end
228
- end
229
-
230
- end
231
-
232
- end
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="qr_codes_result.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
+ # Describes collection of supported QR-code types
32
+ class QRCodesResult
33
+
34
+ # List of QRCode Types
35
+ attr_accessor :qr_code_types
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'qr_code_types' => :'QrCodeTypes'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'qr_code_types' => :'Array<QRCodeType>'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+
59
+ if attributes.key?(:'QrCodeTypes')
60
+ if (value = attributes[:'QrCodeTypes']).is_a?(Array)
61
+ self.qr_code_types = value
62
+ end
63
+ end
64
+
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properies with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = []
71
+ return invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ return true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(other)
83
+ return true if self.equal?(other)
84
+ self.class == other.class &&
85
+ qr_code_types == other.qr_code_types
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(other)
91
+ self == other
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Fixnum] Hash code
96
+ def hash
97
+ [qr_code_types].hash
98
+ end
99
+
100
+ # Downcases first letter.
101
+ # @return downcased string
102
+ def uncap(str)
103
+ str[0, 1].downcase + str[1..-1]
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ pname = uncap(self.class.attribute_map[key]).intern
113
+ value = attributes[pname]
114
+ if type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the the attribute
116
+ # is documented as an array but the input is not
117
+ if value.is_a?(Array)
118
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !value.nil?
121
+ self.send("#{key}=", _deserialize(type, value))
122
+ end
123
+ # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ Date.parse value
137
+ when :Date
138
+ Date.parse value
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :BOOLEAN
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else
166
+ # model
167
+ # Signature type fix
168
+ ttype = type
169
+ if value.is_a?(Hash) and !value[:signatureType].nil?
170
+ ttype = value[:signatureType] + 'Signature'
171
+ end
172
+ temp_model = GroupDocsSignatureCloud.const_get(ttype).new
173
+ temp_model.build_from_hash(value)
174
+ end
175
+ end
176
+
177
+ # Returns the string representation of the object
178
+ # @return [String] String presentation of the object
179
+ def to_s
180
+ to_hash.to_s
181
+ end
182
+
183
+ # to_body is an alias to to_hash (backward compatibility)
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_body
186
+ to_hash
187
+ end
188
+
189
+ # Returns the object in the form of hash
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_hash
192
+ hash = {}
193
+ self.class.attribute_map.each_pair do |attr, param|
194
+ value = self.send(attr)
195
+ next if value.nil?
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end