Skip to content

Commit

Permalink
Merge pull request #492 from codatio/speakeasy-sdk-regen-1700565530
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate Bank Feeds library
  • Loading branch information
dcoplowe authored Nov 21, 2023
2 parents 6a28d71 + 30756ac commit 6bafd01
Show file tree
Hide file tree
Showing 217 changed files with 2,049 additions and 1,734 deletions.
Empty file modified bank-feeds/.eslintrc.yml
100755 → 100644
Empty file.
Empty file modified bank-feeds/.gitattributes
100755 → 100644
Empty file.
261 changes: 250 additions & 11 deletions bank-feeds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ yarn add @codat/bank-feeds

## Example Usage
<!-- Start SDK Example Usage -->
### Example

```typescript
import { CodatBankFeeds } from "@codat/bank-feeds";

Expand All @@ -32,12 +34,9 @@ import { CodatBankFeeds } from "@codat/bank-feeds";
},
});

const res = await sdk.accountMapping.create({
requestBody: {
feedStartDate: "2022-10-23T00:00:00.000Z",
},
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
const res = await sdk.companies.create({
description: "Requested early access to the new financing scheme.",
name: "Bank of Dave",
});

if (res.statusCode == 200) {
Expand All @@ -52,11 +51,6 @@ import { CodatBankFeeds } from "@codat/bank-feeds";
## Available Resources and Operations


### [accountMapping](docs/sdks/accountmapping/README.md)

* [create](docs/sdks/accountmapping/README.md#create) - Create bank feed account mapping
* [get](docs/sdks/accountmapping/README.md#get) - List bank feed account mappings

### [companies](docs/sdks/companies/README.md)

* [create](docs/sdks/companies/README.md#create) - Create company
Expand All @@ -73,6 +67,11 @@ import { CodatBankFeeds } from "@codat/bank-feeds";
* [list](docs/sdks/connections/README.md#list) - List connections
* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection

### [accountMapping](docs/sdks/accountmapping/README.md)

* [create](docs/sdks/accountmapping/README.md#create) - Create bank feed account mapping
* [get](docs/sdks/accountmapping/README.md#get) - List bank feed account mappings

### [sourceAccounts](docs/sdks/sourceaccounts/README.md)

* [create](docs/sdks/sourceaccounts/README.md#create) - Create source account
Expand All @@ -97,6 +96,246 @@ import { CodatBankFeeds } from "@codat/bank-feeds";

<!-- End Dev Containers -->



<!-- Start Retries -->
## Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
```typescript
import { CodatBankFeeds } from "@codat/bank-feeds";

(async () => {
const sdk = new CodatBankFeeds({
security: {
authHeader: "Basic BASE_64_ENCODED(API_KEY)",
},
});

const res = await sdk.companies.create(
{
description: "Requested early access to the new financing scheme.",
name: "Bank of Dave",
},
{
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
}
);

if (res.statusCode == 200) {
// handle response
}
})();

```

If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
```typescript
import { CodatBankFeeds } from "@codat/bank-feeds";

(async () => {
const sdk = new CodatBankFeeds({
retry_config: {
strategy: "backoff",
backoff: {
initialInterval: 1,
maxInterval: 50,
exponent: 1.1,
maxElapsedTime: 100,
},
retryConnectionErrors: false,
},
security: {
authHeader: "Basic BASE_64_ENCODED(API_KEY)",
},
});

const res = await sdk.companies.create({
description: "Requested early access to the new financing scheme.",
name: "Bank of Dave",
});

if (res.statusCode == 200) {
// handle response
}
})();

```
<!-- End Retries -->



<!-- Start Error Handling -->
## Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.

| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 400-600 | */* |

Example

```typescript
import { CodatBankFeeds } from "@codat/bank-feeds";

(async () => {
const sdk = new CodatBankFeeds({
security: {
authHeader: "Basic BASE_64_ENCODED(API_KEY)",
},
});

let res;
try {
res = await sdk.companies.create({
description: "Requested early access to the new financing scheme.",
name: "Bank of Dave",
});
} catch (e) {}

if (res.statusCode == 200) {
// handle response
}
})();

