ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.383.2

This commit is contained in:
speakeasybot
2024-08-30 00:10:10 +00:00
parent cc8bc7366d
commit ec1b25e152
148 changed files with 1044 additions and 954 deletions

View File

@@ -74,10 +74,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -52,6 +52,15 @@ namespace PlexAPI
/// </remarks>
/// </summary>
Task<GetSourceConnectionInformationResponse> GetSourceConnectionInformationAsync(string source);
/// <summary>
/// Get User SignIn Data
///
/// <remarks>
/// 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);
}
/// <summary>
@@ -63,12 +72,18 @@ namespace PlexAPI
/// </summary>
public class Authentication: IAuthentication
{
/// <summary>
/// List of server URLs available for the post-users-sign-in-data operation.
/// </summary>
public static readonly string[] PostUsersSignInDataServerList = {
"https://plex.tv/api/v2",
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;
@@ -251,5 +266,111 @@ namespace PlexAPI
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
public async Task<PostUsersSignInDataResponse> PostUsersSignInDataAsync(string? xPlexClientIdentifier = null, PostUsersSignInDataRequestBody? requestBody = null, string? serverUrl = null)
{
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 = baseUrl + "/users/signin";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
}
var hookCtx = new HookContext("post-users-sign-in-data", null, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 201)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new PostUsersSignInDataResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.UserPlexAccount = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<PostUsersSignInDataResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}
}

View File

