ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.166.0

This commit is contained in:
speakeasybot
2024-02-05 00:40:10 +00:00
parent 966fd34307
commit 22f8f60b6f
87 changed files with 1811 additions and 358 deletions

View File

@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 5a8dbcbc-e0ee-41f0-9d84-b8b50567d1e9
management:
docChecksum: 7aba498c024534142941d65a7c2e649c
docChecksum: 94439465ae5d544f0e52b00719af05ee
docVersion: 0.0.3
speakeasyVersion: internal
generationVersion: 2.237.3
releaseVersion: 0.1.5
configChecksum: 112f7d72fae8408e2dd1ef59ee88fb3a
generationVersion: 2.248.6
releaseVersion: 0.2.0
configChecksum: f8958faa630145f5a0a4562f1fc8eb84
repoURL: https://github.com/LukeHagar/plexcsharp.git
repoSubDirectory: .
published: true
@@ -14,8 +14,9 @@ features:
csharp:
core: 3.3.1
flattening: 2.81.1
globalSecurity: 2.81.3
globalSecurity: 2.82.0
globalServerURLs: 2.82.2
methodServerURLs: 2.82.1
nameOverrides: 2.81.1
generatedFiles:
- PlexAPI/Server.cs
@@ -26,6 +27,8 @@ generatedFiles:
- PlexAPI/Search.cs
- PlexAPI/Library.cs
- PlexAPI/Log.cs
- PlexAPI/Tv.cs
- PlexAPI/Plex.cs
- PlexAPI/Playlists.cs
- PlexAPI/Security.cs
- PlexAPI/Sessions.cs
@@ -203,7 +206,7 @@ generatedFiles:
- PlexAPI/Models/Requests/GetRecentlyAddedResponse.cs
- PlexAPI/Models/Requests/GetLibrariesErrors.cs
- PlexAPI/Models/Requests/GetLibrariesLibraryResponseBody.cs
- PlexAPI/Models/Requests/Location.cs
- PlexAPI/Models/Requests/GetLibrariesLocation.cs
- PlexAPI/Models/Requests/GetLibrariesDirectory.cs
- PlexAPI/Models/Requests/GetLibrariesMediaContainer.cs
- PlexAPI/Models/Requests/GetLibrariesResponseBody.cs
@@ -243,6 +246,12 @@ generatedFiles:
- PlexAPI/Models/Requests/RefreshLibraryErrors.cs
- PlexAPI/Models/Requests/RefreshLibraryResponseBody.cs
- PlexAPI/Models/Requests/RefreshLibraryResponse.cs
- PlexAPI/Models/Requests/Type.cs
- PlexAPI/Models/Requests/SearchLibraryRequest.cs
- PlexAPI/Models/Requests/SearchLibraryMetadata.cs
- PlexAPI/Models/Requests/SearchLibraryMediaContainer.cs
- PlexAPI/Models/Requests/SearchLibraryResponseBody.cs
- PlexAPI/Models/Requests/SearchLibraryResponse.cs
- PlexAPI/Models/Requests/GetMetadataRequest.cs
- PlexAPI/Models/Requests/GetMetadataErrors.cs
- PlexAPI/Models/Requests/GetMetadataLibraryResponseBody.cs
@@ -290,7 +299,17 @@ generatedFiles:
- PlexAPI/Models/Requests/EnablePaperTrailErrors.cs
- PlexAPI/Models/Requests/EnablePaperTrailResponseBody.cs
- PlexAPI/Models/Requests/EnablePaperTrailResponse.cs
- PlexAPI/Models/Requests/Type.cs
- PlexAPI/Models/Requests/GetPinRequest.cs
- PlexAPI/Models/Requests/GetPinErrors.cs
- PlexAPI/Models/Requests/GetPinPlexTvResponseBody.cs
- PlexAPI/Models/Requests/Location.cs
- PlexAPI/Models/Requests/GetPinResponseBody.cs
- PlexAPI/Models/Requests/GetPinResponse.cs
- PlexAPI/Models/Requests/GetTokenRequest.cs
- PlexAPI/Models/Requests/GetTokenErrors.cs
- PlexAPI/Models/Requests/GetTokenResponseBody.cs
- PlexAPI/Models/Requests/GetTokenResponse.cs
- PlexAPI/Models/Requests/QueryParamType.cs
- PlexAPI/Models/Requests/Smart.cs
- PlexAPI/Models/Requests/CreatePlaylistRequest.cs
- PlexAPI/Models/Requests/CreatePlaylistErrors.cs
@@ -353,7 +372,7 @@ generatedFiles:
- PlexAPI/Models/Requests/UploadPlaylistErrors.cs
- PlexAPI/Models/Requests/UploadPlaylistResponseBody.cs
- PlexAPI/Models/Requests/UploadPlaylistResponse.cs
- PlexAPI/Models/Requests/QueryParamType.cs
- PlexAPI/Models/Requests/GetTransientTokenQueryParamType.cs
- PlexAPI/Models/Requests/Scope.cs
- PlexAPI/Models/Requests/GetTransientTokenRequest.cs
- PlexAPI/Models/Requests/GetTransientTokenErrors.cs
@@ -575,7 +594,7 @@ generatedFiles:
- docs/Models/Requests/GetRecentlyAddedResponse.md
- docs/Models/Requests/GetLibrariesErrors.md
- docs/Models/Requests/GetLibrariesLibraryResponseBody.md
- docs/Models/Requests/Location.md
- docs/Models/Requests/GetLibrariesLocation.md
- docs/Models/Requests/GetLibrariesDirectory.md
- docs/Models/Requests/GetLibrariesMediaContainer.md
- docs/Models/Requests/GetLibrariesResponseBody.md
@@ -615,6 +634,12 @@ generatedFiles:
- docs/Models/Requests/RefreshLibraryErrors.md
- docs/Models/Requests/RefreshLibraryResponseBody.md
- docs/Models/Requests/RefreshLibraryResponse.md
- docs/Models/Requests/Type.md
- docs/Models/Requests/SearchLibraryRequest.md
- docs/Models/Requests/SearchLibraryMetadata.md
- docs/Models/Requests/SearchLibraryMediaContainer.md
- docs/Models/Requests/SearchLibraryResponseBody.md
- docs/Models/Requests/SearchLibraryResponse.md
- docs/Models/Requests/GetMetadataRequest.md
- docs/Models/Requests/GetMetadataErrors.md
- docs/Models/Requests/GetMetadataLibraryResponseBody.md
@@ -662,7 +687,17 @@ generatedFiles:
- docs/Models/Requests/EnablePaperTrailErrors.md
- docs/Models/Requests/EnablePaperTrailResponseBody.md
- docs/Models/Requests/EnablePaperTrailResponse.md
- docs/Models/Requests/Type.md
- docs/Models/Requests/GetPinRequest.md
- docs/Models/Requests/GetPinErrors.md
- docs/Models/Requests/GetPinPlexTvResponseBody.md
- docs/Models/Requests/Location.md
- docs/Models/Requests/GetPinResponseBody.md
- docs/Models/Requests/GetPinResponse.md
- docs/Models/Requests/GetTokenRequest.md
- docs/Models/Requests/GetTokenErrors.md
- docs/Models/Requests/GetTokenResponseBody.md
- docs/Models/Requests/GetTokenResponse.md
- docs/Models/Requests/QueryParamType.md
- docs/Models/Requests/Smart.md
- docs/Models/Requests/CreatePlaylistRequest.md
- docs/Models/Requests/CreatePlaylistErrors.md
@@ -725,7 +760,7 @@ generatedFiles:
- docs/Models/Requests/UploadPlaylistErrors.md
- docs/Models/Requests/UploadPlaylistResponseBody.md
- docs/Models/Requests/UploadPlaylistResponse.md
- docs/Models/Requests/QueryParamType.md
- docs/Models/Requests/GetTransientTokenQueryParamType.md
- docs/Models/Requests/Scope.md
- docs/Models/Requests/GetTransientTokenRequest.md
- docs/Models/Requests/GetTransientTokenErrors.md
@@ -799,6 +834,8 @@ generatedFiles:
- docs/sdks/search/README.md
- docs/sdks/library/README.md
- docs/sdks/log/README.md
- docs/sdks/plex/README.md
- docs/sdks/tv/README.md
- docs/sdks/playlists/README.md
- docs/sdks/security/README.md
- docs/sdks/sessions/README.md

