Class: OCI::UsageApi::Models::UsageSummary
- Inherits:
-
Object
- Object
- OCI::UsageApi::Models::UsageSummary
- Defined in:
- lib/oci/usage_api/models/usage_summary.rb
Overview
The usage store result.
Instance Attribute Summary collapse
-
#ad ⇒ String
The availability domain of the usage.
-
#compartment_id ⇒ String
The compartment OCID.
-
#compartment_name ⇒ String
The compartment name.
-
#compartment_path ⇒ String
The compartment path, starting from root.
-
#computed_amount ⇒ Float
The computed cost.
-
#computed_quantity ⇒ Float
The usage number.
-
#currency ⇒ String
The price currency.
-
#discount ⇒ Float
The discretionary discount applied to the SKU.
-
#is_forecast ⇒ BOOLEAN
The forecasted data.
-
#list_rate ⇒ Float
The SKU list rate (not discount).
-
#overage ⇒ String
The overage usage.
-
#overages_flag ⇒ String
The SPM OverageFlag.
-
#platform ⇒ String
Platform for the cost.
-
#region ⇒ String
The region of the usage.
-
#resource_id ⇒ String
The resource OCID that is incurring the cost.
-
#resource_name ⇒ String
The resource name that is incurring the cost.
-
#service ⇒ String
The service name that is incurring the cost.
-
#shape ⇒ String
The resource shape.
-
#sku_name ⇒ String
The SKU friendly name.
-
#sku_part_number ⇒ String
The SKU part number.
-
#subscription_id ⇒ String
The subscription ID.
-
#tags ⇒ Array<OCI::UsageApi::Models::Tag>
For grouping, a tag definition.
-
#tenant_id ⇒ String
The tenancy OCID.
-
#tenant_name ⇒ String
The tenancy name.
-
#time_usage_ended ⇒ DateTime
**[Required]** The usage end time.
-
#time_usage_started ⇒ DateTime
**[Required]** The usage start time.
-
#unit ⇒ String
The usage unit.
-
#unit_price ⇒ Float
The price per unit.
-
#weight ⇒ Float
The resource size being metered.
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 = {}) ⇒ UsageSummary
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 = {}) ⇒ UsageSummary
Initializes the object
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 235 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.tenant_id = attributes[:'tenantId'] if attributes[:'tenantId'] raise 'You cannot provide both :tenantId and :tenant_id' if attributes.key?(:'tenantId') && attributes.key?(:'tenant_id') self.tenant_id = attributes[:'tenant_id'] if attributes[:'tenant_id'] self.tenant_name = attributes[:'tenantName'] if attributes[:'tenantName'] raise 'You cannot provide both :tenantName and :tenant_name' if attributes.key?(:'tenantName') && attributes.key?(:'tenant_name') self.tenant_name = attributes[:'tenant_name'] if attributes[:'tenant_name'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.compartment_path = attributes[:'compartmentPath'] if attributes[:'compartmentPath'] raise 'You cannot provide both :compartmentPath and :compartment_path' if attributes.key?(:'compartmentPath') && attributes.key?(:'compartment_path') self.compartment_path = attributes[:'compartment_path'] if attributes[:'compartment_path'] self.compartment_name = attributes[:'compartmentName'] if attributes[:'compartmentName'] raise 'You cannot provide both :compartmentName and :compartment_name' if attributes.key?(:'compartmentName') && attributes.key?(:'compartment_name') self.compartment_name = attributes[:'compartment_name'] if attributes[:'compartment_name'] self.service = attributes[:'service'] if attributes[:'service'] self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName'] raise 'You cannot provide both :resourceName and :resource_name' if attributes.key?(:'resourceName') && attributes.key?(:'resource_name') self.resource_name = attributes[:'resource_name'] if attributes[:'resource_name'] self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId'] raise 'You cannot provide both :resourceId and :resource_id' if attributes.key?(:'resourceId') && attributes.key?(:'resource_id') self.resource_id = attributes[:'resource_id'] if attributes[:'resource_id'] self.region = attributes[:'region'] if attributes[:'region'] self.ad = attributes[:'ad'] if attributes[:'ad'] self.weight = attributes[:'weight'] if attributes[:'weight'] self.shape = attributes[:'shape'] if attributes[:'shape'] self.sku_part_number = attributes[:'skuPartNumber'] if attributes[:'skuPartNumber'] raise 'You cannot provide both :skuPartNumber and :sku_part_number' if attributes.key?(:'skuPartNumber') && attributes.key?(:'sku_part_number') self.sku_part_number = attributes[:'sku_part_number'] if attributes[:'sku_part_number'] self.sku_name = attributes[:'skuName'] if attributes[:'skuName'] raise 'You cannot provide both :skuName and :sku_name' if attributes.key?(:'skuName') && attributes.key?(:'sku_name') self.sku_name = attributes[:'sku_name'] if attributes[:'sku_name'] self.unit = attributes[:'unit'] if attributes[:'unit'] self.discount = attributes[:'discount'] if attributes[:'discount'] self.list_rate = attributes[:'listRate'] if attributes[:'listRate'] raise 'You cannot provide both :listRate and :list_rate' if attributes.key?(:'listRate') && attributes.key?(:'list_rate') self.list_rate = attributes[:'list_rate'] if attributes[:'list_rate'] self.platform = attributes[:'platform'] if attributes[:'platform'] self.time_usage_started = attributes[:'timeUsageStarted'] if attributes[:'timeUsageStarted'] raise 'You cannot provide both :timeUsageStarted and :time_usage_started' if attributes.key?(:'timeUsageStarted') && attributes.key?(:'time_usage_started') self.time_usage_started = attributes[:'time_usage_started'] if attributes[:'time_usage_started'] self.time_usage_ended = attributes[:'timeUsageEnded'] if attributes[:'timeUsageEnded'] raise 'You cannot provide both :timeUsageEnded and :time_usage_ended' if attributes.key?(:'timeUsageEnded') && attributes.key?(:'time_usage_ended') self.time_usage_ended = attributes[:'time_usage_ended'] if attributes[:'time_usage_ended'] self.computed_amount = attributes[:'computedAmount'] if attributes[:'computedAmount'] raise 'You cannot provide both :computedAmount and :computed_amount' if attributes.key?(:'computedAmount') && attributes.key?(:'computed_amount') self.computed_amount = attributes[:'computed_amount'] if attributes[:'computed_amount'] self.computed_quantity = attributes[:'computedQuantity'] if attributes[:'computedQuantity'] raise 'You cannot provide both :computedQuantity and :computed_quantity' if attributes.key?(:'computedQuantity') && attributes.key?(:'computed_quantity') self.computed_quantity = attributes[:'computed_quantity'] if attributes[:'computed_quantity'] self.overages_flag = attributes[:'overagesFlag'] if attributes[:'overagesFlag'] raise 'You cannot provide both :overagesFlag and :overages_flag' if attributes.key?(:'overagesFlag') && attributes.key?(:'overages_flag') self.overages_flag = attributes[:'overages_flag'] if attributes[:'overages_flag'] self.unit_price = attributes[:'unitPrice'] if attributes[:'unitPrice'] raise 'You cannot provide both :unitPrice and :unit_price' if attributes.key?(:'unitPrice') && attributes.key?(:'unit_price') self.unit_price = attributes[:'unit_price'] if attributes[:'unit_price'] self.currency = attributes[:'currency'] if attributes[:'currency'] self.subscription_id = attributes[:'subscriptionId'] if attributes[:'subscriptionId'] raise 'You cannot provide both :subscriptionId and :subscription_id' if attributes.key?(:'subscriptionId') && attributes.key?(:'subscription_id') self.subscription_id = attributes[:'subscription_id'] if attributes[:'subscription_id'] self.overage = attributes[:'overage'] if attributes[:'overage'] self.is_forecast = attributes[:'isForecast'] unless attributes[:'isForecast'].nil? raise 'You cannot provide both :isForecast and :is_forecast' if attributes.key?(:'isForecast') && attributes.key?(:'is_forecast') self.is_forecast = attributes[:'is_forecast'] unless attributes[:'is_forecast'].nil? self. = attributes[:'tags'] if attributes[:'tags'] end |
Instance Attribute Details
#ad ⇒ String
The availability domain of the usage.
48 49 50 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 48 def ad @ad end |
#compartment_id ⇒ String
The compartment OCID.
20 21 22 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 20 def compartment_id @compartment_id end |
#compartment_name ⇒ String
The compartment name.
28 29 30 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 28 def compartment_name @compartment_name end |
#compartment_path ⇒ String
The compartment path, starting from root.
24 25 26 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 24 def compartment_path @compartment_path end |
#computed_amount ⇒ Float
The computed cost.
92 93 94 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 92 def computed_amount @computed_amount end |
#computed_quantity ⇒ Float
The usage number.
96 97 98 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 96 def computed_quantity @computed_quantity end |
#currency ⇒ String
The price currency.
108 109 110 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 108 def currency @currency end |
#discount ⇒ Float
The discretionary discount applied to the SKU.
72 73 74 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 72 def discount @discount end |
#is_forecast ⇒ BOOLEAN
The forecasted data.
120 121 122 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 120 def is_forecast @is_forecast end |
#list_rate ⇒ Float
The SKU list rate (not discount).
76 77 78 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 76 def list_rate @list_rate end |
#overage ⇒ String
The overage usage.
116 117 118 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 116 def overage @overage end |
#overages_flag ⇒ String
The SPM OverageFlag.
100 101 102 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 100 def overages_flag @overages_flag end |
#platform ⇒ String
Platform for the cost.
80 81 82 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 80 def platform @platform end |
#region ⇒ String
The region of the usage.
44 45 46 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 44 def region @region end |
#resource_id ⇒ String
The resource OCID that is incurring the cost.
40 41 42 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 40 def resource_id @resource_id end |
#resource_name ⇒ String
The resource name that is incurring the cost.
36 37 38 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 36 def resource_name @resource_name end |
#service ⇒ String
The service name that is incurring the cost.
32 33 34 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 32 def service @service end |
#shape ⇒ String
The resource shape.
56 57 58 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 56 def shape @shape end |
#sku_name ⇒ String
The SKU friendly name.
64 65 66 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 64 def sku_name @sku_name end |
#sku_part_number ⇒ String
The SKU part number.
60 61 62 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 60 def sku_part_number @sku_part_number end |
#subscription_id ⇒ String
The subscription ID.
112 113 114 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 112 def subscription_id @subscription_id end |
#tags ⇒ Array<OCI::UsageApi::Models::Tag>
For grouping, a tag definition. For filtering, a definition and key.
124 125 126 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 124 def @tags end |
#tenant_id ⇒ String
The tenancy OCID.
12 13 14 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 12 def tenant_id @tenant_id end |
#tenant_name ⇒ String
The tenancy name.
16 17 18 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 16 def tenant_name @tenant_name end |
#time_usage_ended ⇒ DateTime
**[Required]** The usage end time.
88 89 90 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 88 def time_usage_ended @time_usage_ended end |
#time_usage_started ⇒ DateTime
**[Required]** The usage start time.
84 85 86 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 84 def time_usage_started @time_usage_started end |
#unit ⇒ String
The usage unit.
68 69 70 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 68 def unit @unit end |
#unit_price ⇒ Float
The price per unit.
104 105 106 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 104 def unit_price @unit_price end |
#weight ⇒ Float
The resource size being metered.
52 53 54 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 52 def weight @weight end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 127 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'tenant_id': :'tenantId', 'tenant_name': :'tenantName', 'compartment_id': :'compartmentId', 'compartment_path': :'compartmentPath', 'compartment_name': :'compartmentName', 'service': :'service', 'resource_name': :'resourceName', 'resource_id': :'resourceId', 'region': :'region', 'ad': :'ad', 'weight': :'weight', 'shape': :'shape', 'sku_part_number': :'skuPartNumber', 'sku_name': :'skuName', 'unit': :'unit', 'discount': :'discount', 'list_rate': :'listRate', 'platform': :'platform', 'time_usage_started': :'timeUsageStarted', 'time_usage_ended': :'timeUsageEnded', 'computed_amount': :'computedAmount', 'computed_quantity': :'computedQuantity', 'overages_flag': :'overagesFlag', 'unit_price': :'unitPrice', 'currency': :'currency', 'subscription_id': :'subscriptionId', 'overage': :'overage', 'is_forecast': :'isForecast', 'tags': :'tags' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 164 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'tenant_id': :'String', 'tenant_name': :'String', 'compartment_id': :'String', 'compartment_path': :'String', 'compartment_name': :'String', 'service': :'String', 'resource_name': :'String', 'resource_id': :'String', 'region': :'String', 'ad': :'String', 'weight': :'Float', 'shape': :'String', 'sku_part_number': :'String', 'sku_name': :'String', 'unit': :'String', 'discount': :'Float', 'list_rate': :'Float', 'platform': :'String', 'time_usage_started': :'DateTime', 'time_usage_ended': :'DateTime', 'computed_amount': :'Float', 'computed_quantity': :'Float', 'overages_flag': :'String', 'unit_price': :'Float', 'currency': :'String', 'subscription_id': :'String', 'overage': :'String', 'is_forecast': :'BOOLEAN', 'tags': :'Array<OCI::UsageApi::Models::Tag>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 379 def ==(other) return true if equal?(other) self.class == other.class && tenant_id == other.tenant_id && tenant_name == other.tenant_name && compartment_id == other.compartment_id && compartment_path == other.compartment_path && compartment_name == other.compartment_name && service == other.service && resource_name == other.resource_name && resource_id == other.resource_id && region == other.region && ad == other.ad && weight == other.weight && shape == other.shape && sku_part_number == other.sku_part_number && sku_name == other.sku_name && unit == other.unit && discount == other.discount && list_rate == other.list_rate && platform == other.platform && time_usage_started == other.time_usage_started && time_usage_ended == other.time_usage_ended && computed_amount == other.computed_amount && computed_quantity == other.computed_quantity && overages_flag == other.overages_flag && unit_price == other.unit_price && currency == other.currency && subscription_id == other.subscription_id && overage == other.overage && is_forecast == other.is_forecast && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 437 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
417 418 419 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 417 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
426 427 428 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 426 def hash [tenant_id, tenant_name, compartment_id, compartment_path, compartment_name, service, resource_name, resource_id, region, ad, weight, shape, sku_part_number, sku_name, unit, discount, list_rate, platform, time_usage_started, time_usage_ended, computed_amount, computed_quantity, overages_flag, unit_price, currency, subscription_id, overage, is_forecast, ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
470 471 472 473 474 475 476 477 478 479 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 470 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
464 465 466 |
# File 'lib/oci/usage_api/models/usage_summary.rb', line 464 def to_s to_hash.to_s end |