Regenerated SDK with small changes

This commit is contained in:
Luke Hagar
2024-06-27 14:39:09 +00:00
parent 367dc248c3
commit 7585dd0b5c
845 changed files with 12822 additions and 4844 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
configVersion: 2.0.0
generation:
sdkClassName: Plex-API
sdkClassName: PlexAPI
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
@@ -10,10 +10,13 @@ generation:
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2ClientCredentialsEnabled: true
csharp:
version: 0.2.1
version: 0.3.0
additionalDependencies: []
author: LukeHagar
clientServerStatusCodesAsErrors: true
disableNamespacePascalCasingApr2024: true
dotnetVersion: net5.0
flattenGlobalSecurity: true
imports:
@@ -27,4 +30,5 @@ csharp:
inputModelSuffix: input
maxMethodParams: 4
outputModelSuffix: output
packageName: Plex-API
packageName: PlexAPI
responseFormat: envelope

28
.speakeasy/workflow.lock Normal file
View File

@@ -0,0 +1,28 @@
speakeasyVersion: 1.321.0
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:8df2ed3829cded89c3ef312b1f830c20d48146f7fdf883137befd836432c9e6a
sourceBlobDigest: sha256:a4557b86024d2cd6fe1a00b5631730ed0fc81bebb9efc057af0b96c2fa389acf
tags:
- latest
targets:
plexcsharp:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:8df2ed3829cded89c3ef312b1f830c20d48146f7fdf883137befd836432c9e6a
sourceBlobDigest: sha256:a4557b86024d2cd6fe1a00b5631730ed0fc81bebb9efc057af0b96c2fa389acf
outLocation: /home/luke/github/plexcsharp
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-source:
inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml
registry:
location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source
targets:
plexcsharp:
target: csharp
source: my-source

View File

@@ -1,8 +1,11 @@
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
my-source:
inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml
registry:
location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source
targets:
plexcsharp:
target: csharp

176
NUGET.md Normal file
View File

