Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc v1.0.0, Speakeasy CLI 1.126.0
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Dec 11, 2023
1 parent da49b79 commit 3500c03
Show file tree
Hide file tree
Showing 16 changed files with 233 additions and 175 deletions.
105 changes: 49 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<a href="https://codespaces.new/Leonardo-Interactive/leonardo-ts-sdk.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
</div>

<!-- Start SDK Installation -->
<!-- Start SDK Installation [installation] -->
## SDK Installation

### NPM
Expand All @@ -22,22 +22,23 @@ npm add @leonardo-ai/sdk
```bash
yarn add @leonardo-ai/sdk
```
<!-- End SDK Installation -->
<!-- End SDK Installation [installation] -->

## Authentication

To get access to the API and fetch an API key, please sign up for [access](https://leonardo.ai/).

<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage
<!-- Start SDK Example Usage -->

### Example

```typescript
import { Leonardo } from "@leonardo-ai/sdk";

(async () => {
async function run() {
const sdk = new Leonardo({
bearerAuth: "",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.dataset.createDataset({
Expand All @@ -47,15 +48,16 @@ import { Leonardo } from "@leonardo-ai/sdk";
if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->

<!-- Start SDK Available Operations -->
<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations


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

* [createDataset](docs/sdks/dataset/README.md#createdataset) - Create a Dataset
Expand Down Expand Up @@ -102,37 +104,15 @@ import { Leonardo } from "@leonardo-ai/sdk";
* [createVariationUpscale](docs/sdks/variation/README.md#createvariationupscale) - Create upscale
* [getVariationById](docs/sdks/variation/README.md#getvariationbyid) - Get variation by ID
* [postVariationsUnzoom](docs/sdks/variation/README.md#postvariationsunzoom) - Create unzoom
<!-- End SDK Available Operations -->



<!-- Start Dev Containers -->
# Dev Containers
<div align="left">
<a href="https://codespaces.new/Leonardo-Interactive/leonardo-ts-sdk.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>

</div>

Experience our SDK in an enhanced sandbox environment. Try it now in **GitHub Codespaces**!
<!-- End Available Resources and Operations [operations] -->

* [Explore Dev Containers](.devcontainer/README.md)
<!-- End Dev Containers -->



<!-- Start Pagination -->
# Pagination

Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a `next` method that can be called to pull down the next group of results. If the
return value of `next` is `null`, then there are no more pages to be fetched.

Here's an example of one such pagination call:
<!-- End Pagination -->



<!-- Start Error Handling -->
<!-- Start Error Handling [errors] -->
## 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.
Expand All @@ -146,50 +126,57 @@ Example
```typescript
import { Leonardo } from "@leonardo-ai/sdk";

(async () => {
async function run() {
const sdk = new Leonardo({
bearerAuth: "",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

let res;
try {
res = await sdk.dataset.createDataset({
name: "string",
});
} catch (e) {}
} catch (err) {
if (err instanceof errors.SDKError) {
console.error(err); // handle exception
throw err;
}
}

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

run();

```
<!-- End Error Handling -->
<!-- End Error Handling [errors] -->



<!-- Start Custom HTTP Client -->
<!-- Start Custom HTTP Client [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.
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 @leonardo-ai/sdk import Leonardo;
import axios;
import { @leonardo-ai/sdk } from "Leonardo";
import axios from "axios";

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

const sdk = new Leonardo({defaultClient: httpClient});
```
<!-- End Custom HTTP Client -->
<!-- End Custom HTTP Client [http-client] -->



<!-- Start Server Selection -->
<!-- Start Server Selection [server] -->
## Server Selection

### Select Server by Index
Expand All @@ -205,10 +192,10 @@ You can override the default server globally by passing a server index to the `s
```typescript
import { Leonardo } from "@leonardo-ai/sdk";

(async () => {
async function run() {
const sdk = new Leonardo({
serverIdx: 0,
bearerAuth: "",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.dataset.createDataset({
Expand All @@ -218,7 +205,9 @@ import { Leonardo } from "@leonardo-ai/sdk";
if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```

Expand All @@ -229,10 +218,10 @@ The default server can also be overridden globally by passing a URL to the `serv
```typescript
import { Leonardo } from "@leonardo-ai/sdk";

(async () => {
async function run() {
const sdk = new Leonardo({
serverURL: "https://cloud.leonardo.ai/api/rest/v1",
bearerAuth: "",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.dataset.createDataset({
Expand All @@ -242,14 +231,16 @@ import { Leonardo } from "@leonardo-ai/sdk";
if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```
<!-- End Server Selection -->
<!-- End Server Selection [server] -->



<!-- Start Authentication -->
<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes
Expand All @@ -264,9 +255,9 @@ To authenticate with the API the `bearerAuth` parameter must be set when initial
```typescript
import { Leonardo } from "@leonardo-ai/sdk";

(async () => {
async function run() {
const sdk = new Leonardo({
bearerAuth: "",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.dataset.createDataset({
Expand All @@ -276,10 +267,12 @@ import { Leonardo } from "@leonardo-ai/sdk";
if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```
<!-- End Authentication -->
<!-- End Authentication [security] -->

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

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1429,4 +1429,14 @@ Based on:
### Generated
- [typescript v2.1.4] .
### Releases
- [NPM v2.1.4] https://www.npmjs.com/package/@leonardo-ai/sdk/v/2.1.4 - .
- [NPM v2.1.4] https://www.npmjs.com/package/@leonardo-ai/sdk/v/2.1.4 - .

## 2023-12-11 19:01:59
### Changes
Based on:
- OpenAPI Doc v1.0.0 https://api-docs-nine-delta.vercel.app/cloud/openapi.json
- Speakeasy CLI 1.126.0 (2.213.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v2.2.0] .
### Releases
- [NPM v2.2.0] https://www.npmjs.com/package/@leonardo-ai/sdk/v/2.2.0 - .
12 changes: 7 additions & 5 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- Start SDK Example Usage -->
<!-- Start SDK Example Usage [usage] -->
```typescript
import { Leonardo } from "@leonardo-ai/sdk";

(async () => {
async function run() {
const sdk = new Leonardo({
bearerAuth: "",
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

const res = await sdk.dataset.createDataset({
Expand All @@ -14,7 +14,9 @@ import { Leonardo } from "@leonardo-ai/sdk";
if (res.statusCode == 200) {
// handle response
}
})();
}

run();

```
<!-- End SDK Example Usage -->
<!-- End SDK Example Usage [usage] -->
6 changes: 3 additions & 3 deletions docs/sdk/models/shared/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

## Fields

| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `bearerAuth` | *string* | :heavy_check_mark: | N/A | |
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `bearerAuth` | *string* | :heavy_check_mark: | N/A |
Loading

0 comments on commit 3500c03

Please sign in to comment.