Class: Azure::ARM::Compute::Models::Plan

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

Overview

Plan for the resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString

Returns Gets or sets the plan ID.

Returns:

  • (String)

    Gets or sets the plan ID.



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

def name
  @name
end

#productString

Returns Gets or sets the offer ID.

Returns:

  • (String)

    Gets or sets the offer ID.



22
23
24
# File 'lib/azure_mgmt_compute/models/plan.rb', line 22

def product
  @product
end

#promotion_codeString

Returns Gets or sets the promotion code.

Returns:

  • (String)

    Gets or sets the promotion code.



25
26
27
# File 'lib/azure_mgmt_compute/models/plan.rb', line 25

def promotion_code
  @promotion_code
end

#publisherString

Returns Gets or sets the publisher ID.

Returns:

  • (String)

    Gets or sets the publisher ID.



19
20
21
# File 'lib/azure_mgmt_compute/models/plan.rb', line 19

def publisher
  @publisher
end

Class Method Details

.deserialize_object(object) ⇒ Plan

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:

  • (Plan)

    Deserialized object.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/azure_mgmt_compute/models/plan.rb', line 63

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

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

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

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

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



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/azure_mgmt_compute/models/plan.rb', line 39

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

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

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

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

  serialized_property = object.promotion_code
  output_object['promotionCode'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



30
31
32
# File 'lib/azure_mgmt_compute/models/plan.rb', line 30

def validate
  # Nothing to validate
end