File size: 2,440 Bytes
1477a90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { type Client } from '../core.js'
import { unwrap, type RequestOptions } from '../lib/types.js'
import {
  listInvoices,
  getInvoice,
  updateInvoice,
  deleteInvoice,
  advanceInvoice,
  approveInvoice,
  retryInvoice,
  snapshotQuantitiesInvoice,
} from '../funcs/invoices.js'
import type {
  ListInvoicesRequest,
  ListInvoicesResponse,
  GetInvoiceRequest,
  GetInvoiceResponse,
  UpdateInvoiceRequest,
  UpdateInvoiceResponse,
  DeleteInvoiceRequest,
  DeleteInvoiceResponse,
  AdvanceInvoiceRequest,
  AdvanceInvoiceResponse,
  ApproveInvoiceRequest,
  ApproveInvoiceResponse,
  RetryInvoiceRequest,
  RetryInvoiceResponse,
  SnapshotQuantitiesInvoiceRequest,
  SnapshotQuantitiesInvoiceResponse,
} from '../models/operations/invoices.js'

export class Invoices {
  constructor(private readonly _client: Client) {}

  async list(
    request?: ListInvoicesRequest,
    options?: RequestOptions,
  ): Promise<ListInvoicesResponse> {
    return unwrap(await listInvoices(this._client, request, options))
  }

  async get(
    request: GetInvoiceRequest,
    options?: RequestOptions,
  ): Promise<GetInvoiceResponse> {
    return unwrap(await getInvoice(this._client, request, options))
  }

  async update(
    request: UpdateInvoiceRequest,
    options?: RequestOptions,
  ): Promise<UpdateInvoiceResponse> {
    return unwrap(await updateInvoice(this._client, request, options))
  }

  async delete(
    request: DeleteInvoiceRequest,
    options?: RequestOptions,
  ): Promise<DeleteInvoiceResponse> {
    return unwrap(await deleteInvoice(this._client, request, options))
  }

  async advance(
    request: AdvanceInvoiceRequest,
    options?: RequestOptions,
  ): Promise<AdvanceInvoiceResponse> {
    return unwrap(await advanceInvoice(this._client, request, options))
  }

  async approve(
    request: ApproveInvoiceRequest,
    options?: RequestOptions,
  ): Promise<ApproveInvoiceResponse> {
    return unwrap(await approveInvoice(this._client, request, options))
  }

  async retry(
    request: RetryInvoiceRequest,
    options?: RequestOptions,
  ): Promise<RetryInvoiceResponse> {
    return unwrap(await retryInvoice(this._client, request, options))
  }

  async snapshotQuantities(
    request: SnapshotQuantitiesInvoiceRequest,
    options?: RequestOptions,
  ): Promise<SnapshotQuantitiesInvoiceResponse> {
    return unwrap(
      await snapshotQuantitiesInvoice(this._client, request, options),
    )
  }
}