View File

@@ -70,10 +70,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -97,10 +97,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -59,10 +59,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -143,7 +143,6 @@ namespace PlexAPI
/// - `resolution`: Items categorized by resolution.<br/>
/// - `firstCharacter`: Items categorized by the first letter.<br/>
/// - `folder`: Items categorized by folder.<br/>
/// - `search?type=1`: Search functionality within the section.<br/>
///
/// </remarks>
/// </summary>
@@ -159,6 +158,33 @@ namespace PlexAPI
/// </summary>
Task<RefreshLibraryResponse> RefreshLibraryAsync(double sectionId);
/// <summary>
/// Search Library
///
/// <remarks>
/// Search for content within a specific section of the library.<br/>
/// <br/>
/// ### Types<br/>
/// Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:<br/>
/// <br/>
/// - **Type Object Attributes**:<br/>
/// - `type`: Metadata type (if standard Plex type). <br/>
/// - `title`: Title for this content type (e.g., &quot;Movies&quot;).<br/>
/// <br/>
/// - **Filter Objects**:<br/>
/// - Subset of the media query language.<br/>
/// - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.<br/>
/// <br/>
/// - **Sort Objects**:<br/>
/// - Description of sort fields.<br/>
/// - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.<br/>
/// <br/>
/// &gt; **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.<br/>
///
/// </remarks>
/// </summary>
Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Type type);
/// <summary>
/// Get Items Metadata
///
@@ -201,10 +227,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
@@ -543,6 +569,46 @@ namespace PlexAPI
}
public async Task<SearchLibraryResponse> SearchLibraryAsync(long sectionId, Type type)
{
var request = new SearchLibraryRequest()
{
SectionId = sectionId,
Type = type,
};
string baseUrl = this.SDKConfiguration.GetTemplatedServerDetails();
var urlString = URLBuilder.Build(baseUrl, "/library/sections/{sectionId}/search", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
var client = _securityClient;
var httpResponse = await client.SendAsync(httpRequest);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new SearchLibraryResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.Object = JsonConvert.DeserializeObject<SearchLibraryResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
}
return response;
}
public async Task<GetMetadataResponse> GetMetadataAsync(double ratingKey)
{
var request = new GetMetadataRequest()

View File

@@ -90,10 +90,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -68,10 +68,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -25,7 +25,7 @@ namespace PlexAPI.Models.Requests
/// type of playlist to create
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public Type Type { get; set; } = default!;
public QueryParamType Type { get; set; } = default!;
/// <summary>
/// whether the playlist is smart or not

View File

@@ -77,6 +77,6 @@ namespace PlexAPI.Models.Requests
public int? Hidden { get; set; }
[JsonProperty("Location")]
public List<Location>? Location { get; set; }
public List<GetLibrariesLocation>? Location { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using Newtonsoft.Json;
public class GetLibrariesLocation
{
[JsonProperty("id")]
public int? Id { get; set; }
[JsonProperty("path")]
public string? Path { get; set; }
}
}

View File

@@ -58,6 +58,9 @@ namespace PlexAPI.Models.Requests
[JsonProperty("viewMode")]
public int? ViewMode { get; set; }
[JsonProperty("mixedParents")]
public bool? MixedParents { get; set; }
[JsonProperty("Metadata")]
public List<GetLibraryItemsMetadata>? Metadata { get; set; }
}

View File

@@ -83,6 +83,27 @@ namespace PlexAPI.Models.Requests
[JsonProperty("ratingImage")]
public string? RatingImage { get; set; }
[JsonProperty("grandparentRatingKey")]
public string? GrandparentRatingKey { get; set; }
[JsonProperty("grandparentGuid")]
public string? GrandparentGuid { get; set; }
[JsonProperty("grandparentKey")]
public string? GrandparentKey { get; set; }
[JsonProperty("grandparentTitle")]
public string? GrandparentTitle { get; set; }
[JsonProperty("grandparentThumb")]
public string? GrandparentThumb { get; set; }
[JsonProperty("grandparentArt")]
public string? GrandparentArt { get; set; }
[JsonProperty("grandparentTheme")]
public string? GrandparentTheme { get; set; }
[JsonProperty("Media")]
public List<GetLibraryItemsMedia>? Media { get; set; }
@@ -118,5 +139,53 @@ namespace PlexAPI.Models.Requests
[JsonProperty("skipCount")]
public int? SkipCount { get; set; }
[JsonProperty("index")]
public int? Index { get; set; }
[JsonProperty("theme")]
public string? Theme { get; set; }
[JsonProperty("leafCount")]
public int? LeafCount { get; set; }
[JsonProperty("viewedLeafCount")]
public int? ViewedLeafCount { get; set; }
[JsonProperty("childCount")]
public int? ChildCount { get; set; }
[JsonProperty("hasPremiumExtras")]
public string? HasPremiumExtras { get; set; }
[JsonProperty("hasPremiumPrimaryExtra")]
public string? HasPremiumPrimaryExtra { get; set; }
[JsonProperty("parentRatingKey")]
public string? ParentRatingKey { get; set; }
[JsonProperty("parentGuid")]
public string? ParentGuid { get; set; }
[JsonProperty("parentStudio")]
public string? ParentStudio { get; set; }
[JsonProperty("parentKey")]
public string? ParentKey { get; set; }
[JsonProperty("parentTitle")]
public string? ParentTitle { get; set; }
[JsonProperty("parentIndex")]
public int? ParentIndex { get; set; }
[JsonProperty("parentYear")]
public int? ParentYear { get; set; }
[JsonProperty("parentThumb")]
public string? ParentThumb { get; set; }
[JsonProperty("parentTheme")]
public string? ParentTheme { get; set; }
}
}

View File

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

View File

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

View File

@@ -0,0 +1,36 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using PlexAPI.Utils;
public class GetPinRequest
{
/// <summary>
/// Plex Authentication Token
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
public string XPlexClientIdentifier { get; set; } = default!;
/// <summary>
/// Determines the kind of code returned by the API call<br/>
///
/// <remarks>
/// Strong codes are used for Pin authentication flows<br/>
/// Non-Strong codes are used for `Plex.tv/link`<br/>
///
/// </remarks>
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=strong")]
public bool? Strong { get; set; }
}
}

View File

@@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using System.Net.Http;
using System;
public class GetPinResponse
{
/// <summary>
/// HTTP response content type for this operation
/// </summary>
public string? ContentType { get; set; } = default!;
/// <summary>
/// HTTP response status code for this operation
/// </summary>
public int StatusCode { get; set; } = default!;
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
public HttpResponseMessage RawResponse { get; set; } = default!;
/// <summary>
/// The Pin
/// </summary>
public GetPinResponseBody? TwoHundredApplicationJsonObject { get; set; }
/// <summary>
/// X-Plex-Client-Identifier is missing
/// </summary>
public GetPinPlexTvResponseBody? FourHundredApplicationJsonObject { get; set; }
}
}

View File

@@ -0,0 +1,70 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using Newtonsoft.Json;
using System;
/// <summary>
/// The Pin
/// </summary>
public class GetPinResponseBody
{
/// <summary>
/// PinID for use with authentication
/// </summary>
[JsonProperty("id")]
public double? Id { get; set; }
[JsonProperty("code")]
public string? Code { get; set; }
[JsonProperty("product")]
public string? Product { get; set; }
[JsonProperty("trusted")]
public bool? Trusted { get; set; }
/// <summary>
/// a link to a QR code hosted on plex.tv <br/>
///
/// <remarks>
/// The QR code redirects to the relevant `plex.tv/link` authentication page<br/>
/// Which then prompts the user for the 4 Digit Link Pin<br/>
///
/// </remarks>
/// </summary>
[JsonProperty("qr")]
public string? Qr { get; set; }
[JsonProperty("clientIdentifier")]
public string? ClientIdentifier { get; set; }
[JsonProperty("location")]
public Location? Location { get; set; }
[JsonProperty("expiresIn")]
public double? ExpiresIn { get; set; }
[JsonProperty("createdAt")]
public DateTime? CreatedAt { get; set; }
[JsonProperty("expiresAt")]
public DateTime? ExpiresAt { get; set; }
[JsonProperty("authToken")]
public string? AuthToken { get; set; }
[JsonProperty("newRegistration")]
public string? NewRegistration { get; set; }
}
}

