Class: OCI::Onesubscription::Models::InvoiceSummary

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

Overview

Invoice details

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ InvoiceSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
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
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 181

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

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

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

  self.ar_invoices = attributes[:'arInvoices'] if attributes[:'arInvoices']

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

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

  self.bill_to_customer = attributes[:'billToCustomer'] if attributes[:'billToCustomer']

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

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

  self.bill_to_contact = attributes[:'billToContact'] if attributes[:'billToContact']

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

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

  self.bill_to_address = attributes[:'billToAddress'] if attributes[:'billToAddress']

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

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

  self.payment_method = attributes[:'paymentMethod'] if attributes[:'paymentMethod']

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

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

  self.payment_term = attributes[:'paymentTerm'] if attributes[:'paymentTerm']

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

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

  self.receipt_method = attributes[:'receiptMethod'] if attributes[:'receiptMethod']

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

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

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

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

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

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

  self.subscription_number = attributes[:'subscriptionNumber'] if attributes[:'subscriptionNumber']

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

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

  self.time_invoice_date = attributes[:'timeInvoiceDate'] if attributes[:'timeInvoiceDate']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.created_by = attributes[:'createdBy'] if attributes[:'createdBy']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.updated_by = attributes[:'updatedBy'] if attributes[:'updatedBy']

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

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

  self.invoice_lines = attributes[:'invoiceLines'] if attributes[:'invoiceLines']

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

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

Instance Attribute Details

#ar_invoicesString

AR Invoice Numbers comma separated under one invoice

Returns:

  • (String)


21
22
23
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 21

def ar_invoices
  @ar_invoices
end

#bill_to_addressOCI::Onesubscription::Models::InvoicingAddress

This attribute is required.



33
34
35
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 33

def bill_to_address
  @bill_to_address
end

#bill_to_contactOCI::Onesubscription::Models::InvoicingUser

This attribute is required.



29
30
31
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 29

def bill_to_contact
  @bill_to_contact
end

#bill_to_customerOCI::Onesubscription::Models::InvoicingBusinessPartner

This attribute is required.



25
26
27
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 25

def bill_to_customer
  @bill_to_customer
end

#created_byString

User that executed SPM Invoice process

Returns:

  • (String)


85
86
87
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 85

def created_by
  @created_by
end

#currencyOCI::Onesubscription::Models::InvoicingCurrency

This attribute is required.



51
52
53
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 51

def currency
  @currency
end

#invoice_linesArray<OCI::Onesubscription::Models::InvoiceLineSummary>

Invoice Lines under particular invoice.



100
101
102
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 100

def invoice_lines
  @invoice_lines
end

#organizationOCI::Onesubscription::Models::InvoicingOrganization

This attribute is required.



55
56
57
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 55

def organization
  @organization
end

#payment_methodString

[Required] Payment Method

Returns:

  • (String)


38
39
40
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 38

def payment_method
  @payment_method
end

#payment_termOCI::Onesubscription::Models::InvoicingPaymentTerm

This attribute is required.



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

def payment_term
  @payment_term
end

#receipt_methodString

Receipt Method of Payment Mode

Returns:

  • (String)


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

def receipt_method
  @receipt_method
end

#spm_invoice_numberString

[Required] SPM Document Number is an functional identifier for invoice in SPM

Returns:

  • (String)


16
17
18
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 16

def spm_invoice_number
  @spm_invoice_number
end

#statusString

[Required] Document Status in SPM which depicts current state of invoice

Returns:

  • (String)


65
66
67
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 65

def status
  @status
end

#subscription_numberString

[Required] Invoice associated subscription plan number.

Returns:

  • (String)


70
71
72
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 70

def subscription_number
  @subscription_number
end

#time_createdDateTime

SPM Invocie creation date

Returns:

  • (DateTime)


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

def time_created
  @time_created
end

#time_invoice_dateDateTime

[Required] Invoice Date

Returns:

  • (DateTime)


75
76
77
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 75

def time_invoice_date
  @time_invoice_date
end

#time_updatedDateTime

SPM Invoice updated date

Returns:

  • (DateTime)


90
91
92
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 90

def time_updated
  @time_updated
end

#typeString

[Required] Document Type in SPM like SPM Invoice,SPM Credit Memo etc.,

Returns:

  • (String)


60
61
62
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 60

def type
  @type
end

#updated_byString

User that updated SPM Invoice

Returns:

  • (String)


95
96
97
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 95

def updated_by
  @updated_by
end

Class Method Details

.attribute_mapObject

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



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 103

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'spm_invoice_number': :'spmInvoiceNumber',
    'ar_invoices': :'arInvoices',
    'bill_to_customer': :'billToCustomer',
    'bill_to_contact': :'billToContact',
    'bill_to_address': :'billToAddress',
    'payment_method': :'paymentMethod',
    'payment_term': :'paymentTerm',
    'receipt_method': :'receiptMethod',
    'currency': :'currency',
    'organization': :'organization',
    'type': :'type',
    'status': :'status',
    'subscription_number': :'subscriptionNumber',
    'time_invoice_date': :'timeInvoiceDate',
    'time_created': :'timeCreated',
    'created_by': :'createdBy',
    'time_updated': :'timeUpdated',
    'updated_by': :'updatedBy',
    'invoice_lines': :'invoiceLines'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 130

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'spm_invoice_number': :'String',
    'ar_invoices': :'String',
    'bill_to_customer': :'OCI::Onesubscription::Models::InvoicingBusinessPartner',
    'bill_to_contact': :'OCI::Onesubscription::Models::InvoicingUser',
    'bill_to_address': :'OCI::Onesubscription::Models::InvoicingAddress',
    'payment_method': :'String',
    'payment_term': :'OCI::Onesubscription::Models::InvoicingPaymentTerm',
    'receipt_method': :'String',
    'currency': :'OCI::Onesubscription::Models::InvoicingCurrency',
    'organization': :'OCI::Onesubscription::Models::InvoicingOrganization',
    'type': :'String',
    'status': :'String',
    'subscription_number': :'String',
    'time_invoice_date': :'DateTime',
    'time_created': :'DateTime',
    'created_by': :'String',
    'time_updated': :'DateTime',
    'updated_by': :'String',
    'invoice_lines': :'Array<OCI::Onesubscription::Models::InvoiceLineSummary>'
    # 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



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 293

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

  self.class == other.class &&
    spm_invoice_number == other.spm_invoice_number &&
    ar_invoices == other.ar_invoices &&
    bill_to_customer == other.bill_to_customer &&
    bill_to_contact == other.bill_to_contact &&
    bill_to_address == other.bill_to_address &&
    payment_method == other.payment_method &&
    payment_term == other.payment_term &&
    receipt_method == other.receipt_method &&
    currency == other.currency &&
    organization == other.organization &&
    type == other.type &&
    status == other.status &&
    subscription_number == other.subscription_number &&
    time_invoice_date == other.time_invoice_date &&
    time_created == other.time_created &&
    created_by == other.created_by &&
    time_updated == other.time_updated &&
    updated_by == other.updated_by &&
    invoice_lines == other.invoice_lines
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



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 341

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


321
322
323
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 321

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



330
331
332
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 330

def hash
  [spm_invoice_number, ar_invoices, bill_to_customer, bill_to_contact, bill_to_address, payment_method, payment_term, receipt_method, currency, organization, type, status, subscription_number, time_invoice_date, time_created, created_by, time_updated, updated_by, invoice_lines].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



374
375
376
377
378
379
380
381
382
383
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 374

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



368
369
370
# File 'lib/oci/onesubscription/models/invoice_summary.rb', line 368

def to_s
  to_hash.to_s
end