@@ -0,0 +1,176 @@
# PlexAPI
<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage
### Example
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman");
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
<!-- End SDK Example Usage [usage] -->
<!-- Start Global Parameters [global-parameters] -->
## Global Parameters
## Global Parameters
A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `X-Plex-Client-Identifier` to `"Postman"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. 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 parameter is available.
| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| xPlexClientIdentifier | 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)
|
### Example
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(xPlexClientIdentifier: "Postman");
var res = await sdk.Plex.GetPinAsync(
xPlexProduct: "Postman",
strong: false,
xPlexClientIdentifier: "Postman");
// handle response
```
<!-- End Global Parameters [global-parameters] -->
<!-- Start Error Handling [errors] -->
## Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.
| Error Object | Status Code | Content Type |
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| PlexAPI.Models.Errors.GetServerCapabilitiesResponseBody | 401 | application/json |
| PlexAPI.Models.Errors.SDKException | 4xx-5xx | */* |
### Example
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
using System;
using PlexAPI.Models.Errors;
var sdk = new PlexAPISDK(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman");
try
{
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
}
catch (Exception ex)
{
if (ex is Models.Errors.GetServerCapabilitiesResponseBody)
{
// handle exception
}
else if (ex is PlexAPI.Models.Errors.SDKException)
{
// handle exception
}
}
```
<!-- End Error Handling [errors] -->
<!-- Start Server Selection [server] -->
## Server Selection
### Select Server by Index
You can override the default server globally by passing a server index to the `serverIndex: 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 | `{protocol}://{ip}:{port}` | `protocol` (default is `http`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) |
#### Variables
Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so:
* `protocol: ServerProtocol`
* `ip: string`
* `port: string`
### 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:
### Override Server URL Per-Operation
The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(xPlexClientIdentifier: "Postman");
var res = await sdk.Plex.GetPinAsync(
serverUrl: "https://plex.tv/api/v2",
xPlexProduct: "Postman",
strong: false,
xPlexClientIdentifier: "Postman");
// handle response
```
<!-- End Server Selection [server] -->
<!-- Start Authentication [security] -->
## Authentication
### Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
| ------------- | ------------- | ------------- |
| `AccessToken` | apiKey | API key |
To authenticate with the API the `AccessToken` parameter must be set when initializing the SDK client instance. For example:
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "Postman");
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
<!-- End Authentication [security] -->
<!-- Placeholder for Future Speakeasy SDK Sections -->

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -11,9 +10,13 @@
namespace PlexAPI
{
using Newtonsoft.Json;
using PlexAPI.Hooks;
using PlexAPI.Models.Components;
using PlexAPI.Models.Errors;
using PlexAPI.Models.Requests;
using PlexAPI.Utils.Retries;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
@@ -71,17 +74,17 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.1";
private const string _sdkGenVersion = "2.281.2";
private const string _sdkVersion = "0.3.0";
private const string _sdkGenVersion = "2.354.2";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.1 2.281.2 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.354.2 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _client;
private Func<Security>? _securitySource;
public Activities(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
public Activities(ISpeakeasyHttpClient client, Func<Security>? securitySource, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config;
@@ -89,105 +92,179 @@ namespace PlexAPI
public async Task<GetServerActivitiesResponse> GetServerActivitiesAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/activities";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("getServerActivities", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new GetServerActivitiesResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetServerActivitiesResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
return response;
}
if((response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
else
{
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetServerActivitiesActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
return response;
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
{
var request = new CancelServerActivitiesRequest()
{
ActivityUUID = activityUUID,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/activities/{activityUUID}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("cancelServerActivities", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new CancelServerActivitiesResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new CancelServerActivitiesResponse()
{
response.Object = JsonConvert.DeserializeObject<CancelServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<CancelServerActivitiesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -11,9 +10,13 @@
namespace PlexAPI
{
using Newtonsoft.Json;
using PlexAPI.Hooks;
using PlexAPI.Models.Components;
using PlexAPI.Models.Errors;
using PlexAPI.Models.Requests;
using PlexAPI.Utils.Retries;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
@@ -62,17 +65,17 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.1";
private const string _sdkGenVersion = "2.281.2";
private const string _sdkVersion = "0.3.0";
private const string _sdkGenVersion = "2.354.2";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.1 2.281.2 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.354.2 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _client;
private Func<Security>? _securitySource;
public Authentication(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
public Authentication(ISpeakeasyHttpClient client, Func<Security>? securitySource, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config;
@@ -85,94 +88,168 @@ namespace PlexAPI
Type = type,
Scope = scope,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/security/token", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("getTransientToken", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new GetTransientTokenResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new GetTransientTokenResponse()
{
response.Object = JsonConvert.DeserializeObject<GetTransientTokenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetTransientTokenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
{
var request = new GetSourceConnectionInformationRequest()
{
Source = source,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/security/resources", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("getSourceConnectionInformation", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new GetSourceConnectionInformationResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new GetSourceConnectionInformationResponse()
{
response.Object = JsonConvert.DeserializeObject<GetSourceConnectionInformationResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetSourceConnectionInformationResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -11,9 +10,13 @@
namespace PlexAPI
{
using Newtonsoft.Json;
using PlexAPI.Hooks;
using PlexAPI.Models.Components;
using PlexAPI.Models.Errors;
using PlexAPI.Models.Requests;
using PlexAPI.Utils.Retries;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
@@ -98,17 +101,17 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.1";
private const string _sdkGenVersion = "2.281.2";
private const string _sdkVersion = "0.3.0";
private const string _sdkGenVersion = "2.354.2";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.1 2.281.2 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.354.2 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _client;
private Func<Security>? _securitySource;
public Butler(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
public Butler(ISpeakeasyHttpClient client, Func<Security>? securitySource, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config;
@@ -116,243 +119,428 @@ namespace PlexAPI
public async Task<GetButlerTasksResponse> GetButlerTasksAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("getButlerTasks", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new GetButlerTasksResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetButlerTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetButlerTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetButlerTasksResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
return response;
}
if((response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
else
{
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetButlerTasksButlerResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
return response;
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetButlerTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
public async Task<StartAllTasksResponse> StartAllTasksAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("startAllTasks", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new StartAllTasksResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new StartAllTasksResponse()
{
response.Object = JsonConvert.DeserializeObject<StartAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<StartAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
public async Task<StopAllTasksResponse> StopAllTasksAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/butler";
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("stopAllTasks", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new StopAllTasksResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new StopAllTasksResponse()
{
response.Object = JsonConvert.DeserializeObject<StopAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<StopAllTasksResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
{
var request = new StartTaskRequest()
{
TaskName = taskName,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("startTask", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new StartTaskResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(new List<int>{200, 202}.Contains(responseStatusCode))
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 202) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new StartTaskResponse()
{
response.Object = JsonConvert.DeserializeObject<StartTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<StartTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
{
var request = new StopTaskRequest()
{
TaskName = taskName,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/butler/{taskName}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("stopTask", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 404 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new StopTaskResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400) || (response.StatusCode == 404))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new StopTaskResponse()
{
response.Object = JsonConvert.DeserializeObject<StopTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<StopTaskResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
}
}

View File

@@ -0,0 +1,36 @@
namespace PlexAPI.Hooks
{
/// <summary>
/// Hook Registration File.
/// </summary>
/// <remarks>
/// This file is only ever generated once on the first generation and then is free to be modified.
/// Any hooks you wish to add should be registered in the InitHooks function. Feel free to define them
/// in this file or in separate files in the Hooks folder.
/// </remarks>
public static class HookRegistration
{
/// <summary>
/// Initializes hooks.
/// </summary>
/// <remarks>
/// Add hooks by calling `PlexAPI.Hooks.Register&lt;HookInterface&gt;(myHook);`
/// where `I&lt;HookInterface&gt;` is one of the following interfaces defined in HookTypes.cs:
/// - ISDKInitHook
/// - IBeforeRequestHook
/// - IAfterSuccess
/// - IAfterError
/// and `myHook` an instance that implements that specific interface.
/// </remarks>
public static void InitHooks(IHooks hooks)
{
// var myHook = new MyHook();
// hooks.RegisterSDKInitHook(myHook);
// hooks.RegisterBeforeRequestHook(myHook);
// hooks.RegisterAfterSuccessHook(myHook);
// hooks.RegisterAfterErrorHook(myHook;
}
}
}

View File

@@ -0,0 +1,98 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Hooks
{
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using PlexAPI.Utils;
public class HookContext
{
public string OperationID { get; set; }
public List<string>? Oauth2Scopes { get; set; }
public Func<object>? SecuritySource { get; set; }
public HookContext(string operationID, List<string>? oauth2Scopes, Func<object>? securitySource)
{
OperationID = operationID;
Oauth2Scopes = oauth2Scopes;
SecuritySource = securitySource;
}
}
public class BeforeRequestContext : HookContext
{
public BeforeRequestContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
}
public class AfterSuccessContext : HookContext
{
public AfterSuccessContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
}
public class AfterErrorContext : HookContext
{
public AfterErrorContext(HookContext hookCtx)
: base(hookCtx.OperationID, hookCtx.Oauth2Scopes, hookCtx.SecuritySource) { }
}
/// <summary>
/// SDKInit hook is called when the SDK is initializing.
/// The hook can modify and return a new baseUrl and HTTP client to be used by the SDK.
/// </summary>
public interface ISDKInitHook
{
(string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client);
}
/// <summary>
/// BeforeRequestAsync hook is called before the SDK sends a request.
/// The hook can modify the request before it is sent or throw an exception to stop the request from being sent.
/// </summary>
public interface IBeforeRequestHook
{
Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request);
}
/// <summary>
/// AfterSuccessAsync is called after the SDK receives a response.
/// The hook can modify the response before it is handled or throw an exception to stop the response from being handled.
/// </summary>
public interface IAfterSuccessHook
{
Task<HttpResponseMessage> AfterSuccessAsync(AfterSuccessContext hookCtx, HttpResponseMessage response);
}
/// <summary>
/// AfterErrorAsync is called after the SDK encounters an error, or a non-successful response.
/// The hook can modify the response, if available, otherwise modify the error.
/// All hooks are called sequentially. If an error is returned, it will be passed to the subsequent hook implementing IAfterErrorHook.
/// If you want to prevent other AfterError hooks from being run, you can throw an FailEarlyException instead.
/// </summary>
public interface IAfterErrorHook
{
Task<(HttpResponseMessage?, Exception?)> AfterErrorAsync(AfterErrorContext hookCtx, HttpResponseMessage? response, Exception? error);
}
public interface IHooks
{
void RegisterSDKInitHook(ISDKInitHook hook);
void RegisterBeforeRequestHook(IBeforeRequestHook hook);
void RegisterAfterSuccessHook(IAfterSuccessHook hook);
void RegisterAfterErrorHook(IAfterErrorHook hook);
}
}

129
PlexAPI/Hooks/SDKHooks.cs Normal file
View File

@@ -0,0 +1,129 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Hooks
{
using PlexAPI.Utils;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
public sealed class FailEarlyException : Exception {}
public class SDKHooks: IHooks
{
public List<ISDKInitHook> sdkInitHooks;
public List<IBeforeRequestHook> beforeRequestHooks;
public List<IAfterSuccessHook> afterSuccessHooks;
public List<IAfterErrorHook> afterErrorHooks;
public SDKHooks()
{
this.sdkInitHooks = new List<ISDKInitHook>();
this.beforeRequestHooks = new List<IBeforeRequestHook>();
this.afterSuccessHooks = new List<IAfterSuccessHook>();
this.afterErrorHooks = new List<IAfterErrorHook>();
HookRegistration.InitHooks(this);
}
public void RegisterSDKInitHook(ISDKInitHook hook)
{
this.sdkInitHooks.Add(hook);
}
public void RegisterBeforeRequestHook(IBeforeRequestHook hook)
{
this.beforeRequestHooks.Add(hook);
}
public void RegisterAfterSuccessHook(IAfterSuccessHook hook)
{
this.afterSuccessHooks.Add(hook);
}
public void RegisterAfterErrorHook(IAfterErrorHook hook)
{
this.afterErrorHooks.Add(hook);
}
public (string, ISpeakeasyHttpClient) SDKInit(string baseUrl, ISpeakeasyHttpClient client)
{
var urlAndClient = (baseUrl, client);
foreach (var hook in this.sdkInitHooks)
{
try
{
urlAndClient = hook.SDKInit(urlAndClient.Item1, urlAndClient.Item2);
} catch (Exception ex)
{
throw new Exception("An error occurred while calling SDKInit hook.", ex);
}
}
return urlAndClient;
}
public async Task<HttpRequestMessage> BeforeRequestAsync(BeforeRequestContext hookCtx, HttpRequestMessage request)
{
foreach (var hook in this.beforeRequestHooks)
{
try
{
request = await hook.BeforeRequestAsync(hookCtx, request);
} catch (Exception ex)
{
throw new Exception("An error occurred while calling BeforeRequestAsync hook", ex);
}
}
return request;
}
public async Task<HttpResponseMessage> AfterSuccessAsync(AfterSuccessContext hookCtx, HttpResponseMessage response)
{
foreach (var hook in this.afterSuccessHooks)
{
try
{
response = await hook.AfterSuccessAsync(hookCtx, response);
}
catch (Exception ex)
{
throw new Exception("An error occurred while calling AfterSuccessAsync hook.", ex);
}
}
return response;
}
public async Task<HttpResponseMessage?> AfterErrorAsync(AfterErrorContext hookCtx, HttpResponseMessage? response, Exception? error)
{
(HttpResponseMessage?, Exception?) responseAndError = (response, error);
foreach (var hook in this.afterErrorHooks)
{
try
{
responseAndError = await hook.AfterErrorAsync(hookCtx, responseAndError.Item1, responseAndError.Item2);
} catch (FailEarlyException)
{
throw;
} catch (Exception ex)
{
throw new Exception("An error occurred while calling AfterErrorAsync hook", ex);
}
}
if (responseAndError.Item2 != null)
{
throw responseAndError.Item2;
}
return responseAndError.Item1;
}
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -11,9 +10,13 @@
namespace PlexAPI
{
using Newtonsoft.Json;
using PlexAPI.Hooks;
using PlexAPI.Models.Components;
using PlexAPI.Models.Errors;
using PlexAPI.Models.Requests;
using PlexAPI.Utils.Retries;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
@@ -60,17 +63,17 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.1";
private const string _sdkGenVersion = "2.281.2";
private const string _sdkVersion = "0.3.0";
private const string _sdkGenVersion = "2.354.2";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.1 2.281.2 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.354.2 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _client;
private Func<Security>? _securitySource;
public Hubs(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
public Hubs(ISpeakeasyHttpClient client, Func<Security>? securitySource, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config;
@@ -83,58 +86,95 @@ namespace PlexAPI
Count = count,
OnlyTransient = onlyTransient,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/hubs", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("getGlobalHubs", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new GetGlobalHubsResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetGlobalHubsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
return response;
}
if((response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
else
{
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetGlobalHubsHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
return response;
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
{
var request = new GetLibraryHubsRequest()
@@ -143,56 +183,93 @@ namespace PlexAPI
Count = count,
OnlyTransient = onlyTransient,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/hubs/sections/{sectionId}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("getLibraryHubs", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new GetLibraryHubsResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetLibraryHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetLibraryHubsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Object = obj;
return response;
}
return response;
}
if((response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
else
{
response.FourHundredAndOneApplicationJsonObject = JsonConvert.DeserializeObject<GetLibraryHubsHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
return response;
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetLibraryHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -11,9 +10,13 @@
namespace PlexAPI
{
using Newtonsoft.Json;
using PlexAPI.Hooks;
using PlexAPI.Models.Components;
using PlexAPI.Models.Errors;
using PlexAPI.Models.Requests;
using PlexAPI.Utils.Retries;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
@@ -91,17 +94,17 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.1";
private const string _sdkGenVersion = "2.281.2";
private const string _sdkVersion = "0.3.0";
private const string _sdkGenVersion = "2.354.2";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.1 2.281.2 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.354.2 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _client;
private Func<Security>? _securitySource;
public Log(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
public Log(ISpeakeasyHttpClient client, Func<Security>? securitySource, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config;
@@ -115,51 +118,88 @@ namespace PlexAPI
Message = message,
Source = source,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/log", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("logLine", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new LogLineResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new LogLineResponse()
{
response.Object = JsonConvert.DeserializeObject<LogLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<LogLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/log";
@@ -172,85 +212,159 @@ namespace PlexAPI
httpRequest.Content = serializedBody;
}
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("logMultiLine", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new LogMultiLineResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new LogMultiLineResponse()
{
response.Object = JsonConvert.DeserializeObject<LogMultiLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<LogMultiLineResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = baseUrl + "/log/networked";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("enablePaperTrail", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode == 403 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new EnablePaperTrailResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400) || (response.StatusCode == 403))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new EnablePaperTrailResponse()
{
response.Object = JsonConvert.DeserializeObject<EnablePaperTrailResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<EnablePaperTrailResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -11,9 +10,13 @@
namespace PlexAPI
{
using Newtonsoft.Json;
using PlexAPI.Hooks;
using PlexAPI.Models.Components;
using PlexAPI.Models.Errors;
using PlexAPI.Models.Requests;
using PlexAPI.Utils.Retries;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
@@ -69,17 +72,17 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.1";
private const string _sdkGenVersion = "2.281.2";
private const string _sdkVersion = "0.3.0";
private const string _sdkGenVersion = "2.354.2";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.1 2.281.2 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.3.0 2.354.2 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _client;
private Func<Security>? _securitySource;
public Media(ISpeakeasyHttpClient defaultClient, Func<Security>? securitySource, string serverUrl, SDKConfig config)
public Media(ISpeakeasyHttpClient client, Func<Security>? securitySource, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config;
@@ -91,96 +94,170 @@ namespace PlexAPI
{
Key = key,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/:/scrobble", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("markPlayed", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new MarkPlayedResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new MarkPlayedResponse()
{
response.Object = JsonConvert.DeserializeObject<MarkPlayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<MarkPlayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
{
var request = new MarkUnplayedRequest()
{
Key = key,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/:/unscrobble", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("markUnplayed", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new MarkUnplayedResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new MarkUnplayedResponse()
{
response.Object = JsonConvert.DeserializeObject<MarkUnplayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<MarkUnplayedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
{
var request = new UpdatePlayProgressRequest()
@@ -189,46 +266,83 @@ namespace PlexAPI
Time = time,
State = state,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/:/progress", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _defaultClient;
if (_securitySource != null)
{
client = SecuritySerializer.Apply(_defaultClient, _securitySource);
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var httpResponse = await client.SendAsync(httpRequest);
var hookCtx = new HookContext("updatePlayProgress", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new UpdatePlayProgressResponse
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200) || (response.StatusCode == 400))
{
return response;
}
if((response.StatusCode == 401))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
return new UpdatePlayProgressResponse()
{
response.Object = JsonConvert.DeserializeObject<UpdatePlayProgressResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};;
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<UpdatePlayProgressResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
return response;
}
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class AddPlaylistContentsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class AddPlaylistContentsPlaylistsResponseBody
public class AddPlaylistContentsResponseBody : Exception
{
[JsonProperty("errors")]
public List<AddPlaylistContentsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class ApplyUpdatesErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class ApplyUpdatesResponseBody
public class ApplyUpdatesResponseBody : Exception
{
[JsonProperty("errors")]
public List<ApplyUpdatesErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class CancelServerActivitiesErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class CancelServerActivitiesResponseBody
public class CancelServerActivitiesResponseBody : Exception
{
[JsonProperty("errors")]
public List<CancelServerActivitiesErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class CheckForUpdatesErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class CheckForUpdatesResponseBody
public class CheckForUpdatesResponseBody : Exception
{
[JsonProperty("errors")]
public List<CheckForUpdatesErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class ClearPlaylistContentsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class ClearPlaylistContentsResponseBody
public class ClearPlaylistContentsResponseBody : Exception
{
[JsonProperty("errors")]
public List<ClearPlaylistContentsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class CreatePlaylistErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class CreatePlaylistPlaylistsResponseBody
public class CreatePlaylistResponseBody : Exception
{
[JsonProperty("errors")]
public List<CreatePlaylistErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class DeleteLibraryErrors
{

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class DeleteLibraryResponseBody : Exception
{
[JsonProperty("errors")]
public List<DeleteLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class DeletePlaylistErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class DeletePlaylistResponseBody
public class DeletePlaylistResponseBody : Exception
{
[JsonProperty("errors")]
public List<DeletePlaylistErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class EnablePaperTrailErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class EnablePaperTrailResponseBody
public class EnablePaperTrailResponseBody : Exception
{
[JsonProperty("errors")]
public List<EnablePaperTrailErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class Errors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetAvailableClientsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetAvailableClientsServerResponseBody
public class GetAvailableClientsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetAvailableClientsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetBandwidthStatisticsErrors
{
[JsonProperty("code")]
public double? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public double? Status { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetBandwidthStatisticsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetBandwidthStatisticsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetButlerTasksErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetButlerTasksButlerResponseBody
public class GetButlerTasksResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetButlerTasksErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetDevicesErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetDevicesServerResponseBody
public class GetDevicesResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetDevicesErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetFileHashErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetFileHashResponseBody
public class GetFileHashResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetFileHashErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetGlobalHubsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetGlobalHubsHubsResponseBody
public class GetGlobalHubsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetGlobalHubsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetHomeDataErrors
{
[JsonProperty("code")]
public double? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public double? Status { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetHomeDataResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetHomeDataErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibrariesErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetLibrariesLibraryResponseBody
public class GetLibrariesResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetLibrariesErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryHubsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetLibraryHubsHubsResponseBody
public class GetLibraryHubsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetLibraryHubsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryItemsErrors
{
[JsonProperty("code")]
public double? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public double? Status { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetLibraryItemsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetLibraryItemsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetLibraryLibraryResponseBody
public class GetLibraryResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetMetadataChildrenErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetMetadataChildrenLibraryResponseBody
public class GetMetadataChildrenResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetMetadataChildrenErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetMetadataErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetMetadataLibraryResponseBody
public class GetMetadataResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetMetadataErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetMyPlexAccountErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetMyPlexAccountServerResponseBody
public class GetMyPlexAccountResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetMyPlexAccountErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetOnDeckErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetOnDeckLibraryResponseBody
public class GetOnDeckResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetOnDeckErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetPinErrors
{

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// X-Plex-Client-Identifier is missing
/// </summary>
public class GetPinResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetPinErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetPlaylistContentsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetPlaylistContentsPlaylistsResponseBody
public class GetPlaylistContentsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetPlaylistContentsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetPlaylistErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetPlaylistPlaylistsResponseBody
public class GetPlaylistResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetPlaylistErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetPlaylistsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetPlaylistsPlaylistsResponseBody
public class GetPlaylistsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetPlaylistsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetRecentlyAddedErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetRecentlyAddedLibraryResponseBody
public class GetRecentlyAddedResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetRecentlyAddedErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetResizedPhotoErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetResizedPhotoResponseBody
public class GetResizedPhotoResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetResizedPhotoErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetResourcesStatisticsErrors
{
[JsonProperty("code")]
public double? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public double? Status { get; set; }
}
}

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetResourcesStatisticsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetResourcesStatisticsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetSearchResultsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetSearchResultsSearchResponseBody
public class GetSearchResultsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetSearchResultsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetServerActivitiesErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetServerActivitiesActivitiesResponseBody
public class GetServerActivitiesResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetServerActivitiesErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetServerCapabilitiesServerResponseBody
public class GetServerCapabilitiesResponseBody : Exception
{
[JsonProperty("errors")]
public List<Errors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetServerIdentityErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetServerIdentityServerResponseBody
public class GetServerIdentityResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetServerIdentityErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetServerListErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetServerListServerResponseBody
public class GetServerListResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetServerListErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetServerPreferencesErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetServerPreferencesServerResponseBody
public class GetServerPreferencesResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetServerPreferencesErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetSessionHistoryErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetSessionHistorySessionsResponseBody
public class GetSessionHistoryResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetSessionHistoryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetSessionsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetSessionsSessionsResponseBody
public class GetSessionsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetSessionsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetSourceConnectionInformationErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetSourceConnectionInformationResponseBody
public class GetSourceConnectionInformationResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetSourceConnectionInformationErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetStatisticsErrors
{

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,18 +7,28 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetStatisticsStatisticsResponseBody
public class GetStatisticsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetStatisticsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -1,4 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
@@ -8,9 +7,10 @@
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetTimelineErrors
{

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Errors
{
using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System;
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetTimelineResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetTimelineErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More