Class: TenantManagerControlPlane::Models::AssignedSubscription
- Inherits:
-
Object
- Object
- TenantManagerControlPlane::Models::AssignedSubscription
- Defined in:
- lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb
Overview
Assigned subscription information.
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze, LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze, LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze, LIFECYCLE_STATE_DELETING = 'DELETING'.freeze, LIFECYCLE_STATE_DELETED = 'DELETED'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#classic_subscription_id ⇒ String
**[Required]** Subscription ID.
-
#cloud_amount_currency ⇒ String
The currency code for the customer associated with the subscription.
-
#compartment_id ⇒ String
**[Required]** OCID of the compartment.
-
#csi_number ⇒ String
Customer service identifier for the customer associated with the subscription.
-
#customer_country_code ⇒ String
The country code for the customer associated with the subscription.
-
#end_date ⇒ DateTime
Subscription end time.
-
#id ⇒ String
**[Required]** OCID of the subscription.
-
#is_classic_subscription ⇒ BOOLEAN
Denotes if the subscription is legacy or not.
-
#is_government_subscription ⇒ BOOLEAN
Denotes if the subscription is a government subscription or not.
-
#lifecycle_state ⇒ String
Lifecycle state of the subscription.
-
#order_ids ⇒ Array<String>
List of subscription order OCIDs that contributed to this subscription.
-
#program_type ⇒ String
Denotes any program that is associated with the subscription.
-
#promotion ⇒ Array<OCI::TenantManagerControlPlane::Models::Promotion>
List of promotions related to the subscription.
-
#purchase_entitlement_id ⇒ String
Purchase entitlement id associated with the subscription.
-
#region_assignment ⇒ String
Region for the subscription.
-
#service_name ⇒ String
**[Required]** The type of subscription, such as 'CLOUDCM', 'SAAS', 'ERP', or 'CRM'.
-
#skus ⇒ Array<OCI::TenantManagerControlPlane::Models::SubscriptionSku>
List of SKUs linked to the subscription.
-
#start_date ⇒ DateTime
Subscription start time.
-
#subscription_tier ⇒ String
Tier for the subscription, such as if it is a free promotion subscription or a paid subscription.
-
#time_created ⇒ DateTime
Date-time when subscription is created.
-
#time_updated ⇒ DateTime
Date-time when subscription is updated.
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 = {}) ⇒ AssignedSubscription
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 = {}) ⇒ AssignedSubscription
Initializes the object
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 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 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 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 191 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.id = attributes[:'id'] if attributes[:'id'] 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.classic_subscription_id = attributes[:'classicSubscriptionId'] if attributes[:'classicSubscriptionId'] raise 'You cannot provide both :classicSubscriptionId and :classic_subscription_id' if attributes.key?(:'classicSubscriptionId') && attributes.key?(:'classic_subscription_id') self.classic_subscription_id = attributes[:'classic_subscription_id'] if attributes[:'classic_subscription_id'] self.service_name = attributes[:'serviceName'] if attributes[:'serviceName'] raise 'You cannot provide both :serviceName and :service_name' if attributes.key?(:'serviceName') && attributes.key?(:'service_name') self.service_name = attributes[:'service_name'] if attributes[:'service_name'] self.is_classic_subscription = attributes[:'isClassicSubscription'] unless attributes[:'isClassicSubscription'].nil? self.is_classic_subscription = false if is_classic_subscription.nil? && !attributes.key?(:'isClassicSubscription') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isClassicSubscription and :is_classic_subscription' if attributes.key?(:'isClassicSubscription') && attributes.key?(:'is_classic_subscription') self.is_classic_subscription = attributes[:'is_classic_subscription'] unless attributes[:'is_classic_subscription'].nil? self.is_classic_subscription = false if is_classic_subscription.nil? && !attributes.key?(:'isClassicSubscription') && !attributes.key?(:'is_classic_subscription') # rubocop:disable Style/StringLiterals self.region_assignment = attributes[:'regionAssignment'] if attributes[:'regionAssignment'] raise 'You cannot provide both :regionAssignment and :region_assignment' if attributes.key?(:'regionAssignment') && attributes.key?(:'region_assignment') self.region_assignment = attributes[:'region_assignment'] if attributes[:'region_assignment'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] self.skus = attributes[:'skus'] if attributes[:'skus'] self.order_ids = attributes[:'orderIds'] if attributes[:'orderIds'] raise 'You cannot provide both :orderIds and :order_ids' if attributes.key?(:'orderIds') && attributes.key?(:'order_ids') self.order_ids = attributes[:'order_ids'] if attributes[:'order_ids'] self.program_type = attributes[:'programType'] if attributes[:'programType'] raise 'You cannot provide both :programType and :program_type' if attributes.key?(:'programType') && attributes.key?(:'program_type') self.program_type = attributes[:'program_type'] if attributes[:'program_type'] self.customer_country_code = attributes[:'customerCountryCode'] if attributes[:'customerCountryCode'] raise 'You cannot provide both :customerCountryCode and :customer_country_code' if attributes.key?(:'customerCountryCode') && attributes.key?(:'customer_country_code') self.customer_country_code = attributes[:'customer_country_code'] if attributes[:'customer_country_code'] self.cloud_amount_currency = attributes[:'cloudAmountCurrency'] if attributes[:'cloudAmountCurrency'] raise 'You cannot provide both :cloudAmountCurrency and :cloud_amount_currency' if attributes.key?(:'cloudAmountCurrency') && attributes.key?(:'cloud_amount_currency') self.cloud_amount_currency = attributes[:'cloud_amount_currency'] if attributes[:'cloud_amount_currency'] self.csi_number = attributes[:'csiNumber'] if attributes[:'csiNumber'] raise 'You cannot provide both :csiNumber and :csi_number' if attributes.key?(:'csiNumber') && attributes.key?(:'csi_number') self.csi_number = attributes[:'csi_number'] if attributes[:'csi_number'] self.subscription_tier = attributes[:'subscriptionTier'] if attributes[:'subscriptionTier'] raise 'You cannot provide both :subscriptionTier and :subscription_tier' if attributes.key?(:'subscriptionTier') && attributes.key?(:'subscription_tier') self.subscription_tier = attributes[:'subscription_tier'] if attributes[:'subscription_tier'] self.is_government_subscription = attributes[:'isGovernmentSubscription'] unless attributes[:'isGovernmentSubscription'].nil? self.is_government_subscription = false if is_government_subscription.nil? && !attributes.key?(:'isGovernmentSubscription') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isGovernmentSubscription and :is_government_subscription' if attributes.key?(:'isGovernmentSubscription') && attributes.key?(:'is_government_subscription') self.is_government_subscription = attributes[:'is_government_subscription'] unless attributes[:'is_government_subscription'].nil? self.is_government_subscription = false if is_government_subscription.nil? && !attributes.key?(:'isGovernmentSubscription') && !attributes.key?(:'is_government_subscription') # rubocop:disable Style/StringLiterals self.promotion = attributes[:'promotion'] if attributes[:'promotion'] self.purchase_entitlement_id = attributes[:'purchaseEntitlementId'] if attributes[:'purchaseEntitlementId'] raise 'You cannot provide both :purchaseEntitlementId and :purchase_entitlement_id' if attributes.key?(:'purchaseEntitlementId') && attributes.key?(:'purchase_entitlement_id') self.purchase_entitlement_id = attributes[:'purchase_entitlement_id'] if attributes[:'purchase_entitlement_id'] self.start_date = attributes[:'startDate'] if attributes[:'startDate'] raise 'You cannot provide both :startDate and :start_date' if attributes.key?(:'startDate') && attributes.key?(:'start_date') self.start_date = attributes[:'start_date'] if attributes[:'start_date'] self.end_date = attributes[:'endDate'] if attributes[:'endDate'] raise 'You cannot provide both :endDate and :end_date' if attributes.key?(:'endDate') && attributes.key?(:'end_date') self.end_date = attributes[:'end_date'] if attributes[:'end_date'] 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.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'] end |
Instance Attribute Details
#classic_subscription_id ⇒ String
**[Required]** Subscription ID.
32 33 34 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 32 def classic_subscription_id @classic_subscription_id end |
#cloud_amount_currency ⇒ String
The currency code for the customer associated with the subscription.
68 69 70 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 68 def cloud_amount_currency @cloud_amount_currency end |
#compartment_id ⇒ String
**[Required]** OCID of the compartment. Always a tenancy OCID.
28 29 30 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 28 def compartment_id @compartment_id end |
#csi_number ⇒ String
Customer service identifier for the customer associated with the subscription.
72 73 74 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 72 def csi_number @csi_number end |
#customer_country_code ⇒ String
The country code for the customer associated with the subscription.
64 65 66 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 64 def customer_country_code @customer_country_code end |
#end_date ⇒ DateTime
Subscription end time.
96 97 98 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 96 def end_date @end_date end |
#id ⇒ String
**[Required]** OCID of the subscription.
24 25 26 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 24 def id @id end |
#is_classic_subscription ⇒ BOOLEAN
Denotes if the subscription is legacy or not.
40 41 42 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 40 def is_classic_subscription @is_classic_subscription end |
#is_government_subscription ⇒ BOOLEAN
Denotes if the subscription is a government subscription or not.
80 81 82 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 80 def is_government_subscription @is_government_subscription end |
#lifecycle_state ⇒ String
Lifecycle state of the subscription.
48 49 50 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 48 def lifecycle_state @lifecycle_state end |
#order_ids ⇒ Array<String>
List of subscription order OCIDs that contributed to this subscription.
56 57 58 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 56 def order_ids @order_ids end |
#program_type ⇒ String
Denotes any program that is associated with the subscription.
60 61 62 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 60 def program_type @program_type end |
#promotion ⇒ Array<OCI::TenantManagerControlPlane::Models::Promotion>
List of promotions related to the subscription.
84 85 86 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 84 def promotion @promotion end |
#purchase_entitlement_id ⇒ String
Purchase entitlement id associated with the subscription.
88 89 90 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 88 def purchase_entitlement_id @purchase_entitlement_id end |
#region_assignment ⇒ String
Region for the subscription.
44 45 46 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 44 def region_assignment @region_assignment end |
#service_name ⇒ String
**[Required]** The type of subscription, such as 'CLOUDCM', 'SAAS', 'ERP', or 'CRM'.
36 37 38 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 36 def service_name @service_name end |
#skus ⇒ Array<OCI::TenantManagerControlPlane::Models::SubscriptionSku>
List of SKUs linked to the subscription.
52 53 54 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 52 def skus @skus end |
#start_date ⇒ DateTime
Subscription start time.
92 93 94 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 92 def start_date @start_date end |
#subscription_tier ⇒ String
Tier for the subscription, such as if it is a free promotion subscription or a paid subscription.
76 77 78 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 76 def subscription_tier @subscription_tier end |
#time_created ⇒ DateTime
Date-time when subscription is created.
104 105 106 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 104 def time_created @time_created end |
#time_updated ⇒ DateTime
Date-time when subscription is updated.
100 101 102 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 100 def time_updated @time_updated end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 107 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'compartment_id': :'compartmentId', 'classic_subscription_id': :'classicSubscriptionId', 'service_name': :'serviceName', 'is_classic_subscription': :'isClassicSubscription', 'region_assignment': :'regionAssignment', 'lifecycle_state': :'lifecycleState', 'skus': :'skus', 'order_ids': :'orderIds', 'program_type': :'programType', 'customer_country_code': :'customerCountryCode', 'cloud_amount_currency': :'cloudAmountCurrency', 'csi_number': :'csiNumber', 'subscription_tier': :'subscriptionTier', 'is_government_subscription': :'isGovernmentSubscription', 'promotion': :'promotion', 'purchase_entitlement_id': :'purchaseEntitlementId', 'start_date': :'startDate', 'end_date': :'endDate', 'time_updated': :'timeUpdated', 'time_created': :'timeCreated' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 136 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'compartment_id': :'String', 'classic_subscription_id': :'String', 'service_name': :'String', 'is_classic_subscription': :'BOOLEAN', 'region_assignment': :'String', 'lifecycle_state': :'String', 'skus': :'Array<OCI::TenantManagerControlPlane::Models::SubscriptionSku>', 'order_ids': :'Array<String>', 'program_type': :'String', 'customer_country_code': :'String', 'cloud_amount_currency': :'String', 'csi_number': :'String', 'subscription_tier': :'String', 'is_government_subscription': :'BOOLEAN', 'promotion': :'Array<OCI::TenantManagerControlPlane::Models::Promotion>', 'purchase_entitlement_id': :'String', 'start_date': :'DateTime', 'end_date': :'DateTime', 'time_updated': :'DateTime', 'time_created': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 336 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && compartment_id == other.compartment_id && classic_subscription_id == other.classic_subscription_id && service_name == other.service_name && is_classic_subscription == other.is_classic_subscription && region_assignment == other.region_assignment && lifecycle_state == other.lifecycle_state && skus == other.skus && order_ids == other.order_ids && program_type == other.program_type && customer_country_code == other.customer_country_code && cloud_amount_currency == other.cloud_amount_currency && csi_number == other.csi_number && subscription_tier == other.subscription_tier && is_government_subscription == other.is_government_subscription && promotion == other.promotion && purchase_entitlement_id == other.purchase_entitlement_id && start_date == other.start_date && end_date == other.end_date && time_updated == other.time_updated && time_created == other.time_created end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 386 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
366 367 368 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 366 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
375 376 377 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 375 def hash [id, compartment_id, classic_subscription_id, service_name, is_classic_subscription, region_assignment, lifecycle_state, skus, order_ids, program_type, customer_country_code, cloud_amount_currency, csi_number, subscription_tier, is_government_subscription, promotion, purchase_entitlement_id, start_date, end_date, time_updated, time_created].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
419 420 421 422 423 424 425 426 427 428 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 419 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
413 414 415 |
# File 'lib/oci/tenant_manager_control_plane/models/assigned_subscription.rb', line 413 def to_s to_hash.to_s end |