Compare commits

..

5 Commits

Author SHA1 Message Date
speakeasybot
4b10ba72ca ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.401.2 2024-09-21 00:21:00 +00:00
Luke Hagar
3b6806d2db cleaning 2024-09-19 06:10:10 +00:00
speakeasybot
5883791d10 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.399.2 2024-09-19 00:22:17 +00:00
speakeasybot
548ce2564d ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.398.0 2024-09-16 22:54:32 +00:00
speakeasybot
46c35ae5e3 ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.398.0 2024-09-16 21:55:23 +00:00
144 changed files with 2604 additions and 2354 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
csharp:
version: 0.6.8
version: 0.7.0
additionalDependencies: []
author: LukeHagar
clientServerStatusCodesAsErrors: true
@@ -35,3 +35,4 @@ csharp:
packageName: LukeHagar.PlexAPI.SDK
packageTags: Plex Media Server SDK
responseFormat: envelope
sourceDirectory: ""

View File

@@ -1,4 +1,4 @@
speakeasyVersion: 1.397.3
speakeasyVersion: 1.401.2
sources:
my-source:
sourceNamespace: my-source
@@ -16,8 +16,8 @@ sources:
- main
plexapi:
sourceNamespace: plexapi
sourceRevisionDigest: sha256:533fe97486e3fe2d84e890b7bbcdba4543d415e45181386154e011861f6da36f
sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9
sourceRevisionDigest: sha256:5aa71ad96ca6de91143ee513c9880e08e555e7748fb4b5f8d069c6ab0c8f3069
sourceBlobDigest: sha256:1cbef844e2856c2eabba4bd6d677d96c572fed13b27978d0d953aa06b224c02f
tags:
- latest
- main
@@ -25,10 +25,10 @@ targets:
plexcsharp:
source: plexapi
sourceNamespace: plexapi
sourceRevisionDigest: sha256:533fe97486e3fe2d84e890b7bbcdba4543d415e45181386154e011861f6da36f
sourceBlobDigest: sha256:f7e2709f52370dff16c1851a7a4e44a89f2e978e9cae335bffc10625950b3bd9
sourceRevisionDigest: sha256:5aa71ad96ca6de91143ee513c9880e08e555e7748fb4b5f8d069c6ab0c8f3069
sourceBlobDigest: sha256:1cbef844e2856c2eabba4bd6d677d96c572fed13b27978d0d953aa06b224c02f
codeSamplesNamespace: code-samples-csharp-plexcsharp
codeSamplesRevisionDigest: sha256:e8c936700dba1d895b8fb1ffba469fd6335db4f90d32542d8884b6687caa19da
codeSamplesRevisionDigest: sha256:f7febae6230f9bc151d99328c2b771c41002cc699d664ef857e752d9cd213bc2
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest

View File

@@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -154,10 +154,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -167,10 +165,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -180,19 +176,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<CancelServerActivitiesResponse> CancelServerActivitiesAsync(string activityUUID)
@@ -265,10 +257,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -278,19 +268,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -69,7 +69,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Sign in user with username and password and return user data with Plex authentication token
/// </remarks>
/// </summary>
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(string? xPlexClientIdentifier = null, PostUsersSignInDataRequestBody? requestBody = null, string? serverUrl = null);
Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(PostUsersSignInDataRequestBody? request = null, string? serverUrl = null);
}
/// <summary>
@@ -95,10 +95,10 @@ namespace LukeHagar.PlexAPI.SDK
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -182,10 +182,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -195,19 +193,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source)
@@ -280,10 +274,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -293,19 +285,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetTokenDetailsResponse> GetTokenDetailsAsync(string? serverUrl = null)
@@ -377,10 +365,8 @@ namespace LukeHagar.PlexAPI.SDK
response.UserPlexAccount = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -390,10 +376,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -403,42 +387,32 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.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(PostUsersSignInDataRequestBody? request = null, string? serverUrl = null)
{
var request = new PostUsersSignInDataRequest()
{
XPlexClientIdentifier = xPlexClientIdentifier,
RequestBody = requestBody,
};
request.XPlexClientIdentifier ??= SDKConfiguration.XPlexClientIdentifier;
string baseUrl = Utilities.TemplateUrl(PostUsersSignInDataServerList[0], new Dictionary<string, string>(){
});
if (serverUrl != null)
{
baseUrl = serverUrl;
}
var urlString = URLBuilder.Build(baseUrl, "/users/signin", request);
var urlString = baseUrl + "/users/signin";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
var serializedBody = RequestBodySerializer.Serialize(request, "Request", "form", false, true);
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
@@ -484,7 +458,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new PostUsersSignInDataResponse()
{
StatusCode = responseStatusCode,
@@ -494,45 +468,37 @@ namespace LukeHagar.PlexAPI.SDK
response.UserPlexAccount = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -101,10 +101,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -181,10 +181,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -194,10 +192,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -207,19 +203,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<StartAllTasksResponse> StartAllTasksAsync()
@@ -289,10 +281,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -302,19 +292,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<StopAllTasksResponse> StopAllTasksAsync()
@@ -384,10 +370,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -397,19 +381,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<StartTaskResponse> StartTaskAsync(TaskName taskName)
@@ -482,10 +462,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -495,19 +473,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<StopTaskResponse> StopTaskAsync(PathParamTaskName taskName)
@@ -580,10 +554,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -593,19 +565,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 404 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -63,10 +63,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -137,7 +137,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetGlobalHubsResponse()
{
StatusCode = responseStatusCode,
@@ -147,45 +147,37 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetGlobalHubsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetLibraryHubsResponse> GetLibraryHubsAsync(double sectionId, double? count = null, QueryParamOnlyTransient? onlyTransient = null)
@@ -257,10 +249,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -270,10 +260,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -283,19 +271,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -241,10 +241,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -328,10 +328,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -341,19 +339,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetRecentlyAddedResponse> GetRecentlyAddedAsync(int? xPlexContainerStart = null, int? xPlexContainerSize = null)
@@ -414,7 +408,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetRecentlyAddedResponse()
{
StatusCode = responseStatusCode,
@@ -424,45 +418,37 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetRecentlyAddedUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync()
@@ -529,10 +515,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -542,10 +526,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -555,19 +537,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(int sectionKey, IncludeDetails? includeDetails = null)
@@ -638,10 +616,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -651,10 +627,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -664,19 +638,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<DeleteLibraryResponse> DeleteLibraryAsync(int sectionKey)
@@ -749,10 +719,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -762,19 +730,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetLibraryItemsResponse> GetLibraryItemsAsync(GetLibraryItemsRequest request)
@@ -840,10 +804,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -853,10 +815,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -866,19 +826,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(int sectionKey, Force? force = null)
@@ -952,10 +908,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -965,19 +919,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetSearchLibraryResponse> GetSearchLibraryAsync(int sectionKey, QueryParamType type)
@@ -1048,10 +998,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -1061,10 +1009,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -1074,19 +1020,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMetaDataByRatingKeyResponse> GetMetaDataByRatingKeyAsync(long ratingKey)
@@ -1156,10 +1098,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -1169,10 +1109,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -1182,19 +1120,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMetadataChildrenResponse> GetMetadataChildrenAsync(double ratingKey, string? includeElements = null)
@@ -1265,10 +1199,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -1278,10 +1210,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -1291,19 +1221,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetTopWatchedContentResponse> GetTopWatchedContentAsync(GetTopWatchedContentQueryParamType type, long? includeGuids = null)
@@ -1374,10 +1300,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -1387,10 +1311,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -1400,19 +1322,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetOnDeckResponse> GetOnDeckAsync()
@@ -1479,10 +1397,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -1492,10 +1408,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -1505,19 +1419,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -94,10 +94,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -182,10 +182,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -195,19 +193,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<LogMultiLineResponse> LogMultiLineAsync(string request)
@@ -283,10 +277,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -296,19 +288,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<EnablePaperTrailResponse> EnablePaperTrailAsync()
@@ -378,10 +366,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -391,19 +377,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 403 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>LukeHagar.PlexAPI.SDK</PackageId>
<Version>0.6.8</Version>
<Version>0.7.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2024</Copyright>

View File

@@ -90,10 +90,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -176,10 +176,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -189,19 +187,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<MarkUnplayedResponse> MarkUnplayedAsync(double key)
@@ -274,10 +268,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -287,19 +279,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<UpdatePlayProgressResponse> UpdatePlayProgressAsync(string key, double time, string state)
@@ -374,10 +362,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -387,19 +373,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetBannerImageResponse> GetBannerImageAsync(GetBannerImageRequest request)
@@ -464,10 +446,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -477,10 +457,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -490,19 +468,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetThumbImageResponse> GetThumbImageAsync(GetThumbImageRequest request)
@@ -567,10 +541,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Bytes = await httpResponse.Content.ReadAsByteArrayAsync();
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -580,10 +552,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -593,19 +563,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

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

View File

@@ -10,51 +10,14 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
/// </summary>
public enum AutoSelectSubtitle
{
[JsonProperty("0")]
Zero,
[JsonProperty("1")]
One,
}
public static class AutoSelectSubtitleExtension
{
public static string Value(this AutoSelectSubtitle value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static AutoSelectSubtitle ToEnum(this string value)
{
foreach(var field in typeof(AutoSelectSubtitle).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is AutoSelectSubtitle)
{
return (AutoSelectSubtitle)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum AutoSelectSubtitle");
}
Disable = 0,
Enable = 1,
}
}

View File

@@ -9,30 +9,52 @@
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class Connections
{
/// <summary>
/// The protocol used for the connection (http, https, etc)
/// </summary>
[JsonProperty("protocol")]
public string Protocol { get; set; } = default!;
public Protocol Protocol { get; set; } = default!;
/// <summary>
/// The (ip) address or domain name used for the connection
/// </summary>
[JsonProperty("address")]
public string Address { get; set; } = default!;
/// <summary>
/// The port used for the connection
/// </summary>
[JsonProperty("port")]
public double Port { get; set; } = default!;
public int Port { get; set; } = default!;
/// <summary>
/// The full URI of the connection
/// </summary>
[JsonProperty("uri")]
public string Uri { get; set; } = default!;
/// <summary>
/// If the connection is local address
/// </summary>
[JsonProperty("local")]
public bool Local { get; set; } = default!;
/// <summary>
/// If the connection is relayed through plex.direct
/// </summary>
[JsonProperty("relay")]
public bool Relay { get; set; } = default!;
/// <summary>
/// If the connection is using IPv6
/// </summary>
[JsonProperty("IPv6")]
public bool IPv6 { get; set; } = default!;
}

View File

@@ -10,51 +10,14 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)
/// The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)
/// </summary>
public enum DefaultSubtitleAccessibility
{
[JsonProperty("0")]
Zero,
[JsonProperty("1")]
One,
}
public static class DefaultSubtitleAccessibilityExtension
{
public static string Value(this DefaultSubtitleAccessibility value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static DefaultSubtitleAccessibility ToEnum(this string value)
{
foreach(var field in typeof(DefaultSubtitleAccessibility).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is DefaultSubtitleAccessibility)
{
return (DefaultSubtitleAccessibility)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum DefaultSubtitleAccessibility");
}
Disable = 0,
Enable = 1,
}
}

View File

@@ -10,51 +10,14 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)
/// </summary>
public enum DefaultSubtitleForced
{
[JsonProperty("0")]
Zero,
[JsonProperty("1")]
One,
}
public static class DefaultSubtitleForcedExtension
{
public static string Value(this DefaultSubtitleForced value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static DefaultSubtitleForced ToEnum(this string value)
{
foreach(var field in typeof(DefaultSubtitleForced).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is DefaultSubtitleForced)
{
return (DefaultSubtitleForced)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum DefaultSubtitleForced");
}
Disable = 0,
Enable = 1,
}
}

View File

@@ -58,7 +58,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// The postal code of the location.
/// </summary>
[JsonProperty("postal_code")]
public long PostalCode { get; set; } = default!;
public string PostalCode { get; set; } = default!;
/// <summary>
/// Indicates if the country has privacy restrictions.

View File

@@ -18,75 +18,75 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
[JsonProperty("allowSync")]
public bool? AllowSync { get; set; }
public bool AllowSync { get; set; } = default!;
[JsonProperty("art")]
public string? Art { get; set; }
public string Art { get; set; } = default!;
[JsonProperty("composite")]
public string? Composite { get; set; }
public string Composite { get; set; } = default!;
[JsonProperty("filters")]
public bool? Filters { get; set; }
public bool Filters { get; set; } = default!;
[JsonProperty("refreshing")]
public bool? Refreshing { get; set; }
public bool Refreshing { get; set; } = default!;
[JsonProperty("thumb")]
public string? Thumb { get; set; }
public string Thumb { get; set; } = default!;
[JsonProperty("key")]
public string? Key { get; set; }
public string Key { get; set; } = default!;
[JsonProperty("type")]
public string? Type { get; set; }
public string Type { get; set; } = default!;
[JsonProperty("title")]
public string? Title { get; set; }
public string Title { get; set; } = default!;
[JsonProperty("agent")]
public string? Agent { get; set; }
public string Agent { get; set; } = default!;
[JsonProperty("scanner")]
public string? Scanner { get; set; }
public string Scanner { get; set; } = default!;
[JsonProperty("language")]
public string? Language { get; set; }
public string Language { get; set; } = default!;
[JsonProperty("uuid")]
public string? Uuid { get; set; }
public string Uuid { get; set; } = default!;
/// <summary>
/// Unix epoch datetime
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("updatedAt")]
public long? UpdatedAt { get; set; }
public long UpdatedAt { get; set; } = default!;
/// <summary>
/// Unix epoch datetime
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("createdAt")]
public long? CreatedAt { get; set; }
public long CreatedAt { get; set; } = default!;
/// <summary>
/// Unix epoch datetime
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("scannedAt")]
public long? ScannedAt { get; set; }
public long ScannedAt { get; set; } = default!;
[JsonProperty("content")]
public bool? Content { get; set; }
public bool Content { get; set; } = default!;
[JsonProperty("directory")]
public bool? Directory { get; set; }
public bool Directory { get; set; } = default!;
[JsonProperty("contentChangedAt")]
public int? ContentChangedAt { get; set; }
public int ContentChangedAt { get; set; } = default!;
[JsonProperty("hidden")]
public int? Hidden { get; set; }
public int Hidden { get; set; } = default!;
[JsonProperty("Location")]
public List<Location>? Location { get; set; }
public List<Location> Location { get; set; } = default!;
}
}

