Class: Azure::ARM::Resources::Models::ProviderResourceType

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

Overview

Resource type managed by the resource provider.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_versionsArray<String>

Returns Gets or sets the api version.

Returns:

  • (Array<String>)

    Gets or sets the api version.



23
24
25
# File 'lib/azure_mgmt_resources/models/provider_resource_type.rb', line 23

def api_versions
  @api_versions
end

#locationsArray<String>

this resource type can be created in.

Returns:

  • (Array<String>)

    Gets or sets the collection of locations where



20
21
22
# File 'lib/azure_mgmt_resources/models/provider_resource_type.rb', line 20

def locations
  @locations
end

#propertiesHash{String => String}

Returns Gets or sets the properties.

Returns:

  • (Hash{String => String})

    Gets or sets the properties.



26
27
28
# File 'lib/azure_mgmt_resources/models/provider_resource_type.rb', line 26

def properties
  @properties
end

#resource_typeString

Returns Gets or sets the resource type.

Returns:

  • (String)

    Gets or sets the resource type.



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

def resource_type
  @resource_type
end

Class Method Details

.deserialize_object(object) ⇒ ProviderResourceType

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/azure_mgmt_resources/models/provider_resource_type.rb', line 66

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

  deserialized_property = object['resourceType']
  output_object.resource_type = deserialized_property

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

  deserialized_property = object['apiVersions']
  output_object.api_versions = deserialized_property

  deserialized_property = object['properties']
  output_object.properties = 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.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/azure_mgmt_resources/models/provider_resource_type.rb', line 42

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

  serialized_property = object.resource_type
  output_object['resourceType'] = serialized_property unless serialized_property.nil?

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

  serialized_property = object.api_versions
  output_object['apiVersions'] = serialized_property unless serialized_property.nil?

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

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



31
32
33
34
35
# File 'lib/azure_mgmt_resources/models/provider_resource_type.rb', line 31

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