Class: MsRestAzure::SubResource

Inherits:
Object
  • Object
show all
Defined in:
lib/ms_rest_azure/sub_resource.rb

Overview

Class which represents any Azure subresource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idString

Returns the id of the subresource.

Returns:

  • (String)

    the id of the subresource.



12
13
14
# File 'lib/ms_rest_azure/sub_resource.rb', line 12

def id
  @id
end

Class Method Details

.deserialize_object(object) ⇒ SubResource

Deserializes given hash object into subresource.

Parameters:

  • object (Hash)

    subresource in hash representation to deserialize.

Returns:



34
35
36
37
38
39
40
41
42
43
# File 'lib/ms_rest_azure/sub_resource.rb', line 34

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

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

  output_object.validate
  output_object
end

.serialize_object(object) ⇒ Hash

Serializes given subresource object into hash.

Parameters:

  • object (SubResource)

    subresource object to serialize.

Returns:

  • (Hash)

    hash representation of subresource.



19
20
21
22
23
24
25
26
27
# File 'lib/ms_rest_azure/sub_resource.rb', line 19

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

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

  output_object
end

Instance Method Details

#validateObject

Validates the subresource. Throws error if there is any property is incorrect.



48
49
# File 'lib/ms_rest_azure/sub_resource.rb', line 48

def validate
end