ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.377.1

This commit is contained in:
speakeasybot
2024-08-22 05:18:31 +00:00
parent 8c39ddc475
commit 454b20d045
740 changed files with 56231 additions and 21574 deletions

View File

@@ -36,7 +36,38 @@ const plexAPI = new PlexAPI({
});
async function run() {
const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13", 4462.17);
const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13");
// Handle the result
console.log(result)
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetFileHash } from "@lukehagar/plexjs/funcs/libraryGetFileHash.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetFileHash(plexAPI, "file://C:\Image.png&type=13");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
@@ -53,11 +84,12 @@ run();
| `type` | *number* | :heavy_minus_sign: | Item type | |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[models.GetFileHashResponse](../../models/getfilehashresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -65,6 +97,7 @@ run();
| models.GetFileHashResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## getRecentlyAdded
This endpoint will return the recently added content.
@@ -90,17 +123,49 @@ async function run() {
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetRecentlyAdded } from "@lukehagar/plexjs/funcs/libraryGetRecentlyAdded.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetRecentlyAdded(plexAPI);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.GetRecentlyAddedResponse](../../models/getrecentlyaddedresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -108,6 +173,7 @@ run();
| models.GetRecentlyAddedLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## getLibraries
A library section (commonly referred to as just a library) is a collection of media.
@@ -138,17 +204,49 @@ async function run() {
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetLibraries } from "@lukehagar/plexjs/funcs/libraryGetLibraries.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetLibraries(plexAPI);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.GetLibrariesResponse](../../models/getlibrariesresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -156,6 +254,7 @@ run();
| models.GetLibrariesLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## getLibrary
## Library Details Endpoint
@@ -202,7 +301,7 @@ Each type in the library comes with a set of filters and sorts, aiding in buildi
### Example Usage
```typescript
import { IncludeDetails, PlexAPI } from "@lukehagar/plexjs";
import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
accessToken: "<YOUR_API_KEY_HERE>",
@@ -210,7 +309,38 @@ const plexAPI = new PlexAPI({
});
async function run() {
const result = await plexAPI.library.getLibrary(1000, IncludeDetails.Zero);
const result = await plexAPI.library.getLibrary(1000);
// Handle the result
console.log(result)
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetLibrary } from "@lukehagar/plexjs/funcs/libraryGetLibrary.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetLibrary(plexAPI, 1000);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
@@ -227,11 +357,12 @@ run();
| `includeDetails` | [models.IncludeDetails](../../models/includedetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts). <br/>Only exists for backwards compatibility, media providers other than the server libraries have it on always.<br/> | |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[models.GetLibraryResponse](../../models/getlibraryresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -239,6 +370,7 @@ run();
| models.GetLibraryLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## deleteLibrary
Delate a library using a specific section
@@ -263,6 +395,37 @@ async function run() {
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryDeleteLibrary } from "@lukehagar/plexjs/funcs/libraryDeleteLibrary.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryDeleteLibrary(plexAPI, 1000);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
```
### Parameters
| Parameter | Type | Required | Description | Example |
@@ -270,11 +433,12 @@ run();
| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to query | [object Object] |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[models.DeleteLibraryResponse](../../models/deletelibraryresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -282,6 +446,7 @@ run();
| models.DeleteLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## getLibraryItems
Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values:
@@ -326,6 +491,38 @@ async function run() {
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { Tag } from "@lukehagar/plexjs";
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetLibraryItems } from "@lukehagar/plexjs/funcs/libraryGetLibraryItems.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetLibraryItems(plexAPI, "<value>", Tag.FirstCharacter, 1);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
```
### Parameters
| Parameter | Type | Required | Description | Example |
@@ -335,11 +532,12 @@ run();
| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response<br/> | [object Object] |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[models.GetLibraryItemsResponse](../../models/getlibraryitemsresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -347,6 +545,7 @@ run();
| models.GetLibraryItemsLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## refreshLibrary
This endpoint Refreshes the library.
@@ -372,6 +571,37 @@ async function run() {
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryRefreshLibrary } from "@lukehagar/plexjs/funcs/libraryRefreshLibrary.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryRefreshLibrary(plexAPI, 3179.56);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
@@ -379,11 +609,12 @@ run();
| `sectionId` | *number* | :heavy_check_mark: | the Id of the library to refresh |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.RefreshLibraryResponse](../../models/refreshlibraryresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -391,6 +622,7 @@ run();
| models.RefreshLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## searchLibrary
Search for content within a specific section of the library.
@@ -433,6 +665,38 @@ async function run() {
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { Type } from "@lukehagar/plexjs";
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { librarySearchLibrary } from "@lukehagar/plexjs/funcs/librarySearchLibrary.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await librarySearchLibrary(plexAPI, 457197, Type.Four);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
@@ -441,11 +705,12 @@ run();
| `type` | [models.Type](../../models/type.md) | :heavy_check_mark: | Plex content type to search for |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.SearchLibraryResponse](../../models/searchlibraryresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -453,6 +718,7 @@ run();
| models.SearchLibraryLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## getMetadata
This endpoint will return the metadata of a library item specified with the ratingKey.
@@ -469,7 +735,38 @@ const plexAPI = new PlexAPI({
});
async function run() {
const result = await plexAPI.library.getMetadata(8382.31);
const result = await plexAPI.library.getMetadata(17);
// Handle the result
console.log(result)
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetMetadata } from "@lukehagar/plexjs/funcs/libraryGetMetadata.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetMetadata(plexAPI, 17);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
@@ -485,11 +782,12 @@ run();
| `ratingKey` | *number* | :heavy_check_mark: | the id of the library item to return the children of. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.GetMetadataResponse](../../models/getmetadataresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -497,6 +795,7 @@ run();
| models.GetMetadataLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## getMetadataChildren
This endpoint will return the children of of a library item specified with the ratingKey.
@@ -513,7 +812,38 @@ const plexAPI = new PlexAPI({
});
async function run() {
const result = await plexAPI.library.getMetadataChildren(1539.14, "<value>");
const result = await plexAPI.library.getMetadataChildren(1539.14, "Stream");
// Handle the result
console.log(result)
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetMetadataChildren } from "@lukehagar/plexjs/funcs/libraryGetMetadataChildren.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetMetadataChildren(plexAPI, 5800.4, "Stream");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
@@ -530,11 +860,12 @@ run();
| `includeElements` | *string* | :heavy_minus_sign: | Adds additional elements to the response. Supported types are (Stream)<br/> |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.GetMetadataChildrenResponse](../../models/getmetadatachildrenresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
@@ -542,6 +873,7 @@ run();
| models.GetMetadataChildrenLibraryResponseBody | 401 | application/json |
| models.SDKError | 4xx-5xx | */* |
## getTopWatchedContent
This endpoint will return the top watched content from libraries of a certain type
@@ -558,7 +890,38 @@ const plexAPI = new PlexAPI({
});
async function run() {
const result = await plexAPI.library.getTopWatchedContent(505531, 1);
const result = await plexAPI.library.getTopWatchedContent(1, 1);
// Handle the result
console.log(result)
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetTopWatchedContent } from "@lukehagar/plexjs/funcs/libraryGetTopWatchedContent.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetTopWatchedContent(plexAPI, 1, 1);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
@@ -575,17 +938,19 @@ run();
| `includeGuids` | *number* | :heavy_minus_sign: | Adds the Guids object to the response<br/> | [object Object] |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
### Response
**Promise\<[models.GetTopWatchedContentResponse](../../models/gettopwatchedcontentresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| models.SDKError | 4xx-5xx | */* |
## getOnDeck
This endpoint will return the on deck content.
@@ -611,17 +976,49 @@ async function run() {
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { PlexAPICore } from "@lukehagar/plexjs/core.js";
import { libraryGetOnDeck } from "@lukehagar/plexjs/funcs/libraryGetOnDeck.js";
// Use `PlexAPICore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const plexAPI = new PlexAPICore({
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman",
});
async function run() {
const res = await libraryGetOnDeck(plexAPI);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.GetOnDeckResponse](../../models/getondeckresponse.md)\>**
### Errors
| Error Object | Status Code | Content Type |