Class: OCI::OspGateway::Models::Subscription
- Inherits:
-
Object
- Object
- OCI::OspGateway::Models::Subscription
- Defined in:
- lib/oci/osp_gateway/models/subscription.rb
Overview
Subscription details object which extends the SubscriptionSummary
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_P2_C_ERROR = 'P2C_ERROR'.freeze, UPGRADE_STATE_DETAILS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- ACCOUNT_TYPE_ENUM =
[ ACCOUNT_TYPE_PERSONAL = 'PERSONAL'.freeze, ACCOUNT_TYPE_CORPORATE = 'CORPORATE'.freeze, ACCOUNT_TYPE_CORPORATE_SUBMITTED = 'CORPORATE_SUBMITTED'.freeze, ACCOUNT_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#account_type ⇒ String
Account type.
-
#bill_to_cust_account_id ⇒ String
Bill to customer Account id.
- #billing_address ⇒ OCI::OspGateway::Models::Address
-
#currency_code ⇒ String
Currency code.
-
#gsi_org_code ⇒ String
GSI Subscription external code.
-
#id ⇒ String
Subscription id identifier (OCID).
-
#is_corporate_conversion_allowed ⇒ BOOLEAN
Corporate conversion allowed status.
-
#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_personal_to_corporate_conv ⇒ DateTime
Date of upgrade/conversion when account type changed from PERSONAL to CORPORATE.
-
#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 = {}) ⇒ Subscription
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 = {}) ⇒ Subscription
Initializes the object
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 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 213 def initialize(attributes = {}) return unless attributes.is_a?(Hash) 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.is_corporate_conversion_allowed = attributes[:'isCorporateConversionAllowed'] unless attributes[:'isCorporateConversionAllowed'].nil? raise 'You cannot provide both :isCorporateConversionAllowed and :is_corporate_conversion_allowed' if attributes.key?(:'isCorporateConversionAllowed') && attributes.key?(:'is_corporate_conversion_allowed') self.is_corporate_conversion_allowed = attributes[:'is_corporate_conversion_allowed'] unless attributes[:'is_corporate_conversion_allowed'].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.account_type = attributes[:'accountType'] if attributes[:'accountType'] raise 'You cannot provide both :accountType and :account_type' if attributes.key?(:'accountType') && attributes.key?(:'account_type') self.account_type = attributes[:'account_type'] if attributes[:'account_type'] 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'] self.time_personal_to_corporate_conv = attributes[:'timePersonalToCorporateConv'] if attributes[:'timePersonalToCorporateConv'] raise 'You cannot provide both :timePersonalToCorporateConv and :time_personal_to_corporate_conv' if attributes.key?(:'timePersonalToCorporateConv') && attributes.key?(:'time_personal_to_corporate_conv') self.time_personal_to_corporate_conv = attributes[:'time_personal_to_corporate_conv'] if attributes[:'time_personal_to_corporate_conv'] end |
Instance Attribute Details
#account_type ⇒ String
Account type.
102 103 104 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 102 def account_type @account_type end |
#bill_to_cust_account_id ⇒ String
Bill to customer Account id.
66 67 68 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 66 def bill_to_cust_account_id @bill_to_cust_account_id end |
#billing_address ⇒ OCI::OspGateway::Models::Address
115 116 117 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 115 def billing_address @billing_address end |
#currency_code ⇒ String
Currency code
78 79 80 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 78 def currency_code @currency_code end |
#gsi_org_code ⇒ String
GSI Subscription external code.
82 83 84 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 82 def gsi_org_code @gsi_org_code end |
#id ⇒ String
Subscription id identifier (OCID).
42 43 44 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 42 def id @id end |
#is_corporate_conversion_allowed ⇒ BOOLEAN
Corporate conversion allowed status
74 75 76 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 74 def is_corporate_conversion_allowed @is_corporate_conversion_allowed end |
#is_intent_to_pay ⇒ BOOLEAN
Payment intension.
70 71 72 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 70 def is_intent_to_pay @is_intent_to_pay end |
#language_code ⇒ String
Language short code (en, de, hu, etc)
86 87 88 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 86 def language_code @language_code end |
#organization_id ⇒ String
GSI organization external identifier.
90 91 92 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 90 def organization_id @organization_id end |
#payment_gateway ⇒ OCI::OspGateway::Models::PaymentGateway
112 113 114 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 112 def payment_gateway @payment_gateway end |
#payment_options ⇒ Array<OCI::OspGateway::Models::PaymentOption>
Payment option list of a subscription.
109 110 111 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 109 def @payment_options end |
#plan_type ⇒ String
Subscription plan type.
50 51 52 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 50 def plan_type @plan_type end |
#ship_to_cust_acct_role_id ⇒ String
Ship to customer account role.
62 63 64 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 62 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.
58 59 60 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 58 def ship_to_cust_acct_site_id @ship_to_cust_acct_site_id end |
#subscription_plan_number ⇒ String
[Required] Subscription plan number.
46 47 48 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 46 def subscription_plan_number @subscription_plan_number end |
#tax_info ⇒ OCI::OspGateway::Models::TaxInfo
105 106 107 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 105 def tax_info @tax_info end |
#time_personal_to_corporate_conv ⇒ DateTime
Date of upgrade/conversion when account type changed from PERSONAL to CORPORATE
123 124 125 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 123 def time_personal_to_corporate_conv @time_personal_to_corporate_conv end |
#time_plan_upgrade ⇒ DateTime
Date of upgrade/conversion when planType changed from FREE_TIER to PAYG
119 120 121 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 119 def time_plan_upgrade @time_plan_upgrade end |
#time_start ⇒ DateTime
Start date of the subscription.
54 55 56 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 54 def time_start @time_start end |
#upgrade_state ⇒ String
Status of the upgrade.
94 95 96 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 94 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)
98 99 100 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 98 def upgrade_state_details @upgrade_state_details end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 126 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', 'is_corporate_conversion_allowed': :'isCorporateConversionAllowed', 'currency_code': :'currencyCode', 'gsi_org_code': :'gsiOrgCode', 'language_code': :'languageCode', 'organization_id': :'organizationId', 'upgrade_state': :'upgradeState', 'upgrade_state_details': :'upgradeStateDetails', 'account_type': :'accountType', 'tax_info': :'taxInfo', 'payment_options': :'paymentOptions', 'payment_gateway': :'paymentGateway', 'billing_address': :'billingAddress', 'time_plan_upgrade': :'timePlanUpgrade', 'time_personal_to_corporate_conv': :'timePersonalToCorporateConv' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 156 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', 'is_corporate_conversion_allowed': :'BOOLEAN', 'currency_code': :'String', 'gsi_org_code': :'String', 'language_code': :'String', 'organization_id': :'String', 'upgrade_state': :'String', 'upgrade_state_details': :'String', 'account_type': :'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::Address', 'time_plan_upgrade': :'DateTime', 'time_personal_to_corporate_conv': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 404 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 && is_corporate_conversion_allowed == other.is_corporate_conversion_allowed && 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 && account_type == other.account_type && tax_info == other.tax_info && == other. && payment_gateway == other.payment_gateway && billing_address == other.billing_address && time_plan_upgrade == other.time_plan_upgrade && time_personal_to_corporate_conv == other.time_personal_to_corporate_conv end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 455 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
435 436 437 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 435 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
444 445 446 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 444 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, is_corporate_conversion_allowed, currency_code, gsi_org_code, language_code, organization_id, upgrade_state, upgrade_state_details, account_type, tax_info, , payment_gateway, billing_address, time_plan_upgrade, time_personal_to_corporate_conv].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
488 489 490 491 492 493 494 495 496 497 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 488 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
482 483 484 |
# File 'lib/oci/osp_gateway/models/subscription.rb', line 482 def to_s to_hash.to_s end |