Class: Azure::ARM::Web::Models::CsmUsageQuota

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/azure_mgmt_web/models/csm_usage_quota.rb

Overview

Usage of the quota resource

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_valueInteger

Returns The current value of the resource counter.

Returns:

  • (Integer)

    The current value of the resource counter



22
23
24
# File 'lib/azure_mgmt_web/models/csm_usage_quota.rb', line 22

def current_value
  @current_value
end

#limitInteger

Returns The resource limit.

Returns:

  • (Integer)

    The resource limit



25
26
27
# File 'lib/azure_mgmt_web/models/csm_usage_quota.rb', line 25

def limit
  @limit
end

#nameLocalizableString

Returns Quota name.

Returns:



28
29
30
# File 'lib/azure_mgmt_web/models/csm_usage_quota.rb', line 28

def name
  @name
end

#next_reset_timeDateTime

Returns Next reset time for the resource counter.

Returns:

  • (DateTime)

    Next reset time for the resource counter



19
20
21
# File 'lib/azure_mgmt_web/models/csm_usage_quota.rb', line 19

def next_reset_time
  @next_reset_time
end

#unitString

Returns Units of measurement for the quota resourse.

Returns:

  • (String)

    Units of measurement for the quota resourse



16
17
18
# File 'lib/azure_mgmt_web/models/csm_usage_quota.rb', line 16

def unit
  @unit
end

Class Method Details

.deserialize_object(object) ⇒ CsmUsageQuota

Deserializes given Ruby Hash into Model object.

Parameters:

  • object (Hash)

    Ruby Hash object to deserialize.

Returns:



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/azure_mgmt_web/models/csm_usage_quota.rb', line 73

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

  deserialized_property = object['unit']
  output_object.unit = 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['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['name']
  unless deserialized_property.nil?
    deserialized_property = LocalizableString.deserialize_object(deserialized_property)
  end
  output_object.name = 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
60
61
62
63
64
65
66
# File 'lib/azure_mgmt_web/models/csm_usage_quota.rb', line 42

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

  serialized_property = object.unit
  output_object['unit'] = 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.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.name
  unless serialized_property.nil?
    serialized_property = LocalizableString.serialize_object(serialized_property)
  end
  output_object['name'] = serialized_property unless serialized_property.nil?

  output_object
end

Instance Method Details

#validateObject

Validate the object. Throws ValidationError if validation fails.



33
34
35
# File 'lib/azure_mgmt_web/models/csm_usage_quota.rb', line 33

def validate
  @name.validate unless @name.nil?
end