Class: OCI::OsubUsage::Models::ComputedUsage
- Inherits:
-
Object
- Object
- OCI::OsubUsage::Models::ComputedUsage
- Defined in:
- lib/oci/osub_usage/models/computed_usage.rb
Overview
Computed Usage Summary object
Constant Summary collapse
- TYPE_ENUM =
[ TYPE_PROMOTION = 'PROMOTION'.freeze, TYPE_DO_NOT_BILL = 'DO_NOT_BILL'.freeze, TYPE_USAGE = 'USAGE'.freeze, TYPE_COMMIT = 'COMMIT'.freeze, TYPE_OVERAGE = 'OVERAGE'.freeze, TYPE_PAY_AS_YOU_GO = 'PAY_AS_YOU_GO'.freeze, TYPE_MONTHLY_MINIMUM = 'MONTHLY_MINIMUM'.freeze, TYPE_DELAYED_USAGE_INVOICE_TIMING = 'DELAYED_USAGE_INVOICE_TIMING'.freeze, TYPE_DELAYED_USAGE_COMMITMENT_EXP = 'DELAYED_USAGE_COMMITMENT_EXP'.freeze, TYPE_ON_ACCOUNT_CREDIT = 'ON_ACCOUNT_CREDIT'.freeze, TYPE_SERVICE_CREDIT = 'SERVICE_CREDIT'.freeze, TYPE_COMMITMENT_EXPIRATION = 'COMMITMENT_EXPIRATION'.freeze, TYPE_FUNDED_ALLOCATION = 'FUNDED_ALLOCATION'.freeze, TYPE_DONOT_BILL_USAGE_POST_TERMINATION = 'DONOT_BILL_USAGE_POST_TERMINATION'.freeze, TYPE_DELAYED_USAGE_POST_TERMINATION = 'DELAYED_USAGE_POST_TERMINATION'.freeze, TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#commitment_service_id ⇒ String
Subscribed service commitmentId.
-
#compute_source ⇒ String
SPM Internal compute records source .
-
#cost ⇒ String
Computed Line Amount not rounded.
-
#cost_rounded ⇒ String
Computed Line Amount rounded.
-
#currency_code ⇒ String
Currency code.
-
#data_center ⇒ String
Data Center Attribute as sent by MQS to SPM.
-
#id ⇒ String
[Required] SPM Internal computed usage Id , 32 character string.
-
#is_invoiced ⇒ BOOLEAN
Invoicing status for the aggregated compute usage.
-
#mqs_message_id ⇒ String
MQS Identfier send to SPM , SPM does not transform this attribute and is received as is.
-
#net_unit_price ⇒ String
Net Unit Price for the product in consideration, price actual.
-
#original_usage_number ⇒ String
SPM Internal Original usage Line number identifier in SPM coming from Metered Services entity.
- #parent_product ⇒ OCI::OsubUsage::Models::Product
-
#parent_subscribed_service_id ⇒ String
Subscribed service line parent id.
-
#plan_number ⇒ String
Subscription plan number.
- #product ⇒ OCI::OsubUsage::Models::Product
-
#quantity ⇒ String
Total Quantity that was used for computation.
-
#rate_card_id ⇒ String
Ratecard Id at subscribed service level.
-
#rate_card_tierd_id ⇒ String
References the tier in the ratecard for that usage (OCI will be using the same reference to cross-reference for correctness on the usage csv report), comes from Entity OBSCNTR_IPT_PRODUCTTIER.
-
#time_created ⇒ DateTime
Computed Usage created time, expressed in RFC 3339 timestamp format.
-
#time_metered_on ⇒ DateTime
Metered Service date, expressed in RFC 3339 timestamp format.
-
#time_of_arrival ⇒ DateTime
Usae computation date, expressed in RFC 3339 timestamp format.
-
#time_updated ⇒ DateTime
Computed Usage updated time, expressed in RFC 3339 timestamp format.
-
#type ⇒ String
Usage compute type in SPM.
-
#unit_of_measure ⇒ String
Unit of Messure.
-
#usage_number ⇒ String
SPM Internal usage Line number identifier in SPM coming from Metered Services entity.
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 = {}) ⇒ ComputedUsage
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 = {}) ⇒ ComputedUsage
Initializes the object
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 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 250 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.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated'] raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated') self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated'] self.parent_subscribed_service_id = attributes[:'parentSubscribedServiceId'] if attributes[:'parentSubscribedServiceId'] raise 'You cannot provide both :parentSubscribedServiceId and :parent_subscribed_service_id' if attributes.key?(:'parentSubscribedServiceId') && attributes.key?(:'parent_subscribed_service_id') self.parent_subscribed_service_id = attributes[:'parent_subscribed_service_id'] if attributes[:'parent_subscribed_service_id'] self.parent_product = attributes[:'parentProduct'] if attributes[:'parentProduct'] raise 'You cannot provide both :parentProduct and :parent_product' if attributes.key?(:'parentProduct') && attributes.key?(:'parent_product') self.parent_product = attributes[:'parent_product'] if attributes[:'parent_product'] self.plan_number = attributes[:'planNumber'] if attributes[:'planNumber'] raise 'You cannot provide both :planNumber and :plan_number' if attributes.key?(:'planNumber') && attributes.key?(:'plan_number') self.plan_number = attributes[:'plan_number'] if attributes[:'plan_number'] self.currency_code = attributes[:'currencyCode'] if attributes[:'currencyCode'] raise 'You cannot provide both :currencyCode and :currency_code' if attributes.key?(:'currencyCode') && attributes.key?(:'currency_code') self.currency_code = attributes[:'currency_code'] if attributes[:'currency_code'] self.rate_card_tierd_id = attributes[:'rateCardTierdId'] if attributes[:'rateCardTierdId'] raise 'You cannot provide both :rateCardTierdId and :rate_card_tierd_id' if attributes.key?(:'rateCardTierdId') && attributes.key?(:'rate_card_tierd_id') self.rate_card_tierd_id = attributes[:'rate_card_tierd_id'] if attributes[:'rate_card_tierd_id'] self.rate_card_id = attributes[:'rateCardId'] if attributes[:'rateCardId'] raise 'You cannot provide both :rateCardId and :rate_card_id' if attributes.key?(:'rateCardId') && attributes.key?(:'rate_card_id') self.rate_card_id = attributes[:'rate_card_id'] if attributes[:'rate_card_id'] self.compute_source = attributes[:'computeSource'] if attributes[:'computeSource'] raise 'You cannot provide both :computeSource and :compute_source' if attributes.key?(:'computeSource') && attributes.key?(:'compute_source') self.compute_source = attributes[:'compute_source'] if attributes[:'compute_source'] self.data_center = attributes[:'dataCenter'] if attributes[:'dataCenter'] raise 'You cannot provide both :dataCenter and :data_center' if attributes.key?(:'dataCenter') && attributes.key?(:'data_center') self.data_center = attributes[:'data_center'] if attributes[:'data_center'] self. = attributes[:'mqsMessageId'] if attributes[:'mqsMessageId'] raise 'You cannot provide both :mqsMessageId and :mqs_message_id' if attributes.key?(:'mqsMessageId') && attributes.key?(:'mqs_message_id') self. = attributes[:'mqs_message_id'] if attributes[:'mqs_message_id'] self.id = attributes[:'id'] if attributes[:'id'] self.quantity = attributes[:'quantity'] if attributes[:'quantity'] self.usage_number = attributes[:'usageNumber'] if attributes[:'usageNumber'] raise 'You cannot provide both :usageNumber and :usage_number' if attributes.key?(:'usageNumber') && attributes.key?(:'usage_number') self.usage_number = attributes[:'usage_number'] if attributes[:'usage_number'] self.original_usage_number = attributes[:'originalUsageNumber'] if attributes[:'originalUsageNumber'] raise 'You cannot provide both :originalUsageNumber and :original_usage_number' if attributes.key?(:'originalUsageNumber') && attributes.key?(:'original_usage_number') self.original_usage_number = attributes[:'original_usage_number'] if attributes[:'original_usage_number'] self.commitment_service_id = attributes[:'commitmentServiceId'] if attributes[:'commitmentServiceId'] raise 'You cannot provide both :commitmentServiceId and :commitment_service_id' if attributes.key?(:'commitmentServiceId') && attributes.key?(:'commitment_service_id') self.commitment_service_id = attributes[:'commitment_service_id'] if attributes[:'commitment_service_id'] self.is_invoiced = attributes[:'isInvoiced'] unless attributes[:'isInvoiced'].nil? raise 'You cannot provide both :isInvoiced and :is_invoiced' if attributes.key?(:'isInvoiced') && attributes.key?(:'is_invoiced') self.is_invoiced = attributes[:'is_invoiced'] unless attributes[:'is_invoiced'].nil? self.type = attributes[:'type'] if attributes[:'type'] self.time_of_arrival = attributes[:'timeOfArrival'] if attributes[:'timeOfArrival'] raise 'You cannot provide both :timeOfArrival and :time_of_arrival' if attributes.key?(:'timeOfArrival') && attributes.key?(:'time_of_arrival') self.time_of_arrival = attributes[:'time_of_arrival'] if attributes[:'time_of_arrival'] self.time_metered_on = attributes[:'timeMeteredOn'] if attributes[:'timeMeteredOn'] raise 'You cannot provide both :timeMeteredOn and :time_metered_on' if attributes.key?(:'timeMeteredOn') && attributes.key?(:'time_metered_on') self.time_metered_on = attributes[:'time_metered_on'] if attributes[:'time_metered_on'] self.net_unit_price = attributes[:'netUnitPrice'] if attributes[:'netUnitPrice'] raise 'You cannot provide both :netUnitPrice and :net_unit_price' if attributes.key?(:'netUnitPrice') && attributes.key?(:'net_unit_price') self.net_unit_price = attributes[:'net_unit_price'] if attributes[:'net_unit_price'] self.cost_rounded = attributes[:'costRounded'] if attributes[:'costRounded'] raise 'You cannot provide both :costRounded and :cost_rounded' if attributes.key?(:'costRounded') && attributes.key?(:'cost_rounded') self.cost_rounded = attributes[:'cost_rounded'] if attributes[:'cost_rounded'] self.cost = attributes[:'cost'] if attributes[:'cost'] self.product = attributes[:'product'] if attributes[:'product'] self.unit_of_measure = attributes[:'unitOfMeasure'] if attributes[:'unitOfMeasure'] raise 'You cannot provide both :unitOfMeasure and :unit_of_measure' if attributes.key?(:'unitOfMeasure') && attributes.key?(:'unit_of_measure') self.unit_of_measure = attributes[:'unit_of_measure'] if attributes[:'unit_of_measure'] end |
Instance Attribute Details
#commitment_service_id ⇒ String
Subscribed service commitmentId.
108 109 110 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 108 def commitment_service_id @commitment_service_id end |
#compute_source ⇒ String
SPM Internal compute records source .
73 74 75 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 73 def compute_source @compute_source end |
#cost ⇒ String
Computed Line Amount not rounded
143 144 145 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 143 def cost @cost end |
#cost_rounded ⇒ String
Computed Line Amount rounded.
138 139 140 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 138 def cost_rounded @cost_rounded end |
#currency_code ⇒ String
Currency code
58 59 60 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 58 def currency_code @currency_code end |
#data_center ⇒ String
Data Center Attribute as sent by MQS to SPM.
78 79 80 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 78 def data_center @data_center end |
#id ⇒ String
[Required] SPM Internal computed usage Id , 32 character string
88 89 90 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 88 def id @id end |
#is_invoiced ⇒ BOOLEAN
Invoicing status for the aggregated compute usage
113 114 115 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 113 def is_invoiced @is_invoiced end |
#mqs_message_id ⇒ String
MQS Identfier send to SPM , SPM does not transform this attribute and is received as is.
83 84 85 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 83 def @mqs_message_id end |
#net_unit_price ⇒ String
Net Unit Price for the product in consideration, price actual.
133 134 135 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 133 def net_unit_price @net_unit_price end |
#original_usage_number ⇒ String
SPM Internal Original usage Line number identifier in SPM coming from Metered Services entity.
103 104 105 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 103 def original_usage_number @original_usage_number end |
#parent_product ⇒ OCI::OsubUsage::Models::Product
48 49 50 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 48 def parent_product @parent_product end |
#parent_subscribed_service_id ⇒ String
Subscribed service line parent id
45 46 47 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 45 def parent_subscribed_service_id @parent_subscribed_service_id end |
#plan_number ⇒ String
Subscription plan number
53 54 55 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 53 def plan_number @plan_number end |
#product ⇒ OCI::OsubUsage::Models::Product
146 147 148 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 146 def product @product end |
#quantity ⇒ String
Total Quantity that was used for computation
93 94 95 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 93 def quantity @quantity end |
#rate_card_id ⇒ String
Ratecard Id at subscribed service level
68 69 70 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 68 def rate_card_id @rate_card_id end |
#rate_card_tierd_id ⇒ String
References the tier in the ratecard for that usage (OCI will be using the same reference to cross-reference for correctness on the usage csv report), comes from Entity OBSCNTR_IPT_PRODUCTTIER.
63 64 65 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 63 def rate_card_tierd_id @rate_card_tierd_id end |
#time_created ⇒ DateTime
Computed Usage created time, expressed in RFC 3339 timestamp format.
35 36 37 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 35 def time_created @time_created end |
#time_metered_on ⇒ DateTime
Metered Service date, expressed in RFC 3339 timestamp format.
128 129 130 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 128 def time_metered_on @time_metered_on end |
#time_of_arrival ⇒ DateTime
Usae computation date, expressed in RFC 3339 timestamp format.
123 124 125 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 123 def time_of_arrival @time_of_arrival end |
#time_updated ⇒ DateTime
Computed Usage updated time, expressed in RFC 3339 timestamp format.
40 41 42 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 40 def time_updated @time_updated end |
#type ⇒ String
Usage compute type in SPM.
118 119 120 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 118 def type @type end |
#unit_of_measure ⇒ String
Unit of Messure
151 152 153 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 151 def unit_of_measure @unit_of_measure end |
#usage_number ⇒ String
SPM Internal usage Line number identifier in SPM coming from Metered Services entity.
98 99 100 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 98 def usage_number @usage_number end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 154 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'time_created': :'timeCreated', 'time_updated': :'timeUpdated', 'parent_subscribed_service_id': :'parentSubscribedServiceId', 'parent_product': :'parentProduct', 'plan_number': :'planNumber', 'currency_code': :'currencyCode', 'rate_card_tierd_id': :'rateCardTierdId', 'rate_card_id': :'rateCardId', 'compute_source': :'computeSource', 'data_center': :'dataCenter', 'mqs_message_id': :'mqsMessageId', 'id': :'id', 'quantity': :'quantity', 'usage_number': :'usageNumber', 'original_usage_number': :'originalUsageNumber', 'commitment_service_id': :'commitmentServiceId', 'is_invoiced': :'isInvoiced', 'type': :'type', 'time_of_arrival': :'timeOfArrival', 'time_metered_on': :'timeMeteredOn', 'net_unit_price': :'netUnitPrice', 'cost_rounded': :'costRounded', 'cost': :'cost', 'product': :'product', 'unit_of_measure': :'unitOfMeasure' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 187 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'time_created': :'DateTime', 'time_updated': :'DateTime', 'parent_subscribed_service_id': :'String', 'parent_product': :'OCI::OsubUsage::Models::Product', 'plan_number': :'String', 'currency_code': :'String', 'rate_card_tierd_id': :'String', 'rate_card_id': :'String', 'compute_source': :'String', 'data_center': :'String', 'mqs_message_id': :'String', 'id': :'String', 'quantity': :'String', 'usage_number': :'String', 'original_usage_number': :'String', 'commitment_service_id': :'String', 'is_invoiced': :'BOOLEAN', 'type': :'String', 'time_of_arrival': :'DateTime', 'time_metered_on': :'DateTime', 'net_unit_price': :'String', 'cost_rounded': :'String', 'cost': :'String', 'product': :'OCI::OsubUsage::Models::Product', 'unit_of_measure': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 407 def ==(other) return true if equal?(other) self.class == other.class && time_created == other.time_created && time_updated == other.time_updated && parent_subscribed_service_id == other.parent_subscribed_service_id && parent_product == other.parent_product && plan_number == other.plan_number && currency_code == other.currency_code && rate_card_tierd_id == other.rate_card_tierd_id && rate_card_id == other.rate_card_id && compute_source == other.compute_source && data_center == other.data_center && == other. && id == other.id && quantity == other.quantity && usage_number == other.usage_number && original_usage_number == other.original_usage_number && commitment_service_id == other.commitment_service_id && is_invoiced == other.is_invoiced && type == other.type && time_of_arrival == other.time_of_arrival && time_metered_on == other.time_metered_on && net_unit_price == other.net_unit_price && cost_rounded == other.cost_rounded && cost == other.cost && product == other.product && unit_of_measure == other.unit_of_measure end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 461 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
441 442 443 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 441 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
450 451 452 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 450 def hash [time_created, time_updated, parent_subscribed_service_id, parent_product, plan_number, currency_code, rate_card_tierd_id, rate_card_id, compute_source, data_center, , id, quantity, usage_number, original_usage_number, commitment_service_id, is_invoiced, type, time_of_arrival, time_metered_on, net_unit_price, cost_rounded, cost, product, unit_of_measure].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
494 495 496 497 498 499 500 501 502 503 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 494 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
488 489 490 |
# File 'lib/oci/osub_usage/models/computed_usage.rb', line 488 def to_s to_hash.to_s end |