Class: Azure::ARM::CDN::Models::OriginProperties

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_cdn/models/origin_properties.rb

Overview

Model object.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#host_nameString

Returns The host name of the origin.

Returns:

  • (String)

    The host name of the origin



16
17
18
# File 'lib/azure_mgmt_cdn/models/origin_properties.rb', line 16

def host_name
  @host_name
end

#http_portInteger

65535

Returns:

  • (Integer)

    The value of the http port, must be between 1 and



20
21
22
# File 'lib/azure_mgmt_cdn/models/origin_properties.rb', line 20

def http_port
  @http_port
end

#https_portInteger

65535

Returns:

  • (Integer)

    The value of the https port, must be between 1 and



24
25
26
# File 'lib/azure_mgmt_cdn/models/origin_properties.rb', line 24

def https_port
  @https_port
end

#provisioning_stateProvisioningState

Possible values include: ‘Creating’, ‘Succeeded’, ‘Failed’

Returns:



32
33
34
# File 'lib/azure_mgmt_cdn/models/origin_properties.rb', line 32

def provisioning_state
  @provisioning_state
end

#resource_stateOriginResourceState

values include: ‘Creating’, ‘Active’, ‘Deleting’

Returns:



28
29
30
# File 'lib/azure_mgmt_cdn/models/origin_properties.rb', line 28

def resource_state
  @resource_state
end

Class Method Details

.deserialize_object(object) ⇒ OriginProperties

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/azure_mgmt_cdn/models/origin_properties.rb', line 73

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

  deserialized_property = object['hostName']
  output_object.host_name = deserialized_property

  deserialized_property = object['httpPort']
  deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty?
  output_object.http_port = deserialized_property

  deserialized_property = object['httpsPort']
  deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty?
  output_object.https_port = deserialized_property

  deserialized_property = object['resourceState']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = OriginResourceState.constants.any? { |e| OriginResourceState.const_get(e).to_s.downcase == deserialized_property.downcase }
    warn 'Enum OriginResourceState does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid
  end
  output_object.resource_state = 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

  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.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/azure_mgmt_cdn/models/origin_properties.rb', line 46

def self.serialize_object(object)
  object.validate
  output_object = {}

  serialized_property = object.host_name
  output_object['hostName'] = serialized_property unless serialized_property.nil?

  serialized_property = object.http_port
  output_object['httpPort'] = serialized_property unless serialized_property.nil?

  serialized_property = object.https_port
  output_object['httpsPort'] = serialized_property unless serialized_property.nil?

  serialized_property = object.resource_state
  output_object['resourceState'] = serialized_property unless serialized_property.nil?

  serialized_property = object.provisioning_state
  output_object['provisioningState'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



37
38
39
# File 'lib/azure_mgmt_cdn/models/origin_properties.rb', line 37

def validate
  fail MsRest::ValidationError, 'property host_name is nil' if @host_name.nil?
end