Class: OCI::TenantManagerControlPlane::Models::CloudSubscriptionSummary
- Inherits:
-
SubscriptionSummary
- Object
- SubscriptionSummary
- OCI::TenantManagerControlPlane::Models::CloudSubscriptionSummary
- Defined in:
- lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb
Overview
Summary of subscription.
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_NEEDS_ATTENTION = 'NEEDS_ATTENTION'.freeze, LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_CREATING = 'CREATING'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Constants inherited from SubscriptionSummary
SubscriptionSummary::ENTITY_VERSION_ENUM
Instance Attribute Summary collapse
-
#currency_code ⇒ String
[Required] Currency code.
-
#lifecycle_state ⇒ String
[Required] Lifecycle state of the subscription.
-
#subscription_number ⇒ String
[Required] Unique Oracle Cloud Subscriptions identifier that is immutable on creation.
Attributes inherited from SubscriptionSummary
#compartment_id, #defined_tags, #entity_version, #freeform_tags, #id, #service_name, #time_created, #time_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 = {}) ⇒ CloudSubscriptionSummary
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.
Methods inherited from SubscriptionSummary
Constructor Details
#initialize(attributes = {}) ⇒ CloudSubscriptionSummary
Initializes the object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 88 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['entityVersion'] = 'V2' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.subscription_number = attributes[:'subscriptionNumber'] if attributes[:'subscriptionNumber'] raise 'You cannot provide both :subscriptionNumber and :subscription_number' if attributes.key?(:'subscriptionNumber') && attributes.key?(:'subscription_number') self.subscription_number = attributes[:'subscription_number'] if attributes[:'subscription_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.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'] end |
Instance Attribute Details
#currency_code ⇒ String
[Required] Currency code. For example USD, MXN.
28 29 30 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 28 def currency_code @currency_code end |
#lifecycle_state ⇒ String
[Required] Lifecycle state of the subscription.
32 33 34 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 32 def lifecycle_state @lifecycle_state end |
#subscription_number ⇒ String
[Required] Unique Oracle Cloud Subscriptions identifier that is immutable on creation.
24 25 26 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 24 def subscription_number @subscription_number end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 35 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'entity_version': :'entityVersion', 'id': :'id', 'compartment_id': :'compartmentId', 'service_name': :'serviceName', 'time_created': :'timeCreated', 'time_updated': :'timeUpdated', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'subscription_number': :'subscriptionNumber', 'currency_code': :'currencyCode', 'lifecycle_state': :'lifecycleState' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 54 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'entity_version': :'String', 'id': :'String', 'compartment_id': :'String', 'service_name': :'String', 'time_created': :'DateTime', 'time_updated': :'DateTime', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'subscription_number': :'String', 'currency_code': :'String', 'lifecycle_state': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 137 def ==(other) return true if equal?(other) self.class == other.class && entity_version == other.entity_version && id == other.id && compartment_id == other.compartment_id && service_name == other.service_name && time_created == other.time_created && time_updated == other.time_updated && == other. && == other. && subscription_number == other.subscription_number && currency_code == other.currency_code && lifecycle_state == other.lifecycle_state end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 177 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
157 158 159 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 157 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
166 167 168 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 166 def hash [entity_version, id, compartment_id, service_name, time_created, time_updated, , , subscription_number, currency_code, lifecycle_state].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
210 211 212 213 214 215 216 217 218 219 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 210 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
204 205 206 |
# File 'lib/oci/tenant_manager_control_plane/models/cloud_subscription_summary.rb', line 204 def to_s to_hash.to_s end |