# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ARM::Web module Models # # Model object. # class CertificateDetailsProperties include MsRestAzure # @return [Integer] Version attr_accessor :version # @return [String] Serial Number attr_accessor :serial_number # @return [String] Thumbprint attr_accessor :thumbprint # @return [String] Subject attr_accessor :subject # @return [DateTime] Valid from attr_accessor :not_before # @return [DateTime] Valid to attr_accessor :not_after # @return [String] Signature Algorithm attr_accessor :signature_algorithm # @return [String] Issuer attr_accessor :issuer # @return [String] Raw certificate data attr_accessor :raw_data # # Validate the object. Throws ValidationError if validation fails. # def validate # Nothing to validate end # # Serializes given Model object into Ruby Hash. # @param object Model object to serialize. # @return [Hash] Serialized object in form of Ruby Hash. # def self.serialize_object(object) object.validate output_object = {} serialized_property = object.version output_object['version'] = serialized_property unless serialized_property.nil? serialized_property = object.serial_number output_object['serialNumber'] = serialized_property unless serialized_property.nil? serialized_property = object.thumbprint output_object['thumbprint'] = serialized_property unless serialized_property.nil? serialized_property = object.subject output_object['subject'] = serialized_property unless serialized_property.nil? serialized_property = object.not_before serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['notBefore'] = serialized_property unless serialized_property.nil? serialized_property = object.not_after serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['notAfter'] = serialized_property unless serialized_property.nil? serialized_property = object.signature_algorithm output_object['signatureAlgorithm'] = serialized_property unless serialized_property.nil? serialized_property = object.issuer output_object['issuer'] = serialized_property unless serialized_property.nil? serialized_property = object.raw_data output_object['rawData'] = serialized_property unless serialized_property.nil? output_object end # # Deserializes given Ruby Hash into Model object. # @param object [Hash] Ruby Hash object to deserialize. # @return [CertificateDetailsProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = CertificateDetailsProperties.new deserialized_property = object['version'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.version = deserialized_property deserialized_property = object['serialNumber'] output_object.serial_number = deserialized_property deserialized_property = object['thumbprint'] output_object.thumbprint = deserialized_property deserialized_property = object['subject'] output_object.subject = deserialized_property deserialized_property = object['notBefore'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.not_before = deserialized_property deserialized_property = object['notAfter'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.not_after = deserialized_property deserialized_property = object['signatureAlgorithm'] output_object.signature_algorithm = deserialized_property deserialized_property = object['issuer'] output_object.issuer = deserialized_property deserialized_property = object['rawData'] output_object.raw_data = deserialized_property output_object end end end end