# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.16.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 CertificateProperties include MsRestAzure # @return [String] Friendly name of the certificate attr_accessor :friendly_name # @return [String] Subject name of the certificate attr_accessor :subject_name # @return [Array] Host names the certificate applies to attr_accessor :host_names # @return [String] Pfx blob attr_accessor :pfx_blob # @return [String] App name attr_accessor :site_name # @return [String] Self link attr_accessor :self_link # @return [String] Certificate issuer attr_accessor :issuer # @return [DateTime] Certificate issue Date attr_accessor :issue_date # @return [DateTime] Certificate expriration date attr_accessor :expiration_date # @return [String] Certificate password attr_accessor :password # @return [String] Certificate thumbprint attr_accessor :thumbprint # @return [Boolean] Is the certificate valid? attr_accessor :valid # @return [String] Raw bytes of .cer file attr_accessor :cer_blob # @return [String] Public key hash attr_accessor :public_key_hash # @return [HostingEnvironmentProfile] Specification for the hosting # environment (App Service Environment) to use for the certificate attr_accessor :hosting_environment_profile # # Validate the object. Throws ValidationError if validation fails. # def validate @host_names.each{ |e| e.validate if e.respond_to?(:validate) } unless @host_names.nil? @hosting_environment_profile.validate unless @hosting_environment_profile.nil? 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.friendly_name output_object['friendlyName'] = serialized_property unless serialized_property.nil? serialized_property = object.subject_name output_object['subjectName'] = serialized_property unless serialized_property.nil? serialized_property = object.host_names output_object['hostNames'] = serialized_property unless serialized_property.nil? serialized_property = object.pfx_blob output_object['pfxBlob'] = serialized_property unless serialized_property.nil? serialized_property = object.site_name output_object['siteName'] = serialized_property unless serialized_property.nil? serialized_property = object.self_link output_object['selfLink'] = serialized_property unless serialized_property.nil? serialized_property = object.issuer output_object['issuer'] = serialized_property unless serialized_property.nil? serialized_property = object.issue_date serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['issueDate'] = serialized_property unless serialized_property.nil? serialized_property = object.expiration_date serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['expirationDate'] = serialized_property unless serialized_property.nil? serialized_property = object.password output_object['password'] = serialized_property unless serialized_property.nil? serialized_property = object.thumbprint output_object['thumbprint'] = serialized_property unless serialized_property.nil? serialized_property = object.valid output_object['valid'] = serialized_property unless serialized_property.nil? serialized_property = object.cer_blob output_object['cerBlob'] = serialized_property unless serialized_property.nil? serialized_property = object.public_key_hash output_object['publicKeyHash'] = serialized_property unless serialized_property.nil? serialized_property = object.hosting_environment_profile unless serialized_property.nil? serialized_property = HostingEnvironmentProfile.serialize_object(serialized_property) end output_object['hostingEnvironmentProfile'] = 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 [CertificateProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = CertificateProperties.new deserialized_property = object['friendlyName'] output_object.friendly_name = deserialized_property deserialized_property = object['subjectName'] output_object.subject_name = deserialized_property deserialized_property = object['hostNames'] output_object.host_names = deserialized_property deserialized_property = object['pfxBlob'] output_object.pfx_blob = deserialized_property deserialized_property = object['siteName'] output_object.site_name = deserialized_property deserialized_property = object['selfLink'] output_object.self_link = deserialized_property deserialized_property = object['issuer'] output_object.issuer = deserialized_property deserialized_property = object['issueDate'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.issue_date = deserialized_property deserialized_property = object['expirationDate'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.expiration_date = deserialized_property deserialized_property = object['password'] output_object.password = deserialized_property deserialized_property = object['thumbprint'] output_object.thumbprint = deserialized_property deserialized_property = object['valid'] output_object.valid = deserialized_property deserialized_property = object['cerBlob'] output_object.cer_blob = deserialized_property deserialized_property = object['publicKeyHash'] output_object.public_key_hash = deserialized_property deserialized_property = object['hostingEnvironmentProfile'] unless deserialized_property.nil? deserialized_property = HostingEnvironmentProfile.deserialize_object(deserialized_property) end output_object.hosting_environment_profile = deserialized_property output_object end end end end