@@ -50,29 +50,6 @@ class Signature
5050
5151 # Gets or sets the subject distinguished name of the certificate that was used to sign the document.
5252 attr_accessor :subject_name
53-
54- class EnumAttributeValidator
55- attr_reader :datatype
56- attr_reader :allowable_values
57-
58- def initialize ( datatype , allowable_values )
59- @allowable_values = allowable_values . map do |value |
60- case datatype . to_s
61- when /Integer/i
62- value . to_i
63- when /Float/i
64- value . to_f
65- else
66- value
67- end
68- end
69- end
70-
71- def valid? ( value )
72- !value || allowable_values . include? ( value )
73- end
74- end
75-
7653 # Attribute mapping from ruby-style variable name to JSON key.
7754 def self . attribute_map
7855 {
@@ -139,27 +116,9 @@ def initialize(attributes = {})
139116 # Check to see if the all the properties in the model are valid
140117 # @return true if the model is valid
141118 def valid?
142- signature_type_validator = EnumAttributeValidator . new ( 'String' , [ "Unknown" , "CryptoApi" , "XmlDsig" ] )
143- return false unless signature_type_validator . valid? ( @signature_type )
144-
145119 return true
146120 end
147121
148- # Custom attribute writer method checking allowed values (enum).
149- # @param [Object] signature_type Object to be assigned
150- def signature_type = ( signature_type )
151- validator = EnumAttributeValidator . new ( 'String' , [ "Unknown" , "CryptoApi" , "XmlDsig" ] )
152- if signature_type . to_i == 0
153- unless validator . valid? ( signature_type )
154- raise ArgumentError , "invalid value for 'signature_type', must be one of #{ validator . allowable_values } ."
155- end
156- @signature_type = signature_type
157- else
158- @signature_type = validator . allowable_values [ signature_type . to_i ]
159- end
160- end
161-
162-
163122 # Checks equality by comparing each attribute.
164123 # @param [Object] Object to be compared
165124 def ==( other )
@@ -301,7 +260,6 @@ def collectFilesContent(resultFilesContent)
301260
302261 def validate ( )
303262 raise ArgumentError , 'Property is_valid in Signature is required.' if self . is_valid . nil?
304- raise ArgumentError , 'Property signature_type in Signature is required.' if self . signature_type . nil?
305263 raise ArgumentError , 'Property sign_time in Signature is required.' if self . sign_time . nil?
306264 end
307265
0 commit comments