Skip to content

Commit c5eb0a4

Browse files
Merge pull request #48 from pagarme/CodeGen-NodeJS
Adding property legal_name with sdk version 6.8.16
2 parents e782f49 + b24206b commit c5eb0a4

31 files changed

+3688
-3341
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ License:
33
The MIT License (MIT)
44
http://opensource.org/licenses/MIT
55

6-
Copyright (c) 2014 - 2024 APIMATIC Limited
6+
Copyright (c) 2014 - 2025 APIMATIC Limited
77

88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ npm install
7171

7272
## Initialize the API Client
7373

74-
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/client.md)
74+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/client.md)
7575

7676
The following parameters are configurable for the API Client:
7777

@@ -81,7 +81,7 @@ The following parameters are configurable for the API Client:
8181
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `0` |
8282
| `httpClientOptions` | `Partial<HttpClientOptions>` | Stable configurable http client options. |
8383
| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. |
84-
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/auth/basic-authentication.md) | The credential object for basicAuth |
84+
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/auth/basic-authentication.md) | The credential object for basicAuth |
8585

8686
### HttpClientOptions
8787

@@ -121,38 +121,39 @@ const client = new Client({
121121

122122
This API uses the following authentication schemes.
123123

124-
* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/auth/basic-authentication.md)
124+
* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/auth/basic-authentication.md)
125125

126126
## API Errors
127127

128128
Here is the list of errors that the API might throw.
129129

130130
| HTTP Status Code | Error Description | Exception Class |
131131
| --- | --- | --- |
132-
| 400 | Invalid request | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/models/custom-error.md) |
133-
| 401 | Invalid API key | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/models/custom-error.md) |
134-
| 404 | An informed resource was not found | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/models/custom-error.md) |
135-
| 412 | Business validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/models/custom-error.md) |
136-
| 422 | Contract validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/models/custom-error.md) |
137-
| 500 | Internal server error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/models/custom-error.md) |
132+
| 400 | Invalid request | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/models/custom-error.md) |
133+
| 401 | Invalid API key | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/models/custom-error.md) |
134+
| 404 | An informed resource was not found | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/models/custom-error.md) |
135+
| 412 | Business validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/models/custom-error.md) |
136+
| 422 | Contract validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/models/custom-error.md) |
137+
| 500 | Internal server error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/models/custom-error.md) |
138138

139139
## List of APIs
140140

141-
* [Subscriptions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/subscriptions.md)
142-
* [Orders](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/orders.md)
143-
* [Plans](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/plans.md)
144-
* [Invoices](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/invoices.md)
145-
* [Customers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/customers.md)
146-
* [Charges](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/charges.md)
147-
* [Recipients](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/recipients.md)
148-
* [Tokens](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/tokens.md)
149-
* [Transactions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/transactions.md)
150-
* [Transfers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/transfers.md)
151-
* [Payables](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/payables.md)
152-
* [Balance Operations](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/controllers/balance-operations.md)
141+
* [Subscriptions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/subscriptions.md)
142+
* [Orders](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/orders.md)
143+
* [Plans](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/plans.md)
144+
* [Invoices](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/invoices.md)
145+
* [Customers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/customers.md)
146+
* [Charges](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/charges.md)
147+
* [Recipients](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/recipients.md)
148+
* [Tokens](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/tokens.md)
149+
* [Transactions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/transactions.md)
150+
* [Transfers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/transfers.md)
151+
* [Payables](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/payables.md)
152+
* [Balance Operations](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/controllers/balance-operations.md)
153153

154154
## Classes Documentation
155155

156-
* [ApiResponse](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/api-response.md)
157-
* [ApiError](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.15/doc/api-error.md)
156+
* [ApiResponse](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/api-response.md)
157+
* [HttpRequest](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/http-request.md)
158+
* [ApiError](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.16/doc/api-error.md)
158159

doc/api-response.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11

22
# ApiResponse
33

4-
An interface for the result of an API call.
4+
Represents the result of an API call, including response metadata and the returned data of type `T`.
55

66
## Properties
77

88
| Name | Type | Description |
99
| --- | --- | --- |
10-
| request | HttpRequest | Original request that resulted in this response. |
11-
| statusCode | number | Response status codee. |
12-
| headers | Record<string, string> | Response headers. |
13-
| result | T | Response data. |
14-
| body | string \| Blob \| NodeJS.ReadableStream | Original body from the response. |
10+
| request | [`HttpRequest`](http-request.md) | Original request that resulted in this response. |
11+
| statusCode | `number` | Response status codee. |
12+
| headers | `Record<string, string>` | Response headers. |
13+
| result | `T` | Response data. |
14+
| body | `string \| Blob \| NodeJS.ReadableStream` | Original body from the response. |
15+
16+
## Example Usage
17+
18+
```ts
19+
try {
20+
const exampleController = new ExampleController(client);
21+
const response = exampleController.getExampleType(body);
22+
console.log('Success! Result:', response.result);
23+
console.log('Status Code:', response.statusCode);
24+
} catch (error) {
25+
if (error instanceof ApiError) {
26+
console.log('Error:', error.message);
27+
console.log('Result:', error.body);
28+
console.log('Status Code:', error.statusCode);
29+
}
30+
}
31+
```
1532