View File

@@ -27,6 +27,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string Title1 { get; set; } = default!;
[JsonProperty("Directory")]
public List<GetAllLibrariesDirectory>? Directory { get; set; }
public List<GetAllLibrariesDirectory> Directory { get; set; } = default!;
}
}

View File

@@ -20,6 +20,6 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
[JsonProperty("MediaContainer")]
public GetAllLibrariesMediaContainer? MediaContainer { get; set; }
public GetAllLibrariesMediaContainer MediaContainer { get; set; } = default!;
}
}

View File

@@ -58,7 +58,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// The postal code of the location.
/// </summary>
[JsonProperty("postal_code")]
public long PostalCode { get; set; } = default!;
public string PostalCode { get; set; } = default!;
/// <summary>
/// Indicates if the country has privacy restrictions.

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetLibraryItemsField
{
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("type")]
public string Type { get; set; } = default!;
[JsonProperty("subType")]
public string? SubType { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class GetLibraryItemsFieldType
{
[JsonProperty("type")]
public string Type { get; set; } = default!;
[JsonProperty("Operator")]
public List<GetLibraryItemsOperator> Operator { get; set; } = default!;
}
}

View File

@@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetLibraryItemsFilter
{
[JsonProperty("filter")]
public string Filter { get; set; } = default!;
[JsonProperty("filterType")]
public string FilterType { get; set; } = default!;
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("type")]
public string Type { get; set; } = default!;
}
}

View File

@@ -19,43 +19,43 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
[JsonProperty("size")]
public int? Size { get; set; }
public int Size { get; set; } = default!;
[JsonProperty("allowSync")]
public bool? AllowSync { get; set; }
public bool AllowSync { get; set; } = default!;
[JsonProperty("art")]
public string? Art { get; set; }
public string Art { get; set; } = default!;
[JsonProperty("identifier")]
public string? Identifier { get; set; }
public string Identifier { get; set; } = default!;
[JsonProperty("librarySectionID")]
public LibrarySectionID? LibrarySectionID { get; set; }
public LibrarySectionID LibrarySectionID { get; set; } = default!;
[JsonProperty("librarySectionTitle")]
public string? LibrarySectionTitle { get; set; }
public string LibrarySectionTitle { get; set; } = default!;
[JsonProperty("librarySectionUUID")]
public string? LibrarySectionUUID { get; set; }
public string LibrarySectionUUID { get; set; } = default!;
[JsonProperty("mediaTagPrefix")]
public string? MediaTagPrefix { get; set; }
public string MediaTagPrefix { get; set; } = default!;
[JsonProperty("mediaTagVersion")]
public int? MediaTagVersion { get; set; }
public int MediaTagVersion { get; set; } = default!;
[JsonProperty("thumb")]
public string? Thumb { get; set; }
public string Thumb { get; set; } = default!;
[JsonProperty("title1")]
public string? Title1 { get; set; }
public string Title1 { get; set; } = default!;
[JsonProperty("title2")]
public string? Title2 { get; set; }
public string Title2 { get; set; } = default!;
[JsonProperty("viewGroup")]
public string? ViewGroup { get; set; }
public string ViewGroup { get; set; } = default!;
[JsonProperty("viewMode")]
public int? ViewMode { get; set; }
@@ -65,5 +65,15 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("Metadata")]
public List<GetLibraryItemsMetadata>? Metadata { get; set; }
/// <summary>
/// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("Meta")]
public Meta? Meta { get; set; }
}
}

View File

@@ -19,22 +19,22 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
[JsonProperty("ratingKey")]
public string? RatingKey { get; set; }
public string RatingKey { get; set; } = default!;
[JsonProperty("key")]
public string? Key { get; set; }
public string Key { get; set; } = default!;
[JsonProperty("guid")]
public string? Guid { get; set; }
public string Guid { get; set; } = default!;
[JsonProperty("studio")]
public string? Studio { get; set; }
[JsonProperty("type")]
public string? Type { get; set; }
public string Type { get; set; } = default!;
[JsonProperty("title")]
public string? Title { get; set; }
public string Title { get; set; } = default!;
[JsonProperty("contentRating")]
public string? ContentRating { get; set; }
@@ -49,7 +49,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public double? AudienceRating { get; set; }
[JsonProperty("year")]
public int? Year { get; set; }
public int Year { get; set; } = default!;
[JsonProperty("tagline")]
public string? Tagline { get; set; }
@@ -61,7 +61,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string? Art { get; set; }
[JsonProperty("duration")]
public int? Duration { get; set; }
public int Duration { get; set; } = default!;
[JsonProperty("originallyAvailableAt")]
public LocalDate? OriginallyAvailableAt { get; set; }
@@ -106,7 +106,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public string? GrandparentTheme { get; set; }
[JsonProperty("Media")]
public List<GetLibraryItemsMedia>? Media { get; set; }
public List<GetLibraryItemsMedia> Media { get; set; } = default!;
[JsonProperty("Genre")]
public List<GetLibraryItemsGenre>? Genre { get; set; }
@@ -123,6 +123,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("Role")]
public List<GetLibraryItemsRole>? Role { get; set; }
/// <summary>
/// The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonProperty("Guid")]
public List<MediaGuid>? MediaGuid { get; set; }
[JsonProperty("titleSort")]
public string? TitleSort { get; set; }

