Class: OCI::Usage::Models::ResourceQuotumSummary
- Inherits:
-
Object
- Object
- OCI::Usage::Models::ResourceQuotumSummary
- Defined in:
- lib/oci/usage/models/resource_quotum_summary.rb
Overview
The resource quota balance details.
Instance Attribute Summary collapse
-
#affected_resource ⇒ String
The affected resource name.
-
#balance ⇒ Float
The quota balance.
-
#is_allowed ⇒ BOOLEAN
Used to indicate if further quota consumption isAllowed.
-
#is_dependency ⇒ BOOLEAN
Used to indicate any resource dependencies.
-
#is_overage ⇒ BOOLEAN
Used to indicate if overages are incurred.
-
#limit ⇒ Float
The quota limit.
-
#name ⇒ String
The resource name.
-
#purchased_limit ⇒ Float
The purchased quota limit.
-
#service ⇒ String
The service name.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ResourceQuotumSummary
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ ResourceQuotumSummary
Initializes the object
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 134 135 136 137 138 139 140 141 142 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 97 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.name = attributes[:'name'] if attributes[:'name'] self.is_allowed = attributes[:'isAllowed'] unless attributes[:'isAllowed'].nil? self.is_allowed = true if is_allowed.nil? && !attributes.key?(:'isAllowed') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isAllowed and :is_allowed' if attributes.key?(:'isAllowed') && attributes.key?(:'is_allowed') self.is_allowed = attributes[:'is_allowed'] unless attributes[:'is_allowed'].nil? self.is_allowed = true if is_allowed.nil? && !attributes.key?(:'isAllowed') && !attributes.key?(:'is_allowed') # rubocop:disable Style/StringLiterals self.limit = attributes[:'limit'] if attributes[:'limit'] self.balance = attributes[:'balance'] if attributes[:'balance'] self.is_overage = attributes[:'isOverage'] unless attributes[:'isOverage'].nil? raise 'You cannot provide both :isOverage and :is_overage' if attributes.key?(:'isOverage') && attributes.key?(:'is_overage') self.is_overage = attributes[:'is_overage'] unless attributes[:'is_overage'].nil? self.purchased_limit = attributes[:'purchasedLimit'] if attributes[:'purchasedLimit'] raise 'You cannot provide both :purchasedLimit and :purchased_limit' if attributes.key?(:'purchasedLimit') && attributes.key?(:'purchased_limit') self.purchased_limit = attributes[:'purchased_limit'] if attributes[:'purchased_limit'] self.service = attributes[:'service'] if attributes[:'service'] self.is_dependency = attributes[:'isDependency'] unless attributes[:'isDependency'].nil? raise 'You cannot provide both :isDependency and :is_dependency' if attributes.key?(:'isDependency') && attributes.key?(:'is_dependency') self.is_dependency = attributes[:'is_dependency'] unless attributes[:'is_dependency'].nil? self.affected_resource = attributes[:'affectedResource'] if attributes[:'affectedResource'] raise 'You cannot provide both :affectedResource and :affected_resource' if attributes.key?(:'affectedResource') && attributes.key?(:'affected_resource') self.affected_resource = attributes[:'affected_resource'] if attributes[:'affected_resource'] end |
Instance Attribute Details
#affected_resource ⇒ String
The affected resource name.
46 47 48 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 46 def affected_resource @affected_resource end |
#balance ⇒ Float
The quota balance.
26 27 28 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 26 def balance @balance end |
#is_allowed ⇒ BOOLEAN
Used to indicate if further quota consumption isAllowed.
18 19 20 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 18 def is_allowed @is_allowed end |
#is_dependency ⇒ BOOLEAN
Used to indicate any resource dependencies.
42 43 44 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 42 def is_dependency @is_dependency end |
#is_overage ⇒ BOOLEAN
Used to indicate if overages are incurred.
30 31 32 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 30 def is_overage @is_overage end |
#limit ⇒ Float
The quota limit.
22 23 24 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 22 def limit @limit end |
#name ⇒ String
The resource name.
14 15 16 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 14 def name @name end |
#purchased_limit ⇒ Float
The purchased quota limit.
34 35 36 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 34 def purchased_limit @purchased_limit end |
#service ⇒ String
The service name.
38 39 40 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 38 def service @service end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 49 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'name': :'name', 'is_allowed': :'isAllowed', 'limit': :'limit', 'balance': :'balance', 'is_overage': :'isOverage', 'purchased_limit': :'purchasedLimit', 'service': :'service', 'is_dependency': :'isDependency', 'affected_resource': :'affectedResource' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 66 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'name': :'String', 'is_allowed': :'BOOLEAN', 'limit': :'Float', 'balance': :'Float', 'is_overage': :'BOOLEAN', 'purchased_limit': :'Float', 'service': :'String', 'is_dependency': :'BOOLEAN', 'affected_resource': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 151 def ==(other) return true if equal?(other) self.class == other.class && name == other.name && is_allowed == other.is_allowed && limit == other.limit && balance == other.balance && is_overage == other.is_overage && purchased_limit == other.purchased_limit && service == other.service && is_dependency == other.is_dependency && affected_resource == other.affected_resource end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 189 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
169 170 171 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 169 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
178 179 180 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 178 def hash [name, is_allowed, limit, balance, is_overage, purchased_limit, service, is_dependency, affected_resource].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
222 223 224 225 226 227 228 229 230 231 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 222 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
216 217 218 |
# File 'lib/oci/usage/models/resource_quotum_summary.rb', line 216 def to_s to_hash.to_s end |