Class: Azure::ARM::Web::Models::UsageProperties
- Inherits:
-
Object
- Object
- Azure::ARM::Web::Models::UsageProperties
- Includes:
- MsRestAzure
- Defined in:
- lib/azure_mgmt_web/models/usage_properties.rb
Overview
Model object.
Instance Attribute Summary collapse
-
#compute_mode ⇒ ComputeModeOptions
values include: ‘Shared’, ‘Dedicated’, ‘Dynamic’.
-
#current_value ⇒ Integer
The current value of the resource counter.
-
#display_name ⇒ String
Friendly name shown in the UI.
-
#limit ⇒ Integer
The resource limit.
-
#name ⇒ String
Name of the quota.
-
#next_reset_time ⇒ DateTime
Next reset time for the resource counter.
-
#resource_name ⇒ String
Name of the quota resource.
-
#site_mode ⇒ String
SiteMode used for this usage.
-
#unit ⇒ String
Units of measurement for the quota resource.
Class Method Summary collapse
-
.deserialize_object(object) ⇒ UsageProperties
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
#compute_mode ⇒ ComputeModeOptions
values include: ‘Shared’, ‘Dedicated’, ‘Dynamic’
38 39 40 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 38 def compute_mode @compute_mode end |
#current_value ⇒ Integer
Returns The current value of the resource counter.
28 29 30 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 28 def current_value @current_value end |
#display_name ⇒ String
Returns Friendly name shown in the UI.
16 17 18 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 16 def display_name @display_name end |
#limit ⇒ Integer
Returns The resource limit.
31 32 33 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 31 def limit @limit end |
#name ⇒ String
Returns Name of the quota.
19 20 21 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 19 def name @name end |
#next_reset_time ⇒ DateTime
Returns Next reset time for the resource counter.
34 35 36 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 34 def next_reset_time @next_reset_time end |
#resource_name ⇒ String
Returns Name of the quota resource.
22 23 24 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 22 def resource_name @resource_name end |
#site_mode ⇒ String
Returns SiteMode used for this usage.
41 42 43 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 41 def site_mode @site_mode end |
#unit ⇒ String
Returns Units of measurement for the quota resource.
25 26 27 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 25 def unit @unit end |
Class Method Details
.deserialize_object(object) ⇒ UsageProperties
Deserializes given Ruby Hash into Model object.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 94 def self.deserialize_object(object) return if object.nil? output_object = UsageProperties.new deserialized_property = object['displayName'] output_object.display_name = deserialized_property deserialized_property = object['name'] output_object.name = deserialized_property deserialized_property = object['resourceName'] output_object.resource_name = deserialized_property deserialized_property = object['unit'] output_object.unit = deserialized_property deserialized_property = object['currentValue'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.current_value = deserialized_property deserialized_property = object['limit'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.limit = deserialized_property deserialized_property = object['nextResetTime'] deserialized_property = DateTime.parse(deserialized_property) unless deserialized_property.to_s.empty? output_object.next_reset_time = deserialized_property deserialized_property = object['computeMode'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ComputeModeOptions.constants.any? { |e| ComputeModeOptions.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum ComputeModeOptions does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.compute_mode = deserialized_property deserialized_property = object['siteMode'] output_object.site_mode = deserialized_property output_object end |
.serialize_object(object) ⇒ Hash
Serializes given Model object into Ruby Hash.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 54 def self.serialize_object(object) object.validate output_object = {} serialized_property = object.display_name output_object['displayName'] = serialized_property unless serialized_property.nil? serialized_property = object.name output_object['name'] = serialized_property unless serialized_property.nil? serialized_property = object.resource_name output_object['resourceName'] = serialized_property unless serialized_property.nil? serialized_property = object.unit output_object['unit'] = serialized_property unless serialized_property.nil? serialized_property = object.current_value output_object['currentValue'] = serialized_property unless serialized_property.nil? serialized_property = object.limit output_object['limit'] = serialized_property unless serialized_property.nil? serialized_property = object.next_reset_time serialized_property = serialized_property.new_offset(0).strftime('%FT%TZ') output_object['nextResetTime'] = serialized_property unless serialized_property.nil? serialized_property = object.compute_mode output_object['computeMode'] = serialized_property unless serialized_property.nil? serialized_property = object.site_mode output_object['siteMode'] = serialized_property unless serialized_property.nil? output_object end |
Instance Method Details
#validate ⇒ Object
Validate the object. Throws ValidationError if validation fails.
46 47 |
# File 'lib/azure_mgmt_web/models/usage_properties.rb', line 46 def validate end |