mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-07 12:37:45 +00:00
ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.205.0
This commit is contained in:
42
PlexAPI/Models/Requests/Account.cs
Normal file
42
PlexAPI/Models/Requests/Account.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Account
|
||||
{
|
||||
|
||||
[JsonProperty("id")]
|
||||
public int? Id { get; set; }
|
||||
|
||||
[JsonProperty("key")]
|
||||
public string? Key { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[JsonProperty("defaultAudioLanguage")]
|
||||
public string? DefaultAudioLanguage { get; set; }
|
||||
|
||||
[JsonProperty("autoSelectAudio")]
|
||||
public bool? AutoSelectAudio { get; set; }
|
||||
|
||||
[JsonProperty("defaultSubtitleLanguage")]
|
||||
public string? DefaultSubtitleLanguage { get; set; }
|
||||
|
||||
[JsonProperty("subtitleMode")]
|
||||
public int? SubtitleMode { get; set; }
|
||||
|
||||
[JsonProperty("thumb")]
|
||||
public string? Thumb { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
24
PlexAPI/Models/Requests/GetLibrariesLocation.cs
Normal file
24
PlexAPI/Models/Requests/GetLibrariesLocation.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
27
PlexAPI/Models/Requests/GetPinErrors.cs
Normal file
27
PlexAPI/Models/Requests/GetPinErrors.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
25
PlexAPI/Models/Requests/GetPinPlexResponseBody.cs
Normal file
25
PlexAPI/Models/Requests/GetPinPlexResponseBody.cs
Normal 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 GetPinPlexResponseBody
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetPinErrors>? Errors { get; set; }
|
||||
}
|
||||
}
|
||||
42
PlexAPI/Models/Requests/GetPinRequest.cs
Normal file
42
PlexAPI/Models/Requests/GetPinRequest.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <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>
|
||||
/// The unique identifier for the client application<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// This is used to track the client application and its usage<br/>
|
||||
/// (UUID, serial number, or other number unique per device)<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("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; }
|
||||
}
|
||||
}
|
||||
44
PlexAPI/Models/Requests/GetPinResponse.cs
Normal file
44
PlexAPI/Models/Requests/GetPinResponse.cs
Normal 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 GetPinPlexResponseBody? FourHundredApplicationJsonObject { get; set; }
|
||||
}
|
||||
}
|
||||
70
PlexAPI/Models/Requests/GetPinResponseBody.cs
Normal file
70
PlexAPI/Models/Requests/GetPinResponseBody.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,6 @@ namespace PlexAPI.Models.Requests
|
||||
public int? Size { get; set; }
|
||||
|
||||
[JsonProperty("Setting")]
|
||||
public List<object>? Setting { get; set; }
|
||||
public List<Setting>? Setting { get; set; }
|
||||
}
|
||||
}
|
||||
33
PlexAPI/Models/Requests/GetStatisticsDevice.cs
Normal file
33
PlexAPI/Models/Requests/GetStatisticsDevice.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GetStatisticsDevice
|
||||
{
|
||||
|
||||
[JsonProperty("id")]
|
||||
public int? Id { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[JsonProperty("platform")]
|
||||
public string? Platform { get; set; }
|
||||
|
||||
[JsonProperty("clientIdentifier")]
|
||||
public string? ClientIdentifier { get; set; }
|
||||
|
||||
[JsonProperty("createdAt")]
|
||||
public int? CreatedAt { get; set; }
|
||||
}
|
||||
}
|
||||
27
PlexAPI/Models/Requests/GetStatisticsErrors.cs
Normal file
27
PlexAPI/Models/Requests/GetStatisticsErrors.cs
Normal 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 GetStatisticsErrors
|
||||
{
|
||||
|
||||
[JsonProperty("code")]
|
||||
public double? Code { get; set; }
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
public double? Status { get; set; }
|
||||
}
|
||||
}
|
||||
31
PlexAPI/Models/Requests/GetStatisticsMediaContainer.cs
Normal file
31
PlexAPI/Models/Requests/GetStatisticsMediaContainer.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GetStatisticsMediaContainer
|
||||
{
|
||||
|
||||
[JsonProperty("size")]
|
||||
public int? Size { get; set; }
|
||||
|
||||
[JsonProperty("Device")]
|
||||
public List<GetStatisticsDevice>? Device { get; set; }
|
||||
|
||||
[JsonProperty("Account")]
|
||||
public List<Account>? Account { get; set; }
|
||||
|
||||
[JsonProperty("StatisticsMedia")]
|
||||
public List<StatisticsMedia>? StatisticsMedia { get; set; }
|
||||
}
|
||||
}
|
||||
29
PlexAPI/Models/Requests/GetStatisticsRequest.cs
Normal file
29
PlexAPI/Models/Requests/GetStatisticsRequest.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GetStatisticsRequest
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The timespan to retrieve statistics for<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// the exact meaning of this parameter is not known<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("queryParam:style=form,explode=true,name=Timespan")]
|
||||
public long? Timespan { get; set; }
|
||||
}
|
||||
}
|
||||
44
PlexAPI/Models/Requests/GetStatisticsResponse.cs
Normal file
44
PlexAPI/Models/Requests/GetStatisticsResponse.cs
Normal 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 GetStatisticsResponse
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// Media Statistics
|
||||
/// </summary>
|
||||
public GetStatisticsResponseBody? TwoHundredApplicationJsonObject { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
/// </summary>
|
||||
public GetStatisticsStatisticsResponseBody? FourHundredAndOneApplicationJsonObject { get; set; }
|
||||
}
|
||||
}
|
||||
24
PlexAPI/Models/Requests/GetStatisticsResponseBody.cs
Normal file
24
PlexAPI/Models/Requests/GetStatisticsResponseBody.cs
Normal 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>
|
||||
/// Media Statistics
|
||||
/// </summary>
|
||||
public class GetStatisticsResponseBody
|
||||
{
|
||||
|
||||
[JsonProperty("MediaContainer")]
|
||||
public GetStatisticsMediaContainer? MediaContainer { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
/// Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
||||
/// </summary>
|
||||
public class GetStatisticsStatisticsResponseBody
|
||||
{
|
||||
|
||||
[JsonProperty("errors")]
|
||||
public List<GetStatisticsErrors>? Errors { get; set; }
|
||||
}
|
||||
}
|
||||
27
PlexAPI/Models/Requests/GetTokenErrors.cs
Normal file
27
PlexAPI/Models/Requests/GetTokenErrors.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
36
PlexAPI/Models/Requests/GetTokenRequest.cs
Normal file
36
PlexAPI/Models/Requests/GetTokenRequest.cs
Normal 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 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>
|
||||
/// The unique identifier for the client application<br/>
|
||||
///
|
||||
/// <remarks>
|
||||
/// This is used to track the client application and its usage<br/>
|
||||
/// (UUID, serial number, or other number unique per device)<br/>
|
||||
///
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
[SpeakeasyMetadata("header:style=simple,explode=false,name=X-Plex-Client-Identifier")]
|
||||
public string XPlexClientIdentifier { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
39
PlexAPI/Models/Requests/GetTokenResponse.cs
Normal file
39
PlexAPI/Models/Requests/GetTokenResponse.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
25
PlexAPI/Models/Requests/GetTokenResponseBody.cs
Normal file
25
PlexAPI/Models/Requests/GetTokenResponseBody.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
58
PlexAPI/Models/Requests/GetTransientTokenQueryParamType.cs
Normal file
58
PlexAPI/Models/Requests/GetTransientTokenQueryParamType.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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.
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
58
PlexAPI/Models/Requests/SearchLibraryMediaContainer.cs
Normal file
58
PlexAPI/Models/Requests/SearchLibraryMediaContainer.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
78
PlexAPI/Models/Requests/SearchLibraryMetadata.cs
Normal file
78
PlexAPI/Models/Requests/SearchLibraryMetadata.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
30
PlexAPI/Models/Requests/SearchLibraryRequest.cs
Normal file
30
PlexAPI/Models/Requests/SearchLibraryRequest.cs
Normal 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!;
|
||||
}
|
||||
}
|
||||
39
PlexAPI/Models/Requests/SearchLibraryResponse.cs
Normal file
39
PlexAPI/Models/Requests/SearchLibraryResponse.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
24
PlexAPI/Models/Requests/SearchLibraryResponseBody.cs
Normal file
24
PlexAPI/Models/Requests/SearchLibraryResponseBody.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
48
PlexAPI/Models/Requests/Setting.cs
Normal file
48
PlexAPI/Models/Requests/Setting.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 Setting
|
||||
{
|
||||
|
||||
[JsonProperty("id")]
|
||||
public string? Id { get; set; }
|
||||
|
||||
[JsonProperty("label")]
|
||||
public string? Label { get; set; }
|
||||
|
||||
[JsonProperty("summary")]
|
||||
public string? Summary { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string? Type { get; set; }
|
||||
|
||||
[JsonProperty("default")]
|
||||
public bool? Default { get; set; }
|
||||
|
||||
[JsonProperty("value")]
|
||||
public bool? Value { get; set; }
|
||||
|
||||
[JsonProperty("hidden")]
|
||||
public bool? Hidden { get; set; }
|
||||
|
||||
[JsonProperty("advanced")]
|
||||
public bool? Advanced { get; set; }
|
||||
|
||||
[JsonProperty("group")]
|
||||
public string? Group { get; set; }
|
||||
|
||||
[JsonProperty("enumValues")]
|
||||
public string? EnumValues { get; set; }
|
||||
}
|
||||
}
|
||||
39
PlexAPI/Models/Requests/StatisticsMedia.cs
Normal file
39
PlexAPI/Models/Requests/StatisticsMedia.cs
Normal 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 Newtonsoft.Json;
|
||||
|
||||
public class StatisticsMedia
|
||||
{
|
||||
|
||||
[JsonProperty("accountID")]
|
||||
public int? AccountID { get; set; }
|
||||
|
||||
[JsonProperty("deviceID")]
|
||||
public int? DeviceID { get; set; }
|
||||
|
||||
[JsonProperty("timespan")]
|
||||
public int? Timespan { get; set; }
|
||||
|
||||
[JsonProperty("at")]
|
||||
public int? At { get; set; }
|
||||
|
||||
[JsonProperty("metadataType")]
|
||||
public int? MetadataType { get; set; }
|
||||
|
||||
[JsonProperty("count")]
|
||||
public int? Count { get; set; }
|
||||
|
||||
[JsonProperty("duration")]
|
||||
public int? Duration { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -56,8 +56,6 @@ namespace PlexAPI.Models.Requests
|
||||
FirstCharacter,
|
||||
[JsonProperty("folder")]
|
||||
Folder,
|
||||
[JsonProperty("search?type=1")]
|
||||
SearchTypeEqual1,
|
||||
}
|
||||
|
||||
public static class TagExtension
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user