Class: Killbill::Plugin::Api::InvoiceUserApi

Inherits:
Object
  • Object
show all
Defined in:
lib/killbill/gen/api/invoice_user_api.rb

Instance Method Summary collapse

Constructor Details

#initialize(real_java_api) ⇒ InvoiceUserApi

Returns a new instance of InvoiceUserApi.



37
38
39
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 37

def initialize(real_java_api)
  @real_java_api = real_java_api
end

Instance Method Details

#commit_invoice(invoiceId, context) ⇒ Object



633
634
635
636
637
638
639
640
641
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 633

def commit_invoice(invoiceId, context)

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  @real_java_api.commit_invoice(invoiceId, context)
end

#consume_existing_cba_onaccount_with_unpaid_invoices(accountId, context) ⇒ Object



622
623
624
625
626
627
628
629
630
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 622

def consume_existing_cba_onaccount_with_unpaid_invoices(accountId, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  @real_java_api.consume_existing_cba_onaccount_with_unpaid_invoices(accountId, context)
end

#create_migration_invoice(accountId, invoiceDate, items, context) ⇒ Object



644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 644

def create_migration_invoice(accountId, invoiceDate, items, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for invoiceDate [type = org.joda.time.LocalDate]
  if !invoiceDate.nil?
    invoiceDate = Java::org.joda.time.LocalDate.parse(invoiceDate.to_s)
  end

  # conversion for items [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (items || []).each do |m|
    # conversion for m [type = org.killbill.billing.invoice.api.InvoiceItem]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  items = tmp

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  res = @real_java_api.create_migration_invoice(accountId, invoiceDate, items, context)
  # conversion for res [type = java.util.UUID]
  res = res.nil? ? nil : res.to_s
  return res
end

#delete_cba(accountId, invoiceId, invoiceItemId, context) ⇒ Object



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 584

def delete_cba(accountId, invoiceId, invoiceItemId, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for invoiceItemId [type = java.util.UUID]
  invoiceItemId = java.util.UUID.fromString(invoiceItemId.to_s) unless invoiceItemId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  @real_java_api.delete_cba(accountId, invoiceId, invoiceItemId, context)
end

#get_account_balance(accountId, context) ⇒ Object



106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 106

def (accountId, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  res = @real_java_api.(accountId, context)
  # conversion for res [type = java.math.BigDecimal]
  res = res.nil? ? 0 : BigDecimal.new(res.to_s)
  return res
end

#get_account_cba(accountId, context) ⇒ Object



120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 120

def (accountId, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  res = @real_java_api.(accountId, context)
  # conversion for res [type = java.math.BigDecimal]
  res = res.nil? ? 0 : BigDecimal.new(res.to_s)
  return res
end

#get_credit_by_id(creditId, context) ⇒ Object



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 420

def get_credit_by_id(creditId, context)

  # conversion for creditId [type = java.util.UUID]
  creditId = java.util.UUID.fromString(creditId.to_s) unless creditId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.get_credit_by_id(creditId, context)
    # conversion for res [type = org.killbill.billing.invoice.api.InvoiceItem]
    res = Killbill::Plugin::Model::InvoiceItem.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#get_external_charge_by_id(externalChargeId, context) ⇒ Object



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 302

def get_external_charge_by_id(externalChargeId, context)

  # conversion for externalChargeId [type = java.util.UUID]
  externalChargeId = java.util.UUID.fromString(externalChargeId.to_s) unless externalChargeId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.get_external_charge_by_id(externalChargeId, context)
    # conversion for res [type = org.killbill.billing.invoice.api.InvoiceItem]
    res = Killbill::Plugin::Model::InvoiceItem.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#get_invoice(invoiceId, context) ⇒ Object



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 134

def get_invoice(invoiceId, context)

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.get_invoice(invoiceId, context)
    # conversion for res [type = org.killbill.billing.invoice.api.Invoice]
    res = Killbill::Plugin::Model::Invoice.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#get_invoice_as_html(invoiceId, context) ⇒ Object



601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 601

def get_invoice_as_html(invoiceId, context)

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.get_invoice_as_html(invoiceId, context)
    # conversion for res [type = java.lang.String]
    return res
  rescue Java::org.killbill.billing..api.AccountApiException => e
    raise Killbill::Plugin::Model::AccountApiException.new.to_ruby(e)
  rescue Java::java.io.IOException => e
    raise ApiException.new("java.io.IOException: #{e.msg unless e.msg.nil?}")
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#get_invoice_by_invoice_item(invoiceItemId, context) ⇒ Object



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 188

def get_invoice_by_invoice_item(invoiceItemId, context)

  # conversion for invoiceItemId [type = java.util.UUID]
  invoiceItemId = java.util.UUID.fromString(invoiceItemId.to_s) unless invoiceItemId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.get_invoice_by_invoice_item(invoiceItemId, context)
    # conversion for res [type = org.killbill.billing.invoice.api.Invoice]
    res = Killbill::Plugin::Model::Invoice.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#get_invoice_by_number(number, context) ⇒ Object



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 170

def get_invoice_by_number(number, context)

  # conversion for number [type = java.lang.Integer]
  number = number

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.get_invoice_by_number(number, context)
    # conversion for res [type = org.killbill.billing.invoice.api.Invoice]
    res = Killbill::Plugin::Model::Invoice.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#get_invoice_by_payment(paymentId, context) ⇒ Object



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 152

def get_invoice_by_payment(paymentId, context)

  # conversion for paymentId [type = java.util.UUID]
  paymentId = java.util.UUID.fromString(paymentId.to_s) unless paymentId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.get_invoice_by_payment(paymentId, context)
    # conversion for res [type = org.killbill.billing.invoice.api.Invoice]
    res = Killbill::Plugin::Model::Invoice.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#get_invoice_items_by_parent_invoice(parentInvoiceId, context) ⇒ Object



683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 683

def get_invoice_items_by_parent_invoice(parentInvoiceId, context)

  # conversion for parentInvoiceId [type = java.util.UUID]
  parentInvoiceId = java.util.UUID.fromString(parentInvoiceId.to_s) unless parentInvoiceId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.get_invoice_items_by_parent_invoice(parentInvoiceId, context)
    # conversion for res [type = java.util.List]
    tmp = []
    (res || []).each do |m|
      # conversion for m [type = org.killbill.billing.invoice.api.InvoiceItem]
      m = Killbill::Plugin::Model::InvoiceItem.new.to_ruby(m) unless m.nil?
      tmp << m
    end
    res = tmp
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#get_invoices(offset, limit, context) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 69

def get_invoices(offset, limit, context)

  # conversion for offset [type = java.lang.Long]
  offset = offset

  # conversion for limit [type = java.lang.Long]
  limit = limit

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  res = @real_java_api.get_invoices(offset, limit, context)
  # conversion for res [type = org.killbill.billing.util.entity.Pagination]
  res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
  return res
end

#get_invoices_by_account(accountId, includesMigrated, includeVoidedInvoices, context) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 43

def (accountId, includesMigrated, includeVoidedInvoices, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for includesMigrated [type = boolean]
  includesMigrated = includesMigrated.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(includesMigrated)

  # conversion for includeVoidedInvoices [type = boolean]
  includeVoidedInvoices = includeVoidedInvoices.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(includeVoidedInvoices)

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  res = @real_java_api.(accountId, includesMigrated, includeVoidedInvoices, context)
  # conversion for res [type = java.util.List]
  tmp = []
  (res || []).each do |m|
    # conversion for m [type = org.killbill.billing.invoice.api.Invoice]
    m = Killbill::Plugin::Model::Invoice.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  res = tmp
  return res
end

#get_unpaid_invoices_by_account_id(accountId, upToDate, context) ⇒ Object



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 206

def (accountId, upToDate, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for upToDate [type = org.joda.time.LocalDate]
  if !upToDate.nil?
    upToDate = Java::org.joda.time.LocalDate.parse(upToDate.to_s)
  end

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  res = @real_java_api.(accountId, upToDate, context)
  # conversion for res [type = java.util.Collection]
  tmp = []
  (res || []).each do |m|
    # conversion for m [type = org.killbill.billing.invoice.api.Invoice]
    m = Killbill::Plugin::Model::Invoice.new.to_ruby(m) unless m.nil?
    tmp << m
  end
  res = tmp
  return res
end

#insert_credit(accountId, amount, effectiveDate, currency, autoCommit, description, itemDetails, properties, context) ⇒ Object



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 438

def insert_credit(accountId, amount, effectiveDate, currency, autoCommit, description, itemDetails, properties, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for amount [type = java.math.BigDecimal]
  if amount.nil?
    amount = java.math.BigDecimal::ZERO
  else
    amount = java.math.BigDecimal.new(amount.to_s)
  end

  # conversion for effectiveDate [type = org.joda.time.LocalDate]
  if !effectiveDate.nil?
    effectiveDate = Java::org.joda.time.LocalDate.parse(effectiveDate.to_s)
  end

  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
  currency = Java::org.killbill.billing.catalog.api.Currency.value_of( currency.to_s ) unless currency.nil?

  # conversion for autoCommit [type = boolean]
  autoCommit = autoCommit.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(autoCommit)

  # conversion for description [type = java.lang.String]
  description = description.to_s unless description.nil?

  # conversion for itemDetails [type = java.lang.String]
  itemDetails = itemDetails.to_s unless itemDetails.nil?

  # conversion for properties [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (properties || []).each do |m|
    # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  properties = tmp

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.insert_credit(accountId, amount, effectiveDate, currency, autoCommit, description, itemDetails, properties, context)
    # conversion for res [type = org.killbill.billing.invoice.api.InvoiceItem]
    res = Killbill::Plugin::Model::InvoiceItem.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#insert_credit_for_invoice(accountId, invoiceId, amount, effectiveDate, currency, description, itemDetails, properties, context) ⇒ Object



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 489

def insert_credit_for_invoice(accountId, invoiceId, amount, effectiveDate, currency, description, itemDetails, properties, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for amount [type = java.math.BigDecimal]
  if amount.nil?
    amount = java.math.BigDecimal::ZERO
  else
    amount = java.math.BigDecimal.new(amount.to_s)
  end

  # conversion for effectiveDate [type = org.joda.time.LocalDate]
  if !effectiveDate.nil?
    effectiveDate = Java::org.joda.time.LocalDate.parse(effectiveDate.to_s)
  end

  # conversion for currency [type = org.killbill.billing.catalog.api.Currency]
  currency = Java::org.killbill.billing.catalog.api.Currency.value_of( currency.to_s ) unless currency.nil?

  # conversion for description [type = java.lang.String]
  description = description.to_s unless description.nil?

  # conversion for itemDetails [type = java.lang.String]
  itemDetails = itemDetails.to_s unless itemDetails.nil?

  # conversion for properties [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (properties || []).each do |m|
    # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  properties = tmp

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.insert_credit_for_invoice(accountId, invoiceId, amount, effectiveDate, currency, description, itemDetails, properties, context)
    # conversion for res [type = org.killbill.billing.invoice.api.InvoiceItem]
    res = Killbill::Plugin::Model::InvoiceItem.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#insert_external_charges(accountId, effectiveDate, charges, autoCommit, properties, context) ⇒ Object



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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 320

def insert_external_charges(accountId, effectiveDate, charges, autoCommit, properties, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for effectiveDate [type = org.joda.time.LocalDate]
  if !effectiveDate.nil?
    effectiveDate = Java::org.joda.time.LocalDate.parse(effectiveDate.to_s)
  end

  # conversion for charges [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (charges || []).each do |m|
    # conversion for m [type = org.killbill.billing.invoice.api.InvoiceItem]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  charges = tmp

  # conversion for autoCommit [type = boolean]
  autoCommit = autoCommit.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(autoCommit)

  # conversion for properties [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (properties || []).each do |m|
    # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  properties = tmp

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.insert_external_charges(accountId, effectiveDate, charges, autoCommit, properties, context)
    # conversion for res [type = java.util.List]
    tmp = []
    (res || []).each do |m|
      # conversion for m [type = org.killbill.billing.invoice.api.InvoiceItem]
      m = Killbill::Plugin::Model::InvoiceItem.new.to_ruby(m) unless m.nil?
      tmp << m
    end
    res = tmp
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#insert_invoice_item_adjustment(accountId, invoiceId, invoiceItemId, effectiveDate, description, itemDetails, properties, context) ⇒ Object



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 540

def insert_invoice_item_adjustment(accountId, invoiceId, invoiceItemId, effectiveDate, description, itemDetails, properties, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for invoiceItemId [type = java.util.UUID]
  invoiceItemId = java.util.UUID.fromString(invoiceItemId.to_s) unless invoiceItemId.nil?

  # conversion for effectiveDate [type = org.joda.time.LocalDate]
  if !effectiveDate.nil?
    effectiveDate = Java::org.joda.time.LocalDate.parse(effectiveDate.to_s)
  end

  # conversion for description [type = java.lang.String]
  description = description.to_s unless description.nil?

  # conversion for itemDetails [type = java.lang.String]
  itemDetails = itemDetails.to_s unless itemDetails.nil?

  # conversion for properties [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (properties || []).each do |m|
    # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  properties = tmp

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.insert_invoice_item_adjustment(accountId, invoiceId, invoiceItemId, effectiveDate, description, itemDetails, properties, context)
    # conversion for res [type = org.killbill.billing.invoice.api.InvoiceItem]
    res = Killbill::Plugin::Model::InvoiceItem.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#insert_tax_items(accountId, effectiveDate, taxes, autoCommit, properties, context) ⇒ Object



370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
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
416
417
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 370

def insert_tax_items(accountId, effectiveDate, taxes, autoCommit, properties, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for effectiveDate [type = org.joda.time.LocalDate]
  if !effectiveDate.nil?
    effectiveDate = Java::org.joda.time.LocalDate.parse(effectiveDate.to_s)
  end

  # conversion for taxes [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (taxes || []).each do |m|
    # conversion for m [type = org.killbill.billing.invoice.api.InvoiceItem]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  taxes = tmp

  # conversion for autoCommit [type = boolean]
  autoCommit = autoCommit.nil? ? java.lang.Boolean.new(false) : java.lang.Boolean.new(autoCommit)

  # conversion for properties [type = java.lang.Iterable]
  tmp = java.util.ArrayList.new
  (properties || []).each do |m|
    # conversion for m [type = org.killbill.billing.payment.api.PluginProperty]
    m = m.to_java unless m.nil?
    tmp.add(m)
  end
  properties = tmp

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.insert_tax_items(accountId, effectiveDate, taxes, autoCommit, properties, context)
    # conversion for res [type = java.util.List]
    tmp = []
    (res || []).each do |m|
      # conversion for m [type = org.killbill.billing.invoice.api.InvoiceItem]
      m = Killbill::Plugin::Model::InvoiceItem.new.to_ruby(m) unless m.nil?
      tmp << m
    end
    res = tmp
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#search_invoices(searchKey, offset, limit, context) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 86

def search_invoices(searchKey, offset, limit, context)

  # conversion for searchKey [type = java.lang.String]
  searchKey = searchKey.to_s unless searchKey.nil?

  # conversion for offset [type = java.lang.Long]
  offset = offset

  # conversion for limit [type = java.lang.Long]
  limit = limit

  # conversion for context [type = org.killbill.billing.util.callcontext.TenantContext]
  context = context.to_java unless context.nil?
  res = @real_java_api.search_invoices(searchKey, offset, limit, context)
  # conversion for res [type = org.killbill.billing.util.entity.Pagination]
  res = Killbill::Plugin::Model::Pagination.new.to_ruby(res) unless res.nil?
  return res
end

#tag_invoice_as_not_written_off(invoiceId, context) ⇒ Object



291
292
293
294
295
296
297
298
299
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 291

def tag_invoice_as_not_written_off(invoiceId, context)

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  @real_java_api.tag_invoice_as_not_written_off(invoiceId, context)
end

#tag_invoice_as_written_off(invoiceId, context) ⇒ Object



280
281
282
283
284
285
286
287
288
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 280

def tag_invoice_as_written_off(invoiceId, context)

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  @real_java_api.tag_invoice_as_written_off(invoiceId, context)
end

#transfer_child_credit_to_parent(childAccountId, context) ⇒ Object



672
673
674
675
676
677
678
679
680
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 672

def transfer_child_credit_to_parent(childAccountId, context)

  # conversion for childAccountId [type = java.util.UUID]
  childAccountId = java.util.UUID.fromString(childAccountId.to_s) unless childAccountId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  @real_java_api.transfer_child_credit_to_parent(childAccountId, context)
end

#trigger_dry_run_invoice_generation(accountId, targetDate, dryRunArguments, context) ⇒ Object



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 254

def trigger_dry_run_invoice_generation(accountId, targetDate, dryRunArguments, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for targetDate [type = org.joda.time.LocalDate]
  if !targetDate.nil?
    targetDate = Java::org.joda.time.LocalDate.parse(targetDate.to_s)
  end

  # conversion for dryRunArguments [type = org.killbill.billing.invoice.api.DryRunArguments]
  dryRunArguments = dryRunArguments.to_java unless dryRunArguments.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.trigger_dry_run_invoice_generation(accountId, targetDate, dryRunArguments, context)
    # conversion for res [type = org.killbill.billing.invoice.api.Invoice]
    res = Killbill::Plugin::Model::Invoice.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#trigger_invoice_generation(accountId, targetDate, context) ⇒ Object



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 231

def trigger_invoice_generation(accountId, targetDate, context)

  # conversion for accountId [type = java.util.UUID]
  accountId = java.util.UUID.fromString(accountId.to_s) unless accountId.nil?

  # conversion for targetDate [type = org.joda.time.LocalDate]
  if !targetDate.nil?
    targetDate = Java::org.joda.time.LocalDate.parse(targetDate.to_s)
  end

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  begin
    res = @real_java_api.trigger_invoice_generation(accountId, targetDate, context)
    # conversion for res [type = org.killbill.billing.invoice.api.Invoice]
    res = Killbill::Plugin::Model::Invoice.new.to_ruby(res) unless res.nil?
    return res
  rescue Java::org.killbill.billing.invoice.api.InvoiceApiException => e
    raise Killbill::Plugin::Model::InvoiceApiException.new.to_ruby(e)
  end
end

#void_invoice(invoiceId, context) ⇒ Object



707
708
709
710
711
712
713
714
715
# File 'lib/killbill/gen/api/invoice_user_api.rb', line 707

def void_invoice(invoiceId, context)

  # conversion for invoiceId [type = java.util.UUID]
  invoiceId = java.util.UUID.fromString(invoiceId.to_s) unless invoiceId.nil?

  # conversion for context [type = org.killbill.billing.util.callcontext.CallContext]
  context = context.to_java unless context.nil?
  @real_java_api.void_invoice(invoiceId, context)
end