View File

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

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using PlexAPI.Utils;
public class GetTokenRequest
{
/// <summary>
/// The PinID to retrieve an access token for
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=pinID")]
public string PinID { get; set; } = default!;
/// <summary>
/// Plex Authentication Token
/// </summary>
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
public string XPlexClientIdentifier { get; set; } = default!;
}
}

View File

@@ -0,0 +1,39 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using System.Net.Http;
using System;
public class GetTokenResponse
{
/// <summary>
/// HTTP response content type for this operation
/// </summary>
public string? ContentType { get; set; } = default!;
/// <summary>
/// HTTP response status code for this operation
/// </summary>
public int StatusCode { get; set; } = default!;
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
public HttpResponseMessage RawResponse { get; set; } = default!;
/// <summary>
/// X-Plex-Client-Identifier is missing
/// </summary>
public GetTokenResponseBody? Object { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using Newtonsoft.Json;
using System.Collections.Generic;
/// <summary>
/// X-Plex-Client-Identifier is missing
/// </summary>
public class GetTokenResponseBody
{
[JsonProperty("errors")]
public List<GetTokenErrors>? Errors { get; set; }
}
}

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using Newtonsoft.Json;
using System;
/// <summary>
/// `delegation` - This is the only supported `type` parameter.
/// </summary>
public enum GetTransientTokenQueryParamType
{
[JsonProperty("delegation")]
Delegation,
}
public static class GetTransientTokenQueryParamTypeExtension
{
public static string Value(this GetTransientTokenQueryParamType value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static GetTransientTokenQueryParamType ToEnum(this string value)
{
foreach(var field in typeof(GetTransientTokenQueryParamType).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 GetTransientTokenQueryParamType)
{
return (GetTransientTokenQueryParamType)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum GetTransientTokenQueryParamType");
}
}
}

View File

@@ -19,7 +19,7 @@ namespace PlexAPI.Models.Requests
/// `delegation` - This is the only supported `type` parameter.
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public QueryParamType Type { get; set; } = default!;
public GetTransientTokenQueryParamType Type { get; set; } = default!;
/// <summary>
/// `all` - This is the only supported `scope` parameter.

View File

@@ -15,10 +15,34 @@ namespace PlexAPI.Models.Requests
public class Location
{
[JsonProperty("id")]
public int? Id { get; set; }
[JsonProperty("code")]
public string? Code { get; set; }
[JsonProperty("path")]
public string? Path { get; set; }
[JsonProperty("european_union_member")]
public bool? EuropeanUnionMember { get; set; }
[JsonProperty("continent_code")]
public string? ContinentCode { get; set; }
[JsonProperty("country")]
public string? Country { get; set; }
[JsonProperty("city")]
public string? City { get; set; }
[JsonProperty("time_zone")]
public string? TimeZone { get; set; }
[JsonProperty("postal_code")]
public double? PostalCode { get; set; }
[JsonProperty("in_privacy_restricted_country")]
public bool? InPrivacyRestrictedCountry { get; set; }
[JsonProperty("subdivisions")]
public string? Subdivisions { get; set; }
[JsonProperty("coordinates")]
public string? Coordinates { get; set; }
}
}

View File

@@ -14,12 +14,16 @@ namespace PlexAPI.Models.Requests
using System;
/// <summary>
/// `delegation` - This is the only supported `type` parameter.
/// type of playlist to create
/// </summary>
public enum QueryParamType
{
[JsonProperty("delegation")]
Delegation,
[JsonProperty("audio")]
Audio,
[JsonProperty("video")]
Video,
[JsonProperty("photo")]
Photo,
}
public static class QueryParamTypeExtension

View File

@@ -0,0 +1,58 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using Newtonsoft.Json;
using System.Collections.Generic;
public class SearchLibraryMediaContainer
{
[JsonProperty("size")]
public int? Size { get; set; }
[JsonProperty("allowSync")]
public bool? AllowSync { get; set; }
[JsonProperty("art")]
public string? Art { get; set; }
[JsonProperty("identifier")]
public string? Identifier { get; set; }
[JsonProperty("mediaTagPrefix")]
public string? MediaTagPrefix { get; set; }
[JsonProperty("mediaTagVersion")]
public int? MediaTagVersion { get; set; }
[JsonProperty("nocache")]
public bool? Nocache { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
[JsonProperty("title1")]
public string? Title1 { get; set; }
[JsonProperty("title2")]
public string? Title2 { get; set; }
[JsonProperty("viewGroup")]
public string? ViewGroup { get; set; }
[JsonProperty("viewMode")]
public int? ViewMode { get; set; }
[JsonProperty("Metadata")]
public List<SearchLibraryMetadata>? Metadata { get; set; }
}
}

View File

@@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using Newtonsoft.Json;
public class SearchLibraryMetadata
{
[JsonProperty("ratingKey")]
public string? RatingKey { get; set; }
[JsonProperty("key")]
public string? Key { get; set; }
[JsonProperty("parentRatingKey")]
public string? ParentRatingKey { get; set; }
[JsonProperty("guid")]
public string? Guid { get; set; }
[JsonProperty("parentGuid")]
public string? ParentGuid { get; set; }
[JsonProperty("parentStudio")]
public string? ParentStudio { get; set; }
[JsonProperty("type")]
public string? Type { get; set; }
[JsonProperty("title")]
public string? Title { get; set; }
[JsonProperty("parentKey")]
public string? ParentKey { get; set; }
[JsonProperty("parentTitle")]
public string? ParentTitle { get; set; }
[JsonProperty("summary")]
public string? Summary { get; set; }
[JsonProperty("index")]
public int? Index { get; set; }
[JsonProperty("parentIndex")]
public int? ParentIndex { get; set; }
[JsonProperty("parentYear")]
public int? ParentYear { get; set; }
[JsonProperty("thumb")]
public string? Thumb { get; set; }
[JsonProperty("art")]
public string? Art { get; set; }
[JsonProperty("parentThumb")]
public string? ParentThumb { get; set; }
[JsonProperty("parentTheme")]
public string? ParentTheme { get; set; }
[JsonProperty("addedAt")]
public int? AddedAt { get; set; }
[JsonProperty("updatedAt")]
public int? UpdatedAt { get; set; }
}
}

View File

@@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using PlexAPI.Utils;
public class SearchLibraryRequest
{
/// <summary>
/// the Id of the library to query
/// </summary>
[SpeakeasyMetadata("pathParam:style=simple,explode=false,name=sectionId")]
public long SectionId { get; set; } = default!;
/// <summary>
/// Plex content type to search for
/// </summary>
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=type")]
public Type Type { get; set; } = default!;
}
}

View File

@@ -0,0 +1,39 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using System.Net.Http;
using System;
public class SearchLibraryResponse
{
/// <summary>
/// HTTP response content type for this operation
/// </summary>
public string? ContentType { get; set; } = default!;
/// <summary>
/// HTTP response status code for this operation
/// </summary>
public int StatusCode { get; set; } = default!;
/// <summary>
/// Raw HTTP response; suitable for custom response parsing
/// </summary>
public HttpResponseMessage RawResponse { get; set; } = default!;
/// <summary>
/// The contents of the library by section and type
/// </summary>
public SearchLibraryResponseBody? Object { get; set; }
}
}

View File

@@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI.Models.Requests
{
using Newtonsoft.Json;
/// <summary>
/// The contents of the library by section and type
/// </summary>
public class SearchLibraryResponseBody
{
[JsonProperty("MediaContainer")]
public SearchLibraryMediaContainer? MediaContainer { get; set; }
}
}

