Class: OCI::OspGateway::Models::SubscriptionSummary

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SubscriptionSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
344
345
346
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 213

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. = 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.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. = 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)


102
103
104
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 102

def 
  @account_type
end

#bill_to_cust_account_idString

Bill to customer Account id.

Returns:

  • (String)


66
67
68
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 66

def 
  @bill_to_cust_account_id
end

#billing_addressOCI::OspGateway::Models::Address



115
116
117
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 115

def billing_address
  @billing_address
end

#currency_codeString

Currency code

Returns:

  • (String)


78
79
80
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 78

def currency_code
  @currency_code
end

#gsi_org_codeString

GSI Subscription external code.

Returns:

  • (String)


82
83
84
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 82

def gsi_org_code
  @gsi_org_code
end

#idString

Subscription id identifier (OCID).

Returns:

  • (String)


42
43
44
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 42

def id
  @id
end

#is_corporate_conversion_allowedBOOLEAN

Corporate conversion allowed status

Returns:

  • (BOOLEAN)


74
75
76
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 74

def is_corporate_conversion_allowed
  @is_corporate_conversion_allowed
end

#is_intent_to_payBOOLEAN

Payment intension.

Returns:

  • (BOOLEAN)


70
71
72
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 70

def is_intent_to_pay
  @is_intent_to_pay
end

#language_codeString

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

Returns:

  • (String)


86
87
88
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 86

def language_code
  @language_code
end

#organization_idString

GSI organization external identifier.

Returns:

  • (String)


90
91
92
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 90

def organization_id
  @organization_id
end

#payment_gatewayOCI::OspGateway::Models::PaymentGateway



112
113
114
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 112

def payment_gateway
  @payment_gateway
end

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

Payment option list of a subscription.



109
110
111
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 109

def payment_options
  @payment_options
end

#plan_typeString

Subscription plan type.

Returns:

  • (String)


50
51
52
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 50

def plan_type
  @plan_type
end

#ship_to_cust_acct_role_idString

Ship to customer account role.

Returns:

  • (String)


62
63
64
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 62

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)


58
59
60
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 58

def ship_to_cust_acct_site_id
  @ship_to_cust_acct_site_id
end

#subscription_plan_numberString

[Required] Subscription plan number.

Returns:

  • (String)


46
47
48
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 46

def subscription_plan_number
  @subscription_plan_number
end

#tax_infoOCI::OspGateway::Models::TaxInfo



105
106
107
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 105

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)


123
124
125
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 123

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)


119
120
121
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 119

def time_plan_upgrade
  @time_plan_upgrade
end

#time_startDateTime

Start date of the subscription.

Returns:

  • (DateTime)


54
55
56
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 54

def time_start
  @time_start
end

#upgrade_stateString

Status of the upgrade.

Returns:

  • (String)


94
95
96
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 94

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)


98
99
100
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 98

def upgrade_state_details
  @upgrade_state_details
end

Class Method Details

.attribute_mapObject

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_summary.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_typesObject

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_summary.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.

Parameters:

  • other (Object)

    the other object to be compared



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 407

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 &&
    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 &&
     == 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



458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 458

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


438
439
440
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 438

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



447
448
449
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 447

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, is_corporate_conversion_allowed, 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



491
492
493
494
495
496
497
498
499
500
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 491

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



485
486
487
# File 'lib/oci/osp_gateway/models/subscription_summary.rb', line 485

def to_s
  to_hash.to_s
end