Class: OCI::OsubUsage::Models::ComputedUsageAggregatedSummary
- Inherits:
-
Object
- Object
- OCI::OsubUsage::Models::ComputedUsageAggregatedSummary
- Defined in:
- lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb
Overview
Subscribed Service Contract details
Constant Summary collapse
- PRICING_MODEL_ENUM =
[ PRICING_MODEL_PAY_AS_YOU_GO = 'PAY_AS_YOU_GO'.freeze, PRICING_MODEL_MONTHLY = 'MONTHLY'.freeze, PRICING_MODEL_ANNUAL = 'ANNUAL'.freeze, PRICING_MODEL_PREPAID = 'PREPAID'.freeze, PRICING_MODEL_FUNDED_ALLOCATION = 'FUNDED_ALLOCATION'.freeze, PRICING_MODEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#aggregated_computed_usages ⇒ Array<OCI::OsubUsage::Models::ComputedUsageAggregation>
Aggregation of computed usages for the subscribed service.
-
#currency_code ⇒ String
Currency code.
- #parent_product ⇒ OCI::OsubUsage::Models::Product
-
#parent_subscribed_service_id ⇒ String
Subscribed service line parent id.
-
#plan_number ⇒ String
Subscribed service asociated subscription plan number.
-
#pricing_model ⇒ String
Subscribed services pricing model.
-
#rate_card_id ⇒ String
Inernal SPM Ratecard Id at line level.
-
#subscription_id ⇒ String
[Required] Subscription Id is an identifier associated to the service used for filter the Computed Usage in SPM.
-
#time_end ⇒ DateTime
Subscribed services contract line end date, expressed in RFC 3339 timestamp format.
-
#time_start ⇒ DateTime
Subscribed services contract line start date, expressed in RFC 3339 timestamp format.
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 = {}) ⇒ ComputedUsageAggregatedSummary
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 = {}) ⇒ ComputedUsageAggregatedSummary
Initializes the object
122 123 124 125 126 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 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 122 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.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.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.time_start = attributes[:'timeStart'] if attributes[:'timeStart'] raise 'You cannot provide both :timeStart and :time_start' if attributes.key?(:'timeStart') && attributes.key?(:'time_start') self.time_start = attributes[:'time_start'] if attributes[:'time_start'] self.time_end = attributes[:'timeEnd'] if attributes[:'timeEnd'] raise 'You cannot provide both :timeEnd and :time_end' if attributes.key?(:'timeEnd') && attributes.key?(:'time_end') self.time_end = attributes[:'time_end'] if attributes[:'time_end'] 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_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.pricing_model = attributes[:'pricingModel'] if attributes[:'pricingModel'] raise 'You cannot provide both :pricingModel and :pricing_model' if attributes.key?(:'pricingModel') && attributes.key?(:'pricing_model') self.pricing_model = attributes[:'pricing_model'] if attributes[:'pricing_model'] self.aggregated_computed_usages = attributes[:'aggregatedComputedUsages'] if attributes[:'aggregatedComputedUsages'] raise 'You cannot provide both :aggregatedComputedUsages and :aggregated_computed_usages' if attributes.key?(:'aggregatedComputedUsages') && attributes.key?(:'aggregated_computed_usages') self.aggregated_computed_usages = attributes[:'aggregated_computed_usages'] if attributes[:'aggregated_computed_usages'] end |
Instance Attribute Details
#aggregated_computed_usages ⇒ Array<OCI::OsubUsage::Models::ComputedUsageAggregation>
Aggregation of computed usages for the subscribed service.
68 69 70 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 68 def aggregated_computed_usages @aggregated_computed_usages end |
#currency_code ⇒ String
Currency code
53 54 55 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 53 def currency_code @currency_code end |
#parent_product ⇒ OCI::OsubUsage::Models::Product
33 34 35 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 33 def parent_product @parent_product end |
#parent_subscribed_service_id ⇒ String
Subscribed service line parent id
30 31 32 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 30 def parent_subscribed_service_id @parent_subscribed_service_id end |
#plan_number ⇒ String
Subscribed service asociated subscription plan number.
48 49 50 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 48 def plan_number @plan_number end |
#pricing_model ⇒ String
Subscribed services pricing model
63 64 65 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 63 def pricing_model @pricing_model end |
#rate_card_id ⇒ String
Inernal SPM Ratecard Id at line level
58 59 60 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 58 def rate_card_id @rate_card_id end |
#subscription_id ⇒ String
[Required] Subscription Id is an identifier associated to the service used for filter the Computed Usage in SPM
25 26 27 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 25 def subscription_id @subscription_id end |
#time_end ⇒ DateTime
Subscribed services contract line end date, expressed in RFC 3339 timestamp format.
43 44 45 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 43 def time_end @time_end end |
#time_start ⇒ DateTime
Subscribed services contract line start date, expressed in RFC 3339 timestamp format.
38 39 40 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 38 def time_start @time_start end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 71 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'subscription_id': :'subscriptionId', 'parent_subscribed_service_id': :'parentSubscribedServiceId', 'parent_product': :'parentProduct', 'time_start': :'timeStart', 'time_end': :'timeEnd', 'plan_number': :'planNumber', 'currency_code': :'currencyCode', 'rate_card_id': :'rateCardId', 'pricing_model': :'pricingModel', 'aggregated_computed_usages': :'aggregatedComputedUsages' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 89 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'subscription_id': :'String', 'parent_subscribed_service_id': :'String', 'parent_product': :'OCI::OsubUsage::Models::Product', 'time_start': :'DateTime', 'time_end': :'DateTime', 'plan_number': :'String', 'currency_code': :'String', 'rate_card_id': :'String', 'pricing_model': :'String', 'aggregated_computed_usages': :'Array<OCI::OsubUsage::Models::ComputedUsageAggregation>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 209 def ==(other) return true if equal?(other) self.class == other.class && subscription_id == other.subscription_id && parent_subscribed_service_id == other.parent_subscribed_service_id && parent_product == other.parent_product && time_start == other.time_start && time_end == other.time_end && plan_number == other.plan_number && currency_code == other.currency_code && rate_card_id == other.rate_card_id && pricing_model == other.pricing_model && aggregated_computed_usages == other.aggregated_computed_usages end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 248 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
228 229 230 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 228 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
237 238 239 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 237 def hash [subscription_id, parent_subscribed_service_id, parent_product, time_start, time_end, plan_number, currency_code, rate_card_id, pricing_model, aggregated_computed_usages].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
281 282 283 284 285 286 287 288 289 290 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 281 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
275 276 277 |
# File 'lib/oci/osub_usage/models/computed_usage_aggregated_summary.rb', line 275 def to_s to_hash.to_s end |