Class: Azure::ARM::Resources::Models::TagDetails

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_resources/models/tag_details.rb

Overview

Tag details.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countTagCount

Returns Gets or sets the tag count.

Returns:

  • (TagCount)

    Gets or sets the tag count.



22
23
24
# File 'lib/azure_mgmt_resources/models/tag_details.rb', line 22

def count
  @count
end

#idString

Returns Gets or sets the tag ID.

Returns:

  • (String)

    Gets or sets the tag ID.



16
17
18
# File 'lib/azure_mgmt_resources/models/tag_details.rb', line 16

def id
  @id
end

#tag_nameString

Returns Gets or sets the tag name.

Returns:

  • (String)

    Gets or sets the tag name.



19
20
21
# File 'lib/azure_mgmt_resources/models/tag_details.rb', line 19

def tag_name
  @tag_name
end

#valuesArray<TagValue>

Returns Gets or sets the list of tag values.

Returns:

  • (Array<TagValue>)

    Gets or sets the list of tag values.



25
26
27
# File 'lib/azure_mgmt_resources/models/tag_details.rb', line 25

def values
  @values
end

Class Method Details

.deserialize_object(object) ⇒ TagDetails

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



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
104
105
106
107
# File 'lib/azure_mgmt_resources/models/tag_details.rb', line 77

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

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

  deserialized_property = object['tagName']
  output_object.tag_name = deserialized_property

  deserialized_property = object['count']
  unless deserialized_property.nil?
    deserialized_property = TagCount.deserialize_object(deserialized_property)
  end
  output_object.count = deserialized_property

  deserialized_property = object['values']
  unless deserialized_property.nil?
    deserialized_array = []
    deserialized_property.each do |element1|
      unless element1.nil?
        element1 = TagValue.deserialize_object(element1)
      end
      deserialized_array.push(element1)
    end
    deserialized_property = deserialized_array
  end
  output_object.values = 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.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/azure_mgmt_resources/models/tag_details.rb', line 40

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

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

  serialized_property = object.tag_name
  output_object['tagName'] = serialized_property unless serialized_property.nil?

  serialized_property = object.count
  unless serialized_property.nil?
    serialized_property = TagCount.serialize_object(serialized_property)
  end
  output_object['count'] = serialized_property unless serialized_property.nil?

  serialized_property = object.values
  unless serialized_property.nil?
    serializedArray = []
    serialized_property.each do |element|
      unless element.nil?
        element = TagValue.serialize_object(element)
      end
      serializedArray.push(element)
    end
    serialized_property = serializedArray
  end
  output_object['values'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



30
31
32
33
# File 'lib/azure_mgmt_resources/models/tag_details.rb', line 30

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