Class: OCI::OsubBillingSchedule::Models::BillingScheduleSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/osub_billing_schedule/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):



135
136
137
138
139
140
141
142
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
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 135

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


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

def amount
  @amount
end

#ar_customer_transaction_idString

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

Returns:

  • (String)


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

def ar_customer_transaction_id
  @ar_customer_transaction_id
end

#ar_invoice_numberString

Indicates the associated AR Invoice Number

Returns:

  • (String)


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

def ar_invoice_number
  @ar_invoice_number
end

#billing_frequencyString

Billing frequency

Returns:

  • (String)


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

def billing_frequency
  @billing_frequency
end

#invoice_statusString

Billing schedule invoice status

Returns:

  • (String)


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

def invoice_status
  @invoice_status
end

#net_unit_priceString

Billing schedule net unit price

Returns:

  • (String)


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

def net_unit_price
  @net_unit_price
end

#order_numberString

Order number associated with the Subscribed Service

Returns:

  • (String)


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

def order_number
  @order_number
end

#productOCI::OsubBillingSchedule::Models::Product



75
76
77
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 75

def product
  @product
end

#quantityString

Billing schedule quantity

Returns:

  • (String)


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

def quantity
  @quantity
end

#time_endDateTime

Billing schedule end date

Returns:

  • (DateTime)


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

def time_end
  @time_end
end

#time_invoicingDateTime

Billing schedule invoicing date

Returns:

  • (DateTime)


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

def time_invoicing
  @time_invoicing
end

#time_startDateTime

Billing schedule start date

Returns:

  • (DateTime)


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

def time_start
  @time_start
end

Class Method Details

.attribute_mapObject

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



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 78

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    '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.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 98

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    '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::OsubBillingSchedule::Models::Product'
    # 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



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 222

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

  self.class == other.class &&
    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



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 263

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


243
244
245
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 243

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



252
253
254
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 252

def hash
  [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



296
297
298
299
300
301
302
303
304
305
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 296

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



290
291
292
# File 'lib/oci/osub_billing_schedule/models/billing_schedule_summary.rb', line 290

def to_s
  to_hash.to_s
end