Class: OCI::Onesubscription::Models::BillingScheduleSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/onesubscription/models/billing_schedule_summary.rb

Overview

Billing schedule details related to Subscription Id

Constant Summary collapse

INVOICE_STATUS_ENUM =
[
  INVOICE_STATUS_INVOICED = 'INVOICED'.freeze,
  INVOICE_STATUS_NOT_INVOICED = 'NOT_INVOICED'.freeze,
  INVOICE_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BillingScheduleSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



143
144
145
146
147
148
149
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
177
178
179
180
181
182
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
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 143

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

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

  self.subscribed_service_id = attributes[:'subscribed_service_id'] if attributes[:'subscribed_service_id']

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

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

  self.time_end = attributes[:'time_end'] if attributes[:'time_end']

  self.time_invoicing = attributes[:'timeInvoicing'] if attributes[:'timeInvoicing']

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

  self.time_invoicing = attributes[:'time_invoicing'] if attributes[:'time_invoicing']

  self.invoice_status = attributes[:'invoiceStatus'] if attributes[:'invoiceStatus']

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

  self.invoice_status = attributes[:'invoice_status'] if attributes[:'invoice_status']

  self.quantity = attributes[:'quantity'] if attributes[:'quantity']

  self.net_unit_price = attributes[:'netUnitPrice'] if attributes[:'netUnitPrice']

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

  self.net_unit_price = attributes[:'net_unit_price'] if attributes[:'net_unit_price']

  self.amount = attributes[:'amount'] if attributes[:'amount']

  self.billing_frequency = attributes[:'billingFrequency'] if attributes[:'billingFrequency']

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

  self.billing_frequency = attributes[:'billing_frequency'] if attributes[:'billing_frequency']

  self.ar_invoice_number = attributes[:'arInvoiceNumber'] if attributes[:'arInvoiceNumber']

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

  self.ar_invoice_number = attributes[:'ar_invoice_number'] if attributes[:'ar_invoice_number']

  self.ar_customer_transaction_id = attributes[:'arCustomerTransactionId'] if attributes[:'arCustomerTransactionId']

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

  self.ar_customer_transaction_id = attributes[:'ar_customer_transaction_id'] if attributes[:'ar_customer_transaction_id']

  self.order_number = attributes[:'orderNumber'] if attributes[:'orderNumber']

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

  self.order_number = attributes[:'order_number'] if attributes[:'order_number']

  self.product = attributes[:'product'] if attributes[:'product']
end

Instance Attribute Details

#amountString

Billing schedule line net amount

Returns:

  • (String)


57
58
59
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 57

def amount
  @amount
end

#ar_customer_transaction_idString

Indicates the associated AR Customer transaction id a unique identifier existing on AR.

Returns:

  • (String)


72
73
74
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 72

def ar_customer_transaction_id
  @ar_customer_transaction_id
end

#ar_invoice_numberString

Indicates the associated AR Invoice Number

Returns:

  • (String)


67
68
69
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 67

def ar_invoice_number
  @ar_invoice_number
end

#billing_frequencyString

Billing frequency

Returns:

  • (String)


62
63
64
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 62

def billing_frequency
  @billing_frequency
end

#invoice_statusString

Billing schedule invoice status

Returns:

  • (String)


42
43
44
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 42

def invoice_status
  @invoice_status
end

#net_unit_priceString

Billing schedule net unit price

Returns:

  • (String)


52
53
54
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 52

def net_unit_price
  @net_unit_price
end

#order_numberString

Order number associated with the Subscribed Service

Returns:

  • (String)


77
78
79
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 77

def order_number
  @order_number
end

#productOCI::Onesubscription::Models::BillingScheduleProduct



80
81
82
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 80

def product
  @product
end

#quantityString

Billing schedule quantity

Returns:

  • (String)


47
48
49
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 47

def quantity
  @quantity
end

#subscribed_service_idString

SPM internal Subscribed Service ID

Returns:

  • (String)


22
23
24
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 22

def subscribed_service_id
  @subscribed_service_id
end

#time_endDateTime

Billing schedule end date

Returns:

  • (DateTime)


32
33
34
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 32

def time_end
  @time_end
end

#time_invoicingDateTime

Billing schedule invoicing date

Returns:

  • (DateTime)


37
38
39
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 37

def time_invoicing
  @time_invoicing
end

#time_startDateTime

Billing schedule start date

Returns:

  • (DateTime)


27
28
29
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 27

def time_start
  @time_start
end

Class Method Details

.attribute_mapObject

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



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 83

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'subscribed_service_id': :'subscribedServiceId',
    'time_start': :'timeStart',
    'time_end': :'timeEnd',
    'time_invoicing': :'timeInvoicing',
    'invoice_status': :'invoiceStatus',
    'quantity': :'quantity',
    'net_unit_price': :'netUnitPrice',
    'amount': :'amount',
    'billing_frequency': :'billingFrequency',
    'ar_invoice_number': :'arInvoiceNumber',
    'ar_customer_transaction_id': :'arCustomerTransactionId',
    'order_number': :'orderNumber',
    'product': :'product'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 104

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'subscribed_service_id': :'String',
    'time_start': :'DateTime',
    'time_end': :'DateTime',
    'time_invoicing': :'DateTime',
    'invoice_status': :'String',
    'quantity': :'String',
    'net_unit_price': :'String',
    'amount': :'String',
    'billing_frequency': :'String',
    'ar_invoice_number': :'String',
    'ar_customer_transaction_id': :'String',
    'order_number': :'String',
    'product': :'OCI::Onesubscription::Models::BillingScheduleProduct'
    # 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



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 236

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    subscribed_service_id == other.subscribed_service_id &&
    time_start == other.time_start &&
    time_end == other.time_end &&
    time_invoicing == other.time_invoicing &&
    invoice_status == other.invoice_status &&
    quantity == other.quantity &&
    net_unit_price == other.net_unit_price &&
    amount == other.amount &&
    billing_frequency == other.billing_frequency &&
    ar_invoice_number == other.ar_invoice_number &&
    ar_customer_transaction_id == other.ar_customer_transaction_id &&
    order_number == other.order_number &&
    product == other.product
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



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 278

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


258
259
260
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 258

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



267
268
269
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 267

def hash
  [subscribed_service_id, time_start, time_end, time_invoicing, invoice_status, quantity, net_unit_price, amount, billing_frequency, ar_invoice_number, ar_customer_transaction_id, order_number, product].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



311
312
313
314
315
316
317
318
319
320
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 311

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



305
306
307
# File 'lib/oci/onesubscription/models/billing_schedule_summary.rb', line 305

def to_s
  to_hash.to_s
end