Class: OCI::OspGateway::Models::SubscriptionSummary
- Inherits:
-
Object
- Object
- OCI::OspGateway::Models::SubscriptionSummary
- Defined in:
- lib/oci/osp_gateway/models/subscription_summary.rb
Overview
Subscription object which contains the common subscription data.
Constant Summary collapse
- PLAN_TYPE_ENUM =
[ PLAN_TYPE_FREE_TIER = 'FREE_TIER'.freeze, PLAN_TYPE_PAYG = 'PAYG'.freeze, PLAN_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- UPGRADE_STATE_ENUM =
[ UPGRADE_STATE_PROMO = 'PROMO'.freeze, UPGRADE_STATE_SUBMITTED = 'SUBMITTED'.freeze, UPGRADE_STATE_ERROR = 'ERROR'.freeze, UPGRADE_STATE_UPGRADED = 'UPGRADED'.freeze, UPGRADE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- UPGRADE_STATE_DETAILS_ENUM =
[ UPGRADE_STATE_DETAILS_TAX_ERROR = 'TAX_ERROR'.freeze, UPGRADE_STATE_DETAILS_UPGRADE_ERROR = 'UPGRADE_ERROR'.freeze, UPGRADE_STATE_DETAILS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#bill_to_cust_account_id ⇒ String
Bill to customer Account id.
- #billing_address ⇒ OCI::OspGateway::Models::BillingAddress
-
#currency_code ⇒ String
Currency code.
-
#gsi_org_code ⇒ String
GSI Subscription external code.
-
#id ⇒ String
Subscription id identifier (OCID).
-
#is_intent_to_pay ⇒ BOOLEAN
Payment intension.
-
#language_code ⇒ String
Language short code (en, de, hu, etc).
-
#organization_id ⇒ String
GSI organization external identifier.
- #payment_gateway ⇒ OCI::OspGateway::Models::PaymentGateway
-
#payment_options ⇒ Array<OCI::OspGateway::Models::PaymentOption>
Payment option list of a subscription.
-
#plan_type ⇒ String
Subscription plan type.
-
#ship_to_cust_acct_role_id ⇒ String
Ship to customer account role.
-
#ship_to_cust_acct_site_id ⇒ String
Ship to customer account site address id.
-
#subscription_plan_number ⇒ String
**[Required]** Subscription plan number.
- #tax_info ⇒ OCI::OspGateway::Models::TaxInfo
-
#time_plan_upgrade ⇒ DateTime
Date of upgrade/conversion when planType changed from FREE_TIER to PAYG.
-
#time_start ⇒ DateTime
Start date of the subscription.
-
#upgrade_state ⇒ String
Status of the upgrade.
-
#upgrade_state_details ⇒ String
This field is used to describe the Upgrade State in case of error (E.g. Upgrade failure caused by interfacing Tax details- TaxError).
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 = {}) ⇒ SubscriptionSummary
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 = {}) ⇒ SubscriptionSummary
Initializes the object
183 184 185 186 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 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 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 183 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.subscription_plan_number = attributes[:'subscriptionPlanNumber'] if attributes[:'subscriptionPlanNumber'] raise 'You cannot provide both :subscriptionPlanNumber and :subscription_plan_number' if attributes.key?(:'subscriptionPlanNumber') && attributes.key?(:'subscription_plan_number') self.subscription_plan_number = attributes[:'subscription_plan_number'] if attributes[:'subscription_plan_number'] self.plan_type = attributes[:'planType'] if attributes[:'planType'] raise 'You cannot provide both :planType and :plan_type' if attributes.key?(:'planType') && attributes.key?(:'plan_type') self.plan_type = attributes[:'plan_type'] if attributes[:'plan_type'] 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.ship_to_cust_acct_site_id = attributes[:'shipToCustAcctSiteId'] if attributes[:'shipToCustAcctSiteId'] raise 'You cannot provide both :shipToCustAcctSiteId and :ship_to_cust_acct_site_id' if attributes.key?(:'shipToCustAcctSiteId') && attributes.key?(:'ship_to_cust_acct_site_id') self.ship_to_cust_acct_site_id = attributes[:'ship_to_cust_acct_site_id'] if attributes[:'ship_to_cust_acct_site_id'] self.ship_to_cust_acct_role_id = attributes[:'shipToCustAcctRoleId'] if attributes[:'shipToCustAcctRoleId'] raise 'You cannot provide both :shipToCustAcctRoleId and :ship_to_cust_acct_role_id' if attributes.key?(:'shipToCustAcctRoleId') && attributes.key?(:'ship_to_cust_acct_role_id') self.ship_to_cust_acct_role_id = attributes[:'ship_to_cust_acct_role_id'] if attributes[:'ship_to_cust_acct_role_id'] self.bill_to_cust_account_id = attributes[:'billToCustAccountId'] if attributes[:'billToCustAccountId'] raise 'You cannot provide both :billToCustAccountId and :bill_to_cust_account_id' if attributes.key?(:'billToCustAccountId') && attributes.key?(:'bill_to_cust_account_id') self.bill_to_cust_account_id = attributes[:'bill_to_cust_account_id'] if attributes[:'bill_to_cust_account_id'] self.is_intent_to_pay = attributes[:'isIntentToPay'] unless attributes[:'isIntentToPay'].nil? raise 'You cannot provide both :isIntentToPay and :is_intent_to_pay' if attributes.key?(:'isIntentToPay') && attributes.key?(:'is_intent_to_pay') self.is_intent_to_pay = attributes[:'is_intent_to_pay'] unless attributes[:'is_intent_to_pay'].nil? 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.gsi_org_code = attributes[:'gsiOrgCode'] if attributes[:'gsiOrgCode'] raise 'You cannot provide both :gsiOrgCode and :gsi_org_code' if attributes.key?(:'gsiOrgCode') && attributes.key?(:'gsi_org_code') self.gsi_org_code = attributes[:'gsi_org_code'] if attributes[:'gsi_org_code'] self.language_code = attributes[:'languageCode'] if attributes[:'languageCode'] raise 'You cannot provide both :languageCode and :language_code' if attributes.key?(:'languageCode') && attributes.key?(:'language_code') self.language_code = attributes[:'language_code'] if attributes[:'language_code'] self.organization_id = attributes[:'organizationId'] if attributes[:'organizationId'] raise 'You cannot provide both :organizationId and :organization_id' if attributes.key?(:'organizationId') && attributes.key?(:'organization_id') self.organization_id = attributes[:'organization_id'] if attributes[:'organization_id'] self.upgrade_state = attributes[:'upgradeState'] if attributes[:'upgradeState'] raise 'You cannot provide both :upgradeState and :upgrade_state' if attributes.key?(:'upgradeState') && attributes.key?(:'upgrade_state') self.upgrade_state = attributes[:'upgrade_state'] if attributes[:'upgrade_state'] self.upgrade_state_details = attributes[:'upgradeStateDetails'] if attributes[:'upgradeStateDetails'] raise 'You cannot provide both :upgradeStateDetails and :upgrade_state_details' if attributes.key?(:'upgradeStateDetails') && attributes.key?(:'upgrade_state_details') self.upgrade_state_details = attributes[:'upgrade_state_details'] if attributes[:'upgrade_state_details'] self.tax_info = attributes[:'taxInfo'] if attributes[:'taxInfo'] raise 'You cannot provide both :taxInfo and :tax_info' if attributes.key?(:'taxInfo') && attributes.key?(:'tax_info') self.tax_info = attributes[:'tax_info'] if attributes[:'tax_info'] self. = attributes[:'paymentOptions'] if attributes[:'paymentOptions'] raise 'You cannot provide both :paymentOptions and :payment_options' if attributes.key?(:'paymentOptions') && attributes.key?(:'payment_options') self. = attributes[:'payment_options'] if attributes[:'payment_options'] self.payment_gateway = attributes[:'paymentGateway'] if attributes[:'paymentGateway'] raise 'You cannot provide both :paymentGateway and :payment_gateway' if attributes.key?(:'paymentGateway') && attributes.key?(:'payment_gateway') self.payment_gateway = attributes[:'payment_gateway'] if attributes[:'payment_gateway'] self.billing_address = attributes[:'billingAddress'] if attributes[:'billingAddress'] raise 'You cannot provide both :billingAddress and :billing_address' if attributes.key?(:'billingAddress') && attributes.key?(:'billing_address') self.billing_address = attributes[:'billing_address'] if attributes[:'billing_address'] self.time_plan_upgrade = attributes[:'timePlanUpgrade'] if attributes[:'timePlanUpgrade'] raise 'You cannot provide both :timePlanUpgrade and :time_plan_upgrade' if attributes.key?(:'timePlanUpgrade') && attributes.key?(:'time_plan_upgrade') self.time_plan_upgrade = attributes[:'time_plan_upgrade'] if attributes[:'time_plan_upgrade'] end |
Instance Attribute Details
#bill_to_cust_account_id ⇒ String
Bill to customer Account id.
57 58 59 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 57 def bill_to_cust_account_id @bill_to_cust_account_id end |
#billing_address ⇒ OCI::OspGateway::Models::BillingAddress
98 99 100 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 98 def billing_address @billing_address end |
#currency_code ⇒ String
Currency code
65 66 67 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 65 def currency_code @currency_code end |
#gsi_org_code ⇒ String
GSI Subscription external code.
69 70 71 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 69 def gsi_org_code @gsi_org_code end |
#id ⇒ String
Subscription id identifier (OCID).
33 34 35 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 33 def id @id end |
#is_intent_to_pay ⇒ BOOLEAN
Payment intension.
61 62 63 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 61 def is_intent_to_pay @is_intent_to_pay end |
#language_code ⇒ String
Language short code (en, de, hu, etc)
73 74 75 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 73 def language_code @language_code end |
#organization_id ⇒ String
GSI organization external identifier.
77 78 79 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 77 def organization_id @organization_id end |
#payment_gateway ⇒ OCI::OspGateway::Models::PaymentGateway
95 96 97 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 95 def payment_gateway @payment_gateway end |
#payment_options ⇒ Array<OCI::OspGateway::Models::PaymentOption>
Payment option list of a subscription.
92 93 94 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 92 def @payment_options end |
#plan_type ⇒ String
Subscription plan type.
41 42 43 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 41 def plan_type @plan_type end |
#ship_to_cust_acct_role_id ⇒ String
Ship to customer account role.
53 54 55 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 53 def ship_to_cust_acct_role_id @ship_to_cust_acct_role_id end |
#ship_to_cust_acct_site_id ⇒ String
Ship to customer account site address id.
49 50 51 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 49 def ship_to_cust_acct_site_id @ship_to_cust_acct_site_id end |
#subscription_plan_number ⇒ String
**[Required]** Subscription plan number.
37 38 39 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 37 def subscription_plan_number @subscription_plan_number end |
#tax_info ⇒ OCI::OspGateway::Models::TaxInfo
88 89 90 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 88 def tax_info @tax_info end |
#time_plan_upgrade ⇒ DateTime
Date of upgrade/conversion when planType changed from FREE_TIER to PAYG
102 103 104 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 102 def time_plan_upgrade @time_plan_upgrade end |
#time_start ⇒ DateTime
Start date of the subscription.
45 46 47 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 45 def time_start @time_start end |
#upgrade_state ⇒ String
Status of the upgrade.
81 82 83 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 81 def upgrade_state @upgrade_state end |
#upgrade_state_details ⇒ String
This field is used to describe the Upgrade State in case of error (E.g. Upgrade failure caused by interfacing Tax details- TaxError)
85 86 87 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 85 def upgrade_state_details @upgrade_state_details end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 105 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'subscription_plan_number': :'subscriptionPlanNumber', 'plan_type': :'planType', 'time_start': :'timeStart', 'ship_to_cust_acct_site_id': :'shipToCustAcctSiteId', 'ship_to_cust_acct_role_id': :'shipToCustAcctRoleId', 'bill_to_cust_account_id': :'billToCustAccountId', 'is_intent_to_pay': :'isIntentToPay', 'currency_code': :'currencyCode', 'gsi_org_code': :'gsiOrgCode', 'language_code': :'languageCode', 'organization_id': :'organizationId', 'upgrade_state': :'upgradeState', 'upgrade_state_details': :'upgradeStateDetails', 'tax_info': :'taxInfo', 'payment_options': :'paymentOptions', 'payment_gateway': :'paymentGateway', 'billing_address': :'billingAddress', 'time_plan_upgrade': :'timePlanUpgrade' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 132 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'subscription_plan_number': :'String', 'plan_type': :'String', 'time_start': :'DateTime', 'ship_to_cust_acct_site_id': :'String', 'ship_to_cust_acct_role_id': :'String', 'bill_to_cust_account_id': :'String', 'is_intent_to_pay': :'BOOLEAN', 'currency_code': :'String', 'gsi_org_code': :'String', 'language_code': :'String', 'organization_id': :'String', 'upgrade_state': :'String', 'upgrade_state_details': :'String', 'tax_info': :'OCI::OspGateway::Models::TaxInfo', 'payment_options': :'Array<OCI::OspGateway::Models::PaymentOption>', 'payment_gateway': :'OCI::OspGateway::Models::PaymentGateway', 'billing_address': :'OCI::OspGateway::Models::BillingAddress', 'time_plan_upgrade': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 346 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && subscription_plan_number == other.subscription_plan_number && plan_type == other.plan_type && time_start == other.time_start && ship_to_cust_acct_site_id == other.ship_to_cust_acct_site_id && ship_to_cust_acct_role_id == other.ship_to_cust_acct_role_id && bill_to_cust_account_id == other.bill_to_cust_account_id && is_intent_to_pay == other.is_intent_to_pay && currency_code == other.currency_code && gsi_org_code == other.gsi_org_code && language_code == other.language_code && organization_id == other.organization_id && upgrade_state == other.upgrade_state && upgrade_state_details == other.upgrade_state_details && tax_info == other.tax_info && == other. && payment_gateway == other.payment_gateway && billing_address == other.billing_address && time_plan_upgrade == other.time_plan_upgrade end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 394 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
374 375 376 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 374 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
383 384 385 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 383 def hash [id, subscription_plan_number, plan_type, time_start, ship_to_cust_acct_site_id, ship_to_cust_acct_role_id, bill_to_cust_account_id, is_intent_to_pay, currency_code, gsi_org_code, language_code, organization_id, upgrade_state, upgrade_state_details, tax_info, , payment_gateway, billing_address, time_plan_upgrade].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
427 428 429 430 431 432 433 434 435 436 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 427 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
421 422 423 |
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 421 def to_s to_hash.to_s end |