Class: Azure::ARM::Compute::Models::InstanceViewStatus

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_compute/models/instance_view_status.rb

Overview

Instance view status.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeString

Returns Gets or sets the status Code.

Returns:

  • (String)

    Gets or sets the status Code.



16
17
18
# File 'lib/azure_mgmt_compute/models/instance_view_status.rb', line 16

def code
  @code
end

#display_statusString

status.

Returns:

  • (String)

    Gets or sets the short localizable label for the



24
25
26
# File 'lib/azure_mgmt_compute/models/instance_view_status.rb', line 24

def display_status
  @display_status
end

#levelStatusLevelTypes

values for this property include: ‘Info’, ‘Warning’, ‘Error’.

Returns:



20
21
22
# File 'lib/azure_mgmt_compute/models/instance_view_status.rb', line 20

def level
  @level
end

#messageString

for alerts and error messages.

Returns:

  • (String)

    Gets or sets the optional detailed Message, including



28
29
30
# File 'lib/azure_mgmt_compute/models/instance_view_status.rb', line 28

def message
  @message
end

#timeDateTime

Returns Gets or sets the time of the status.

Returns:

  • (DateTime)

    Gets or sets the time of the status.



31
32
33
# File 'lib/azure_mgmt_compute/models/instance_view_status.rb', line 31

def time
  @time
end

Class Method Details

.deserialize_object(object) ⇒ InstanceViewStatus

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



72
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
# File 'lib/azure_mgmt_compute/models/instance_view_status.rb', line 72

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

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

  deserialized_property = object['level']
  if (!deserialized_property.nil? && !deserialized_property.empty?)
    enum_is_valid = StatusLevelTypes.constants.any? { |e| StatusLevelTypes.const_get(e).to_s.downcase == deserialized_property.downcase }
    fail MsRest::DeserializationError.new('Error occured while deserializing the enum', nil, nil, nil) unless enum_is_valid
  end
  output_object.level = deserialized_property

  deserialized_property = object['displayStatus']
  output_object.display_status = deserialized_property

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

  deserialized_property = object['time']
  deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty?
  output_object.time = deserialized_property

  output_object.validate

  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.



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

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

  serialized_property = object.code
  output_object['code'] = serialized_property unless serialized_property.nil?

  serialized_property = object.level
  output_object['level'] = serialized_property unless serialized_property.nil?

  serialized_property = object.display_status
  output_object['displayStatus'] = serialized_property unless serialized_property.nil?

  serialized_property = object.message
  output_object['message'] = serialized_property unless serialized_property.nil?

  serialized_property = object.time
  serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ')
  output_object['time'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



36
37
# File 'lib/azure_mgmt_compute/models/instance_view_status.rb', line 36

def validate
end