ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.557.0

This commit is contained in:
speakeasybot
2025-06-09 00:28:07 +00:00
parent bc02ecef34
commit 4197184f92
192 changed files with 3360 additions and 2768 deletions

View File

@@ -0,0 +1,203 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace LukeHagar.PlexAPI.SDK.Models.Requests
{
using LukeHagar.PlexAPI.SDK.Models.Requests;
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Reflection;
public class GetLibraryItemsLibraryOptimizedForStreamingType
{
private GetLibraryItemsLibraryOptimizedForStreamingType(string value) { Value = value; }
public string Value { get; private set; }
public static GetLibraryItemsLibraryOptimizedForStreamingType GetLibraryItemsOptimizedForStreaming1 { get { return new GetLibraryItemsLibraryOptimizedForStreamingType("get-library-items_optimizedForStreaming_1"); } }
public static GetLibraryItemsLibraryOptimizedForStreamingType Boolean { get { return new GetLibraryItemsLibraryOptimizedForStreamingType("boolean"); } }
public static GetLibraryItemsLibraryOptimizedForStreamingType Null { get { return new GetLibraryItemsLibraryOptimizedForStreamingType("null"); } }
public override string ToString() { return Value; }
public static implicit operator String(GetLibraryItemsLibraryOptimizedForStreamingType v) { return v.Value; }
public static GetLibraryItemsLibraryOptimizedForStreamingType FromString(string v) {
switch(v) {
case "get-library-items_optimizedForStreaming_1": return GetLibraryItemsOptimizedForStreaming1;
case "boolean": return Boolean;
case "null": return Null;
default: throw new ArgumentException("Invalid value for GetLibraryItemsLibraryOptimizedForStreamingType");
}
}
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType())
{
return false;
}
return Value.Equals(((GetLibraryItemsLibraryOptimizedForStreamingType)obj).Value);
}
public override int GetHashCode()
{
return Value.GetHashCode();
}
}
/// <summary>
/// Has this media been optimized for streaming. NOTE: This can be 0, 1, false or true<br/>
///
/// <remarks>
///
/// </remarks>
/// </summary>
[JsonConverter(typeof(GetLibraryItemsLibraryOptimizedForStreaming.GetLibraryItemsLibraryOptimizedForStreamingConverter))]
public class GetLibraryItemsLibraryOptimizedForStreaming {
public GetLibraryItemsLibraryOptimizedForStreaming(GetLibraryItemsLibraryOptimizedForStreamingType type) {
Type = type;
}
[SpeakeasyMetadata("form:explode=true")]
public GetLibraryItemsOptimizedForStreaming1? GetLibraryItemsOptimizedForStreaming1 { get; set; }
[SpeakeasyMetadata("form:explode=true")]
public bool? Boolean { get; set; }
public GetLibraryItemsLibraryOptimizedForStreamingType Type { get; set; }
public static GetLibraryItemsLibraryOptimizedForStreaming CreateGetLibraryItemsOptimizedForStreaming1(GetLibraryItemsOptimizedForStreaming1 getLibraryItemsOptimizedForStreaming1) {
GetLibraryItemsLibraryOptimizedForStreamingType typ = GetLibraryItemsLibraryOptimizedForStreamingType.GetLibraryItemsOptimizedForStreaming1;
GetLibraryItemsLibraryOptimizedForStreaming res = new GetLibraryItemsLibraryOptimizedForStreaming(typ);
res.GetLibraryItemsOptimizedForStreaming1 = getLibraryItemsOptimizedForStreaming1;
return res;
}
public static GetLibraryItemsLibraryOptimizedForStreaming CreateBoolean(bool boolean) {
GetLibraryItemsLibraryOptimizedForStreamingType typ = GetLibraryItemsLibraryOptimizedForStreamingType.Boolean;
GetLibraryItemsLibraryOptimizedForStreaming res = new GetLibraryItemsLibraryOptimizedForStreaming(typ);
res.Boolean = boolean;
return res;
}
public static GetLibraryItemsLibraryOptimizedForStreaming CreateNull() {
GetLibraryItemsLibraryOptimizedForStreamingType typ = GetLibraryItemsLibraryOptimizedForStreamingType.Null;
return new GetLibraryItemsLibraryOptimizedForStreaming(typ);
}
public class GetLibraryItemsLibraryOptimizedForStreamingConverter : JsonConverter
{
public override bool CanConvert(System.Type objectType) => objectType == typeof(GetLibraryItemsLibraryOptimizedForStreaming);
public override bool CanRead => true;
public override object? ReadJson(JsonReader reader, System.Type objectType, object? existingValue, JsonSerializer serializer)
{
var json = JRaw.Create(reader).ToString();
if (json == "null")
{
return null;
}
var fallbackCandidates = new List<(System.Type, object, string)>();
try
{
return new GetLibraryItemsLibraryOptimizedForStreaming(GetLibraryItemsLibraryOptimizedForStreamingType.GetLibraryItemsOptimizedForStreaming1)
{
GetLibraryItemsOptimizedForStreaming1 = ResponseBodyDeserializer.DeserializeUndiscriminatedUnionMember<GetLibraryItemsOptimizedForStreaming1>(json)
};
}
catch (ResponseBodyDeserializer.MissingMemberException)
{
fallbackCandidates.Add((typeof(GetLibraryItemsOptimizedForStreaming1), new GetLibraryItemsLibraryOptimizedForStreaming(GetLibraryItemsLibraryOptimizedForStreamingType.GetLibraryItemsOptimizedForStreaming1), "GetLibraryItemsOptimizedForStreaming1"));
}
catch (ResponseBodyDeserializer.DeserializationException)
{
// try next option
}
catch (Exception)
{
throw;
}
try
{
var converted = Convert.ToBoolean(json);
return new GetLibraryItemsLibraryOptimizedForStreaming(GetLibraryItemsLibraryOptimizedForStreamingType.Boolean)
{
Boolean = converted
};
}
catch (System.FormatException)
{
// try next option
}
if (fallbackCandidates.Count > 0)
{
fallbackCandidates.Sort((a, b) => ResponseBodyDeserializer.CompareFallbackCandidates(a.Item1, b.Item1, json));
foreach(var (deserializationType, returnObject, propertyName) in fallbackCandidates)
{
try
{
return ResponseBodyDeserializer.DeserializeUndiscriminatedUnionFallback(deserializationType, returnObject, propertyName, json);
}
catch (ResponseBodyDeserializer.DeserializationException)
{
// try next fallback option
}
catch (Exception)
{
throw;
}
}
}
throw new InvalidOperationException("Could not deserialize into any supported types.");
}
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
if (value == null) {
writer.WriteRawValue("null");
return;
}
GetLibraryItemsLibraryOptimizedForStreaming res = (GetLibraryItemsLibraryOptimizedForStreaming)value;
if (GetLibraryItemsLibraryOptimizedForStreamingType.FromString(res.Type).Equals(GetLibraryItemsLibraryOptimizedForStreamingType.Null))
{
writer.WriteRawValue("null");
return;
}
if (res.GetLibraryItemsOptimizedForStreaming1 != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.GetLibraryItemsOptimizedForStreaming1));
return;
}
if (res.Boolean != null)
{
writer.WriteRawValue(Utilities.SerializeJSON(res.Boolean));
return;
}
}
}
}
}