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