Class: OCI::OspGateway::Models::Subscription

Inherits:
Object
  • Object
show all
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_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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Subscription

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/oci/osp_gateway/models/subscription.rb', line 205

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. = 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. = 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. = attributes[:'accountType'] if attributes[:'accountType']

  raise 'You cannot provide both :accountType and :account_type' if attributes.key?(:'accountType') && attributes.key?(:'account_type')

  self. = 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.payment_options = attributes[:'paymentOptions'] if attributes[:'paymentOptions']

  raise 'You cannot provide both :paymentOptions and :payment_options' if attributes.key?(:'paymentOptions') && attributes.key?(:'payment_options')

  self.payment_options = 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_typeString

Account type.

Returns:

  • (String)


97
98
99
# File 'lib/oci/osp_gateway/models/subscription.rb', line 97

def 
  @account_type
end

#bill_to_cust_account_idString

Bill to customer Account id.

Returns:

  • (String)


65
66
67
# File 'lib/oci/osp_gateway/models/subscription.rb', line 65

def 
  @bill_to_cust_account_id
end

#billing_addressOCI::OspGateway::Models::Address



110
111
112
# File 'lib/oci/osp_gateway/models/subscription.rb', line 110

def billing_address
  @billing_address
end

#currency_codeString

Currency code

Returns:

  • (String)


73
74
75
# File 'lib/oci/osp_gateway/models/subscription.rb', line 73

def currency_code
  @currency_code
end

#gsi_org_codeString

GSI Subscription external code.

Returns:

  • (String)


77
78
79
# File 'lib/oci/osp_gateway/models/subscription.rb', line 77

def gsi_org_code
  @gsi_org_code
end

#idString

Subscription id identifier (OCID).

Returns:

  • (String)


41
42
43
# File 'lib/oci/osp_gateway/models/subscription.rb', line 41

def id
  @id
end

#is_intent_to_payBOOLEAN

Payment intension.

Returns:

  • (BOOLEAN)


69
70
71
# File 'lib/oci/osp_gateway/models/subscription.rb', line 69

def is_intent_to_pay
  @is_intent_to_pay
end

#language_codeString

Language short code (en, de, hu, etc)

Returns:

  • (String)


81
82
83
# File 'lib/oci/osp_gateway/models/subscription.rb', line 81

def language_code
  @language_code
end

#organization_idString

GSI organization external identifier.

Returns:

  • (String)


85
86
87
# File 'lib/oci/osp_gateway/models/subscription.rb', line 85

def organization_id
  @organization_id
end

#payment_gatewayOCI::OspGateway::Models::PaymentGateway



107
108
109
# File 'lib/oci/osp_gateway/models/subscription.rb', line 107

def payment_gateway
  @payment_gateway
end

#payment_optionsArray<OCI::OspGateway::Models::PaymentOption>

Payment option list of a subscription.



104
105
106
# File 'lib/oci/osp_gateway/models/subscription.rb', line 104

def payment_options
  @payment_options
end

#plan_typeString

Subscription plan type.

Returns:

  • (String)


49
50
51
# File 'lib/oci/osp_gateway/models/subscription.rb', line 49

def plan_type
  @plan_type
end

#ship_to_cust_acct_role_idString

Ship to customer account role.

Returns:

  • (String)


61
62
63
# File 'lib/oci/osp_gateway/models/subscription.rb', line 61

def ship_to_cust_acct_role_id
  @ship_to_cust_acct_role_id
end

#ship_to_cust_acct_site_idString

Ship to customer account site address id.

Returns:

  • (String)


57
58
59
# File 'lib/oci/osp_gateway/models/subscription.rb', line 57

def ship_to_cust_acct_site_id
  @ship_to_cust_acct_site_id
end

#subscription_plan_numberString

[Required] Subscription plan number.

Returns:

  • (String)


45
46
47
# File 'lib/oci/osp_gateway/models/subscription.rb', line 45

def subscription_plan_number
  @subscription_plan_number
end

#tax_infoOCI::OspGateway::Models::TaxInfo



100
101
102
# File 'lib/oci/osp_gateway/models/subscription.rb', line 100

def tax_info
  @tax_info
end

#time_personal_to_corporate_convDateTime

Date of upgrade/conversion when account type changed from PERSONAL to CORPORATE

Returns:

  • (DateTime)


118
119
120
# File 'lib/oci/osp_gateway/models/subscription.rb', line 118

def time_personal_to_corporate_conv
  @time_personal_to_corporate_conv
end

#time_plan_upgradeDateTime

Date of upgrade/conversion when planType changed from FREE_TIER to PAYG

Returns:

  • (DateTime)


114
115
116
# File 'lib/oci/osp_gateway/models/subscription.rb', line 114

def time_plan_upgrade
  @time_plan_upgrade
end

#time_startDateTime

Start date of the subscription.

Returns:

  • (DateTime)


53
54
55
# File 'lib/oci/osp_gateway/models/subscription.rb', line 53

def time_start
  @time_start
end

#upgrade_stateString

Status of the upgrade.

Returns:

  • (String)


89
90
91
# File 'lib/oci/osp_gateway/models/subscription.rb', line 89

def upgrade_state
  @upgrade_state
end

#upgrade_state_detailsString

This field is used to describe the Upgrade State in case of error (E.g. Upgrade failure caused by interfacing Tax details- TaxError)

Returns:

  • (String)


93
94
95
# File 'lib/oci/osp_gateway/models/subscription.rb', line 93

def upgrade_state_details
  @upgrade_state_details
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/osp_gateway/models/subscription.rb', line 121

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',
    '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_typesObject

Attribute type mapping.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/oci/osp_gateway/models/subscription.rb', line 150

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',
    '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.

Parameters:

  • other (Object)

    the other object to be compared



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/oci/osp_gateway/models/subscription.rb', line 390

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 &&
     == other. &&
    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 &&
     == other. &&
    tax_info == other.tax_info &&
    payment_options == other.payment_options &&
    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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'lib/oci/osp_gateway/models/subscription.rb', line 440

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


420
421
422
# File 'lib/oci/osp_gateway/models/subscription.rb', line 420

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



429
430
431
# File 'lib/oci/osp_gateway/models/subscription.rb', line 429

def hash
  [id, subscription_plan_number, plan_type, time_start, ship_to_cust_acct_site_id, ship_to_cust_acct_role_id, , is_intent_to_pay, currency_code, gsi_org_code, language_code, organization_id, upgrade_state, upgrade_state_details, , tax_info, payment_options, payment_gateway, billing_address, time_plan_upgrade, time_personal_to_corporate_conv].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



473
474
475
476
477
478
479
480
481
482
# File 'lib/oci/osp_gateway/models/subscription.rb', line 473

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



467
468
469
# File 'lib/oci/osp_gateway/models/subscription.rb', line 467

def to_s
  to_hash.to_s
end