View File

@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetLibraryItemsOperator
{
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
}
}

View File

@@ -55,7 +55,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeGuids")]
public IncludeGuids? IncludeGuids { get; set; }
public IncludeGuids? IncludeGuids { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeGuids.Disable;
/// <summary>
/// Adds the Meta object to the response<br/>
@@ -65,7 +65,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeMeta")]
public IncludeMeta? IncludeMeta { get; set; }
public IncludeMeta? IncludeMeta { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeMeta.Disable;
/// <summary>
/// The index of the first item to return. If not specified, the first item will be returned.<br/>

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.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class GetLibraryItemsSort
{
[JsonProperty("default")]
public string? Default { get; set; }
[JsonProperty("defaultDirection")]
public string DefaultDirection { get; set; } = default!;
[JsonProperty("descKey")]
public string? DescKey { get; set; }
[JsonProperty("firstCharacterKey")]
public string? FirstCharacterKey { get; set; }
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
}
}

View File

@@ -0,0 +1,41 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
public class GetLibraryItemsType
{
[JsonProperty("key")]
public string Key { get; set; } = default!;
[JsonProperty("type")]
public string Type { get; set; } = default!;
[JsonProperty("title")]
public string Title { get; set; } = default!;
[JsonProperty("active")]
public bool Active { get; set; } = default!;
[JsonProperty("Filter")]
public List<GetLibraryItemsFilter>? Filter { get; set; }
[JsonProperty("Sort")]
public List<GetLibraryItemsSort>? Sort { get; set; }
[JsonProperty("Field")]
public List<GetLibraryItemsField>? Field { get; set; }
}
}

View File

@@ -60,7 +60,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public DateTime ExpiresAt { get; set; } = default!;
[JsonProperty("authToken")]
public object? AuthToken { get; set; } = null;
public string? AuthToken { get; set; } = null;
[JsonProperty("newRegistration")]
public object? NewRegistration { get; set; } = null;

View File

@@ -26,19 +26,16 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=strong")]
public bool? Strong { get; set; } = false;
/// <summary>
/// The unique identifier for the client application<br/>
///
/// <remarks>
/// This is used to track the client application and its usage<br/>
/// (UUID, serial number, or other number unique per device)<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")]
public string? XPlexClientIdentifier { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Product")]
public string? XPlexProduct { get; set; }
public string? ClientName { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Device")]
public string? DeviceName { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Version")]
public string? ClientVersion { get; set; }
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Platform")]
public string? ClientPlatform { get; set; }
}
}

View File

@@ -25,10 +25,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum GetPlaylistContentsQueryParamType
{
One = 1,
Two = 2,
Three = 3,
Four = 4,
Movie = 1,
Show = 2,
Season = 3,
Episode = 4,
}
}

View File

@@ -15,23 +15,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public class GetServerResourcesRequest
{
/// <summary>
/// The unique identifier for the client application<br/>
///
/// <remarks>
/// This is used to track the client application and its usage<br/>
/// (UUID, serial number, or other number unique per device)<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")]
public string? XPlexClientIdentifier { get; set; }
/// <summary>
/// Include Https entries in the results
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeHttps")]
public IncludeHttps? IncludeHttps { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.Zero;
public IncludeHttps? IncludeHttps { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.Disable;
/// <summary>
/// Include Relay addresses in the results <br/>
@@ -42,12 +30,12 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeRelay")]
public IncludeRelay? IncludeRelay { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeRelay.Zero;
public IncludeRelay? IncludeRelay { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeRelay.Disable;
/// <summary>
/// Include IPv6 entries in the results
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=includeIPv6")]
public IncludeIPv6? IncludeIPv6 { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Zero;
public IncludeIPv6? IncludeIPv6 { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.Disable;
}
}

View File

@@ -60,7 +60,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public DateTime ExpiresAt { get; set; } = default!;
[JsonProperty("authToken")]
public object? AuthToken { get; set; } = null;
public string? AuthToken { get; set; } = null;
[JsonProperty("newRegistration")]
public object? NewRegistration { get; set; } = null;

View File

@@ -58,7 +58,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// The postal code of the location.
/// </summary>
[JsonProperty("postal_code")]
public long PostalCode { get; set; } = default!;
public string PostalCode { get; set; } = default!;
/// <summary>
/// Indicates if the country has privacy restrictions.

View File

@@ -19,17 +19,5 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=pinID")]
public long PinID { get; set; } = default!;
/// <summary>
/// The unique identifier for the client application<br/>
///
/// <remarks>
/// This is used to track the client application and its usage<br/>
/// (UUID, serial number, or other number unique per device)<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")]
public string? XPlexClientIdentifier { get; set; }
}
}

View File

@@ -136,7 +136,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public int Id { get; set; } = default!;
/// <summary>
/// Unix epoch datetime
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("joinedAt")]
public long JoinedAt { get; set; } = default!;
@@ -182,7 +182,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public bool? Protected { get; set; } = false;
/// <summary>
/// Unix epoch datetime
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("rememberExpiresAt")]
public long RememberExpiresAt { get; set; } = default!;

View File

@@ -25,10 +25,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum GetTopWatchedContentQueryParamType
{
One = 1,
Two = 2,
Three = 3,
Four = 4,
Movie = 1,
Show = 2,
Season = 3,
Episode = 4,
}
}

View File

@@ -20,8 +20,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum IncludeGuids
{
Zero = 0,
One = 1,
Disable = 0,
Enable = 1,
}
}

View File

@@ -16,8 +16,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum IncludeHttps
{
Zero = 0,
One = 1,
Disable = 0,
Enable = 1,
}
}

View File

@@ -16,8 +16,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum IncludeIPv6
{
Zero = 0,
One = 1,
Disable = 0,
Enable = 1,
}
}

View File

@@ -20,8 +20,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum IncludeMeta
{
Zero = 0,
One = 1,
Disable = 0,
Enable = 1,
}
}

View File

@@ -21,8 +21,8 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum IncludeRelay
{
Zero = 0,
One = 1,
Disable = 0,
Enable = 1,
}
}

View File

@@ -16,9 +16,9 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
[JsonProperty("id")]
public int? Id { get; set; }
public int Id { get; set; } = default!;
[JsonProperty("path")]
public string? Path { get; set; }
public string Path { get; set; } = default!;
}
}

View File

@@ -0,0 +1,29 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
public class MediaGuid
{
/// <summary>
/// Can be one of the following formats:<br/>
///
/// <remarks>
/// imdb://tt13015952, tmdb://2434012, tvdb://7945991<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("id")]
public string Id { get; set; } = default!;
}
}

View File

@@ -11,10 +11,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
/// <summary>
/// Whether or not the account has media reviews visibility enabled
/// </summary>
public enum MediaReviewsVisibility
{
Zero = 0,
One = 1,
Disable = 0,
Enable = 1,
}
}

View File

@@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class Meta
{
[JsonProperty("Type")]
public List<GetLibraryItemsType>? Type { get; set; }
[JsonProperty("FieldType")]
public List<GetLibraryItemsFieldType>? FieldType { get; set; }
}
}

View File

@@ -10,51 +10,14 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
/// </summary>
public enum PostUsersSignInDataAutoSelectSubtitle
{
[JsonProperty("0")]
Zero,
[JsonProperty("1")]
One,
}
public static class PostUsersSignInDataAutoSelectSubtitleExtension
{
public static string Value(this PostUsersSignInDataAutoSelectSubtitle value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataAutoSelectSubtitle ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataAutoSelectSubtitle).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is PostUsersSignInDataAutoSelectSubtitle)
{
return (PostUsersSignInDataAutoSelectSubtitle)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAutoSelectSubtitle");
}
Disable = 0,
Enable = 1,
}
}

View File

@@ -10,51 +10,14 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)
/// The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)
/// </summary>
public enum PostUsersSignInDataDefaultSubtitleAccessibility
{
[JsonProperty("0")]
Zero,
[JsonProperty("1")]
One,
}
public static class PostUsersSignInDataDefaultSubtitleAccessibilityExtension
{
public static string Value(this PostUsersSignInDataDefaultSubtitleAccessibility value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataDefaultSubtitleAccessibility ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataDefaultSubtitleAccessibility).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is PostUsersSignInDataDefaultSubtitleAccessibility)
{
return (PostUsersSignInDataDefaultSubtitleAccessibility)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataDefaultSubtitleAccessibility");
}
Disable = 0,
Enable = 1,
}
}

View File

@@ -10,51 +10,14 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)
/// </summary>
public enum PostUsersSignInDataDefaultSubtitleForced
{
[JsonProperty("0")]
Zero,
[JsonProperty("1")]
One,
}
public static class PostUsersSignInDataDefaultSubtitleForcedExtension
{
public static string Value(this PostUsersSignInDataDefaultSubtitleForced value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataDefaultSubtitleForced ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataDefaultSubtitleForced).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is PostUsersSignInDataDefaultSubtitleForced)
{
return (PostUsersSignInDataDefaultSubtitleForced)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataDefaultSubtitleForced");
}
Disable = 0,
Enable = 1,
}
}

View File

@@ -11,10 +11,13 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
/// <summary>
/// Whether or not the account has media reviews visibility enabled
/// </summary>
public enum PostUsersSignInDataMediaReviewsVisibility
{
Zero = 0,
One = 1,
Disable = 0,
Enable = 1,
}
}

View File

