Class: Azure::ARM::Compute::Models::Plan
- Inherits:
-
Object
- Object
- Azure::ARM::Compute::Models::Plan
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_compute/models/plan.rb
Overview
Plan for the resource.
Instance Attribute Summary collapse
-
#name ⇒ String
Gets or sets the plan ID.
-
#product ⇒ String
Gets or sets the offer ID.
-
#promotion_code ⇒ String
Gets or sets the promotion code.
-
#publisher ⇒ String
Gets or sets the publisher ID.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ Plan
Deserializes given Ruby Hash into Model object.
-
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
Instance Method Summary collapse
-
#validate ⇒ Object
Validate the object.
Instance Attribute Details
#name ⇒ String
Returns Gets or sets the plan ID.
16 17 18 |
# File 'lib/azure_mgmt_compute/models/plan.rb', line 16 def name @name end |
#product ⇒ String
Returns Gets or sets the offer ID.
22 23 24 |
# File 'lib/azure_mgmt_compute/models/plan.rb', line 22 def product @product end |
#promotion_code ⇒ String
Returns 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 |
#publisher ⇒ String
Returns 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.
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.
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
#validate ⇒ Object
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 |