Class: Azure::ARM::Web::Models::HostName

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_web/models/host_name.rb

Overview

Details of a hostname derived from a domain

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#azure_resource_nameString

to. If it is assigned to a traffic manager then it will be the traffic manager name otherwise it will be the website name

Returns:

  • (String)

    Name of the Azure resource the hostname is assigned



26
27
28
# File 'lib/azure_mgmt_web/models/host_name.rb', line 26

def azure_resource_name
  @azure_resource_name
end

#azure_resource_typeAzureResourceType

assigned to. Possible values include: ‘Website’, ‘TrafficManager’

Returns:



30
31
32
# File 'lib/azure_mgmt_web/models/host_name.rb', line 30

def azure_resource_type
  @azure_resource_type
end

#custom_host_name_dns_record_typeCustomHostNameDnsRecordType

values include: ‘CName’, ‘A’

Returns:



34
35
36
# File 'lib/azure_mgmt_web/models/host_name.rb', line 34

def custom_host_name_dns_record_type
  @custom_host_name_dns_record_type
end

#host_name_typeHostNameType

‘Verified’, ‘Managed’

Returns:

  • (HostNameType)

    Type of the hostname. Possible values include:



38
39
40
# File 'lib/azure_mgmt_web/models/host_name.rb', line 38

def host_name_type
  @host_name_type
end

#nameString

Returns Name of the hostname.

Returns:

  • (String)

    Name of the hostname



16
17
18
# File 'lib/azure_mgmt_web/models/host_name.rb', line 16

def name
  @name
end

#site_namesArray<String>

This list will have more than one site only if the hostname is pointing to a Traffic Manager

Returns:

  • (Array<String>)

    List of sites the hostname is assigned to.



21
22
23
# File 'lib/azure_mgmt_web/models/host_name.rb', line 21

def site_names
  @site_names
end

Class Method Details

.deserialize_object(object) ⇒ HostName

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/azure_mgmt_web/models/host_name.rb', line 82

def self.deserialize_object(object)
  return if object.nil?
  output_object = HostName.new

  deserialized_property = object['name']
  output_object.name = deserialized_property

  deserialized_property = object['siteNames']
  output_object.site_names = deserialized_property

  deserialized_property = object['azureResourceName']
  output_object.azure_resource_name = deserialized_property

  deserialized_property = object['azureResourceType']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = AzureResourceType.constants.any? { |e| AzureResourceType.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum AzureResourceType does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.azure_resource_type = deserialized_property

  deserialized_property = object['customHostNameDnsRecordType']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = CustomHostNameDnsRecordType.constants.any? { |e| CustomHostNameDnsRecordType.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum CustomHostNameDnsRecordType does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.custom_host_name_dns_record_type = deserialized_property

  deserialized_property = object['hostNameType']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = HostNameType.constants.any? { |e| HostNameType.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum HostNameType does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.host_name_type = deserialized_property

  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given Model object into Ruby Hash.

Parameters:

  • object

    Model object to serialize.

Returns:

  • (Hash)

    Serialized object in form of Ruby Hash.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/azure_mgmt_web/models/host_name.rb', line 52

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.site_names
  output_object['siteNames'] = serialized_property unless serialized_property.nil?

  serialized_property = object.azure_resource_name
  output_object['azureResourceName'] = serialized_property unless serialized_property.nil?

  serialized_property = object.azure_resource_type
  output_object['azureResourceType'] = serialized_property unless serialized_property.nil?

  serialized_property = object.custom_host_name_dns_record_type
  output_object['customHostNameDnsRecordType'] = serialized_property unless serialized_property.nil?

  serialized_property = object.host_name_type
  output_object['hostNameType'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



43
44
45
# File 'lib/azure_mgmt_web/models/host_name.rb', line 43

def validate
  @site_names.each{ |e| e.validate if e.respond_to?(:validate) } unless @site_names.nil?
end