@@ -101,10 +101,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -63,10 +63,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -64,7 +64,7 @@ namespace PlexAPI
///
/// </remarks>
/// </summary>
Task<GetLibrariesResponse> GetLibrariesAsync();
Task<GetAllLibrariesResponse> GetAllLibrariesAsync();
/// <summary>
/// Get Library Details
@@ -112,13 +112,13 @@ namespace PlexAPI
///
/// </remarks>
/// </summary>
Task<GetLibraryResponse> GetLibraryAsync(double sectionId, IncludeDetails? includeDetails = null);
Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(double sectionId, IncludeDetails? includeDetails = null);
/// <summary>
/// Delete Library Section
///
/// <remarks>
/// Delate a library using a specific section
/// Delete a library using a specific section id
/// </remarks>
/// </summary>
Task<DeleteLibraryResponse> DeleteLibraryAsync(double sectionId);
@@ -153,14 +153,14 @@ namespace PlexAPI
Task<GetLibraryItemsResponse> GetLibraryItemsAsync(object sectionId, Tag tag, long? includeGuids = null);
/// <summary>
/// Refresh Library
/// Refresh Metadata Of The Library
///
/// <remarks>
/// This endpoint Refreshes the library.<br/>
/// This endpoint Refreshes all the Metadata of the library.<br/>
///
/// </remarks>
/// </summary>
Task<RefreshLibraryResponse> RefreshLibraryAsync(double sectionId);
Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(double sectionId, Force? force = null);
/// <summary>
/// Search Library
@@ -187,7 +187,7 @@ namespace PlexAPI
///
/// </remarks>
/// </summary>
Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Type type);
Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Models.Requests.Type type);
/// <summary>
/// Get Items Metadata
@@ -241,10 +241,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;
@@ -435,7 +435,7 @@ namespace PlexAPI
}
}
public async Task<GetLibrariesResponse> GetLibrariesAsync()
public async Task<GetAllLibrariesResponse> GetAllLibrariesAsync()
{
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
@@ -449,7 +449,7 @@ namespace PlexAPI
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getLibraries", null, _securitySource);
var hookCtx = new HookContext("get-all-libraries", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
@@ -489,8 +489,8 @@ namespace PlexAPI
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetLibrariesResponse()
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetAllLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetAllLibrariesResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
@@ -512,7 +512,7 @@ namespace PlexAPI
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetAllLibrariesResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
@@ -527,9 +527,9 @@ namespace PlexAPI
}
}
public async Task<GetLibraryResponse> GetLibraryAsync(double sectionId, IncludeDetails? includeDetails = null)
public async Task<GetLibraryDetailsResponse> GetLibraryDetailsAsync(double sectionId, IncludeDetails? includeDetails = null)
{
var request = new GetLibraryRequest()
var request = new GetLibraryDetailsRequest()
{
SectionId = sectionId,
IncludeDetails = includeDetails,
@@ -545,7 +545,7 @@ namespace PlexAPI
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var hookCtx = new HookContext("getLibrary", null, _securitySource);
var hookCtx = new HookContext("get-library-details", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
@@ -585,8 +585,8 @@ namespace PlexAPI
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetLibraryResponse()
var obj = ResponseBodyDeserializer.Deserialize<Models.Requests.GetLibraryDetailsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new GetLibraryDetailsResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
@@ -608,7 +608,7 @@ namespace PlexAPI
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<Models.Errors.GetLibraryDetailsResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
@@ -805,11 +805,12 @@ namespace PlexAPI
}
}
public async Task<RefreshLibraryResponse> RefreshLibraryAsync(double sectionId)
public async Task<GetRefreshLibraryMetadataResponse> GetRefreshLibraryMetadataAsync(double sectionId, Force? force = null)
{
var request = new RefreshLibraryRequest()
var request = new GetRefreshLibraryMetadataRequest()
{
SectionId = sectionId,
Force = force,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerUrl();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/refresh", request);
@@ -822,7 +823,7 @@ namespace PlexAPI
httpRequest = new SecurityMetadata(_securitySource).Apply(httpRequest);
}
var hookCtx = new HookContext("refreshLibrary", null, _securitySource);
var hookCtx = new HookContext("get-refresh-library-metadata", null, _securitySource);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
@@ -860,7 +861,7 @@ namespace PlexAPI
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 200)
{
return new RefreshLibraryResponse()
return new GetRefreshLibraryMetadataResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
@@ -875,7 +876,7 @@ namespace PlexAPI
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<RefreshLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var obj = ResponseBodyDeserializer.Deserialize<GetRefreshLibraryMetadataResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
@@ -890,7 +891,7 @@ namespace PlexAPI
}
}
public async Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Type type)
public async Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Models.Requests.Type type)
{
var request = new SearchLibraryRequest()
{

View File

@@ -94,10 +94,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -72,10 +72,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -12,7 +12,7 @@ namespace PlexAPI.Models.Errors
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibrariesErrors
public class GetAllLibrariesErrors
{
[JsonProperty("code")]

View File

@@ -19,11 +19,11 @@ namespace PlexAPI.Models.Errors
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class PostSignInResponseBody : Exception
public class GetAllLibrariesResponseBody : Exception
{
[JsonProperty("errors")]
public List<PostSignInErrors>? Errors { get; set; }
public List<GetAllLibrariesErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing

View File

@@ -12,7 +12,7 @@ namespace PlexAPI.Models.Errors
using Newtonsoft.Json;
using PlexAPI.Utils;
public class PostSignInErrors
public class GetLibraryDetailsErrors
{
[JsonProperty("code")]

View File

@@ -19,11 +19,11 @@ namespace PlexAPI.Models.Errors
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetLibrariesResponseBody : Exception
public class GetLibraryDetailsResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetLibrariesErrors>? Errors { get; set; }
public List<GetLibraryDetailsErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing

View File

@@ -12,7 +12,7 @@ namespace PlexAPI.Models.Errors
using Newtonsoft.Json;
using PlexAPI.Utils;
public class RefreshLibraryErrors
public class GetRefreshLibraryMetadataErrors
{
[JsonProperty("code")]

View File

@@ -19,11 +19,11 @@ namespace PlexAPI.Models.Errors
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class GetLibraryResponseBody : Exception
public class GetRefreshLibraryMetadataResponseBody : Exception
{
[JsonProperty("errors")]
public List<GetLibraryErrors>? Errors { get; set; }
public List<GetRefreshLibraryMetadataErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing

View File

@@ -12,7 +12,7 @@ namespace PlexAPI.Models.Errors
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryErrors
public class PostUsersSignInDataErrors
{
[JsonProperty("code")]

View File

@@ -19,11 +19,11 @@ namespace PlexAPI.Models.Errors
/// <summary>
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
/// </summary>
public class RefreshLibraryResponseBody : Exception
public class PostUsersSignInDataResponseBody : Exception
{
[JsonProperty("errors")]
public List<RefreshLibraryErrors>? Errors { get; set; }
public List<PostUsersSignInDataErrors>? Errors { get; set; }
/// <summary>
/// Raw HTTP response; suitable for custom response parsing

View File

@@ -15,7 +15,7 @@ namespace PlexAPI.Models.Requests
{
/// <summary>
/// the Id of the library to query
/// The id of the library
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId")]
public double SectionId { get; set; } = default!;

View File

@@ -12,14 +12,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
/// <summary>
/// Force overwriting of duplicate playlists. <br/>
///
/// <remarks>
/// By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>
/// The `force` argument is used to disable overwriting. <br/>
/// If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/>
///
/// </remarks>
/// Force the refresh even if the library is already being refreshed.
/// </summary>
public enum Force
{

View File

@@ -14,7 +14,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System.Collections.Generic;
public class GetLibrariesDirectory
public class GetAllLibrariesDirectory
{
[JsonProperty("allowSync")]
@@ -56,12 +56,21 @@ namespace PlexAPI.Models.Requests
[JsonProperty("uuid")]
public string? Uuid { get; set; }
/// <summary>
/// Unix epoch datetime
/// </summary>
[JsonProperty("updatedAt")]
public int? UpdatedAt { get; set; }
/// <summary>
/// Unix epoch datetime
/// </summary>
[JsonProperty("createdAt")]
public int? CreatedAt { get; set; }
/// <summary>
/// Unix epoch datetime
/// </summary>
[JsonProperty("scannedAt")]
public int? ScannedAt { get; set; }

View File

@@ -14,19 +14,19 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System.Collections.Generic;
public class GetLibrariesMediaContainer
public class GetAllLibrariesMediaContainer
{
[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("title1")]
public string? Title1 { get; set; }
public string Title1 { get; set; } = default!;
[JsonProperty("Directory")]
public List<GetLibrariesDirectory>? Directory { get; set; }
public List<GetAllLibrariesDirectory>? Directory { get; set; }
}
}

View File

@@ -14,7 +14,7 @@ namespace PlexAPI.Models.Requests
using System.Net.Http;
using System;
public class GetLibrariesResponse
public class GetAllLibrariesResponse
{
/// <summary>
@@ -35,6 +35,6 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// The libraries available on the Server
/// </summary>
public Models.Requests.GetLibrariesResponseBody? Object { get; set; }
public Models.Requests.GetAllLibrariesResponseBody? Object { get; set; }
}
}

View File

@@ -16,10 +16,10 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// The libraries available on the Server
/// </summary>
public class GetLibrariesResponseBody
public class GetAllLibrariesResponseBody
{
[JsonProperty("MediaContainer")]
public GetLibrariesMediaContainer? MediaContainer { get; set; }
public GetAllLibrariesMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -12,7 +12,7 @@ namespace PlexAPI.Models.Requests
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryDirectory
public class GetLibraryDetailsDirectory
{
[JsonProperty("key")]

View File

@@ -12,7 +12,7 @@ namespace PlexAPI.Models.Requests
using Newtonsoft.Json;
using PlexAPI.Utils;
public class GetLibraryFilter
public class GetLibraryDetailsFilter
{
[JsonProperty("filter")]

View File

@@ -14,7 +14,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System.Collections.Generic;
public class GetLibraryMediaContainer
public class GetLibraryDetailsMediaContainer
{
[JsonProperty("size")]
@@ -54,10 +54,10 @@ namespace PlexAPI.Models.Requests
public int? ViewMode { get; set; }
[JsonProperty("Directory")]
public List<GetLibraryDirectory>? Directory { get; set; }
public List<GetLibraryDetailsDirectory>? Directory { get; set; }
[JsonProperty("Type")]
public List<GetLibraryType>? Type { get; set; }
public List<GetLibraryDetailsType>? Type { get; set; }
[JsonProperty("FieldType")]
public List<FieldType>? FieldType { get; set; }

View File

@@ -12,11 +12,11 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Models.Requests;
using PlexAPI.Utils;
public class GetLibraryRequest
public class GetLibraryDetailsRequest
{
/// <summary>
/// the Id of the library to query
/// The id of the library
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId")]
public double SectionId { get; set; } = default!;

View File

@@ -14,7 +14,7 @@ namespace PlexAPI.Models.Requests
using System.Net.Http;
using System;
public class GetLibraryResponse
public class GetLibraryDetailsResponse
{
/// <summary>
@@ -35,6 +35,6 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// The details of the library
/// </summary>
public Models.Requests.GetLibraryResponseBody? Object { get; set; }
public Models.Requests.GetLibraryDetailsResponseBody? Object { get; set; }
}
}

View File

@@ -16,10 +16,10 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// The details of the library
/// </summary>
public class GetLibraryResponseBody
public class GetLibraryDetailsResponseBody
{
[JsonProperty("MediaContainer")]
public GetLibraryMediaContainer? MediaContainer { get; set; }
public GetLibraryDetailsMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -14,7 +14,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System.Collections.Generic;
public class GetLibraryType
public class GetLibraryDetailsType
{
[JsonProperty("key")]
@@ -30,7 +30,7 @@ namespace PlexAPI.Models.Requests
public bool? Active { get; set; }
[JsonProperty("Filter")]
public List<GetLibraryFilter>? Filter { get; set; }
public List<GetLibraryDetailsFilter>? Filter { get; set; }
[JsonProperty("Sort")]
public List<Sort>? Sort { get; set; }

View File

@@ -9,15 +9,22 @@
#nullable enable
namespace PlexAPI.Models.Requests
{
using PlexAPI.Models.Requests;
using PlexAPI.Utils;
public class RefreshLibraryRequest
public class GetRefreshLibraryMetadataRequest
{
/// <summary>
/// the Id of the library to refresh
/// The id of the library
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId")]
public double SectionId { get; set; } = default!;
/// <summary>
/// Force the refresh even if the library is already being refreshed.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=force")]
public Force? Force { get; set; }
}
}

View File

@@ -13,7 +13,7 @@ namespace PlexAPI.Models.Requests
using System.Net.Http;
using System;
public class RefreshLibraryResponse
public class GetRefreshLibraryMetadataResponse
{
/// <summary>

View File

@@ -112,6 +112,6 @@ namespace PlexAPI.Models.Requests
public List<GetTopWatchedContentRole>? Role { get; set; }
[JsonProperty("User")]
public List<Models.Requests.User>? User { get; set; }
public List<User>? User { get; set; }
}
}

View File

@@ -22,15 +22,9 @@ namespace PlexAPI.Models.Requests
[JsonProperty("mode", NullValueHandling = NullValueHandling.Include)]
public string? Mode { get; set; }
/// <summary>
/// Unix epoch datetime
/// </summary>
[JsonProperty("renewsAt", NullValueHandling = NullValueHandling.Include)]
public int? RenewsAt { get; set; }
/// <summary>
/// Unix epoch datetime
/// </summary>
[JsonProperty("endsAt", NullValueHandling = NullValueHandling.Include)]
public int? EndsAt { get; set; }
@@ -62,7 +56,7 @@ namespace PlexAPI.Models.Requests
public string? Transfer { get; set; }
[JsonProperty("state")]
public PostSignInState State { get; set; } = default!;
public PostUsersSignInDataState State { get; set; } = default!;
[JsonProperty("billing")]
public Billing Billing { get; set; } = default!;

View File

@@ -13,7 +13,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System;
public enum PostSignInUserFeatures
public enum PostUsersSignInDataAuthenticationFeatures
{
[JsonProperty("Android - Dolby Vision")]
AndroidDolbyVision,
@@ -135,16 +135,16 @@ namespace PlexAPI.Models.Requests
WebServerDashboard,
}
public static class PostSignInUserFeaturesExtension
public static class PostUsersSignInDataAuthenticationFeaturesExtension
{
public static string Value(this PostSignInUserFeatures value)
public static string Value(this PostUsersSignInDataAuthenticationFeatures value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostSignInUserFeatures ToEnum(this string value)
public static PostUsersSignInDataAuthenticationFeatures ToEnum(this string value)
{
foreach(var field in typeof(PostSignInUserFeatures).GetFields())
foreach(var field in typeof(PostUsersSignInDataAuthenticationFeatures).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -157,14 +157,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInUserFeatures)
if (enumVal is PostUsersSignInDataAuthenticationFeatures)
{
return (PostSignInUserFeatures)enumVal;
return (PostUsersSignInDataAuthenticationFeatures)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInUserFeatures");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAuthenticationFeatures");
}
}

View File

@@ -16,7 +16,7 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// String representation of subscriptionActive
/// </summary>
public enum PostSignInUserStatus
public enum PostUsersSignInDataAuthenticationResponseStatus
{
[JsonProperty("Inactive")]
Inactive,
@@ -24,16 +24,16 @@ namespace PlexAPI.Models.Requests
Active,
}
public static class PostSignInUserStatusExtension
public static class PostUsersSignInDataAuthenticationResponseStatusExtension
{
public static string Value(this PostSignInUserStatus value)
public static string Value(this PostUsersSignInDataAuthenticationResponseStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostSignInUserStatus ToEnum(this string value)
public static PostUsersSignInDataAuthenticationResponseStatus ToEnum(this string value)
{
foreach(var field in typeof(PostSignInUserStatus).GetFields())
foreach(var field in typeof(PostUsersSignInDataAuthenticationResponseStatus).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -46,14 +46,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInUserStatus)
if (enumVal is PostUsersSignInDataAuthenticationResponseStatus)
{
return (PostSignInUserStatus)enumVal;
return (PostUsersSignInDataAuthenticationResponseStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInUserStatus");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAuthenticationResponseStatus");
}
}

View File

@@ -16,7 +16,7 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// String representation of subscriptionActive
/// </summary>
public enum PostSignInUserResponseStatus
public enum PostUsersSignInDataAuthenticationStatus
{
[JsonProperty("Inactive")]
Inactive,
@@ -24,16 +24,16 @@ namespace PlexAPI.Models.Requests
Active,
}
public static class PostSignInUserResponseStatusExtension
public static class PostUsersSignInDataAuthenticationStatusExtension
{
public static string Value(this PostSignInUserResponseStatus value)
public static string Value(this PostUsersSignInDataAuthenticationStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostSignInUserResponseStatus ToEnum(this string value)
public static PostUsersSignInDataAuthenticationStatus ToEnum(this string value)
{
foreach(var field in typeof(PostSignInUserResponseStatus).GetFields())
foreach(var field in typeof(PostUsersSignInDataAuthenticationStatus).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -46,14 +46,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInUserResponseStatus)
if (enumVal is PostUsersSignInDataAuthenticationStatus)
{
return (PostSignInUserResponseStatus)enumVal;
return (PostUsersSignInDataAuthenticationStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInUserResponseStatus");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAuthenticationStatus");
}
}

View File

@@ -14,14 +14,14 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System.Collections.Generic;
public class PostSignInUserSubscription
public class PostUsersSignInDataAuthenticationSubscription
{
/// <summary>
/// List of features allowed on your Plex Pass subscription
/// </summary>
[JsonProperty("features")]
public List<PostSignInUserFeatures>? Features { get; set; }
public List<PostUsersSignInDataAuthenticationFeatures>? Features { get; set; }
/// <summary>
/// If the account&apos;s Plex Pass subscription is active
@@ -39,7 +39,7 @@ namespace PlexAPI.Models.Requests
/// String representation of subscriptionActive
/// </summary>
[JsonProperty("status")]
public PostSignInUserResponseStatus? Status { get; set; }
public PostUsersSignInDataAuthenticationResponseStatus? Status { get; set; }
/// <summary>
/// Payment service used for your Plex Pass subscription

View File

@@ -16,7 +16,7 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
/// </summary>
public enum PostSignInAutoSelectSubtitle
public enum PostUsersSignInDataAutoSelectSubtitle
{
[JsonProperty("0")]
Zero,
@@ -24,16 +24,16 @@ namespace PlexAPI.Models.Requests
One,
}
public static class PostSignInAutoSelectSubtitleExtension
public static class PostUsersSignInDataAutoSelectSubtitleExtension
{
public static string Value(this PostSignInAutoSelectSubtitle value)
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 PostSignInAutoSelectSubtitle ToEnum(this string value)
public static PostUsersSignInDataAutoSelectSubtitle ToEnum(this string value)
{
foreach(var field in typeof(PostSignInAutoSelectSubtitle).GetFields())
foreach(var field in typeof(PostUsersSignInDataAutoSelectSubtitle).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -46,14 +46,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInAutoSelectSubtitle)
if (enumVal is PostUsersSignInDataAutoSelectSubtitle)
{
return (PostSignInAutoSelectSubtitle)enumVal;
return (PostUsersSignInDataAutoSelectSubtitle)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInAutoSelectSubtitle");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataAutoSelectSubtitle");
}
}

View File

@@ -16,7 +16,7 @@ namespace PlexAPI.Models.Requests
/// <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>
public enum PostSignInDefaultSubtitleAccessibility
public enum PostUsersSignInDataDefaultSubtitleAccessibility
{
[JsonProperty("0")]
Zero,
@@ -24,16 +24,16 @@ namespace PlexAPI.Models.Requests
One,
}
public static class PostSignInDefaultSubtitleAccessibilityExtension
public static class PostUsersSignInDataDefaultSubtitleAccessibilityExtension
{
public static string Value(this PostSignInDefaultSubtitleAccessibility value)
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 PostSignInDefaultSubtitleAccessibility ToEnum(this string value)
public static PostUsersSignInDataDefaultSubtitleAccessibility ToEnum(this string value)
{
foreach(var field in typeof(PostSignInDefaultSubtitleAccessibility).GetFields())
foreach(var field in typeof(PostUsersSignInDataDefaultSubtitleAccessibility).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -46,14 +46,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInDefaultSubtitleAccessibility)
if (enumVal is PostUsersSignInDataDefaultSubtitleAccessibility)
{
return (PostSignInDefaultSubtitleAccessibility)enumVal;
return (PostUsersSignInDataDefaultSubtitleAccessibility)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInDefaultSubtitleAccessibility");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataDefaultSubtitleAccessibility");
}
}

View File

@@ -16,7 +16,7 @@ namespace PlexAPI.Models.Requests
/// <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 PostSignInDefaultSubtitleForced
public enum PostUsersSignInDataDefaultSubtitleForced
{
[JsonProperty("0")]
Zero,
@@ -24,16 +24,16 @@ namespace PlexAPI.Models.Requests
One,
}
public static class PostSignInDefaultSubtitleForcedExtension
public static class PostUsersSignInDataDefaultSubtitleForcedExtension
{
public static string Value(this PostSignInDefaultSubtitleForced value)
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 PostSignInDefaultSubtitleForced ToEnum(this string value)
public static PostUsersSignInDataDefaultSubtitleForced ToEnum(this string value)
{
foreach(var field in typeof(PostSignInDefaultSubtitleForced).GetFields())
foreach(var field in typeof(PostUsersSignInDataDefaultSubtitleForced).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -46,14 +46,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInDefaultSubtitleForced)
if (enumVal is PostUsersSignInDataDefaultSubtitleForced)
{
return (PostSignInDefaultSubtitleForced)enumVal;
return (PostUsersSignInDataDefaultSubtitleForced)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInDefaultSubtitleForced");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataDefaultSubtitleForced");
}
}

View File

@@ -13,7 +13,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System;
public enum PostSignInFeatures
public enum PostUsersSignInDataFeatures
{
[JsonProperty("Android - Dolby Vision")]
AndroidDolbyVision,
@@ -135,16 +135,16 @@ namespace PlexAPI.Models.Requests
WebServerDashboard,
}
public static class PostSignInFeaturesExtension
public static class PostUsersSignInDataFeaturesExtension
{
public static string Value(this PostSignInFeatures value)
public static string Value(this PostUsersSignInDataFeatures value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostSignInFeatures ToEnum(this string value)
public static PostUsersSignInDataFeatures ToEnum(this string value)
{
foreach(var field in typeof(PostSignInFeatures).GetFields())
foreach(var field in typeof(PostUsersSignInDataFeatures).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -157,14 +157,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInFeatures)
if (enumVal is PostUsersSignInDataFeatures)
{
return (PostSignInFeatures)enumVal;
return (PostUsersSignInDataFeatures)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInFeatures");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataFeatures");
}
}

View File

@@ -16,7 +16,7 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// Your current mailing list status
/// </summary>
public enum PostSignInMailingListStatus
public enum PostUsersSignInDataMailingListStatus
{
[JsonProperty("active")]
Active,
@@ -24,16 +24,16 @@ namespace PlexAPI.Models.Requests
Unsubscribed,
}
public static class PostSignInMailingListStatusExtension
public static class PostUsersSignInDataMailingListStatusExtension
{
public static string Value(this PostSignInMailingListStatus value)
public static string Value(this PostUsersSignInDataMailingListStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostSignInMailingListStatus ToEnum(this string value)
public static PostUsersSignInDataMailingListStatus ToEnum(this string value)
{
foreach(var field in typeof(PostSignInMailingListStatus).GetFields())
foreach(var field in typeof(PostUsersSignInDataMailingListStatus).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -46,14 +46,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInMailingListStatus)
if (enumVal is PostUsersSignInDataMailingListStatus)
{
return (PostSignInMailingListStatus)enumVal;
return (PostUsersSignInDataMailingListStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInMailingListStatus");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataMailingListStatus");
}
}

View File

@@ -11,7 +11,7 @@ namespace PlexAPI.Models.Requests
{
using PlexAPI.Utils;
public enum PostSignInMediaReviewsVisibility
public enum PostUsersSignInDataMediaReviewsVisibility
{
Zero = 0,
One = 1,

View File

@@ -12,7 +12,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Models.Requests;
using PlexAPI.Utils;
public class PostSignInRequest
public class PostUsersSignInDataRequest
{
/// <summary>
@@ -31,6 +31,6 @@ namespace PlexAPI.Models.Requests
/// Login credentials
/// </summary>
[SpeakeasyMetadata("request:mediaType=application/x-www-form-urlencoded")]
public PostSignInRequestBody? RequestBody { get; set; }
public PostUsersSignInDataRequestBody? RequestBody { get; set; }
}
}

View File

@@ -14,7 +14,7 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// Login credentials
/// </summary>
public class PostSignInRequestBody
public class PostUsersSignInDataRequestBody
{
[SpeakeasyMetadata("form:name=login")]

View File

@@ -14,7 +14,7 @@ namespace PlexAPI.Models.Requests
using System.Net.Http;
using System;
public class PostSignInResponse
public class PostUsersSignInDataResponse
{
/// <summary>
@@ -35,6 +35,6 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// Returns the user account data with a valid auth token
/// </summary>
public PostSignInUserPlexAccount? UserPlexAccount { get; set; }
public PostUsersSignInDataUserPlexAccount? UserPlexAccount { get; set; }
}
}

View File

@@ -13,7 +13,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Models.Requests;
using PlexAPI.Utils;
public class PostSignInServices
public class PostUsersSignInDataServices
{
[JsonProperty("identifier")]
@@ -29,6 +29,6 @@ namespace PlexAPI.Models.Requests
public string? Secret { get; set; }
[JsonProperty("status")]
public PostSignInStatus Status { get; set; } = default!;
public PostUsersSignInDataStatus Status { get; set; } = default!;
}
}

View File

@@ -13,22 +13,22 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System;
public enum PostSignInState
public enum PostUsersSignInDataState
{
[JsonProperty("ended")]
Ended,
}
public static class PostSignInStateExtension
public static class PostUsersSignInDataStateExtension
{
public static string Value(this PostSignInState value)
public static string Value(this PostUsersSignInDataState value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostSignInState ToEnum(this string value)
public static PostUsersSignInDataState ToEnum(this string value)
{
foreach(var field in typeof(PostSignInState).GetFields())
foreach(var field in typeof(PostUsersSignInDataState).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -41,14 +41,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInState)
if (enumVal is PostUsersSignInDataState)
{
return (PostSignInState)enumVal;
return (PostUsersSignInDataState)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInState");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataState");
}
}

View File

@@ -13,7 +13,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System;
public enum PostSignInStatus
public enum PostUsersSignInDataStatus
{
[JsonProperty("online")]
Online,
@@ -21,16 +21,16 @@ namespace PlexAPI.Models.Requests
Offline,
}
public static class PostSignInStatusExtension
public static class PostUsersSignInDataStatusExtension
{
public static string Value(this PostSignInStatus value)
public static string Value(this PostUsersSignInDataStatus value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static PostSignInStatus ToEnum(this string value)
public static PostUsersSignInDataStatus ToEnum(this string value)
{
foreach(var field in typeof(PostSignInStatus).GetFields())
foreach(var field in typeof(PostUsersSignInDataStatus).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -43,14 +43,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInStatus)
if (enumVal is PostUsersSignInDataStatus)
{
return (PostSignInStatus)enumVal;
return (PostUsersSignInDataStatus)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInStatus");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataStatus");
}
}

View File

@@ -17,14 +17,14 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// If the accounts Plex Pass subscription is active
/// </summary>
public class PostSignInSubscription
public class PostUsersSignInDataSubscription
{
/// <summary>
/// List of features allowed on your Plex Pass subscription
/// </summary>
[JsonProperty("features")]
public List<PostSignInFeatures>? Features { get; set; }
public List<PostUsersSignInDataFeatures>? Features { get; set; }
/// <summary>
/// If the account&apos;s Plex Pass subscription is active
@@ -42,7 +42,7 @@ namespace PlexAPI.Models.Requests
/// String representation of subscriptionActive
/// </summary>
[JsonProperty("status")]
public PostSignInUserStatus? Status { get; set; }
public PostUsersSignInDataAuthenticationStatus? Status { get; set; }
/// <summary>
/// Payment service used for your Plex Pass subscription

View File

@@ -18,7 +18,7 @@ namespace PlexAPI.Models.Requests
/// <summary>
/// Returns the user account data with a valid auth token
/// </summary>
public class PostSignInUserPlexAccount
public class PostUsersSignInDataUserPlexAccount
{
/// <summary>
@@ -157,7 +157,7 @@ namespace PlexAPI.Models.Requests
/// Your current mailing list status
/// </summary>
[JsonProperty("mailingListStatus")]
public PostSignInMailingListStatus MailingListStatus { get; set; } = default!;
public PostUsersSignInDataMailingListStatus MailingListStatus { get; set; } = default!;
/// <summary>
/// The maximum number of accounts allowed in the Plex Home
@@ -173,7 +173,7 @@ namespace PlexAPI.Models.Requests
public string? Pin { get; set; }
[JsonProperty("profile")]
public PostSignInUserProfile Profile { get; set; } = default!;
public PostUsersSignInDataUserProfile Profile { get; set; } = default!;
/// <summary>
/// If the account has a Plex Home PIN enabled
@@ -206,13 +206,13 @@ namespace PlexAPI.Models.Requests
public string ScrobbleTypes { get; set; } = default!;
[JsonProperty("services")]
public List<PostSignInServices> Services { get; set; } = default!;
public List<PostUsersSignInDataServices> Services { get; set; } = default!;
/// <summary>
/// If the accounts Plex Pass subscription is active
/// </summary>
[JsonProperty("subscription")]
public PostSignInSubscription Subscription { get; set; } = default!;
public PostUsersSignInDataSubscription Subscription { get; set; } = default!;
/// <summary>
/// Description of the Plex Pass subscription
@@ -221,7 +221,7 @@ namespace PlexAPI.Models.Requests
public string? SubscriptionDescription { get; set; }
[JsonProperty("subscriptions")]
public List<PostSignInUserSubscription> Subscriptions { get; set; } = default!;
public List<PostUsersSignInDataAuthenticationSubscription> Subscriptions { get; set; } = default!;
/// <summary>
/// URL of the account thumbnail

View File

@@ -13,7 +13,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Models.Requests;
using PlexAPI.Utils;
public class PostSignInUserProfile
public class PostUsersSignInDataUserProfile
{
/// <summary>
@@ -38,24 +38,24 @@ namespace PlexAPI.Models.Requests
/// The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)
/// </summary>
[JsonProperty("autoSelectSubtitle")]
public PostSignInAutoSelectSubtitle? AutoSelectSubtitle { get; set; }
public PostUsersSignInDataAutoSelectSubtitle? AutoSelectSubtitle { get; set; }
/// <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 PostSignInDefaultSubtitleAccessibility? DefaultSubtitleAccessibility { get; set; }
public PostUsersSignInDataDefaultSubtitleAccessibility? DefaultSubtitleAccessibility { get; set; }
/// <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 PostSignInDefaultSubtitleForced? DefaultSubtitleForced { get; set; }
public PostUsersSignInDataDefaultSubtitleForced? DefaultSubtitleForced { get; set; }
[JsonProperty("watchedIndicator")]
public PostSignInWatchedIndicator? WatchedIndicator { get; set; }
public PostUsersSignInDataWatchedIndicator? WatchedIndicator { get; set; }
[JsonProperty("mediaReviewsVisibility")]
public PostSignInMediaReviewsVisibility? MediaReviewsVisibility { get; set; }
public PostUsersSignInDataMediaReviewsVisibility? MediaReviewsVisibility { get; set; }
}
}

View File

@@ -13,7 +13,7 @@ namespace PlexAPI.Models.Requests
using PlexAPI.Utils;
using System;
public enum PostSignInWatchedIndicator
public enum PostUsersSignInDataWatchedIndicator
{
[JsonProperty("0")]
Zero,
@@ -21,16 +21,16 @@ namespace PlexAPI.Models.Requests
One,
}
public static class PostSignInWatchedIndicatorExtension
public static class PostUsersSignInDataWatchedIndicatorExtension
{
public static string Value(this PostSignInWatchedIndicator value)
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 PostSignInWatchedIndicator ToEnum(this string value)
public static PostUsersSignInDataWatchedIndicator ToEnum(this string value)
{
foreach(var field in typeof(PostSignInWatchedIndicator).GetFields())
foreach(var field in typeof(PostUsersSignInDataWatchedIndicator).GetFields())
{
var attributes = field.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (attributes.Length == 0)
@@ -43,14 +43,14 @@ namespace PlexAPI.Models.Requests
{
var enumVal = field.GetValue(null);
if (enumVal is PostSignInWatchedIndicator)
if (enumVal is PostUsersSignInDataWatchedIndicator)
{
return (PostSignInWatchedIndicator)enumVal;
return (PostUsersSignInDataWatchedIndicator)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum PostSignInWatchedIndicator");
throw new Exception($"Unknown value {value} for enum PostUsersSignInDataWatchedIndicator");
}
}

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 PlexAPI.Models.Requests
{
using PlexAPI.Utils;
/// <summary>
/// Force overwriting of duplicate playlists. <br/>
///
/// <remarks>
/// By default, a playlist file uploaded with the same path will overwrite the existing playlist. <br/>
/// The `force` argument is used to disable overwriting. <br/>
/// If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.<br/>
///
/// </remarks>
/// </summary>
public enum QueryParamForce
{
Zero = 0,
One = 1,
}
}

View File

@@ -25,6 +25,6 @@ namespace PlexAPI.Models.Requests
/// Plex content type to search for
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public Type Type { get; set; } = default!;
public Models.Requests.Type Type { get; set; } = default!;
}
}

View File

@@ -41,6 +41,6 @@ namespace PlexAPI.Models.Requests
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=force")]
public Force Force { get; set; } = default!;
public QueryParamForce Force { get; set; } = default!;
}
}

View File

@@ -129,7 +129,7 @@ namespace PlexAPI
///
/// </remarks>
/// </summary>
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, Force force);
Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force);
}
/// <summary>
@@ -146,10 +146,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;
@@ -894,7 +894,7 @@ namespace PlexAPI
}
}
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, Force force)
public async Task<UploadPlaylistResponse> UploadPlaylistAsync(string path, QueryParamForce force)
{
var request = new UploadPlaylistRequest()
{

View File

@@ -158,10 +158,10 @@ namespace PlexAPI
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>PlexAPI</PackageId>
<Version>0.4.1</Version>
<Version>0.4.2</Version>
<TargetFramework>net5.0</TargetFramework>
<Authors>LukeHagar</Authors>
<Copyright>Copyright (c) LukeHagar 2024</Copyright>

View File

@@ -213,15 +213,6 @@ namespace PlexAPI
/// </summary>
public IUpdater Updater { get; }
/// <summary>
/// API Calls that perform operations with Plex Media Server Users<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public IUser User { get; }
/// <summary>
/// API Calls that perform operations with Plex Media Server Watchlists<br/>
///
@@ -277,10 +268,10 @@ namespace PlexAPI
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private int _serverIndex = 0;
private ISpeakeasyHttpClient _client;
@@ -300,7 +291,6 @@ namespace PlexAPI
public IStatistics Statistics { get; private set; }
public ISessions Sessions { get; private set; }
public IUpdater Updater { get; private set; }
public IUser User { get; private set; }
public IWatchlist Watchlist { get; private set; }
public PlexAPISDK(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)
@@ -400,9 +390,6 @@ namespace PlexAPI
Updater = new Updater(_client, _securitySource, _serverUrl, SDKConfiguration);
User = new User(_client, _securitySource, _serverUrl, SDKConfiguration);
Watchlist = new Watchlist(_client, _securitySource, _serverUrl, SDKConfiguration);
}
}

View File

@@ -87,10 +87,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -117,10 +117,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -80,10 +80,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -71,10 +71,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -74,10 +74,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -1,184 +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 PlexAPI
{
using Newtonsoft.Json;
using PlexAPI.Hooks;
using PlexAPI.Models.Components;
using PlexAPI.Models.Errors;
using PlexAPI.Models.Requests;
using PlexAPI.Utils.Retries;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System;
/// <summary>
/// API Calls that perform operations with Plex Media Server Users<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public interface IUser
{
/// <summary>
/// Get User SignIn Data
///
/// <remarks>
/// Sign in user with username and password and return user data with Plex authentication token
/// </remarks>
/// </summary>
Task<PostSignInResponse> PostSignInAsync(string? xPlexClientIdentifier = null, PostSignInRequestBody? requestBody = null, string? serverUrl = null);
}
/// <summary>
/// API Calls that perform operations with Plex Media Server Users<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
public class User: IUser
{
/// <summary>
/// List of server URLs available for the post-sign-in operation.
/// </summary>
public static readonly string[] PostSignInServerList = {
"https://plex.tv/api/v2",
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;
public User(ISpeakeasyHttpClient client, Func<PlexAPI.Models.Components.Security>? securitySource, string serverUrl, SDKConfig config)
{
_client = client;
_securitySource = securitySource;
_serverUrl = serverUrl;
SDKConfiguration = config;
}
public async Task<PostSignInResponse> PostSignInAsync(string? xPlexClientIdentifier = null, PostSignInRequestBody? requestBody = null, string? serverUrl = null)
{
var request = new PostSignInRequest()
{
XPlexClientIdentifier = xPlexClientIdentifier,
RequestBody = requestBody,
};
request.XPlexClientIdentifier ??= SDKConfiguration.XPlexClientIdentifier;
string baseUrl = Utilities.TemplateUrl(PostSignInServerList[0], new Dictionary<string, string>(){
});
if (serverUrl != null)
{
baseUrl = serverUrl;
}
var urlString = baseUrl + "/users/signin";
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var serializedBody = RequestBodySerializer.Serialize(request, "RequestBody", "form", false, true);
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
}
var hookCtx = new HookContext("post-sign-in", null, null);
httpRequest = await this.SDKConfiguration.Hooks.BeforeRequestAsync(new BeforeRequestContext(hookCtx), httpRequest);
HttpResponseMessage httpResponse;
try
{
httpResponse = await _client.SendAsync(httpRequest);
int _statusCode = (int)httpResponse.StatusCode;
if (_statusCode == 400 || _statusCode == 401 || _statusCode >= 400 && _statusCode < 500 || _statusCode >= 500 && _statusCode < 600)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), httpResponse, null);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
}
}
catch (Exception error)
{
var _httpResponse = await this.SDKConfiguration.Hooks.AfterErrorAsync(new AfterErrorContext(hookCtx), null, error);
if (_httpResponse != null)
{
httpResponse = _httpResponse;
}
else
{
throw;
}
}
httpResponse = await this.SDKConfiguration.Hooks.AfterSuccessAsync(new AfterSuccessContext(hookCtx), httpResponse);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
int responseStatusCode = (int)httpResponse.StatusCode;
if(responseStatusCode == 201)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<PostSignInUserPlexAccount>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
var response = new PostSignInResponse()
{
StatusCode = responseStatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
response.UserPlexAccount = obj;
return response;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else if(responseStatusCode == 400 || responseStatusCode >= 400 && responseStatusCode < 500 || responseStatusCode >= 500 && responseStatusCode < 600)
{
throw new SDKException("API error occurred", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
else if(responseStatusCode == 401)
{
if(Utilities.IsContentTypeMatch("application/json", contentType))
{
var obj = ResponseBodyDeserializer.Deserialize<PostSignInResponseBody>(await httpResponse.Content.ReadAsStringAsync(), NullValueHandling.Ignore);
obj!.RawResponse = httpResponse;
throw obj!;
}
else
{
throw new SDKException("Unknown content type received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
else
{
throw new SDKException("Unknown status code received", responseStatusCode, await httpResponse.Content.ReadAsStringAsync(), httpResponse);
}
}
}
}

View File

@@ -62,10 +62,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;

View File

@@ -59,10 +59,10 @@ namespace PlexAPI
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.4.1";
private const string _sdkGenVersion = "2.404.3";
private const string _sdkVersion = "0.4.2";
private const string _sdkGenVersion = "2.407.0";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.1 2.404.3 0.0.3 PlexAPI";
private const string _userAgent = "speakeasy-sdk/csharp 0.4.2 2.407.0 0.0.3 PlexAPI";
private string _serverUrl = "";
private ISpeakeasyHttpClient _client;
private Func<PlexAPI.Models.Components.Security>? _securitySource;