```
<!-- End Error Handling -->



<!-- Start Server Selection -->
## Server Selection

### Select Server by Index

You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

| # | Server | Variables |
| - | ------ | --------- |
| 0 | `https://api.codat.io` | None |

#### Example

```typescript
import { CodatBankFeeds } from "@codat/bank-feeds";

(async () => {
const sdk = new CodatBankFeeds({
serverIdx: 0,
security: {
authHeader: "Basic BASE_64_ENCODED(API_KEY)",
},
});

const res = await sdk.companies.create({
description: "Requested early access to the new financing scheme.",
name: "Bank of Dave",
});

if (res.statusCode == 200) {
// handle response
}
})();

```


### Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:
```typescript
import { CodatBankFeeds } from "@codat/bank-feeds";

(async () => {
const sdk = new CodatBankFeeds({
serverURL: "https://api.codat.io",
security: {
authHeader: "Basic BASE_64_ENCODED(API_KEY)",
},
});

const res = await sdk.companies.create({
description: "Requested early access to the new financing scheme.",
name: "Bank of Dave",
});

if (res.statusCode == 200) {
// handle response
}
})();

```
<!-- End Server Selection -->



<!-- Start Custom HTTP Client -->
## Custom HTTP Client

The Typescript SDK makes API calls using the (axios)[https://axios-http.com/docs/intro] HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.

For example, you could specify a header for every request that your sdk makes as follows:

```typescript
from @codat/bank-feeds import CodatBankFeeds;
import axios;

const httpClient = axios.create({
headers: {'x-custom-header': 'someValue'}
})

const sdk = new CodatBankFeeds({defaultClient: httpClient});
```
<!-- End Custom HTTP Client -->
<!-- Start Authentication -->
## Authentication
### Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
| ------------ | ------------ | ------------ |
| `authHeader` | apiKey | API key |
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
```typescript
import { CodatBankFeeds } from "@codat/bank-feeds";

(async () => {
const sdk = new CodatBankFeeds({
security: {
authHeader: "Basic BASE_64_ENCODED(API_KEY)",
},
});

const res = await sdk.companies.create({
description: "Requested early access to the new financing scheme.",
name: "Bank of Dave",
});

if (res.statusCode == 200) {
// handle response
}
})();

```
<!-- End Authentication -->

<!-- Placeholder for Future Speakeasy SDK Sections -->


Expand Down
12 changes: 11 additions & 1 deletion bank-feeds/RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,4 +666,14 @@ Based on:
### Generated
- [typescript v2.2.0] bank-feeds
### Releases
- [NPM v2.2.0] https://www.npmjs.com/package/@codat/bank-feeds/v/2.2.0 - bank-feeds
- [NPM v2.2.0] https://www.npmjs.com/package/@codat/bank-feeds/v/2.2.0 - bank-feeds

## 2023-11-21 11:18:45
### Changes
Based on:
- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Bank-Feeds.yaml
- Speakeasy CLI 1.121.3 (2.195.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v3.0.0] bank-feeds
### Releases
- [NPM v3.0.0] https://www.npmjs.com/package/@codat/bank-feeds/v/3.0.0 - bank-feeds
11 changes: 3 additions & 8 deletions bank-feeds/USAGE.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<!-- Start SDK Example Usage -->


```typescript
import { CodatBankFeeds } from "@codat/bank-feeds";

Expand All @@ -11,12 +9,9 @@ import { CodatBankFeeds } from "@codat/bank-feeds";
},
});

const res = await sdk.accountMapping.create({
requestBody: {
feedStartDate: "2022-10-23T00:00:00.000Z",
},
companyId: "8a210b68-6988-11ed-a1eb-0242ac120002",
connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171",
const res = await sdk.companies.create({
description: "Requested early access to the new financing scheme.",
name: "Bank of Dave",
});

if (res.statusCode == 200) {
Expand Down
File renamed without changes.

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions bank-feeds/docs/models/operations/createbanktransactionsrequest.md

This file was deleted.

Loading

0 comments on commit 6bafd01

Please sign in to comment.