doc/controllers/balance-operations.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,41 @@ const balanceOperationsController = new BalanceOperationsController(client);
1010

1111
## Methods
1212

13-
* [Get Balance Operation by Id](../../doc/controllers/balance-operations.md#get-balance-operation-by-id)
1413
* [Get Balance Operations](../../doc/controllers/balance-operations.md#get-balance-operations)
14+
* [Get Balance Operation by Id](../../doc/controllers/balance-operations.md#get-balance-operation-by-id)
1515

1616

17-
# Get Balance Operation by Id
17+
# Get Balance Operations
1818

1919
```ts
20-
async getBalanceOperationById( id: bigint,
21-
requestOptions?: RequestOptions): Promise<ApiResponse<GetBalanceOperationResponse>>
20+
async getBalanceOperations(
21+
status?: string,
22+
createdSince?: string,
23+
createdUntil?: string,
24+
recipientId?: string,
25+
requestOptions?: RequestOptions
26+
): Promise<ApiResponse<ListBalanceOperationResponse>>
2227
```
2328

2429
## Parameters
2530

2631
| Parameter | Type | Tags | Description |
2732
| --- | --- | --- | --- |
28-
| `id` | `bigint` | Template, Required | - |
33+
| `status` | `string \| undefined` | Query, Optional | - |
34+
| `createdSince` | `string \| undefined` | Query, Optional | - |
35+
| `createdUntil` | `string \| undefined` | Query, Optional | - |
36+
| `recipientId` | `string \| undefined` | Query, Optional | - |
2937
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
3038

3139
## Response Type
3240

33-
[`GetBalanceOperationResponse`](../../doc/models/get-balance-operation-response.md)
41+
This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `result` property of this instance returns the response data which is of type [ListBalanceOperationResponse](../../doc/models/list-balance-operation-response.md).
3442

3543
## Example Usage
3644

3745
```ts
38-
const id = BigInt(112);
39-
4046
try {
41-
const { result, ...httpResponse } = await balanceOperationsController.getBalanceOperationById(id);
47+
const { result, ...httpResponse } = await balanceOperationsController.getBalanceOperations();
4248
// Get more response info...
4349
// const { statusCode, headers } = httpResponse;
4450
} catch (error) {
@@ -50,35 +56,33 @@ try {
5056
```
5157

5258

53-
# Get Balance Operations
59+
# Get Balance Operation by Id
5460

5561
```ts
56-
async getBalanceOperations( status?: string,
57-
createdSince?: string,
58-
createdUntil?: string,
59-
recipientId?: string,
60-
requestOptions?: RequestOptions): Promise<ApiResponse<ListBalanceOperationResponse>>
62+
async getBalanceOperationById(
63+
id: bigint,
64+
requestOptions?: RequestOptions
65+
): Promise<ApiResponse<GetBalanceOperationResponse>>
6166
```
6267

6368
## Parameters
6469

6570
| Parameter | Type | Tags | Description |
6671
| --- | --- | --- | --- |
67-
| `status` | `string \| undefined` | Query, Optional | - |
68-
| `createdSince` | `string \| undefined` | Query, Optional | - |
69-
| `createdUntil` | `string \| undefined` | Query, Optional | - |
70-
| `recipientId` | `string \| undefined` | Query, Optional | - |
72+
| `id` | `bigint` | Template, Required | - |
7173
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
7274

7375
## Response Type
7476

75-
[`ListBalanceOperationResponse`](../../doc/models/list-balance-operation-response.md)
77+
This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `result` property of this instance returns the response data which is of type [GetBalanceOperationResponse](../../doc/models/get-balance-operation-response.md).
7678

7779
## Example Usage
7880

7981
```ts
82+
const id = BigInt(112);
83+
8084
try {
81-
const { result, ...httpResponse } = await balanceOperationsController.getBalanceOperations();
85+
const { result, ...httpResponse } = await balanceOperationsController.getBalanceOperationById(id);
8286
// Get more response info...
8387
// const { statusCode, headers } = httpResponse;
8488
} catch (error) {

0 commit comments

Comments
 (0)