@@ -1,36 +0,0 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
public class PostUsersSignInDataRequest
{
/// <summary>
/// The unique identifier for the client application<br/>
///
/// <remarks>
/// This is used to track the client application and its usage<br/>
/// (UUID, serial number, or other number unique per device)<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=X-Plex-Client-Identifier")]
public string? XPlexClientIdentifier { get; set; }
/// <summary>
/// Login credentials
/// </summary>
[SpeakeasyMetadata("request:mediaType=application/x-www-form-urlencoded")]
public PostUsersSignInDataRequestBody? RequestBody { get; set; }
}
}

View File

@@ -136,7 +136,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public int Id { get; set; } = default!;
/// <summary>
/// Unix epoch datetime
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("joinedAt")]
public long JoinedAt { get; set; } = default!;
@@ -182,7 +182,7 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
public bool? Protected { get; set; } = false;
/// <summary>
/// Unix epoch datetime
/// Unix epoch datetime in seconds
/// </summary>
[JsonProperty("rememberExpiresAt")]
public long RememberExpiresAt { get; set; } = default!;

View File

@@ -34,28 +34,19 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("defaultSubtitleLanguage", NullValueHandling = NullValueHandling.Include)]
public string? DefaultSubtitleLanguage { get; set; }
/// <summary>
/// The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
/// </summary>
[JsonProperty("autoSelectSubtitle")]
public PostUsersSignInDataAutoSelectSubtitle? AutoSelectSubtitle { get; set; }
public PostUsersSignInDataAutoSelectSubtitle? AutoSelectSubtitle { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.PostUsersSignInDataAutoSelectSubtitle.Disable;
/// <summary>
/// The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)
/// </summary>
[JsonProperty("defaultSubtitleAccessibility")]
public PostUsersSignInDataDefaultSubtitleAccessibility? DefaultSubtitleAccessibility { get; set; }
public PostUsersSignInDataDefaultSubtitleAccessibility? DefaultSubtitleAccessibility { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.PostUsersSignInDataDefaultSubtitleAccessibility.Disable;
/// <summary>
/// The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)
/// </summary>
[JsonProperty("defaultSubtitleForced")]
public PostUsersSignInDataDefaultSubtitleForced? DefaultSubtitleForced { get; set; }
public PostUsersSignInDataDefaultSubtitleForced? DefaultSubtitleForced { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.PostUsersSignInDataDefaultSubtitleForced.Disable;
[JsonProperty("watchedIndicator")]
public PostUsersSignInDataWatchedIndicator? WatchedIndicator { get; set; }
public PostUsersSignInDataWatchedIndicator? WatchedIndicator { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.PostUsersSignInDataWatchedIndicator.Disable;
[JsonProperty("mediaReviewsVisibility")]
public PostUsersSignInDataMediaReviewsVisibility? MediaReviewsVisibility { get; set; }
public PostUsersSignInDataMediaReviewsVisibility? MediaReviewsVisibility { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.PostUsersSignInDataMediaReviewsVisibility.Disable;
}
}

View File

@@ -10,48 +10,14 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// Whether or not media watched indicators are enabled (little orange dot on media)
/// </summary>
public enum PostUsersSignInDataWatchedIndicator
{
[JsonProperty("0")]
Zero,
[JsonProperty("1")]
One,
}
public static class PostUsersSignInDataWatchedIndicatorExtension
{
public static string Value(this PostUsersSignInDataWatchedIndicator value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostUsersSignInDataWatchedIndicator ToEnum(this string value)
{
foreach(var field in typeof(PostUsersSignInDataWatchedIndicator).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is PostUsersSignInDataWatchedIndicator)
{
return (PostUsersSignInDataWatchedIndicator)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataWatchedIndicator");
}
Disable = 0,
Enable = 1,
}
}

View File

@@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <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.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// The protocol used for the connection (http, https, etc)
/// </summary>
public enum Protocol
{
[JsonProperty("http")]
Http,
[JsonProperty("https")]
Https,
}
public static class ProtocolExtension
{
public static string Value(this Protocol value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Protocol ToEnum(this string value)
{
foreach(var field in typeof(Protocol).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is Protocol)
{
return (Protocol)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Protocol");
}
}
}

View File

@@ -25,10 +25,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum QueryParamType
{
One = 1,
Two = 2,
Three = 3,
Four = 4,
Movie = 1,
Show = 2,
Season = 3,
Episode = 4,
}
}

View File

@@ -25,10 +25,10 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
public enum Type
{
One = 1,
Two = 2,
Three = 3,
Four = 4,
Movie = 1,
Show = 2,
Season = 3,
Episode = 4,
}
}

View File

@@ -42,5 +42,11 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=force")]
public QueryParamForce Force { get; set; } = default!;
/// <summary>
/// Possibly the section ID to upload the playlist to, we are not certain.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=sectionID")]
public long SectionID { get; set; } = 1;
}
}

View File

@@ -34,28 +34,19 @@ namespace LukeHagar.PlexAPI.SDK.Models.Requests
[JsonProperty("defaultSubtitleLanguage", NullValueHandling = NullValueHandling.Include)]
public string? DefaultSubtitleLanguage { get; set; }
/// <summary>
/// The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
/// </summary>
[JsonProperty("autoSelectSubtitle")]
public AutoSelectSubtitle? AutoSelectSubtitle { get; set; }
public AutoSelectSubtitle? AutoSelectSubtitle { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.AutoSelectSubtitle.Disable;
/// <summary>
/// The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)
/// </summary>
[JsonProperty("defaultSubtitleAccessibility")]
public DefaultSubtitleAccessibility? DefaultSubtitleAccessibility { get; set; }
public DefaultSubtitleAccessibility? DefaultSubtitleAccessibility { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.DefaultSubtitleAccessibility.Disable;
/// <summary>
/// The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)
/// </summary>
[JsonProperty("defaultSubtitleForced")]
public DefaultSubtitleForced? DefaultSubtitleForced { get; set; }
public DefaultSubtitleForced? DefaultSubtitleForced { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.DefaultSubtitleForced.Disable;
[JsonProperty("watchedIndicator")]
public WatchedIndicator? WatchedIndicator { get; set; }
public WatchedIndicator? WatchedIndicator { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.WatchedIndicator.Disable;
[JsonProperty("mediaReviewsVisibility")]
public MediaReviewsVisibility? MediaReviewsVisibility { get; set; }
public MediaReviewsVisibility? MediaReviewsVisibility { get; set; } = LukeHagar.PlexAPI.SDK.Models.Requests.MediaReviewsVisibility.Disable;
}
}

View File

@@ -10,48 +10,14 @@
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// Whether or not media watched indicators are enabled (little orange dot on media)
/// </summary>
public enum WatchedIndicator
{
[JsonProperty("0")]
Zero,
[JsonProperty("1")]
One,
}
public static class WatchedIndicatorExtension
{
public static string Value(this WatchedIndicator value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static WatchedIndicator ToEnum(this string value)
{
foreach(var field in typeof(WatchedIndicator).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
{
continue;
}
var attribute = attributes[0] as JsonPropertyAttribute;
if (attribute != null && attribute.PropertyName == value)
{
var enumVal = field.GetValue(null);
if (enumVal is WatchedIndicator)
{
return (WatchedIndicator)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum WatchedIndicator");
}
Disable = 0,
Enable = 1,
}
}

View File

@@ -129,7 +129,7 @@ namespace LukeHagar.PlexAPI.SDK
///
/// </remarks>
/// </summary>
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force);
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID);
}
/// <summary>
@@ -146,10 +146,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -225,10 +225,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -238,10 +236,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -251,19 +247,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetPlaylistsResponse> GetPlaylistsAsync(PlaylistType? playlistType = null, QueryParamSmart? smart = null)
@@ -324,7 +316,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetPlaylistsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetPlaylistsResponse()
{
StatusCode = responseStatusCode,
@@ -334,45 +326,37 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetPlaylistsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetPlaylistsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetPlaylistsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetPlaylistsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetPlaylistResponse> GetPlaylistAsync(double playlistID)
@@ -442,10 +426,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -455,10 +437,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -468,19 +448,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<DeletePlaylistResponse> DeletePlaylistAsync(double playlistID)
@@ -553,10 +529,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -566,19 +540,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<UpdatePlaylistResponse> UpdatePlaylistAsync(double playlistID, string? title = null, string? summary = null)
@@ -653,10 +623,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -666,19 +634,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetPlaylistContentsResponse> GetPlaylistContentsAsync(double playlistID, GetPlaylistContentsQueryParamType type)
@@ -749,10 +713,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -762,10 +724,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -775,19 +735,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<ClearPlaylistContentsResponse> ClearPlaylistContentsAsync(double playlistID)
@@ -860,10 +816,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -873,19 +827,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<AddPlaylistContentsResponse> AddPlaylistContentsAsync(double playlistID, string uri, double? playQueueID = null)
@@ -957,10 +907,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -970,10 +918,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -983,27 +929,24 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force)
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force, long sectionID)
{
var request = new UploadPlaylistRequest()
{
Path = path,
Force = force,
SectionID = sectionID,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/playlists/upload", request);
@@ -1069,10 +1012,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -1082,19 +1023,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -75,16 +75,16 @@ namespace LukeHagar.PlexAPI.SDK
/// Get Plex server access tokens and server connections
/// </remarks>
/// </summary>
Task<GetServerResourcesResponse> GetServerResourcesAsync(string? xPlexClientIdentifier = null, IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? serverUrl = null);
Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? serverUrl = null);
/// <summary>
/// Get a Pin
///
/// <remarks>
/// Retrieve a Pin from Plex.tv for authentication flows
/// Retrieve a Pin ID from Plex.tv to use for authentication flows
/// </remarks>
/// </summary>
Task<GetPinResponse> GetPinAsync(bool? strong = null, string? xPlexClientIdentifier = null, string? xPlexProduct = null, string? serverUrl = null);
Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null);
/// <summary>
/// Get Access Token by PinId
@@ -93,7 +93,7 @@ namespace LukeHagar.PlexAPI.SDK
/// Retrieve an Access Token from Plex.tv after the Pin has been authenticated
/// </remarks>
/// </summary>
Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(long pinID, string? xPlexClientIdentifier = null, string? serverUrl = null);
Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(long pinID, string? serverUrl = null);
}
/// <summary>
@@ -143,10 +143,10 @@ namespace LukeHagar.PlexAPI.SDK
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -228,10 +228,8 @@ namespace LukeHagar.PlexAPI.SDK
response.ResponseBodies = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -241,10 +239,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -254,19 +250,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetUserFriendsResponse> GetUserFriendsAsync(string? serverUrl = null)
@@ -338,10 +330,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Friends = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -351,10 +341,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -364,19 +352,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetGeoDataResponse> GetGeoDataAsync(string? serverUrl = null)
@@ -443,10 +427,8 @@ namespace LukeHagar.PlexAPI.SDK
response.GeoData = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -456,10 +438,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -469,19 +449,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetHomeDataResponse> GetHomeDataAsync()
@@ -548,10 +524,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -561,10 +535,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -574,32 +546,25 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetServerResourcesResponse> GetServerResourcesAsync(string? xPlexClientIdentifier = null, IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? serverUrl = null)
public async Task<GetServerResourcesResponse> GetServerResourcesAsync(IncludeHttps? includeHttps = null, IncludeRelay? includeRelay = null, IncludeIPv6? includeIPv6 = null, string? serverUrl = null)
{
var request = new GetServerResourcesRequest()
{
XPlexClientIdentifier = xPlexClientIdentifier,
IncludeHttps = includeHttps,
IncludeRelay = includeRelay,
IncludeIPv6 = includeIPv6,
};
request.XPlexClientIdentifier ??= SDKConfiguration.XPlexClientIdentifier;
string baseUrl = Utilities.TemplateUrl(GetServerResourcesServerList[0], new Dictionary<string, string>(){
});
if (serverUrl != null)
@@ -656,7 +621,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<List<PlexDevice>>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<List<PlexDevice>>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetServerResourcesResponse()
{
StatusCode = responseStatusCode,
@@ -666,56 +631,45 @@ namespace LukeHagar.PlexAPI.SDK
response.PlexDevices = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetServerResourcesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetServerResourcesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetServerResourcesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetServerResourcesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetPinResponse> GetPinAsync(bool? strong = null, string? xPlexClientIdentifier = null, string? xPlexProduct = null, string? serverUrl = null)
public async Task<GetPinResponse> GetPinAsync(GetPinRequest? request = null, string? serverUrl = null)
{
var request = new GetPinRequest()
{
Strong = strong,
XPlexClientIdentifier = xPlexClientIdentifier,
XPlexProduct = xPlexProduct,
};
request.XPlexClientIdentifier ??= SDKConfiguration.XPlexClientIdentifier;
request.ClientName ??= SDKConfiguration.ClientName;
request.ClientVersion ??= SDKConfiguration.ClientVersion;
request.ClientPlatform ??= SDKConfiguration.ClientPlatform;
request.DeviceName ??= SDKConfiguration.DeviceName;
string baseUrl = Utilities.TemplateUrl(GetPinServerList[0], new Dictionary<string, string>(){
});
@@ -764,11 +718,11 @@ namespace LukeHagar.PlexAPI.SDK
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
if(responseStatusCode == 201)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetPinAuthPinContainer>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetPinAuthPinContainer>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetPinResponse()
{
StatusCode = responseStatusCode,
@@ -778,43 +732,34 @@ namespace LukeHagar.PlexAPI.SDK
response.AuthPinContainer = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetPinBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetPinBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(long pinID, string? xPlexClientIdentifier = null, string? serverUrl = null)
public async Task<GetTokenByPinIdResponse> GetTokenByPinIdAsync(long pinID, string? serverUrl = null)
{
var request = new GetTokenByPinIdRequest()
{
PinID = pinID,
XPlexClientIdentifier = xPlexClientIdentifier,
};
request.XPlexClientIdentifier ??= SDKConfiguration.XPlexClientIdentifier;
string baseUrl = Utilities.TemplateUrl(GetTokenByPinIdServerList[0], new Dictionary<string, string>(){
});
if (serverUrl != null)
@@ -876,10 +821,8 @@ namespace LukeHagar.PlexAPI.SDK
response.AuthPinContainer = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -889,10 +832,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 404)
{
@@ -902,19 +843,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -238,7 +238,11 @@ namespace LukeHagar.PlexAPI.SDK
public string ServerUrl = "";
public int ServerIndex = 0;
public List<Dictionary<string, string>> ServerDefaults = new List<Dictionary<string, string>>();
public string? XPlexClientIdentifier;
public string? ClientID;
public string? ClientName;
public string? ClientVersion;
public string? ClientPlatform;
public string? DeviceName;
public SDKHooks Hooks = new SDKHooks();
public RetryConfig? RetryConfig = null;
@@ -271,10 +275,10 @@ namespace LukeHagar.PlexAPI.SDK
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private int _serverIndex = 0;
private ISpeakeasyHttpClient _client;
@@ -296,7 +300,7 @@ namespace LukeHagar.PlexAPI.SDK
public ISessions Sessions { get; private set; }
public IUpdater Updater { get; private set; }
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, string? xPlexClientIdentifier = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
public PlexAPI(string? accessToken = null, Func<string>? accessTokenSource = null, string? clientID = null, string? clientName = null, string? clientVersion = null, string? clientPlatform = null, string? deviceName = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null, RetryConfig? retryConfig = null)
{
if (serverIndex != null)
{
@@ -338,7 +342,11 @@ namespace LukeHagar.PlexAPI.SDK
SDKConfiguration = new SDKConfig()
{
XPlexClientIdentifier = xPlexClientIdentifier,
ClientID = clientID,
ClientName = clientName,
ClientVersion = clientVersion,
ClientPlatform = clientPlatform,
DeviceName = deviceName,
ServerDefaults = serverDefaults,
ServerIndex = _serverIndex,
ServerUrl = _serverUrl,

View File

@@ -87,10 +87,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -175,10 +175,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -188,19 +186,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<PerformVoiceSearchResponse> PerformVoiceSearchAsync(string query, double? sectionId = null, double? limit = null)
@@ -275,10 +269,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -288,19 +280,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetSearchResultsResponse> GetSearchResultsAsync(string query)
@@ -370,10 +358,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -383,10 +369,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -396,19 +380,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -126,10 +126,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -206,10 +206,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -219,10 +217,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -232,19 +228,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetServerPreferencesResponse> GetServerPreferencesAsync()
@@ -311,10 +303,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -324,10 +314,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -337,19 +325,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetAvailableClientsResponse> GetAvailableClientsAsync()
@@ -416,10 +400,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -429,10 +411,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -442,19 +422,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetDevicesResponse> GetDevicesAsync()
@@ -521,10 +497,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -534,10 +508,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -547,19 +519,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetServerIdentityResponse> GetServerIdentityAsync()
@@ -621,10 +589,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 408)
{
@@ -634,19 +600,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMyPlexAccountResponse> GetMyPlexAccountAsync()
@@ -713,10 +675,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -726,10 +686,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -739,19 +697,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetResizedPhotoResponse> GetResizedPhotoAsync(GetResizedPhotoRequest request)
@@ -820,10 +774,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -833,19 +785,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetMediaProvidersResponse> GetMediaProvidersAsync(string xPlexToken)
@@ -915,10 +863,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -928,10 +874,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -941,19 +885,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetServerListResponse> GetServerListAsync()
@@ -1020,10 +960,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -1033,10 +971,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -1046,19 +982,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -80,10 +80,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -160,10 +160,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -173,10 +171,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -186,19 +182,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetSessionHistoryResponse> GetSessionHistoryAsync(string? sort = null, long? accountId = null, QueryParamFilter? filter = null, long? librarySectionID = null)
@@ -261,7 +253,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetSessionHistoryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetSessionHistoryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetSessionHistoryResponse()
{
StatusCode = responseStatusCode,
@@ -271,45 +263,37 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetSessionHistoryBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetSessionHistoryBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetSessionHistoryUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetSessionHistoryUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetTranscodeSessionsResponse> GetTranscodeSessionsAsync()
@@ -376,10 +360,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -389,10 +371,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -402,19 +382,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<StopTranscodeSessionResponse> StopTranscodeSessionAsync(string sessionKey)
@@ -487,10 +463,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -500,19 +474,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -71,10 +71,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -144,7 +144,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetStatisticsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetStatisticsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetStatisticsResponse()
{
StatusCode = responseStatusCode,
@@ -154,45 +154,37 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetStatisticsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetStatisticsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetStatisticsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetStatisticsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetResourcesStatisticsResponse> GetResourcesStatisticsAsync(long? timespan = null)
@@ -252,7 +244,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetResourcesStatisticsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetResourcesStatisticsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetResourcesStatisticsResponse()
{
StatusCode = responseStatusCode,
@@ -262,45 +254,37 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetResourcesStatisticsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetResourcesStatisticsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetResourcesStatisticsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetResourcesStatisticsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<GetBandwidthStatisticsResponse> GetBandwidthStatisticsAsync(long? timespan = null)
@@ -360,7 +344,7 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetBandwidthStatisticsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetBandwidthStatisticsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
var response = new GetBandwidthStatisticsResponse()
{
StatusCode = responseStatusCode,
@@ -370,45 +354,37 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetBandwidthStatisticsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetBandwidthStatisticsBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<GetBandwidthStatisticsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetBandwidthStatisticsUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -74,10 +74,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -154,10 +154,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -167,10 +165,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -180,19 +176,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<CheckForUpdatesResponse> CheckForUpdatesAsync(Download? download = null)
@@ -261,36 +253,30 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<CheckForUpdatesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<CheckForUpdatesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<CheckForUpdatesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<CheckForUpdatesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<ApplyUpdatesResponse> ApplyUpdatesAsync(Tonight? tonight = null, Skip? skip = null)
@@ -360,36 +346,30 @@ namespace LukeHagar.PlexAPI.SDK
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<ApplyUpdatesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<ApplyUpdatesBadRequest>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<ApplyUpdatesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<ApplyUpdatesUnauthorized>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Include);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode == 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -62,10 +62,10 @@ namespace LukeHagar.PlexAPI.SDK
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -144,10 +144,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -157,19 +155,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
public async Task<StartUniversalTranscodeResponse> StartUniversalTranscodeAsync(StartUniversalTranscodeRequest request)
@@ -238,10 +232,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -251,19 +243,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -59,10 +59,10 @@ namespace LukeHagar.PlexAPI.SDK
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.6.8";
private const string _sdkGenVersion = "2.415.8";
private const string _sdkVersion = "0.7.0";
private const string _sdkGenVersion = "2.421.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.6.8 2.415.8 0.0.3 LukeHagar.PlexAPI.SDK";
private const string _userAgent = "speakeasy-sdk/csharp 0.7.0 2.421.3 0.0.3 LukeHagar.PlexAPI.SDK";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<LukeHagar.PlexAPI.SDK.Models.Components.Security>? _securitySource;
@@ -143,10 +143,8 @@ namespace LukeHagar.PlexAPI.SDK
response.Object = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 400)
{
@@ -156,10 +154,8 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
@@ -169,19 +165,15 @@ namespace LukeHagar.PlexAPI.SDK
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
throw new Models.Errors.SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
throw new Models.Errors.SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}

View File

@@ -12,7 +12,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -26,21 +30,25 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
## Global Parameters
A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `X-Plex-Client-Identifier` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
### Available Globals
The following global parameter is available.
The following global parameters are available.
| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| xPlexClientIdentifier | string | | The unique identifier for the client application
| clientID | string | | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
|
| clientName | string | | The ClientName parameter. |
| clientVersion | string | | The ClientVersion parameter. |
| clientPlatform | string | | The ClientPlatform parameter. |
| deviceName | string | | The DeviceName parameter. |
### Example
@@ -51,16 +59,16 @@ using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Plex.GetServerResourcesAsync(
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40",
includeHttps: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.One,
includeRelay: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeRelay.One,
includeIPv6: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.One
);
GetPinRequest req = new GetPinRequest() {};
var res = await sdk.Plex.GetPinAsync(req);
// handle response
```
@@ -87,7 +95,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
try
@@ -100,15 +112,18 @@ catch (Exception ex)
{
if (ex is GetServerCapabilitiesBadRequest)
{
// handle exception
// Handle exception data
throw;
}
else if (ex is GetServerCapabilitiesUnauthorized)
{
// handle exception
// Handle exception data
throw;
}
else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
else if (ex is Models.Errors.SDKException)
{
// handle exception
// Handle default exception
throw;
}
}
```
@@ -148,7 +163,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2/");
@@ -175,7 +194,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();

View File

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

View File

@@ -36,7 +36,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -211,7 +215,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Plex.GetCompanionsDataAsync(serverUrl: "https://plex.tv/api/v2/");
@@ -238,7 +246,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();
@@ -252,21 +264,25 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
## Global Parameters
A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
Certain parameters are configured globally. These parameters may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, These global values will be used as defaults on the operations that use them. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set `X-Plex-Client-Identifier` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetServerResources`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
For example, you can set `ClientID` to `"gcgzw5rz2xovp84b4vha3a40"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetPin`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
### Available Globals
The following global parameter is available.
The following global parameters are available.
| Name | Type | Required | Description |
| ---- | ---- |:--------:| ----------- |
| xPlexClientIdentifier | string | | The unique identifier for the client application
| clientID | string | | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
|
| clientName | string | | The ClientName parameter. |
| clientVersion | string | | The ClientVersion parameter. |
| clientPlatform | string | | The ClientPlatform parameter. |
| deviceName | string | | The DeviceName parameter. |
### Example
@@ -277,16 +293,16 @@ using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Plex.GetServerResourcesAsync(
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40",
includeHttps: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeHttps.One,
includeRelay: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeRelay.One,
includeIPv6: LukeHagar.PlexAPI.SDK.Models.Requests.IncludeIPv6.One
);
GetPinRequest req = new GetPinRequest() {};
var res = await sdk.Plex.GetPinAsync(req);
// handle response
```
@@ -313,7 +329,11 @@ using LukeHagar.PlexAPI.SDK.Models.Errors;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
try
@@ -326,15 +346,18 @@ catch (Exception ex)
{
if (ex is GetServerCapabilitiesBadRequest)
{
// handle exception
// Handle exception data
throw;
}
else if (ex is GetServerCapabilitiesUnauthorized)
{
// handle exception
// Handle exception data
throw;
}
else if (ex is LukeHagar.PlexAPI.SDK.Models.Errors.SDKException)
else if (ex is Models.Errors.SDKException)
{
// handle exception
// Handle default exception
throw;
}
}
```

View File

@@ -204,4 +204,44 @@ Based on:
### Generated
- [csharp v0.6.8] .
### Releases
- [NuGet v0.6.8] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.6.8 - .
- [NuGet v0.6.8] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.6.8 - .
## 2024-09-16 21:53:20
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.398.0 (2.415.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.6.9] .
### Releases
- [NuGet v0.6.9] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.6.9 - .
## 2024-09-16 22:52:24
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.398.0 (2.415.8) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.6.10] .
### Releases
- [NuGet v0.6.10] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.6.10 - .
## 2024-09-19 00:20:08
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.399.2 (2.416.6) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.6.11] .
### Releases
- [NuGet v0.6.11] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.6.11 - .
## 2024-09-21 00:19:36
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.401.2 (2.421.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.7.0] .
### Releases
- [NuGet v0.7.0] https://www.nuget.org/packages/LukeHagar.PlexAPI.SDK/0.7.0 - .

View File

@@ -5,7 +5,11 @@ using LukeHagar.PlexAPI.SDK.Models.Components;
var sdk = new PlexAPI(
accessToken: "<YOUR_API_KEY_HERE>",
xPlexClientIdentifier: "gcgzw5rz2xovp84b4vha3a40"
clientID: "gcgzw5rz2xovp84b4vha3a40",
clientName: "Plex Web",
clientVersion: "4.133.0",
clientPlatform: "Chrome",
deviceName: "Linux"
);
var res = await sdk.Server.GetServerCapabilitiesAsync();

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@ The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign aud
## Values
| Name | Value |
| ------ | ------ |
| `Zero` | 0 |
| `One` | 1 |
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -3,12 +3,12 @@
## Fields
| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `Protocol` | *string* | :heavy_check_mark: | N/A |
| `Address` | *string* | :heavy_check_mark: | N/A |
| `Port` | *double* | :heavy_check_mark: | N/A |
| `Uri` | *string* | :heavy_check_mark: | N/A |
| `Local` | *bool* | :heavy_check_mark: | N/A |
| `Relay` | *bool* | :heavy_check_mark: | N/A |
| `IPv6` | *bool* | :heavy_check_mark: | N/A |
| Field | Type | Required | Description |
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| `Protocol` | [Protocol](../../Models/Requests/Protocol.md) | :heavy_check_mark: | The protocol used for the connection (http, https, etc) |
| `Address` | *string* | :heavy_check_mark: | The (ip) address or domain name used for the connection |
| `Port` | *int* | :heavy_check_mark: | The port used for the connection |
| `Uri` | *string* | :heavy_check_mark: | The full URI of the connection |
| `Local` | *bool* | :heavy_check_mark: | If the connection is local address |
| `Relay` | *bool* | :heavy_check_mark: | If the connection is relayed through plex.direct |
| `IPv6` | *bool* | :heavy_check_mark: | If the connection is using IPv6 |

View File

@@ -1,11 +1,11 @@
# DefaultSubtitleAccessibility
The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)
The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only show non-SDH subtitles)
## Values
| Name | Value |
| ------ | ------ |
| `Zero` | 0 |
| `One` | 1 |
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -5,7 +5,7 @@ The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer
## Values
| Name | Value |
| ------ | ------ |
| `Zero` | 0 |
| `One` | 1 |
| Name | Value |
| --------- | --------- |
| `Disable` | 0 |
| `Enable` | 1 |

View File

@@ -13,7 +13,7 @@ Geo location data
| `City` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam |
| `EuropeanUnionMember` | *bool* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true |
| `TimeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas |
| `PostalCode` | *long* | :heavy_check_mark: | The postal code of the location. | 802 |
| `PostalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 |
| `InPrivacyRestrictedCountry` | *bool* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true |
| `InPrivacyRestrictedRegion` | *bool* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true |
| `Subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas |

View File

@@ -5,24 +5,24 @@
| Field | Type | Required | Description | Example |
| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- |
| `AllowSync` | *bool* | :heavy_minus_sign: | N/A | true |
| `Art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg |
| `Composite` | *string* | :heavy_minus_sign: | N/A | /library/sections/1/composite/1705615584 |
| `Filters` | *bool* | :heavy_minus_sign: | N/A | true |
| `Refreshing` | *bool* | :heavy_minus_sign: | N/A | false |
| `Thumb` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie.png |
| `Key` | *string* | :heavy_minus_sign: | N/A | 1 |
| `Type` | *string* | :heavy_minus_sign: | N/A | movie |
| `Title` | *string* | :heavy_minus_sign: | N/A | Movies |
| `Agent` | *string* | :heavy_minus_sign: | N/A | tv.plex.agents.movie |
| `Scanner` | *string* | :heavy_minus_sign: | N/A | Plex Movie |
| `Language` | *string* | :heavy_minus_sign: | N/A | en-US |
| `Uuid` | *string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `UpdatedAt` | *long* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 |
| `CreatedAt` | *long* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 |
| `ScannedAt` | *long* | :heavy_minus_sign: | Unix epoch datetime | 1556281940 |
| `Content` | *bool* | :heavy_minus_sign: | N/A | true |
| `Directory` | *bool* | :heavy_minus_sign: | N/A | true |
| `ContentChangedAt` | *int* | :heavy_minus_sign: | N/A | 3192854 |
| `Hidden` | *int* | :heavy_minus_sign: | N/A | 0 |
| `Location` | List<[Location](../../Models/Requests/Location.md)> | :heavy_minus_sign: | N/A | |
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | true |
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
| `Composite` | *string* | :heavy_check_mark: | N/A | /library/sections/1/composite/1705615584 |
| `Filters` | *bool* | :heavy_check_mark: | N/A | true |
| `Refreshing` | *bool* | :heavy_check_mark: | N/A | false |
| `Thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/movie.png |
| `Key` | *string* | :heavy_check_mark: | N/A | 1 |
| `Type` | *string* | :heavy_check_mark: | N/A | movie |
| `Title` | *string* | :heavy_check_mark: | N/A | Movies |
| `Agent` | *string* | :heavy_check_mark: | N/A | tv.plex.agents.movie |
| `Scanner` | *string* | :heavy_check_mark: | N/A | Plex Movie |
| `Language` | *string* | :heavy_check_mark: | N/A | en-US |
| `Uuid` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `UpdatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `CreatedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `ScannedAt` | *long* | :heavy_check_mark: | Unix epoch datetime in seconds | 1556281940 |
| `Content` | *bool* | :heavy_check_mark: | N/A | true |
| `Directory` | *bool* | :heavy_check_mark: | N/A | true |
| `ContentChangedAt` | *int* | :heavy_check_mark: | N/A | 3192854 |
| `Hidden` | *int* | :heavy_check_mark: | N/A | 0 |
| `Location` | List<[Location](../../Models/Requests/Location.md)> | :heavy_check_mark: | N/A | |

View File

@@ -8,4 +8,4 @@
| `Size` | *int* | :heavy_check_mark: | N/A | 5 |
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | false |
| `Title1` | *string* | :heavy_check_mark: | N/A | Plex Library |
| `Directory` | List<[GetAllLibrariesDirectory](../../Models/Requests/GetAllLibrariesDirectory.md)> | :heavy_minus_sign: | N/A | |
| `Directory` | List<[GetAllLibrariesDirectory](../../Models/Requests/GetAllLibrariesDirectory.md)> | :heavy_check_mark: | N/A | |

View File

@@ -7,4 +7,4 @@ The libraries available on the Server
| Field | Type | Required | Description |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `MediaContainer` | [GetAllLibrariesMediaContainer](../../Models/Requests/GetAllLibrariesMediaContainer.md) | :heavy_minus_sign: | N/A |
| `MediaContainer` | [GetAllLibrariesMediaContainer](../../Models/Requests/GetAllLibrariesMediaContainer.md) | :heavy_check_mark: | N/A |

View File

@@ -13,7 +13,7 @@ Geo location data
| `City` | *string* | :heavy_check_mark: | The name of the city. | Amsterdam |
| `EuropeanUnionMember` | *bool* | :heavy_minus_sign: | Indicates if the country is a member of the European Union. | true |
| `TimeZone` | *string* | :heavy_check_mark: | The time zone of the country. | America/St_Thomas |
| `PostalCode` | *long* | :heavy_check_mark: | The postal code of the location. | 802 |
| `PostalCode` | *string* | :heavy_check_mark: | The postal code of the location. | 802 |
| `InPrivacyRestrictedCountry` | *bool* | :heavy_minus_sign: | Indicates if the country has privacy restrictions. | true |
| `InPrivacyRestrictedRegion` | *bool* | :heavy_minus_sign: | Indicates if the region has privacy restrictions. | true |
| `Subdivisions` | *string* | :heavy_check_mark: | The name of the primary administrative subdivision. | Saint Thomas |

View File

@@ -0,0 +1,11 @@
# GetLibraryItemsField
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Key` | *string* | :heavy_check_mark: | N/A | show.title |
| `Title` | *string* | :heavy_check_mark: | N/A | Show Title |
| `Type` | *string* | :heavy_check_mark: | N/A | string |
| `SubType` | *string* | :heavy_minus_sign: | N/A | rating |

View File

@@ -0,0 +1,9 @@
# GetLibraryItemsFieldType
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `Type` | *string* | :heavy_check_mark: | N/A | tag |
| `Operator` | List<[GetLibraryItemsOperator](../../Models/Requests/GetLibraryItemsOperator.md)> | :heavy_check_mark: | N/A | |

View File

@@ -0,0 +1,12 @@
# GetLibraryItemsFilter
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- |
| `Filter` | *string* | :heavy_check_mark: | N/A | genre |
| `FilterType` | *string* | :heavy_check_mark: | N/A | string |
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/genre?type=2 |
| `Title` | *string* | :heavy_check_mark: | N/A | Genre |
| `Type` | *string* | :heavy_check_mark: | N/A | filter |

View File

@@ -3,21 +3,22 @@
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| `Size` | *int* | :heavy_minus_sign: | N/A | 70 |
| `AllowSync` | *bool* | :heavy_minus_sign: | N/A | true |
| `Art` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie-fanart.jpg |
| `Identifier` | *string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library |
| `LibrarySectionID` | [LibrarySectionID](../../Models/Requests/LibrarySectionID.md) | :heavy_minus_sign: | N/A | |
| `LibrarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies |
| `LibrarySectionUUID` | *string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `MediaTagPrefix` | *string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ |
| `MediaTagVersion` | *int* | :heavy_minus_sign: | N/A | 1701731894 |
| `Thumb` | *string* | :heavy_minus_sign: | N/A | /:/resources/movie.png |
| `Title1` | *string* | :heavy_minus_sign: | N/A | Movies |
| `Title2` | *string* | :heavy_minus_sign: | N/A | Recently Released |
| `ViewGroup` | *string* | :heavy_minus_sign: | N/A | movie |
| `ViewMode` | *int* | :heavy_minus_sign: | N/A | 65592 |
| `MixedParents` | *bool* | :heavy_minus_sign: | N/A | true |
| `Metadata` | List<[GetLibraryItemsMetadata](../../Models/Requests/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | |
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `Size` | *int* | :heavy_check_mark: | N/A | 70 |
| `AllowSync` | *bool* | :heavy_check_mark: | N/A | true |
| `Art` | *string* | :heavy_check_mark: | N/A | /:/resources/movie-fanart.jpg |
| `Identifier` | *string* | :heavy_check_mark: | N/A | com.plexapp.plugins.library |
| `LibrarySectionID` | [LibrarySectionID](../../Models/Requests/LibrarySectionID.md) | :heavy_check_mark: | N/A | |
| `LibrarySectionTitle` | *string* | :heavy_check_mark: | N/A | Movies |
| `LibrarySectionUUID` | *string* | :heavy_check_mark: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 |
| `MediaTagPrefix` | *string* | :heavy_check_mark: | N/A | /system/bundle/media/flags/ |
| `MediaTagVersion` | *int* | :heavy_check_mark: | N/A | 1701731894 |
| `Thumb` | *string* | :heavy_check_mark: | N/A | /:/resources/movie.png |
| `Title1` | *string* | :heavy_check_mark: | N/A | Movies |
| `Title2` | *string* | :heavy_check_mark: | N/A | Recently Released |
| `ViewGroup` | *string* | :heavy_check_mark: | N/A | movie |
| `ViewMode` | *int* | :heavy_minus_sign: | N/A | 65592 |
| `MixedParents` | *bool* | :heavy_minus_sign: | N/A | true |
| `Metadata` | List<[GetLibraryItemsMetadata](../../Models/Requests/GetLibraryItemsMetadata.md)> | :heavy_minus_sign: | N/A | |
| `Meta` | [Meta](../../Models/Requests/Meta.md) | :heavy_minus_sign: | The Meta object is only included in the response if the `includeMeta` parameter is set to `1`.<br/> | |

View File

@@ -5,21 +5,21 @@
| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RatingKey` | *string* | :heavy_minus_sign: | N/A | 58683 |
| `Key` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683 |
| `Guid` | *string* | :heavy_minus_sign: | N/A | plex://movie/5d7768ba96b655001fdc0408 |
| `RatingKey` | *string* | :heavy_check_mark: | N/A | 58683 |
| `Key` | *string* | :heavy_check_mark: | N/A | /library/metadata/58683 |
| `Guid` | *string* | :heavy_check_mark: | N/A | plex://movie/5d7768ba96b655001fdc0408 |
| `Studio` | *string* | :heavy_minus_sign: | N/A | 20th Century Studios |
| `Type` | *string* | :heavy_minus_sign: | N/A | movie |
| `Title` | *string* | :heavy_minus_sign: | N/A | Avatar: The Way of Water |
| `Type` | *string* | :heavy_check_mark: | N/A | movie |
| `Title` | *string* | :heavy_check_mark: | N/A | Avatar: The Way of Water |
| `ContentRating` | *string* | :heavy_minus_sign: | N/A | PG-13 |
| `Summary` | *string* | :heavy_minus_sign: | N/A | Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home. |
| `Rating` | *double* | :heavy_minus_sign: | N/A | 7.6 |
| `AudienceRating` | *double* | :heavy_minus_sign: | N/A | 9.2 |
| `Year` | *int* | :heavy_minus_sign: | N/A | 2022 |
| `Year` | *int* | :heavy_check_mark: | N/A | 2022 |
| `Tagline` | *string* | :heavy_minus_sign: | N/A | Return to Pandora. |
| `Thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 |
| `Art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 |
| `Duration` | *int* | :heavy_minus_sign: | N/A | 11558112 |
| `Duration` | *int* | :heavy_check_mark: | N/A | 11558112 |
| `OriginallyAvailableAt` | [LocalDate](https://nodatime.org/3.1.x/api/NodaTime.LocalDate.html) | :heavy_minus_sign: | N/A | 2022-12-14 00:00:00 +0000 UTC |
| `AddedAt` | *int* | :heavy_minus_sign: | N/A | 1680457607 |
| `UpdatedAt` | *int* | :heavy_minus_sign: | N/A | 1703239236 |
@@ -34,12 +34,13 @@
| `GrandparentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
| `GrandparentArt` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/art/1705716261 |
| `GrandparentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |
| `Media` | List<[GetLibraryItemsMedia](../../Models/Requests/GetLibraryItemsMedia.md)> | :heavy_minus_sign: | N/A | |
| `Media` | List<[GetLibraryItemsMedia](../../Models/Requests/GetLibraryItemsMedia.md)> | :heavy_check_mark: | N/A | |
| `Genre` | List<[GetLibraryItemsGenre](../../Models/Requests/GetLibraryItemsGenre.md)> | :heavy_minus_sign: | N/A | |
| `Country` | List<[GetLibraryItemsCountry](../../Models/Requests/GetLibraryItemsCountry.md)> | :heavy_minus_sign: | N/A | |
| `Director` | List<[GetLibraryItemsDirector](../../Models/Requests/GetLibraryItemsDirector.md)> | :heavy_minus_sign: | N/A | |
| `Writer` | List<[GetLibraryItemsWriter](../../Models/Requests/GetLibraryItemsWriter.md)> | :heavy_minus_sign: | N/A | |
| `Role` | List<[GetLibraryItemsRole](../../Models/Requests/GetLibraryItemsRole.md)> | :heavy_minus_sign: | N/A | |
| `MediaGuid` | List<[MediaGuid](../../Models/Requests/MediaGuid.md)> | :heavy_minus_sign: | The Guid object is only included in the response if the `includeGuids` parameter is set to `1`.<br/> | |
| `TitleSort` | *string* | :heavy_minus_sign: | N/A | Whale |
| `ViewCount` | *int* | :heavy_minus_sign: | N/A | 1 |
| `LastViewedAt` | *int* | :heavy_minus_sign: | N/A | 1682752242 |

View File

@@ -0,0 +1,9 @@
# GetLibraryItemsOperator
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Key` | *string* | :heavy_check_mark: | N/A | = |
| `Title` | *string* | :heavy_check_mark: | N/A | is |

View File

@@ -0,0 +1,13 @@
# GetLibraryItemsSort
## Fields
| Field | Type | Required | Description | Example |
| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- |
| `Default` | *string* | :heavy_minus_sign: | N/A | asc |
| `DefaultDirection` | *string* | :heavy_check_mark: | N/A | asc |
| `DescKey` | *string* | :heavy_minus_sign: | N/A | titleSort:desc |
| `FirstCharacterKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/2/firstCharacter |
| `Key` | *string* | :heavy_check_mark: | N/A | titleSort |
| `Title` | *string* | :heavy_check_mark: | N/A | Title |

View File

@@ -0,0 +1,14 @@
# GetLibraryItemsType
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `Key` | *string* | :heavy_check_mark: | N/A | /library/sections/2/all?type=2 |
| `Type` | *string* | :heavy_check_mark: | N/A | show |
| `Title` | *string* | :heavy_check_mark: | N/A | TV Shows |
| `Active` | *bool* | :heavy_check_mark: | N/A | false |
| `Filter` | List<[GetLibraryItemsFilter](../../Models/Requests/GetLibraryItemsFilter.md)> | :heavy_minus_sign: | N/A | |
| `Sort` | List<[GetLibraryItemsSort](../../Models/Requests/GetLibraryItemsSort.md)> | :heavy_minus_sign: | N/A | |
| `Field` | List<[GetLibraryItemsField](../../Models/Requests/GetLibraryItemsField.md)> | :heavy_minus_sign: | N/A | |

View File

@@ -9,13 +9,13 @@ Requests a new pin id used in the authentication flow
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Id` | *long* | :heavy_check_mark: | N/A | 308667304 |
| `Code` | *string* | :heavy_check_mark: | N/A | 7RQZ |
| `Product` | *string* | :heavy_check_mark: | N/A | 0 |
| `Product` | *string* | :heavy_check_mark: | N/A | Tautulli |
| `Trusted` | *bool* | :heavy_minus_sign: | N/A | |
| `Qr` | *string* | :heavy_check_mark: | N/A | https://plex.tv/api/v2/pins/qr/7RQZ |
| `ClientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | |
| `ClientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | Tautulli |
| `Location` | [GeoData](../../Models/Requests/GeoData.md) | :heavy_check_mark: | Geo location data | {<br/>"code": "VI",<br/>"continent_code": "NA",<br/>"country": "United States Virgin Islands",<br/>"city": "Amsterdam",<br/>"european_union_member": true,<br/>"time_zone": "America/St_Thomas",<br/>"postal_code": 802,<br/>"in_privacy_restricted_country": true,<br/>"in_privacy_restricted_region": true,<br/>"subdivisions": "Saint Thomas",<br/>"coordinates": "18.3381, -64.8941"<br/>} |
| `ExpiresIn` | *long* | :heavy_minus_sign: | The number of seconds this pin expires, by default 900 seconds | 876 |
| `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | 2024-07-16T17:03:05Z |
| `ExpiresAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | 2024-07-16T17:18:05Z |
| `AuthToken` | *object* | :heavy_minus_sign: | N/A | |
| `AuthToken` | *string* | :heavy_minus_sign: | N/A | gcgzw5rz2xovp84b4vha3a40 |
| `NewRegistration` | *object* | :heavy_minus_sign: | N/A | |

View File

@@ -3,8 +3,10 @@
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Strong` | *bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | |
| `XPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | gcgzw5rz2xovp84b4vha3a40 |
| `XPlexProduct` | *string* | :heavy_minus_sign: | N/A | Plex Web |
| Field | Type | Required | Description | Example |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Strong` | *bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call<br/>Strong codes are used for Pin authentication flows<br/>Non-Strong codes are used for `Plex.tv/link`<br/> | |
| `ClientName` | *string* | :heavy_minus_sign: | N/A | Plex Web |
| `DeviceName` | *string* | :heavy_minus_sign: | N/A | Linux |
| `ClientVersion` | *string* | :heavy_minus_sign: | N/A | 4.133.0 |
| `ClientPlatform` | *string* | :heavy_minus_sign: | N/A | Chrome |

View File

@@ -11,9 +11,9 @@ E.g. A movie library will not return anything with type 3 as there are no season
## Values
| Name | Value |
| ------- | ------- |
| `One` | 1 |
| `Two` | 2 |
| `Three` | 3 |
| `Four` | 4 |
| Name | Value |
| --------- | --------- |
| `Movie` | 1 |
| `Show` | 2 |
| `Season` | 3 |
| `Episode` | 4 |

View File

@@ -3,9 +3,8 @@
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `XPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application<br/>This is used to track the client application and its usage<br/>(UUID, serial number, or other number unique per device)<br/> | gcgzw5rz2xovp84b4vha3a40 |
| `IncludeHttps` | [IncludeHttps](../../Models/Requests/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 |
| `IncludeRelay` | [IncludeRelay](../../Models/Requests/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 |
| `IncludeIPv6` | [IncludeIPv6](../../Models/Requests/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |
| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `IncludeHttps` | [IncludeHttps](../../Models/Requests/IncludeHttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 |
| `IncludeRelay` | [IncludeRelay](../../Models/Requests/IncludeRelay.md) | :heavy_minus_sign: | Include Relay addresses in the results <br/>E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400<br/> | 1 |
| `IncludeIPv6` | [IncludeIPv6](../../Models/Requests/IncludeIPv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 |

View File

@@ -9,13 +9,13 @@ The Pin with a non-null authToken when it has been verified by the user
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Id` | *long* | :heavy_check_mark: | N/A | 308667304 |
| `Code` | *string* | :heavy_check_mark: | N/A | 7RQZ |
| `Product` | *string* | :heavy_check_mark: | N/A | 0 |
| `Product` | *string* | :heavy_check_mark: | N/A | Tautulli |
| `Trusted` | *bool* | :heavy_minus_sign: | N/A | |
| `Qr` | *string* | :heavy_check_mark: | N/A | https://plex.tv/api/v2/pins/qr/7RQZ |
| `ClientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | |
| `ClientIdentifier` | *string* | :heavy_check_mark: | The X-Client-Identifier used in the request | Tautulli |
| `Location` | [GetTokenByPinIdGeoData](../../Models/Requests/GetTokenByPinIdGeoData.md) | :heavy_check_mark: | Geo location data | {<br/>"code": "VI",<br/>"continent_code": "NA",<br/>"country": "United States Virgin Islands",<br/>"city": "Amsterdam",<br/>"european_union_member": true,<br/>"time_zone": "America/St_Thomas",<br/>"postal_code": 802,<br/>"in_privacy_restricted_country": true,<br/>"in_privacy_restricted_region": true,<br/>"subdivisions": "Saint Thomas",<br/>"coordinates": "18.3381, -64.8941"<br/>} |
| `ExpiresIn` | *long* | :heavy_minus_sign: | The number of seconds this pin expires, by default 900 seconds | 876 |
| `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | 2024-07-16T17:03:05Z |
| `ExpiresAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_check_mark: | N/A | 2024-07-16T17:18:05Z |
| `AuthToken` | *object* | :heavy_minus_sign: | N/A | |
| `AuthToken` | *string* | :heavy_minus_sign: | N/A | gcgzw5rz2xovp84b4vha3a40 |
| `NewRegistration` | *object* | :heavy_minus_sign: | N/A | |

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