Compare commits

...

6 Commits

Author SHA1 Message Date
speakeasybot
d077d5e9f0 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.391.3 2024-09-06 17:13:00 +00:00
Luke Hagar
2bed38d2cb Merge pull request #5 from JasonLandbridge/patch-2 2024-09-06 12:10:59 -05:00
Jason Landbridge
eb186583a6 Update gen.yaml 2024-09-06 10:46:09 +02:00
speakeasybot
2b03eae316 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.390.7 2024-09-06 00:00:16 +00:00
Luke Hagar
e2d3ad2f38 Merge pull request #3 from JasonLandbridge/patch-1 2024-09-05 14:59:12 -05:00
Jason Landbridge
5d60461459 Update workflow.yaml 2024-09-05 15:05:52 +02:00
712 changed files with 7256 additions and 4216 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -12,12 +12,12 @@ generation:
auth: auth:
oAuth2ClientCredentialsEnabled: true oAuth2ClientCredentialsEnabled: true
csharp: csharp:
version: 0.4.2 version: 0.5.1
additionalDependencies: [] additionalDependencies: []
author: LukeHagar author: LukeHagar
clientServerStatusCodesAsErrors: true clientServerStatusCodesAsErrors: true
disableNamespacePascalCasingApr2024: true disableNamespacePascalCasingApr2024: true
dotnetVersion: net5.0 dotnetVersion: net8.0
enableSourceLink: false enableSourceLink: false
flattenGlobalSecurity: true flattenGlobalSecurity: true
imports: imports:
@@ -32,6 +32,6 @@ csharp:
inputModelSuffix: input inputModelSuffix: input
maxMethodParams: 4 maxMethodParams: 4
outputModelSuffix: output outputModelSuffix: output
packageName: PlexAPI packageName: LukeHagar.PlexAPI.SDK
packageTags: "" packageTags: ""
responseFormat: envelope responseFormat: envelope

View File

@@ -1,9 +1,9 @@
speakeasyVersion: 1.383.2 speakeasyVersion: 1.391.3
sources: sources:
my-source: my-source:
sourceNamespace: my-source sourceNamespace: my-source
sourceRevisionDigest: sha256:c6e5a38f9c953eb820ac1b5cb6d5aade8ee11a7bdb5b568147fd677d61b3a3c5 sourceRevisionDigest: sha256:674cfdd3e98489e023ae9a80ff8753f30d1b6f625d25bd11b9897875477a4392
sourceBlobDigest: sha256:730391fe626304e22e265f9470902fc083d5e6110d20d87cdc3ac7da6b4982de sourceBlobDigest: sha256:370cb4409748c4811372a81d94f1a84f60b538087c23f2cb24f72082bcc827f6
tags: tags:
- latest - latest
- main - main
@@ -11,8 +11,8 @@ targets:
plexcsharp: plexcsharp:
source: my-source source: my-source
sourceNamespace: my-source sourceNamespace: my-source
sourceRevisionDigest: sha256:c6e5a38f9c953eb820ac1b5cb6d5aade8ee11a7bdb5b568147fd677d61b3a3c5 sourceRevisionDigest: sha256:674cfdd3e98489e023ae9a80ff8753f30d1b6f625d25bd11b9897875477a4392
sourceBlobDigest: sha256:730391fe626304e22e265f9470902fc083d5e6110d20d87cdc3ac7da6b4982de sourceBlobDigest: sha256:370cb4409748c4811372a81d94f1a84f60b538087c23f2cb24f72082bcc827f6
outLocation: /github/workspace/repo outLocation: /github/workspace/repo
workflow: workflow:
workflowVersion: 1.0.0 workflowVersion: 1.0.0
@@ -20,7 +20,7 @@ workflow:
sources: sources:
my-source: my-source:
inputs: inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml - location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/output/plex-media-server-spec-dereferenced.yaml
registry: registry:
location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source
targets: targets:

View File