View File

@@ -56,8 +56,6 @@ namespace PlexAPI.Models.Requests
FirstCharacter,
[JsonProperty("folder")]
Folder,
[JsonProperty("search?type=1")]
SearchTypeEqual1,
}
public static class TagExtension

View File

@@ -10,53 +10,16 @@
#nullable enable
namespace PlexAPI.Models.Requests
{
using Newtonsoft.Json;
using System;
/// <summary>
/// type of playlist to create
/// Plex content type to search for
/// </summary>
public enum Type
{
[JsonProperty("audio")]
Audio,
[JsonProperty("video")]
Video,
[JsonProperty("photo")]
Photo,
}
public static class TypeExtension
{
public static string Value(this Type value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static Type ToEnum(this string value)
{
foreach(var field in typeof(Type).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 Type)
{
return (Type)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum Type");
}
One = 1,
Two = 2,
Three = 3,
Four = 4,
}
}

View File

@@ -142,10 +142,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

44
PlexAPI/Plex.cs Normal file
View File

@@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI
{
using PlexAPI.Utils;
using System;
public interface IPlex
{
public ITv Tv { get; }
}
public class Plex: IPlex
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
public ITv Tv { get; private set; }
public Plex(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_securityClient = securityClient;
_serverUrl = serverUrl;
SDKConfiguration = config;
Tv = new Tv(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
}
}
}

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>Plex-API</PackageId>
<Version>0.1.5</Version>
<Version>0.2.0</Version>
<Authors>LukeHagar</Authors>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>

View File

@@ -151,6 +151,7 @@ namespace PlexAPI
/// </remarks>
/// </summary>
public ILog Log { get; }
public IPlex Plex { get; }
/// <summary>
/// Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as &quot;all albums from 2017&quot;). <br/>
@@ -235,11 +236,12 @@ namespace PlexAPI
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private int _serverIndex = 0;
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
public IServer Server { get; private set; }
@@ -250,6 +252,7 @@ namespace PlexAPI
public ISearch Search { get; private set; }
public ILibrary Library { get; private set; }
public ILog Log { get; private set; }
public IPlex Plex { get; private set; }
public IPlaylists Playlists { get; private set; }
public ISecurity Security { get; private set; }
public ISessions Sessions { get; private set; }
@@ -258,8 +261,15 @@ namespace PlexAPI
public PlexAPISDK(Security? security = null, int? serverIndex = null, ServerProtocol? protocol = null, string? ip = null, string? port = null, string? serverUrl = null, Dictionary<string, string>? urlParams = null, ISpeakeasyHttpClient? client = null)
{
if (serverUrl != null) {
if (urlParams != null) {
if (serverIndex != null)
{
_serverIndex = serverIndex.Value;
}
if (serverUrl != null)
{
if (urlParams != null)
{
serverUrl = Utilities.TemplateUrl(serverUrl, urlParams);
}
_serverUrl = serverUrl;
@@ -285,6 +295,7 @@ namespace PlexAPI
SDKConfiguration = new SDKConfig()
{
ServerDefaults = serverDefaults,
serverIndex = _serverIndex,
serverUrl = _serverUrl
};
@@ -296,6 +307,7 @@ namespace PlexAPI
Search = new Search(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Library = new Library(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Log = new Log(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Plex = new Plex(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Playlists = new Playlists(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Security = new Security(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);
Sessions = new Sessions(_defaultClient, _securityClient, _serverUrl, SDKConfiguration);

View File

@@ -83,10 +83,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -36,7 +36,7 @@ namespace PlexAPI
///
/// </remarks>
/// </summary>
Task<GetTransientTokenResponse> GetTransientTokenAsync(QueryParamType type, Scope scope);
Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope);
/// <summary>
/// Get Source Connection Information
@@ -61,10 +61,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
@@ -78,7 +78,7 @@ namespace PlexAPI
}
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(QueryParamType type, Scope scope)
public async Task<GetTransientTokenResponse> GetTransientTokenAsync(GetTransientTokenQueryParamType type, Scope scope)
{
var request = new GetTransientTokenRequest()
{

View File

@@ -113,10 +113,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -76,10 +76,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

185
PlexAPI/Tv.cs Normal file
View File

@@ -0,0 +1,185 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace PlexAPI
{
using Newtonsoft.Json;
using PlexAPI.Models.Requests;
using PlexAPI.Utils;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System;
public interface ITv
{
/// <summary>
/// Get a Pin
///
/// <remarks>
/// Retrieve a Pin from Plex.tv for authentication flows
/// </remarks>
/// </summary>
Task<GetPinResponse> GetPinAsync(string xPlexClientIdentifier, bool? strong = null, string? serverUrl = null);
/// <summary>
/// Get Access Token
///
/// <remarks>
/// Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
/// </remarks>
/// </summary>
Task<GetTokenResponse> GetTokenAsync(string pinID, string xPlexClientIdentifier, string? serverUrl = null);
}
public class Tv: ITv
{
/**
* GetPinServerList contains the list of server urls available to the SDK.
*/
public static readonly string[] GetPinServerList = {
"https://plex.tv/api/v2",
};
/**
* GetTokenServerList contains the list of server urls available to the SDK.
*/
public static readonly string[] GetTokenServerList = {
"https://plex.tv/api/v2",
};
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
public Tv(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_securityClient = securityClient;
_serverUrl = serverUrl;
SDKConfiguration = config;
}
public async Task<GetPinResponse> GetPinAsync(string xPlexClientIdentifier, bool? strong = null, string? serverUrl = null)
{
var request = new GetPinRequest()
{
XPlexClientIdentifier = xPlexClientIdentifier,
Strong = strong,
};
string baseUrl = Utilities.TemplateUrl(GetPinServerList[0], new Dictionary<string, string>(){
});
if (serverUrl != null)
{
baseUrl = serverUrl;
}
var urlString = URLBuilder.Build(baseUrl, "/pins", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var client = _securityClient;
var httpResponse = await client.SendAsync(httpRequest);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new GetPinResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.TwoHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPinResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
}
if((response.StatusCode == 400))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.FourHundredApplicationJsonObject = JsonConvert.DeserializeObject<GetPinPlexTvResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
}
return response;
}
public async Task<GetTokenResponse> GetTokenAsync(string pinID, string xPlexClientIdentifier, string? serverUrl = null)
{
var request = new GetTokenRequest()
{
PinID = pinID,
XPlexClientIdentifier = xPlexClientIdentifier,
};
string baseUrl = Utilities.TemplateUrl(GetTokenServerList[0], new Dictionary<string, string>(){
});
if (serverUrl != null)
{
baseUrl = serverUrl;
}
var urlString = URLBuilder.Build(baseUrl, "/pins/{pinID}", request);
var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", _userAgent);
HeaderSerializer.PopulateHeaders(ref httpRequest, request);
var client = _securityClient;
var httpResponse = await client.SendAsync(httpRequest);
var contentType = httpResponse.Content.Headers.ContentType?.MediaType;
var response = new GetTokenResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
return response;
}
if((response.StatusCode == 400))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.Object = JsonConvert.DeserializeObject<GetTokenResponseBody>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer(), new EnumSerializer() }});
}
return response;
}
return response;
}
}
}

View File

@@ -70,10 +70,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -58,10 +58,10 @@ namespace PlexAPI
{
public SDKConfig SDKConfiguration { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.5";
private const string _sdkGenVersion = "2.237.3";
private const string _sdkVersion = "0.2.0";
private const string _sdkGenVersion = "2.248.6";
private const string _openapiDocVersion = "0.0.3";
private const string _userAgent = "speakeasy-sdk/csharp 0.1.5 2.237.3 0.0.3 Plex-API";
private const string _userAgent = "speakeasy-sdk/csharp 0.2.0 2.248.6 0.0.3 Plex-API";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

View File

@@ -26,8 +26,7 @@ dotnet add package Plex-API
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -90,6 +89,7 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
* [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section
* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items
* [RefreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library
* [SearchLibrary](docs/sdks/library/README.md#searchlibrary) - Search Library
* [GetMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata
* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children
* [GetOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck
@@ -100,6 +100,12 @@ var res = await sdk.Server.GetServerCapabilitiesAsync();
* [LogMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message
* [EnablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail
### [Plex.Tv](docs/sdks/tv/README.md)
* [GetPin](docs/sdks/tv/README.md#getpin) - Get a Pin
* [GetToken](docs/sdks/tv/README.md#gettoken) - Get Access Token
### [Playlists](docs/sdks/playlists/README.md)
* [CreatePlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist
@@ -161,8 +167,55 @@ Some of the server options above contain variables. If you want to set the value
### Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example:
### Override Server URL Per-Operation
The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example:
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Plex.Tv.GetPinAsync(
serverUrl: "https://plex.tv/api/v2",
xPlexClientIdentifier: "string",
strong: false);
// handle response
```
<!-- End Server Selection [server] -->
<!-- Start Authentication [security] -->
## Authentication
### Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
| ------------- | ------------- | ------------- |
| `accessToken` | apiKey | API key |
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Server.GetServerCapabilitiesAsync();
// handle response
```
<!-- End Authentication [security] -->
<!-- Placeholder for Future Speakeasy SDK Sections -->
# Development

View File

@@ -55,3 +55,11 @@ Based on:
- Speakeasy CLI 1.148.0 (2.237.3) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.1.5] .
## 2024-02-05 00:39:57
### Changes
Based on:
- OpenAPI Doc 0.0.3
- Speakeasy CLI 1.166.0 (2.248.6) https://github.com/speakeasy-api/speakeasy
### Generated
- [csharp v0.2.0] .

View File

@@ -3,8 +3,7 @@
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});

View File

@@ -3,10 +3,10 @@
## Fields
| Field | Type | Required | Description |
| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- |
| `Title` | *string* | :heavy_check_mark: | name of the playlist |
| `Type` | [Type](../../Models/Requests/Type.md) | :heavy_check_mark: | type of playlist to create |
| `Smart` | [Smart](../../Models/Requests/Smart.md) | :heavy_check_mark: | whether the playlist is smart or not |
| `Uri` | *string* | :heavy_check_mark: | the content URI for the playlist |
| `PlayQueueID` | *double* | :heavy_minus_sign: | the play queue to copy to a playlist |
| Field | Type | Required | Description |
| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
| `Title` | *string* | :heavy_check_mark: | name of the playlist |
| `Type` | [QueryParamType](../../Models/Requests/QueryParamType.md) | :heavy_check_mark: | type of playlist to create |
| `Smart` | [Smart](../../Models/Requests/Smart.md) | :heavy_check_mark: | whether the playlist is smart or not |
| `Uri` | *string* | :heavy_check_mark: | the content URI for the playlist |
| `PlayQueueID` | *double* | :heavy_minus_sign: | the play queue to copy to a playlist |

View File

@@ -3,26 +3,26 @@
## Fields
| 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` | *int* | :heavy_minus_sign: | N/A | 1705615634 |
| `CreatedAt` | *int* | :heavy_minus_sign: | N/A | 1654131312 |
| `ScannedAt` | *int* | :heavy_minus_sign: | N/A | 1705615584 |
| `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 | [{"id":1,"path":"/movies"}] |
| 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` | *int* | :heavy_minus_sign: | N/A | 1705615634 |
| `CreatedAt` | *int* | :heavy_minus_sign: | N/A | 1654131312 |
| `ScannedAt` | *int* | :heavy_minus_sign: | N/A | 1705615584 |
| `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<[GetLibrariesLocation](../../Models/Requests/GetLibrariesLocation.md)> | :heavy_minus_sign: | N/A | [{"id":1,"path":"/movies"}] |

View File

@@ -0,0 +1,9 @@
# GetLibrariesLocation
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Id` | *int* | :heavy_minus_sign: | N/A | 1 |
| `Path` | *string* | :heavy_minus_sign: | N/A | /movies |

File diff suppressed because one or more lines are too long

View File

@@ -27,6 +27,13 @@
| `ChapterSource` | *string* | :heavy_minus_sign: | N/A | media |
| `PrimaryExtraKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58684 |
| `RatingImage` | *string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe |
| `GrandparentRatingKey` | *string* | :heavy_minus_sign: | N/A | 66 |
| `GrandparentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
| `GrandparentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
| `GrandparentTitle` | *string* | :heavy_minus_sign: | N/A | Caprica |
| `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 | [{"Part":[{"container":"mkv","duration":11558112,"file":"/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv","id":119542,"key":"/library/parts/119542/1680457526/file.mkv","size":36158371307,"videoProfile":"main 10"}],"aspectRatio":1.85,"audioChannels":6,"audioCodec":"eac3","bitrate":25025,"container":"mkv","duration":11558112,"height":2072,"id":119534,"videoCodec":"hevc","videoFrameRate":"24p","videoProfile":"main 10","videoResolution":"4k","width":3840}] |
| `Genre` | List<[GetLibraryItemsGenre](../../Models/Requests/GetLibraryItemsGenre.md)> | :heavy_minus_sign: | N/A | [{"tag":"Adventure"}] |
| `Country` | List<[GetLibraryItemsCountry](../../Models/Requests/GetLibraryItemsCountry.md)> | :heavy_minus_sign: | N/A | [{"tag":"United States of America"}] |
@@ -39,3 +46,19 @@
| `OriginalTitle` | *string* | :heavy_minus_sign: | N/A | 映画 ブラッククローバー 魔法帝の剣 |
| `ViewOffset` | *int* | :heavy_minus_sign: | N/A | 5222500 |
| `SkipCount` | *int* | :heavy_minus_sign: | N/A | 1 |
| `Index` | *int* | :heavy_minus_sign: | N/A | 1 |
| `Theme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 |
| `LeafCount` | *int* | :heavy_minus_sign: | N/A | 14 |
| `ViewedLeafCount` | *int* | :heavy_minus_sign: | N/A | 0 |
| `ChildCount` | *int* | :heavy_minus_sign: | N/A | 1 |
| `HasPremiumExtras` | *string* | :heavy_minus_sign: | N/A | 1 |
| `HasPremiumPrimaryExtra` | *string* | :heavy_minus_sign: | N/A | 1 |
| `ParentRatingKey` | *string* | :heavy_minus_sign: | N/A | 66 |
| `ParentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c081b170e24001f2a7be4 |
| `ParentStudio` | *string* | :heavy_minus_sign: | N/A | UCP |
| `ParentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66 |
| `ParentTitle` | *string* | :heavy_minus_sign: | N/A | Caprica |
| `ParentIndex` | *int* | :heavy_minus_sign: | N/A | 1 |
| `ParentYear` | *int* | :heavy_minus_sign: | N/A | 2010 |
| `ParentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/thumb/1705716261 |
| `ParentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/66/theme/1705716261 |

View File

@@ -0,0 +1,10 @@
# GetPinErrors
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `Code` | *double* | :heavy_minus_sign: | N/A | 1000 |
| `Message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
| `Status` | *double* | :heavy_minus_sign: | N/A | 400 |

View File

@@ -0,0 +1,10 @@
# GetPinPlexTvResponseBody
X-Plex-Client-Identifier is missing
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `Errors` | List<[GetPinErrors](../../Models/Requests/GetPinErrors.md)> | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,9 @@
# GetPinRequest
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `XPlexClientIdentifier` | *string* | :heavy_check_mark: | Plex Authentication Token |
| `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/> |

View File

@@ -0,0 +1,12 @@
# GetPinResponse
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `TwoHundredApplicationJsonObject` | [GetPinResponseBody](../../Models/Requests/GetPinResponseBody.md) | :heavy_minus_sign: | The Pin |
| `FourHundredApplicationJsonObject` | [GetPinPlexTvResponseBody](../../Models/Requests/GetPinPlexTvResponseBody.md) | :heavy_minus_sign: | X-Plex-Client-Identifier is missing |

View File

@@ -0,0 +1,21 @@
# GetPinResponseBody
The Pin
## Fields
| Field | Type | Required | Description | Example |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Id` | *double* | :heavy_minus_sign: | PinID for use with authentication | 1272322473 |
| `Code` | *string* | :heavy_minus_sign: | N/A | 3patfx1a78ukcbr7x0n9bl26t |
| `Product` | *string* | :heavy_minus_sign: | N/A | Plex Web |
| `Trusted` | *bool* | :heavy_minus_sign: | N/A | |
| `Qr` | *string* | :heavy_minus_sign: | a link to a QR code hosted on plex.tv <br/>The QR code redirects to the relevant `plex.tv/link` authentication page<br/>Which then prompts the user for the 4 Digit Link Pin<br/> | https://plex.tv/api/v2/pins/qr/3patfx1a78ukcbr7x0n9bl26t |
| `ClientIdentifier` | *string* | :heavy_minus_sign: | N/A | Postman |
| `Location` | [Location](../../Models/Requests/Location.md) | :heavy_minus_sign: | N/A | |
| `ExpiresIn` | *double* | :heavy_minus_sign: | N/A | 1800 |
| `CreatedAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | 2023-04-12 17:00:03 +0000 UTC |
| `ExpiresAt` | [DateTime](https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-5.0) | :heavy_minus_sign: | N/A | 2023-04-12 17:30:03 +0000 UTC |
| `AuthToken` | *string* | :heavy_minus_sign: | N/A | |
| `NewRegistration` | *string* | :heavy_minus_sign: | N/A | |

View File

@@ -0,0 +1,10 @@
# GetTokenErrors
## Fields
| Field | Type | Required | Description | Example |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `Code` | *double* | :heavy_minus_sign: | N/A | 1000 |
| `Message` | *string* | :heavy_minus_sign: | N/A | X-Plex-Client-Identifier is missing |
| `Status` | *double* | :heavy_minus_sign: | N/A | 400 |

View File

@@ -0,0 +1,9 @@
# GetTokenRequest
## Fields
| Field | Type | Required | Description |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| `PinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for |
| `XPlexClientIdentifier` | *string* | :heavy_check_mark: | Plex Authentication Token |

View File

@@ -0,0 +1,11 @@
# GetTokenResponse
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `Object` | [GetTokenResponseBody](../../Models/Requests/GetTokenResponseBody.md) | :heavy_minus_sign: | X-Plex-Client-Identifier is missing |

View File

@@ -0,0 +1,10 @@
# GetTokenResponseBody
X-Plex-Client-Identifier is missing
## Fields
| Field | Type | Required | Description |
| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- |
| `Errors` | List<[GetTokenErrors](../../Models/Requests/GetTokenErrors.md)> | :heavy_minus_sign: | N/A |

View File

@@ -0,0 +1,10 @@
# GetTransientTokenQueryParamType
`delegation` - This is the only supported `type` parameter.
## Values
| Name | Value |
| ------------ | ------------ |
| `Delegation` | delegation |

View File

@@ -3,7 +3,7 @@
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `Type` | [QueryParamType](../../Models/Requests/QueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
| `Scope` | [Scope](../../Models/Requests/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
| Field | Type | Required | Description |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `Type` | [GetTransientTokenQueryParamType](../../Models/Requests/GetTransientTokenQueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
| `Scope` | [Scope](../../Models/Requests/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |

View File

@@ -3,7 +3,15 @@
## Fields
| Field | Type | Required | Description | Example |
| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
| `Id` | *int* | :heavy_minus_sign: | N/A | 1 |
| `Path` | *string* | :heavy_minus_sign: | N/A | /movies |
| Field | Type | Required | Description | Example |
| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- |
| `Code` | *string* | :heavy_minus_sign: | N/A | US |
| `EuropeanUnionMember` | *bool* | :heavy_minus_sign: | N/A | |
| `ContinentCode` | *string* | :heavy_minus_sign: | N/A | NA |
| `Country` | *string* | :heavy_minus_sign: | N/A | United States |
| `City` | *string* | :heavy_minus_sign: | N/A | Austin |
| `TimeZone` | *string* | :heavy_minus_sign: | N/A | America/Chicago |
| `PostalCode` | *double* | :heavy_minus_sign: | N/A | 78732 |
| `InPrivacyRestrictedCountry` | *bool* | :heavy_minus_sign: | N/A | |
| `Subdivisions` | *string* | :heavy_minus_sign: | N/A | Texas |
| `Coordinates` | *string* | :heavy_minus_sign: | N/A | 30.3768 -97.8935 |

View File

@@ -1,10 +1,12 @@
# QueryParamType
`delegation` - This is the only supported `type` parameter.
type of playlist to create
## Values
| Name | Value |
| ------------ | ------------ |
| `Delegation` | delegation |
| Name | Value |
| ------- | ------- |
| `Audio` | audio |
| `Video` | video |
| `Photo` | photo |

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
# SearchLibraryMetadata
## Fields
| Field | Type | Required | Description | Example |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RatingKey` | *string* | :heavy_minus_sign: | N/A | 2 |
| `Key` | *string* | :heavy_minus_sign: | N/A | /library/metadata/2/children |
| `ParentRatingKey` | *string* | :heavy_minus_sign: | N/A | 1 |
| `Guid` | *string* | :heavy_minus_sign: | N/A | plex://season/602e67e766dfdb002c0a1b5b |
| `ParentGuid` | *string* | :heavy_minus_sign: | N/A | plex://show/5d9c086c7d06d9001ffd27aa |
| `ParentStudio` | *string* | :heavy_minus_sign: | N/A | Mutant Enemy Productions |
| `Type` | *string* | :heavy_minus_sign: | N/A | season |
| `Title` | *string* | :heavy_minus_sign: | N/A | Season 1 |
| `ParentKey` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1 |
| `ParentTitle` | *string* | :heavy_minus_sign: | N/A | Firefly |
| `Summary` | *string* | :heavy_minus_sign: | N/A | Captain Malcolm 'Mal' Reynolds is a former galactic war veteran who is the captain of the transport ship "Serenity". Mal and his crew, ensign Zoe Alleyne Washburne; Zoe's husband, pilot Hoban 'Wash' Washburne; muscular mercenary Jayne Cobb; young mechanic Kaylee Frye; former Alliance medical officer Simon Tam; his disturbed teenage sister River (both on the run from the interplanetary government "The Alliance"); the beautiful courtesan Inara Serra; and preacher Shepherd Book do any jobs, legal or illegal, they can find as the Serenity crew travels across the outskirts of outer space. |
| `Index` | *int* | :heavy_minus_sign: | N/A | 1 |
| `ParentIndex` | *int* | :heavy_minus_sign: | N/A | 1 |
| `ParentYear` | *int* | :heavy_minus_sign: | N/A | 2002 |
| `Thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/2/thumb/1705636920 |
| `Art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/art/1705636920 |
| `ParentThumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/thumb/1705636920 |
| `ParentTheme` | *string* | :heavy_minus_sign: | N/A | /library/metadata/1/theme/1705636920 |
| `AddedAt` | *int* | :heavy_minus_sign: | N/A | 1705636916 |
| `UpdatedAt` | *int* | :heavy_minus_sign: | N/A | 1705636920 |

View File

@@ -0,0 +1,9 @@
# SearchLibraryRequest
## Fields
| Field | Type | Required | Description |
| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- |
| `SectionId` | *long* | :heavy_check_mark: | the Id of the library to query |
| `Type` | [Type](../../Models/Requests/Type.md) | :heavy_check_mark: | Plex content type to search for |

View File

@@ -0,0 +1,11 @@
# SearchLibraryResponse
## Fields
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `RawResponse` | [HttpResponseMessage](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpresponsemessage?view=net-5.0) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `Object` | [SearchLibraryResponseBody](../../Models/Requests/SearchLibraryResponseBody.md) | :heavy_minus_sign: | The contents of the library by section and type |

View File

@@ -0,0 +1,10 @@
# SearchLibraryResponseBody
The contents of the library by section and type
## Fields
| Field | Type | Required | Description |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `MediaContainer` | [SearchLibraryMediaContainer](../../Models/Requests/SearchLibraryMediaContainer.md) | :heavy_minus_sign: | N/A |

View File

@@ -5,25 +5,24 @@ A key representing a specific tag within the section.
## Values
| Name | Value |
| ------------------ | ------------------ |
| `All` | all |
| `Unwatched` | unwatched |
| `Newest` | newest |
| `RecentlyAdded` | recentlyAdded |
| `RecentlyViewed` | recentlyViewed |
| `OnDeck` | onDeck |
| `Collection` | collection |
| `Edition` | edition |
| `Genre` | genre |
| `Year` | year |
| `Decade` | decade |
| `Director` | director |
| `Actor` | actor |
| `Country` | country |
| `ContentRating` | contentRating |
| `Rating` | rating |
| `Resolution` | resolution |
| `FirstCharacter` | firstCharacter |
| `Folder` | folder |
| `SearchTypeEqual1` | search?type=1 |
| Name | Value |
| ---------------- | ---------------- |
| `All` | all |
| `Unwatched` | unwatched |
| `Newest` | newest |
| `RecentlyAdded` | recentlyAdded |
| `RecentlyViewed` | recentlyViewed |
| `OnDeck` | onDeck |
| `Collection` | collection |
| `Edition` | edition |
| `Genre` | genre |
| `Year` | year |
| `Decade` | decade |
| `Director` | director |
| `Actor` | actor |
| `Country` | country |
| `ContentRating` | contentRating |
| `Rating` | rating |
| `Resolution` | resolution |
| `FirstCharacter` | firstCharacter |
| `Folder` | folder |

View File

@@ -1,12 +1,13 @@
# Type
type of playlist to create
Plex content type to search for
## Values
| Name | Value |
| ------- | ------- |
| `Audio` | audio |
| `Video` | video |
| `Photo` | photo |
| `One` | 1 |
| `Two` | 2 |
| `Three` | 3 |
| `Four` | 4 |

View File

@@ -27,8 +27,7 @@ Get Server Activities
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -54,12 +53,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Activities.CancelServerActivitiesAsync(ActivityUUID: "string");
var res = await sdk.Activities.CancelServerActivitiesAsync(activityUUID: "string");
// handle response
```

View File

@@ -24,8 +24,7 @@ Returns a list of butler tasks
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -55,8 +54,7 @@ This endpoint will attempt to start all Butler tasks that are enabled in the set
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -82,8 +80,7 @@ This endpoint will stop all currently running tasks and remove any scheduled tas
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -114,12 +111,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Butler.StartTaskAsync(TaskName: TaskName.CleanOldBundles);
var res = await sdk.Butler.StartTaskAsync(taskName: TaskName.CleanOldBundles);
// handle response
```
@@ -148,12 +144,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Butler.StopTaskAsync(TaskName: PathParamTaskName.BackupDatabase);
var res = await sdk.Butler.StopTaskAsync(taskName: PathParamTaskName.BackupDatabase);
// handle response
```

View File

@@ -22,12 +22,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Hubs.GetGlobalHubsAsync(Count: 1262.49D, OnlyTransient: OnlyTransient.One);
var res = await sdk.Hubs.GetGlobalHubsAsync(
count: 1262.49D,
onlyTransient: OnlyTransient.One);
// handle response
```
@@ -57,12 +58,14 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Hubs.GetLibraryHubsAsync(SectionId: 6728.76D, Count: 9010.22D, OnlyTransient: QueryParamOnlyTransient.Zero);
var res = await sdk.Hubs.GetLibraryHubsAsync(
sectionId: 6728.76D,
count: 9010.22D,
onlyTransient: QueryParamOnlyTransient.Zero);
// handle response
```

View File

@@ -15,6 +15,7 @@ API Calls interacting with Plex Media Server Libraries
* [DeleteLibrary](#deletelibrary) - Delete Library Section
* [GetLibraryItems](#getlibraryitems) - Get Library Items
* [RefreshLibrary](#refreshlibrary) - Refresh Library
* [SearchLibrary](#searchlibrary) - Search Library
* [GetMetadata](#getmetadata) - Get Items Metadata
* [GetMetadataChildren](#getmetadatachildren) - Get Items Children
* [GetOnDeck](#getondeck) - Get On Deck
@@ -30,12 +31,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Library.GetFileHashAsync(Url: "file://C:\Image.png&type=13", Type: 4462.17D);
var res = await sdk.Library.GetFileHashAsync(
url: "file://C:\Image.png&type=13",
type: 4462.17D);
// handle response
```
@@ -64,8 +66,7 @@ This endpoint will return the recently added content.
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -96,8 +97,7 @@ This allows a client to provide a rich interface around the media (e.g. allow so
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -162,12 +162,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Library.GetLibraryAsync(SectionId: 1000D, IncludeDetails: IncludeDetails.Zero);
var res = await sdk.Library.GetLibraryAsync(
sectionId: 1000D,
includeDetails: IncludeDetails.Zero);
// handle response
```
@@ -196,12 +197,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Library.DeleteLibraryAsync(SectionId: 1000D);
var res = await sdk.Library.DeleteLibraryAsync(sectionId: 1000D);
// handle response
```
@@ -240,7 +240,6 @@ Fetches details from a specific section of the library identified by a section k
- `resolution`: Items categorized by resolution.
- `firstCharacter`: Items categorized by the first letter.
- `folder`: Items categorized by folder.
- `search?type=1`: Search functionality within the section.
### Example Usage
@@ -250,12 +249,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Library.GetLibraryItemsAsync(SectionId: 451092, Tag: Tag.Unwatched);
var res = await sdk.Library.GetLibraryItemsAsync(
sectionId: 451092,
tag: Tag.Unwatched);
// handle response
```
@@ -285,12 +285,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Library.RefreshLibraryAsync(SectionId: 934.16D);
var res = await sdk.Library.RefreshLibraryAsync(sectionId: 934.16D);
// handle response
```
@@ -307,6 +306,59 @@ var res = await sdk.Library.RefreshLibraryAsync(SectionId: 934.16D);
**[RefreshLibraryResponse](../../Models/Requests/RefreshLibraryResponse.md)**
## SearchLibrary
Search for content within a specific section of the library.
### Types
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
- **Type Object Attributes**:
- `type`: Metadata type (if standard Plex type).
- `title`: Title for this content type (e.g., "Movies").
- **Filter Objects**:
- Subset of the media query language.
- Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.
- **Sort Objects**:
- Description of sort fields.
- Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.
> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.
### Example Usage
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Library.SearchLibraryAsync(
sectionId: 933505,
type: Type.Four);
// handle response
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- |
| `SectionId` | *long* | :heavy_check_mark: | the Id of the library to query |
| `Type` | [Type](../../Models/Requests/Type.md) | :heavy_check_mark: | Plex content type to search for |
### Response
**[SearchLibraryResponse](../../Models/Requests/SearchLibraryResponse.md)**
## GetMetadata
This endpoint will return the metadata of a library item specified with the ratingKey.
@@ -319,12 +371,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Library.GetMetadataAsync(RatingKey: 8382.31D);
var res = await sdk.Library.GetMetadataAsync(ratingKey: 8382.31D);
// handle response
```
@@ -353,12 +404,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Library.GetMetadataChildrenAsync(RatingKey: 1539.14D);
var res = await sdk.Library.GetMetadataChildrenAsync(ratingKey: 1539.14D);
// handle response
```
@@ -386,8 +436,7 @@ This endpoint will return the on deck content.
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});

View File

@@ -24,12 +24,14 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Log.LogLineAsync(Level: Level.Three, Message: "Test log message", Source: "Postman");
var res = await sdk.Log.LogLineAsync(
level: Level.Three,
message: "Test log message",
source: "Postman");
// handle response
```
@@ -79,8 +81,7 @@ Ensure each parameter is properly URL-encoded to avoid interpretation issues.
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -116,8 +117,7 @@ This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});

View File

@@ -23,12 +23,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Media.MarkPlayedAsync(Key: 59398D);
var res = await sdk.Media.MarkPlayedAsync(key: 59398D);
// handle response
```
@@ -56,12 +55,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Media.MarkUnplayedAsync(Key: 59398D);
var res = await sdk.Media.MarkUnplayedAsync(key: 59398D);
// handle response
```
@@ -90,12 +88,14 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Media.UpdatePlayProgressAsync(Key: "string", Time: 6900.91D, State: "string");
var res = await sdk.Media.UpdatePlayProgressAsync(
key: "string",
time: 6900.91D,
state: "string");
// handle response
```

View File

@@ -35,14 +35,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
CreatePlaylistRequest req = new CreatePlaylistRequest() {
Title = "string",
Type = Type.Photo,
Type = QueryParamType.Photo,
Smart = Smart.One,
Uri = "https://inborn-brochure.biz",
};
@@ -75,12 +74,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Playlists.GetPlaylistsAsync(PlaylistType: PlaylistType.Audio, Smart: QueryParamSmart.Zero);
var res = await sdk.Playlists.GetPlaylistsAsync(
playlistType: PlaylistType.Audio,
smart: QueryParamSmart.Zero);
// handle response
```
@@ -111,12 +111,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Playlists.GetPlaylistAsync(PlaylistID: 4109.48D);
var res = await sdk.Playlists.GetPlaylistAsync(playlistID: 4109.48D);
// handle response
```
@@ -145,12 +144,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Playlists.DeletePlaylistAsync(PlaylistID: 216.22D);
var res = await sdk.Playlists.DeletePlaylistAsync(playlistID: 216.22D);
// handle response
```
@@ -179,12 +177,14 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Playlists.UpdatePlaylistAsync(PlaylistID: 3915D, Title: "string", Summary: "string");
var res = await sdk.Playlists.UpdatePlaylistAsync(
playlistID: 3915D,
title: "string",
summary: "string");
// handle response
```
@@ -218,12 +218,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Playlists.GetPlaylistContentsAsync(PlaylistID: 5004.46D, Type: 9403.59D);
var res = await sdk.Playlists.GetPlaylistContentsAsync(
playlistID: 5004.46D,
type: 9403.59D);
// handle response
```
@@ -253,12 +254,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Playlists.ClearPlaylistContentsAsync(PlaylistID: 1893.18D);
var res = await sdk.Playlists.ClearPlaylistContentsAsync(playlistID: 1893.18D);
// handle response
```
@@ -288,12 +288,14 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Playlists.AddPlaylistContentsAsync(PlaylistID: 8502.01D, Uri: "server://12345/com.plexapp.plugins.library/library/metadata/1", PlayQueueID: 123D);
var res = await sdk.Playlists.AddPlaylistContentsAsync(
playlistID: 8502.01D,
uri: "server://12345/com.plexapp.plugins.library/library/metadata/1",
playQueueID: 123D);
// handle response
```
@@ -324,12 +326,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Playlists.UploadPlaylistAsync(Path: "/home/barkley/playlist.m3u", Force: Force.Zero);
var res = await sdk.Playlists.UploadPlaylistAsync(
path: "/home/barkley/playlist.m3u",
force: Force.Zero);
// handle response
```

5
docs/sdks/plex/README.md Normal file
View File

@@ -0,0 +1,5 @@
# Plex
(*Plex*)
### Available Operations

View File

@@ -35,12 +35,14 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Search.PerformSearchAsync(Query: "dylan", SectionId: 1516.53D, Limit: 5D);
var res = await sdk.Search.PerformSearchAsync(
query: "dylan",
sectionId: 1516.53D,
limit: 5D);
// handle response
```
@@ -74,12 +76,14 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Search.PerformVoiceSearchAsync(Query: "dead+poop", SectionId: 4094.8D, Limit: 5D);
var res = await sdk.Search.PerformVoiceSearchAsync(
query: "dead+poop",
sectionId: 4094.8D,
limit: 5D);
// handle response
```
@@ -109,12 +113,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Search.GetSearchResultsAsync(Query: "110");
var res = await sdk.Search.GetSearchResultsAsync(query: "110");
// handle response
```

View File

@@ -23,22 +23,23 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Security.GetTransientTokenAsync(Type: QueryParamType.Delegation, Scope: Scope.All);
var res = await sdk.Security.GetTransientTokenAsync(
type: GetTransientTokenQueryParamType.Delegation,
scope: Scope.All);
// handle response
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| `Type` | [QueryParamType](../../Models/Requests/QueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
| `Scope` | [Scope](../../Models/Requests/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `Type` | [GetTransientTokenQueryParamType](../../Models/Requests/GetTransientTokenQueryParamType.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. |
| `Scope` | [Scope](../../Models/Requests/Scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. |
### Response
@@ -59,12 +60,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Security.GetSourceConnectionInformationAsync(Source: "server://client-identifier");
var res = await sdk.Security.GetSourceConnectionInformationAsync(source: "server://client-identifier");
// handle response
```

View File

@@ -27,8 +27,7 @@ Server Capabilities
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -53,8 +52,7 @@ Get Server Preferences
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -79,8 +77,7 @@ Get Available Clients
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -105,8 +102,7 @@ Get Devices
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -131,8 +127,7 @@ Get Server Identity
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -157,8 +152,7 @@ Returns MyPlex Account Information
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -185,8 +179,7 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -227,8 +220,7 @@ Get Server List
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});

View File

@@ -23,8 +23,7 @@ This will retrieve the "Now Playing" Information of the PMS.
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -49,8 +48,7 @@ This will Retrieve a listing of all history views.
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -75,8 +73,7 @@ Get Transcode Sessions
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -102,12 +99,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Sessions.StopTranscodeSessionAsync(SessionKey: "zz7llzqlx8w9vnrsbnwhbmep");
var res = await sdk.Sessions.StopTranscodeSessionAsync(sessionKey: "zz7llzqlx8w9vnrsbnwhbmep");
// handle response
```

79
docs/sdks/tv/README.md Normal file
View File

@@ -0,0 +1,79 @@
# Tv
(*Plex.Tv*)
### Available Operations
* [GetPin](#getpin) - Get a Pin
* [GetToken](#gettoken) - Get Access Token
## GetPin
Retrieve a Pin from Plex.tv for authentication flows
### Example Usage
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Plex.Tv.GetPinAsync(
xPlexClientIdentifier: "string",
strong: false);
// handle response
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `XPlexClientIdentifier` | *string* | :heavy_check_mark: | Plex Authentication Token |
| `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/> |
| `serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetPinResponse](../../Models/Requests/GetPinResponse.md)**
## GetToken
Retrieve an Access Token from Plex.tv after the Pin has already been authenticated
### Example Usage
```csharp
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Plex.Tv.GetTokenAsync(
pinID: "string",
xPlexClientIdentifier: "string");
// handle response
```
### Parameters
| Parameter | Type | Required | Description |
| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
| `PinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for |
| `XPlexClientIdentifier` | *string* | :heavy_check_mark: | Plex Authentication Token |
| `serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. |
### Response
**[GetTokenResponse](../../Models/Requests/GetTokenResponse.md)**

View File

@@ -23,8 +23,7 @@ Querying status of updates
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -50,12 +49,11 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Updater.CheckForUpdatesAsync(Download: Download.One);
var res = await sdk.Updater.CheckForUpdatesAsync(download: Download.One);
// handle response
```
@@ -84,12 +82,13 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Updater.ApplyUpdatesAsync(Tonight: Tonight.One, Skip: Skip.Zero);
var res = await sdk.Updater.ApplyUpdatesAsync(
tonight: Tonight.One,
skip: Skip.Zero);
// handle response
```

View File

@@ -22,8 +22,7 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
@@ -63,8 +62,7 @@ using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(
security: new Models.Components.Security() {
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});

View File

@@ -7,10 +7,12 @@ generation:
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: false
parameterOrderingFeb2024: false
csharp:
version: 0.1.5
version: 0.2.0
author: LukeHagar
dotnetVersion: net5.0
flattenGlobalSecurity: false
imports:
option: openapi
paths: