Class: Azure::ARM::Compute::Models::PurchasePlan

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

Overview

Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.

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.



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

def name
  @name
end

#productString

Returns Gets or sets the product ID.

Returns:

  • (String)

    Gets or sets the product ID.



23
24
25
# File 'lib/azure_mgmt_compute/models/purchase_plan.rb', line 23

def product
  @product
end

#publisherString

Returns Gets or sets the publisher ID.

Returns:

  • (String)

    Gets or sets the publisher ID.



17
18
19
# File 'lib/azure_mgmt_compute/models/purchase_plan.rb', line 17

def publisher
  @publisher
end

Class Method Details

.deserialize_object(object) ⇒ PurchasePlan

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/azure_mgmt_compute/models/purchase_plan.rb', line 60

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

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

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

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



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

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

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

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

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

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



28
29
30
31
32
# File 'lib/azure_mgmt_compute/models/purchase_plan.rb', line 28

def validate
  fail MsRest::ValidationError, 'property publisher is nil' if @publisher.nil?
  fail MsRest::ValidationError, 'property name is nil' if @name.nil?
  fail MsRest::ValidationError, 'property product is nil' if @product.nil?
end