@@ -3,7 +3,7 @@ speakeasyVersion: latest
sources: sources:
my-source: my-source:
inputs: inputs:
- location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml - location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/output/plex-media-server-spec-dereferenced.yaml
registry: registry:
location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source location: registry.speakeasyapi.dev/lukehagar/lukehagar/my-source
targets: targets:

View File

@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexAPI", "PlexAPI\PlexAPI.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LukeHagar.PlexAPI.SDK", "LukeHagar\PlexAPI\SDK\LukeHagar.PlexAPI.SDK.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
EndProject EndProject
Global Global

View File

@@ -7,15 +7,15 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI namespace LukeHagar.PlexAPI.SDK
{ {
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; 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.Collections.Generic;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Http; using System.Net.Http;
@@ -74,15 +74,15 @@ namespace PlexAPI
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.4.2"; private const string _sdkVersion = "0.5.1";
private const string _sdkGenVersion = "2.407.0"; private const string _sdkGenVersion = "2.411.5";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI"; private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Activities(ISpeakeasyHttpClient client, Func<PlexAPI.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Activities(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{ {
_client = client; _client = client;
_securitySource = securitySource; _securitySource = securitySource;

View File

@@ -7,15 +7,15 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI namespace LukeHagar.PlexAPI.SDK
{ {
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; 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.Collections.Generic;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Http; using System.Net.Http;
@@ -53,6 +53,15 @@ namespace PlexAPI
/// </summary> /// </summary>
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source); Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source);
/// <summary>
/// Get User Data By Token
///
/// <remarks>
/// Get the User data from the provided X-Plex-Token
/// </remarks>
/// </summary>
Task<GetUserDetailsResponse> GetUserDetailsAsync(string xPlexToken, string? serverUrl = null);
/// <summary> /// <summary>
/// Get User SignIn Data /// Get User SignIn Data
/// ///
@@ -72,6 +81,12 @@ namespace PlexAPI
/// </summary> /// </summary>
public class Authentication: IAuthentication public class Authentication: IAuthentication
{ {
/// <summary>
/// List of server URLs available for the getUserDetails operation.
/// </summary>
public static readonly string[] GetUserDetailsServerList = {
"https://plex.tv/api/v2",
};
/// <summary> /// <summary>
/// List of server URLs available for the post-users-sign-in-data operation. /// List of server URLs available for the post-users-sign-in-data operation.
/// </summary> /// </summary>
@@ -80,15 +95,15 @@ namespace PlexAPI
}; };
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.4.2"; private const string _sdkVersion = "0.5.1";
private const string _sdkGenVersion = "2.407.0"; private const string _sdkGenVersion = "2.411.5";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI"; private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Authentication(ISpeakeasyHttpClient client, Func<PlexAPI.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Authentication(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{ {
_client = client; _client = client;
_securitySource = securitySource; _securitySource = securitySource;
@@ -267,6 +282,106 @@ namespace PlexAPI
} }
} }
public async Task<GetUserDetailsResponse> GetUserDetailsAsync(string xPlexToken, string? serverUrl = null)
{
var request = new GetUserDetailsRequest()
{
XPlexToken = xPlexToken,
};
string baseUrl = Utilities.TemplateUrl(GetUserDetailsServerList[0], new Dictionary<string, string>(){
});
if (serverUrl != null)
{
baseUrl = serverUrl;
}
var urlString = URLBuilder.Build(baseUrl, "/user", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
if (_securitySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getUserDetails", 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;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetUserDetailsUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetUserDetailsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.UserPlexAccount = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), 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<GetUserDetailsResponseBody>(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<PostUsersSignInDataResponse> PostUsersSignInDataAsync(string? xPlexClientIdentifier = null, PostUsersSignInDataRequestBody? requestBody = null, string? serverUrl = null) public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(string? xPlexClientIdentifier = null, PostUsersSignInDataRequestBody? requestBody = null, string? serverUrl = null)
{ {
var request = new PostUsersSignInDataRequest() var request = new PostUsersSignInDataRequest()
@@ -282,12 +397,10 @@ namespace PlexAPI
{ {
baseUrl = serverUrl; baseUrl = serverUrl;
} }
var urlString = URLBuilder.Build(baseUrl, "/users/signin", request);
var urlString = baseUrl + "/users/signin";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true); var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
if (serializedBody != null) if (serializedBody != null)

View File

@@ -7,15 +7,15 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI namespace LukeHagar.PlexAPI.SDK
{ {
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; 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.Collections.Generic;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Http; using System.Net.Http;
@@ -101,15 +101,15 @@ namespace PlexAPI
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.4.2"; private const string _sdkVersion = "0.5.1";
private const string _sdkGenVersion = "2.407.0"; private const string _sdkGenVersion = "2.411.5";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI"; private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Butler(ISpeakeasyHttpClient client, Func<PlexAPI.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Butler(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{ {
_client = client; _client = client;
_securitySource = securitySource; _securitySource = securitySource;

View File

@@ -0,0 +1,36 @@
namespace LukeHagar.PlexAPI.SDK.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 `LukeHagar.PlexAPI.SDK.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

@@ -7,13 +7,13 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Hooks namespace LukeHagar.PlexAPI.SDK.Hooks
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using PlexAPI.Utils; using LukeHagar.PlexAPI.SDK.Utils;
public class HookContext public class HookContext
{ {

View File

@@ -7,9 +7,9 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Hooks namespace LukeHagar.PlexAPI.SDK.Hooks
{ {
using PlexAPI.Utils; using LukeHagar.PlexAPI.SDK.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;

View File

@@ -7,15 +7,15 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI namespace LukeHagar.PlexAPI.SDK
{ {
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; 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.Collections.Generic;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Http; using System.Net.Http;
@@ -63,15 +63,15 @@ namespace PlexAPI
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.4.2"; private const string _sdkVersion = "0.5.1";
private const string _sdkGenVersion = "2.407.0"; private const string _sdkGenVersion = "2.411.5";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI"; private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Hubs(ISpeakeasyHttpClient client, Func<PlexAPI.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Hubs(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{ {
_client = client; _client = client;
_securitySource = securitySource; _securitySource = securitySource;

View File

@@ -7,15 +7,15 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI namespace LukeHagar.PlexAPI.SDK
{ {
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; 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.Collections.Generic;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Http; using System.Net.Http;
@@ -49,7 +49,7 @@ namespace PlexAPI
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(); Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null);
/// <summary> /// <summary>
/// Get All Libraries /// Get All Libraries
@@ -112,7 +112,7 @@ namespace PlexAPI
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(double sectionId, IncludeDetails? includeDetails = null); Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null);
/// <summary> /// <summary>
/// Delete Library Section /// Delete Library Section
@@ -121,7 +121,7 @@ namespace PlexAPI
/// Delete a library using a specific section id /// Delete a library using a specific section id
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<DeleteLibraryResponse> DeleteLibraryAsync(double sectionId); Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey);
/// <summary> /// <summary>
/// Get Library Items /// Get Library Items
@@ -150,7 +150,7 @@ namespace PlexAPI
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(object sectionId, Tag tag, long? includeGuids = null); Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request);
/// <summary> /// <summary>
/// Refresh Metadata Of The Library /// Refresh Metadata Of The Library
@@ -160,7 +160,7 @@ namespace PlexAPI
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(double sectionId, Force? force = null); Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null);
/// <summary> /// <summary>
/// Search Library /// Search Library
@@ -187,17 +187,17 @@ namespace PlexAPI
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Models.Requests.Type type); Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type);
/// <summary> /// <summary>
/// Get Items Metadata /// Get Metadata by RatingKey
/// ///
/// <remarks> /// <remarks>
/// This endpoint will return the metadata of a library item specified with the ratingKey.<br/> /// This endpoint will return the metadata of a library item specified with the ratingKey.<br/>
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetMetadataResponse> GetMetadataAsync(double ratingKey); Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey);
/// <summary> /// <summary>
/// Get Items Children /// Get Items Children
@@ -217,7 +217,7 @@ namespace PlexAPI
/// ///
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(long type, long? includeGuids = null); Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null);
/// <summary> /// <summary>
/// Get On Deck /// Get On Deck
@@ -241,15 +241,15 @@ namespace PlexAPI
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.4.2"; private const string _sdkVersion = "0.5.1";
private const string _sdkGenVersion = "2.407.0"; private const string _sdkGenVersion = "2.411.5";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI"; private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Library(ISpeakeasyHttpClient client, Func<PlexAPI.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Library(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{ {
_client = client; _client = client;
_securitySource = securitySource; _securitySource = securitySource;
@@ -343,11 +343,15 @@ namespace PlexAPI
} }
} }
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync() public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null)
{ {
var request = new GetRecentlyAddedRequest()
{
XPlexContainerStart = xPlexContainerStart,
XPlexContainerSize = xPlexContainerSize,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/recentlyAdded", request);
var urlString = baseUrl + "/library/recentlyAdded";
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
@@ -527,15 +531,15 @@ namespace PlexAPI
} }
} }
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(double sectionId, IncludeDetails? includeDetails = null) public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null)
{ {
var request = new GetLibraryDetailsRequest() var request = new GetLibraryDetailsRequest()
{ {
SectionId = sectionId, SectionKey = sectionKey,
IncludeDetails = includeDetails, IncludeDetails = includeDetails,
}; };
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
@@ -623,14 +627,14 @@ namespace PlexAPI
} }
} }
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(double sectionId) public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey)
{ {
var request = new DeleteLibraryRequest() var request = new DeleteLibraryRequest()
{ {
SectionId = sectionId, SectionKey = sectionKey,
}; };
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Delete, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
@@ -708,16 +712,10 @@ namespace PlexAPI
} }
} }
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(object sectionId, Tag tag, long? includeGuids = null) public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request)
{ {
var request = new GetLibraryItemsRequest()
{
SectionId = sectionId,
Tag = tag,
IncludeGuids = includeGuids,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/{tag}", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/{tag}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
@@ -727,7 +725,7 @@ namespace PlexAPI
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getLibraryItems", null, _securitySource); var hookCtx = new HookContext("get-library-items", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
@@ -805,15 +803,15 @@ namespace PlexAPI
} }
} }
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(double sectionId, Force? force = null) public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null)
{ {
var request = new GetRefreshLibraryMetadataRequest() var request = new GetRefreshLibraryMetadataRequest()
{ {
SectionId = sectionId, SectionKey = sectionKey,
Force = force, Force = force,
}; };
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/refresh", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/refresh", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
@@ -891,15 +889,15 @@ namespace PlexAPI
} }
} }
public async Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Models.Requests.Type type) public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type)
{ {
var request = new SearchLibraryRequest() var request = new GetSearchLibraryRequest()
{ {
SectionId = sectionId, SectionKey = sectionKey,
Type = type, Type = type,
}; };
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl(); string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/search", request); var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionKey}/search", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString); var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent); httpRequest.Headers.Add("user-agent", _userAgent);
@@ -909,7 +907,7 @@ namespace PlexAPI
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("searchLibrary", null, _securitySource); var hookCtx = new HookContext("get-search-library", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
@@ -949,8 +947,8 @@ namespace PlexAPI
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.SearchLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetSearchLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new SearchLibraryResponse() var response = new GetSearchLibraryResponse()
{ {
StatusCode = responseStatusCode, StatusCode = responseStatusCode,
ContentType = contentType, ContentType = contentType,
@@ -972,7 +970,7 @@ namespace PlexAPI
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.SearchLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetSearchLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse; obj!.RawResponse = httpResponse;
throw obj!; throw obj!;
} }
@@ -987,9 +985,9 @@ namespace PlexAPI
} }
} }
public async Task<GetMetadataResponse> GetMetadataAsync(double ratingKey) public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey)
{ {
var request = new GetMetadataRequest() var request = new GetMetaDataByRatingKeyRequest()
{ {
RatingKey = ratingKey, RatingKey = ratingKey,
}; };
@@ -1004,7 +1002,7 @@ namespace PlexAPI
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest); httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
} }
var hookCtx = new HookContext("getMetadata", null, _securitySource); var hookCtx = new HookContext("get-meta-data-by-rating-key", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest); httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
@@ -1044,8 +1042,8 @@ namespace PlexAPI
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetMetadataResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetMetaDataByRatingKeyResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetMetadataResponse() var response = new GetMetaDataByRatingKeyResponse()
{ {
StatusCode = responseStatusCode, StatusCode = responseStatusCode,
ContentType = contentType, ContentType = contentType,
@@ -1067,7 +1065,7 @@ namespace PlexAPI
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetMetadataResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetMetaDataByRatingKeyResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse; obj!.RawResponse = httpResponse;
throw obj!; throw obj!;
} }
@@ -1178,7 +1176,7 @@ namespace PlexAPI
} }
} }
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(long type, long? includeGuids = null) public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null)
{ {
var request = new GetTopWatchedContentRequest() var request = new GetTopWatchedContentRequest()
{ {
@@ -1206,7 +1204,7 @@ namespace PlexAPI
httpResponse = await _client.SendAsync(httpRequest); httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode; int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600) 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); var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null) if (_httpResponse != null)
@@ -1236,7 +1234,7 @@ namespace PlexAPI
{ {
if(Utilities.IsContentTypeMatch("application/json", contentType)) if(Utilities.IsContentTypeMatch("application/json", contentType))
{ {
var obj = ResponseBodyDeserializer.Deserialize<GetTopWatchedContentResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore); var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetTopWatchedContentResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetTopWatchedContentResponse() var response = new GetTopWatchedContentResponse()
{ {
StatusCode = responseStatusCode, StatusCode = responseStatusCode,
@@ -1251,10 +1249,23 @@ namespace PlexAPI
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
} }
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600) else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{ {
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); 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.GetTopWatchedContentResponseBody>(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 else
{ {
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);

View File

@@ -7,15 +7,15 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI namespace LukeHagar.PlexAPI.SDK
{ {
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; 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.Collections.Generic;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Http; using System.Net.Http;
@@ -94,15 +94,15 @@ namespace PlexAPI
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.4.2"; private const string _sdkVersion = "0.5.1";
private const string _sdkGenVersion = "2.407.0"; private const string _sdkGenVersion = "2.411.5";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI"; private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Log(ISpeakeasyHttpClient client, Func<PlexAPI.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Log(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{ {
_client = client; _client = client;
_securitySource = securitySource; _securitySource = securitySource;

View File

@@ -2,14 +2,14 @@
<PropertyGroup> <PropertyGroup>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageId>PlexAPI</PackageId> <PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.4.2</Version> <Version>0.5.1</Version>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors> <Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2024</Copyright> <Copyright>Copyright (c) LukeHagar 2024</Copyright>
<RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl> <RepositoryUrl>https://github.com/LukeHagar/plexcsharp.git</RepositoryUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<Description>Plex-API: An Open API Spec for interacting with Plex.tv</Description> <Description>Plex-API: An Open API Spec for interacting with Plex.tv and Plex Media Server</Description>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
@@ -24,9 +24,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Include="..\NUGET.md" Pack="true" PackagePath="README.md"/> <None Include="..\..\..\NUGET.md" Pack="true" PackagePath="README.md"/>
<None Include="..\LICENSE.md" Pack="true" PackagePath="\"/> <None Include="..\..\..\LICENSE.md" Pack="true" PackagePath="\"/>
<None Include="..\docs\**\*" Pack="true" PackagePath="\docs" CopyToOutputDirectory="PreserveNewest"/> <None Include="..\..\..\docs\**\*" Pack="true" PackagePath="\docs" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -7,15 +7,15 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI namespace LukeHagar.PlexAPI.SDK
{ {
using LukeHagar.PlexAPI.SDK.Hooks;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils.Retries;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; 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.Collections.Generic;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Net.Http; using System.Net.Http;
@@ -59,6 +59,24 @@ namespace PlexAPI
/// </remarks> /// </remarks>
/// </summary> /// </summary>
Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state); Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state);
/// <summary>
/// Get Banner Image
///
/// <remarks>
/// Gets the banner image of the media item
/// </remarks>
/// </summary>
Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request);
/// <summary>
/// Get Thumb Image
///
/// <remarks>
/// Gets the thumbnail image of the media item
/// </remarks>
/// </summary>
Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request);
} }
/// <summary> /// <summary>
@@ -72,15 +90,15 @@ namespace PlexAPI
{ {
public SDKConfig SDKConfiguration { get; private set; } public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp"; private const string _language = "csharp";
private const string _sdkVersion = "0.4.2"; private const string _sdkVersion = "0.5.1";
private const string _sdkGenVersion = "2.407.0"; private const string _sdkGenVersion = "2.411.5";
private const string _openapiDocVersion = "0.0.3"; private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI"; private const string _userAgent = "speakeasy-sdk/csharp 0.5.1 2.411.5 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = ""; private string _serverUrl = "";
private ISpeakeasyHttpClient _client; private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource; private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
public Media(ISpeakeasyHttpClient client, Func<PlexAPI.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config) public Media(ISpeakeasyHttpClient client, Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{ {
_client = client; _client = client;
_securitySource = securitySource; _securitySource = securitySource;
@@ -344,5 +362,185 @@ namespace PlexAPI
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse); throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
} }
} }
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/banner", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
if (_securitySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var hookCtx = new HookContext("get-banner-image", 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;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("image/jpeg", contentType))
{
var response = new GetBannerImageResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), 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<GetBannerImageResponseBody>(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<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request)
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/metadata/{ratingKey}/thumb", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
if (_securitySource != null)
{
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var hookCtx = new HookContext("get-thumb-image", 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;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
if(Utilities.IsContentTypeMatch("image/jpeg", contentType))
{
var response = new GetThumbImageResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), 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<GetThumbImageResponseBody>(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);
}
}
} }
} }

View File

@@ -7,14 +7,14 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Components namespace LukeHagar.PlexAPI.SDK.Models.Components
{ {
using PlexAPI.Utils; using LukeHagar.PlexAPI.SDK.Utils;
public class Security public class Security
{ {
[SpeakeasyMetadata("security:scheme=true,type=apiKey,subType=header,name=X-Plex-Token")] [SpeakeasyMetadata("security:scheme=true,type=apiKey,subType=query,name=X-Plex-Token")]
public string? AccessToken { get; set; } public string? AccessToken { get; set; }
} }
} }

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class AddPlaylistContentsErrors public class AddPlaylistContentsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class ApplyUpdatesErrors public class ApplyUpdatesErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class CancelServerActivitiesErrors public class CancelServerActivitiesErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class CheckForUpdatesErrors public class CheckForUpdatesErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class ClearPlaylistContentsErrors public class ClearPlaylistContentsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class CreatePlaylistErrors public class CreatePlaylistErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class DeleteLibraryErrors public class DeleteLibraryErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class DeletePlaylistErrors public class DeletePlaylistErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class EnablePaperTrailErrors public class EnablePaperTrailErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class Errors public class Errors
{ {

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetAllLibrariesErrors public class GetAllLibrariesErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetAvailableClientsErrors public class GetAvailableClientsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetBandwidthStatisticsErrors public class GetBandwidthStatisticsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,12 +7,12 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetMetadataErrors public class GetBannerImageErrors
{ {
[JsonProperty("code")] [JsonProperty("code")]

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
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 GetBannerImageResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetBannerImageErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetButlerTasksErrors public class GetButlerTasksErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetCompanionsDataErrors public class GetCompanionsDataErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetDevicesErrors public class GetDevicesErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetFileHashErrors public class GetFileHashErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetGeoDataErrors public class GetGeoDataErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetGlobalHubsErrors public class GetGlobalHubsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetHomeDataErrors public class GetHomeDataErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryDetailsErrors public class GetLibraryDetailsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryHubsErrors public class GetLibraryHubsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryItemsErrors public class GetLibraryItemsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetMediaProvidersErrors
{
[JsonProperty("code")]
public double? Code { get; set; }
[JsonProperty("message")]
public string? Message { get; set; }
[JsonProperty("status")]
public double? Status { get; set; }
}
}

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;
@@ -19,11 +19,11 @@ namespace PlexAPI.Models.Errors
/// <summary> /// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query. /// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary> /// </summary>
public class GetServerIdentityResponseBody : Exception public class GetMediaProvidersResponseBody : Exception
{ {
[JsonProperty("errors")] [JsonProperty("errors")]
public List<GetServerIdentityErrors>? Errors { get; set; } public List<GetMediaProvidersErrors>? Errors { get; set; }
/// <summary> /// <summary>
/// Raw HTTP response; suitable for custom response parsing /// Raw HTTP response; suitable for custom response parsing

View File

@@ -0,0 +1,27 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetMetaDataByRatingKeyErrors
{
[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://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
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 GetMetaDataByRatingKeyResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetMetaDataByRatingKeyErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetMetadataChildrenErrors public class GetMetadataChildrenErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetMyPlexAccountErrors public class GetMyPlexAccountErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetOnDeckErrors public class GetOnDeckErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetPinErrors public class GetPinErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetPlaylistContentsErrors public class GetPlaylistContentsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetPlaylistErrors public class GetPlaylistErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetPlaylistsErrors public class GetPlaylistsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetRecentlyAddedErrors public class GetRecentlyAddedErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetRefreshLibraryMetadataErrors public class GetRefreshLibraryMetadataErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetResizedPhotoErrors public class GetResizedPhotoErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetResourcesStatisticsErrors public class GetResourcesStatisticsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,12 +7,12 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetServerIdentityErrors public class GetSearchLibraryErrors
{ {
[JsonProperty("code")] [JsonProperty("code")]

View File

@@ -0,0 +1,34 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
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 GetSearchLibraryResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetSearchLibraryErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetSearchResultsErrors public class GetSearchResultsErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetServerActivitiesErrors public class GetServerActivitiesErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). 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 LukeHagar.PlexAPI.SDK.Models.Errors
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Net.Http;
using System;
/// <summary>
/// Request Timeout
/// </summary>
public class GetServerIdentityResponseBody : Exception
{
[JsonProperty("code")]
public long? Code { get; set; }
[JsonProperty("message")]
private string? _message { get; set; }
public override string Message { get {return _message ?? "";} }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
[JsonProperty("-")]
public HttpResponseMessage? RawResponse { get; set; }
}
}

View File

@@ -7,10 +7,10 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetServerListErrors public class GetServerListErrors
{ {

View File

@@ -7,11 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#nullable enable #nullable enable
namespace PlexAPI.Models.Errors namespace LukeHagar.PlexAPI.SDK.Models.Errors
{ {
using LukeHagar.PlexAPI.SDK.Models.Errors;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json; using Newtonsoft.Json;
using PlexAPI.Models.Errors;
using PlexAPI.Utils;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Http; using System.Net.Http;
using System; using System;

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