mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.377.1
This commit is contained in:
@@ -18,7 +18,7 @@ Get Global Hubs filtered by the parameters provided.
|
||||
### Example Usage
|
||||
|
||||
```typescript
|
||||
import { OnlyTransient, PlexAPI } from "@lukehagar/plexjs";
|
||||
import { PlexAPI } from "@lukehagar/plexjs";
|
||||
|
||||
const plexAPI = new PlexAPI({
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
@@ -26,7 +26,38 @@ const plexAPI = new PlexAPI({
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await plexAPI.hubs.getGlobalHubs(1262.49, OnlyTransient.One);
|
||||
const result = await plexAPI.hubs.getGlobalHubs();
|
||||
|
||||
// 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 { hubsGetGlobalHubs } from "@lukehagar/plexjs/funcs/hubsGetGlobalHubs.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 hubsGetGlobalHubs(plexAPI);
|
||||
|
||||
if (!res.ok) {
|
||||
throw res.error;
|
||||
}
|
||||
|
||||
const { value: result } = res;
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
@@ -43,11 +74,12 @@ run();
|
||||
| `onlyTransient` | [models.OnlyTransient](../../models/onlytransient.md) | :heavy_minus_sign: | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
|
||||
| `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.GetGlobalHubsResponse](../../models/getglobalhubsresponse.md)\>**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
@@ -55,6 +87,7 @@ run();
|
||||
| models.GetGlobalHubsHubsResponseBody | 401 | application/json |
|
||||
| models.SDKError | 4xx-5xx | */* |
|
||||
|
||||
|
||||
## getLibraryHubs
|
||||
|
||||
This endpoint will return a list of library specific hubs
|
||||
@@ -63,7 +96,7 @@ This endpoint will return a list of library specific hubs
|
||||
### Example Usage
|
||||
|
||||
```typescript
|
||||
import { PlexAPI, QueryParamOnlyTransient } from "@lukehagar/plexjs";
|
||||
import { PlexAPI } from "@lukehagar/plexjs";
|
||||
|
||||
const plexAPI = new PlexAPI({
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
@@ -71,7 +104,38 @@ const plexAPI = new PlexAPI({
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await plexAPI.hubs.getLibraryHubs(6728.76, 9010.22, QueryParamOnlyTransient.Zero);
|
||||
const result = await plexAPI.hubs.getLibraryHubs(6728.76);
|
||||
|
||||
// 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 { hubsGetLibraryHubs } from "@lukehagar/plexjs/funcs/hubsGetLibraryHubs.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 hubsGetLibraryHubs(plexAPI, 639.24);
|
||||
|
||||
if (!res.ok) {
|
||||
throw res.error;
|
||||
}
|
||||
|
||||
const { value: result } = res;
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
@@ -89,11 +153,12 @@ run();
|
||||
| `onlyTransient` | [models.QueryParamOnlyTransient](../../models/queryparamonlytransient.md) | :heavy_minus_sign: | Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). |
|
||||
| `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.GetLibraryHubsResponse](../../models/getlibraryhubsresponse.md)\>**
|
||||
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
|
||||
Reference in New Issue
Block a user