ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.474.0

This commit is contained in:
speakeasybot
2025-01-24 00:22:18 +00:00
parent c9746b7ad8
commit fe81f4dff0
50 changed files with 1708 additions and 970 deletions

View File

@@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
/// <summary>
/// Setting that indicates how episodes are sorted for the show. (-1 = Library default, 0 = Oldest first, 1 = Newest first).
/// </summary>
public enum EpisodeSort
{
[JsonProperty("-1")]
LibraryDefault,
[JsonProperty("0")]
OldestFirst,
[JsonProperty("1")]
NewestFirst,
}
public static class EpisodeSortExtension
{
public static string Value(this EpisodeSort value)
{
return ((JsonPropertyAttribute)value.GetType().GetMember(value.ToString())[0].GetCustomAttributes(typeof(JsonPropertyAttribute), false)[0]).PropertyName ?? value.ToString();
}
public static EpisodeSort ToEnum(this string value)
{
foreach(var field in typeof(EpisodeSort).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 EpisodeSort)
{
return (EpisodeSort)enumVal;
}
}
}
throw new Exception($"Unknown value {value} for enum EpisodeSort");
}
}
}