# 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 DomainRegistrationInputProperties include MsRestAzure # @return [String] Name of the domain attr_accessor :name # @return [Contact] Admin contact information attr_accessor :contact_admin # @return [Contact] Billing contact information attr_accessor :contact_billing # @return [Contact] Registrant contact information attr_accessor :contact_registrant # @return [Contact] Technical contact information attr_accessor :contact_tech # @return [DomainStatus] Domain registration status. Possible values # include: 'Active', 'Awaiting', 'Cancelled', 'Confiscated', # 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', # 'Parked', 'Pending', 'Reserved', 'Reverted', 'Suspended', # 'Transferred', 'Unknown', 'Unlocked', 'Unparked', 'Updated', # 'JsonConverterFailed' attr_accessor :registration_status # @return [ProvisioningState] Domain provisioning state. Possible values # include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' attr_accessor :provisioning_state # @return [Array] Name servers attr_accessor :name_servers # @return [Boolean] If true then domain privacy is enabled for this # domain attr_accessor :privacy # @return [DateTime] Domain creation timestamp attr_accessor :created_time # @return [DateTime] Domain expiration timestamp attr_accessor :expiration_time # @return [DateTime] Timestamp when the domain was renewed last time attr_accessor :last_renewed_time # @return [Boolean] If true then domain will renewed automatically attr_accessor :auto_renew # @return [Boolean] If true then Azure can assign this domain to Web # Apps. This value will be true if domain registration status is active # and it is hosted on name servers Azure has programmatic access to attr_accessor :ready_for_dns_record_management # @return [Array] All hostnames derived from the domain and # assigned to Azure resources attr_accessor :managed_host_names # @return [DomainPurchaseConsent] Legal agreement consent attr_accessor :consent # @return Reasons why domain is not renewable attr_accessor :domain_not_renewable_reasons # # Validate the object. Throws ValidationError if validation fails. # def validate @contact_admin.validate unless @contact_admin.nil? @contact_billing.validate unless @contact_billing.nil? @contact_registrant.validate unless @contact_registrant.nil? @contact_tech.validate unless @contact_tech.nil? @name_servers.each{ |e| e.validate if e.respond_to?(:validate) } unless @name_servers.nil? @managed_host_names.each{ |e| e.validate if e.respond_to?(:validate) } unless @managed_host_names.nil? @consent.validate unless @consent.nil? @domain_not_renewable_reasons.each{ |e| e.validate if e.respond_to?(:validate) } unless @domain_not_renewable_reasons.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.name output_object['name'] = serialized_property unless serialized_property.nil? serialized_property = object.contact_admin unless serialized_property.nil? serialized_property = Contact.serialize_object(serialized_property) end output_object['contactAdmin'] = serialized_property unless serialized_property.nil? serialized_property = object.contact_billing unless serialized_property.nil? serialized_property = Contact.serialize_object(serialized_property) end output_object['contactBilling'] = serialized_property unless serialized_property.nil? serialized_property = object.contact_registrant unless serialized_property.nil? serialized_property = Contact.serialize_object(serialized_property) end output_object['contactRegistrant'] = serialized_property unless serialized_property.nil? serialized_property = object.contact_tech unless serialized_property.nil? serialized_property = Contact.serialize_object(serialized_property) end output_object['contactTech'] = serialized_property unless serialized_property.nil? serialized_property = object.registration_status output_object['registrationStatus'] = serialized_property unless serialized_property.nil? serialized_property = object.provisioning_state output_object['provisioningState'] = serialized_property unless serialized_property.nil? serialized_property = object.name_servers output_object['nameServers'] = serialized_property unless serialized_property.nil? serialized_property = object.privacy output_object['privacy'] = serialized_property unless serialized_property.nil? serialized_property = object.created_time serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['createdTime'] = serialized_property unless serialized_property.nil? serialized_property = object.expiration_time serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['expirationTime'] = serialized_property unless serialized_property.nil? serialized_property = object.last_renewed_time serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['lastRenewedTime'] = serialized_property unless serialized_property.nil? serialized_property = object.auto_renew output_object['autoRenew'] = serialized_property unless serialized_property.nil? serialized_property = object.ready_for_dns_record_management output_object['readyForDnsRecordManagement'] = serialized_property unless serialized_property.nil? serialized_property = object.managed_host_names unless serialized_property.nil? serializedArray = [] serialized_property.each do |element1| unless element1.nil? element1 = HostName.serialize_object(element1) end serializedArray.push(element1) end serialized_property = serializedArray end output_object['managedHostNames'] = serialized_property unless serialized_property.nil? serialized_property = object.consent unless serialized_property.nil? serialized_property = DomainPurchaseConsent.serialize_object(serialized_property) end output_object['consent'] = serialized_property unless serialized_property.nil? serialized_property = object.domain_not_renewable_reasons output_object['domainNotRenewableReasons'] = 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 [DomainRegistrationInputProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = DomainRegistrationInputProperties.new deserialized_property = object['name'] output_object.name = deserialized_property deserialized_property = object['contactAdmin'] unless deserialized_property.nil? deserialized_property = Contact.deserialize_object(deserialized_property) end output_object.contact_admin = deserialized_property deserialized_property = object['contactBilling'] unless deserialized_property.nil? deserialized_property = Contact.deserialize_object(deserialized_property) end output_object.contact_billing = deserialized_property deserialized_property = object['contactRegistrant'] unless deserialized_property.nil? deserialized_property = Contact.deserialize_object(deserialized_property) end output_object.contact_registrant = deserialized_property deserialized_property = object['contactTech'] unless deserialized_property.nil? deserialized_property = Contact.deserialize_object(deserialized_property) end output_object.contact_tech = deserialized_property deserialized_property = object['registrationStatus'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = DomainStatus.constants.any? { |e| DomainStatus.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum DomainStatus does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.registration_status = deserialized_property deserialized_property = object['provisioningState'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ProvisioningState.constants.any? { |e| ProvisioningState.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum ProvisioningState does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.provisioning_state = deserialized_property deserialized_property = object['nameServers'] output_object.name_servers = deserialized_property deserialized_property = object['privacy'] output_object.privacy = deserialized_property deserialized_property = object['createdTime'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.created_time = deserialized_property deserialized_property = object['expirationTime'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.expiration_time = deserialized_property deserialized_property = object['lastRenewedTime'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.last_renewed_time = deserialized_property deserialized_property = object['autoRenew'] output_object.auto_renew = deserialized_property deserialized_property = object['readyForDnsRecordManagement'] output_object.ready_for_dns_record_management = deserialized_property deserialized_property = object['managedHostNames'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element4| unless element4.nil? element4 = HostName.deserialize_object(element4) end deserialized_array.push(element4) end deserialized_property = deserialized_array end output_object.managed_host_names = deserialized_property deserialized_property = object['consent'] unless deserialized_property.nil? deserialized_property = DomainPurchaseConsent.deserialize_object(deserialized_property) end output_object.consent = deserialized_property deserialized_property = object['domainNotRenewableReasons'] output_object.domain_not_renewable_reasons = deserialized_property output_object end end end end