Class: OCI::Self::Models::SubscriptionDetails
- Inherits:
-
Object
- Object
- OCI::Self::Models::SubscriptionDetails
- Defined in:
- lib/oci/self/models/subscription_details.rb
Overview
The details of a subscription
Instance Attribute Summary collapse
-
#amount ⇒ Float
Tha amount for the currency type.
-
#billing_details ⇒ OCI::Self::Models::BillingDetails
This attribute is required.
-
#currency ⇒ String
The currency supported, in the format specified by ISO-4217.
-
#is_auto_renew ⇒ BOOLEAN
Whether subscription should be auto-renewed at the end of cycle.
-
#partner_registration_url ⇒ String
[Required] The activation link given by the partner.
-
#pricing_plan ⇒ OCI::Self::Models::PricingPlan
This attribute is required.
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 = {}) ⇒ SubscriptionDetails
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 = {}) ⇒ SubscriptionDetails
Initializes the object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/oci/self/models/subscription_details.rb', line 75 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.pricing_plan = attributes[:'pricingPlan'] if attributes[:'pricingPlan'] raise 'You cannot provide both :pricingPlan and :pricing_plan' if attributes.key?(:'pricingPlan') && attributes.key?(:'pricing_plan') self.pricing_plan = attributes[:'pricing_plan'] if attributes[:'pricing_plan'] self.partner_registration_url = attributes[:'partnerRegistrationUrl'] if attributes[:'partnerRegistrationUrl'] raise 'You cannot provide both :partnerRegistrationUrl and :partner_registration_url' if attributes.key?(:'partnerRegistrationUrl') && attributes.key?(:'partner_registration_url') self.partner_registration_url = attributes[:'partner_registration_url'] if attributes[:'partner_registration_url'] self.currency = attributes[:'currency'] if attributes[:'currency'] self.amount = attributes[:'amount'] if attributes[:'amount'] self.billing_details = attributes[:'billingDetails'] if attributes[:'billingDetails'] raise 'You cannot provide both :billingDetails and :billing_details' if attributes.key?(:'billingDetails') && attributes.key?(:'billing_details') self.billing_details = attributes[:'billing_details'] if attributes[:'billing_details'] self.is_auto_renew = attributes[:'isAutoRenew'] unless attributes[:'isAutoRenew'].nil? raise 'You cannot provide both :isAutoRenew and :is_auto_renew' if attributes.key?(:'isAutoRenew') && attributes.key?(:'is_auto_renew') self.is_auto_renew = attributes[:'is_auto_renew'] unless attributes[:'is_auto_renew'].nil? end |
Instance Attribute Details
#amount ⇒ Float
Tha amount for the currency type.
25 26 27 |
# File 'lib/oci/self/models/subscription_details.rb', line 25 def amount @amount end |
#billing_details ⇒ OCI::Self::Models::BillingDetails
This attribute is required.
29 30 31 |
# File 'lib/oci/self/models/subscription_details.rb', line 29 def billing_details @billing_details end |
#currency ⇒ String
The currency supported, in the format specified by ISO-4217
21 22 23 |
# File 'lib/oci/self/models/subscription_details.rb', line 21 def currency @currency end |
#is_auto_renew ⇒ BOOLEAN
Whether subscription should be auto-renewed at the end of cycle.
33 34 35 |
# File 'lib/oci/self/models/subscription_details.rb', line 33 def is_auto_renew @is_auto_renew end |
#partner_registration_url ⇒ String
[Required] The activation link given by the partner.
17 18 19 |
# File 'lib/oci/self/models/subscription_details.rb', line 17 def partner_registration_url @partner_registration_url end |
#pricing_plan ⇒ OCI::Self::Models::PricingPlan
This attribute is required.
13 14 15 |
# File 'lib/oci/self/models/subscription_details.rb', line 13 def pricing_plan @pricing_plan end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/oci/self/models/subscription_details.rb', line 36 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'pricing_plan': :'pricingPlan', 'partner_registration_url': :'partnerRegistrationUrl', 'currency': :'currency', 'amount': :'amount', 'billing_details': :'billingDetails', 'is_auto_renew': :'isAutoRenew' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/oci/self/models/subscription_details.rb', line 50 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'pricing_plan': :'OCI::Self::Models::PricingPlan', 'partner_registration_url': :'String', 'currency': :'String', 'amount': :'Float', 'billing_details': :'OCI::Self::Models::BillingDetails', 'is_auto_renew': :'BOOLEAN' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/oci/self/models/subscription_details.rb', line 117 def ==(other) return true if equal?(other) self.class == other.class && pricing_plan == other.pricing_plan && partner_registration_url == other.partner_registration_url && currency == other.currency && amount == other.amount && billing_details == other.billing_details && is_auto_renew == other.is_auto_renew end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/oci/self/models/subscription_details.rb', line 152 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
132 133 134 |
# File 'lib/oci/self/models/subscription_details.rb', line 132 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
141 142 143 |
# File 'lib/oci/self/models/subscription_details.rb', line 141 def hash [pricing_plan, partner_registration_url, currency, amount, billing_details, is_auto_renew].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
185 186 187 188 189 190 191 192 193 194 |
# File 'lib/oci/self/models/subscription_details.rb', line 185 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
179 180 181 |
# File 'lib/oci/self/models/subscription_details.rb', line 179 def to_s to_hash.to_s end |