mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 04:20:46 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.8
This commit is contained in:
125
NUGET.md
125
NUGET.md
@@ -12,11 +12,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
var res = await sdk.Server.GetServerCapabilitiesAsync();
|
||||
@@ -25,55 +25,68 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
|
||||
```
|
||||
<!-- End SDK Example Usage [usage] -->
|
||||
|
||||
<!-- Start Global Parameters [global-parameters] -->
|
||||
## Global Parameters
|
||||
<!-- Start Retries [retries] -->
|
||||
## Retries
|
||||
|
||||
## Global Parameters
|
||||
|
||||
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
|
||||
|
||||
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
|
||||
|
||||
|
||||
### Available Globals
|
||||
|
||||
The following global parameters are available.
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
| ---- | ---- |:--------:| ----------- |
|
||||
| clientID | string | | The unique identifier for the client application. This is used to track the client application and its usage. (UUID, serial number, or other number unique per device) |
|
||||
| clientName | string | | The ClientName parameter. |
|
||||
| clientVersion | string | | The ClientVersion parameter. |
|
||||
| clientPlatform | string | | The ClientPlatform parameter. |
|
||||
| deviceName | string | | The DeviceName parameter. |
|
||||
|
||||
|
||||
### Example
|
||||
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 pass a `RetryConfig` to the call:
|
||||
```csharp
|
||||
using LukeHagar.PlexAPI.SDK;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Requests;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
var res = await sdk.Plex.GetServerResourcesAsync(
|
||||
includeHttps: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.Enable,
|
||||
includeRelay: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeRelay.Enable,
|
||||
includeIPv6: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Enable,
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40"
|
||||
);
|
||||
var res = await sdk.Server.GetServerCapabilitiesAsync(retryConfig: new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: new BackoffStrategy(
|
||||
initialIntervalMs: 1L,
|
||||
maxIntervalMs: 50L,
|
||||
maxElapsedTimeMs: 100L,
|
||||
exponent: 1.1
|
||||
),
|
||||
retryConnectionErrors: false
|
||||
));
|
||||
|
||||
// handle response
|
||||
```
|
||||
<!-- End Global Parameters [global-parameters] -->
|
||||
|
||||
If you'd like to override the default retry strategy for all operations that support retries, you can use the `RetryConfig` optional parameter when intitializing the SDK:
|
||||
```csharp
|
||||
using LukeHagar.PlexAPI.SDK;
|
||||
using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
retryConfig: new RetryConfig(
|
||||
strategy: RetryConfig.RetryStrategy.BACKOFF,
|
||||
backoff: new BackoffStrategy(
|
||||
initialIntervalMs: 1L,
|
||||
maxIntervalMs: 50L,
|
||||
maxElapsedTimeMs: 100L,
|
||||
exponent: 1.1
|
||||
),
|
||||
retryConnectionErrors: false
|
||||
),
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
var res = await sdk.Server.GetServerCapabilitiesAsync();
|
||||
|
||||
// handle response
|
||||
```
|
||||
<!-- End Retries [retries] -->
|
||||
|
||||
<!-- Start Error Handling [errors] -->
|
||||
## Error Handling
|
||||
@@ -107,11 +120,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
try
|
||||
@@ -175,11 +188,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2");
|
||||
@@ -206,11 +219,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
|
||||
|
||||
var sdk = new PlexAPI(
|
||||
accessToken: "<YOUR_API_KEY_HERE>",
|
||||
clientID: "gcgzw5rz2xovp84b4vha3a40",
|
||||
clientName: "Plex Web",
|
||||
clientVersion: "4.133.0",
|
||||
clientPlatform: "Chrome",
|
||||
deviceName: "Linux"
|
||||
clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
|
||||
clientName: "Plex for Roku",
|
||||
clientVersion: "2.4.1",
|
||||
platform: "Roku",
|
||||
deviceNickname: "Roku 3"
|
||||
);
|
||||
|
||||
var res = await sdk.Server.GetServerCapabilitiesAsync();
|
||||
|
||||
Reference in New Issue
Block a user