mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-08 20:47:48 +00:00
Regenerated SDK with small changes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
@@ -22,25 +21,73 @@ namespace PlexAPI.Utils
|
||||
|
||||
public class Utilities
|
||||
{
|
||||
public static JsonConverter[] GetJsonConverters(Type type, string format = "")
|
||||
public static JsonConverter[] GetDefaultJsonSerializers()
|
||||
{
|
||||
return new JsonConverter[]
|
||||
{
|
||||
new IsoDateTimeSerializer(),
|
||||
new EnumConverter()
|
||||
};
|
||||
}
|
||||
|
||||
public static JsonConverter[] GetDefaultJsonDeserializers()
|
||||
{
|
||||
return new JsonConverter[] {
|
||||
new FlexibleObjectDeserializer(),
|
||||
new EnumConverter(),
|
||||
new AnyDeserializer()
|
||||
};
|
||||
}
|
||||
|
||||
public static JsonSerializerSettings GetDefaultJsonSerializerSettings()
|
||||
{
|
||||
return new JsonSerializerSettings()
|
||||
{
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
Converters = GetDefaultJsonSerializers()
|
||||
};
|
||||
}
|
||||
|
||||
public static JsonSerializerSettings GetDefaultJsonDeserializerSettings()
|
||||
{
|
||||
return new JsonSerializerSettings()
|
||||
{
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
Converters = GetDefaultJsonDeserializers()
|
||||
};
|
||||
}
|
||||
|
||||
public static JsonConverter[] GetJsonSerializers(Type type, string format = "")
|
||||
{
|
||||
if (format == "string")
|
||||
{
|
||||
if (type == typeof(BigInteger))
|
||||
{
|
||||
return new JsonConverter[] { new BigIntSerializer() };
|
||||
return new JsonConverter[] { new BigIntStrConverter() };
|
||||
}
|
||||
|
||||
if (type == typeof(Decimal))
|
||||
{
|
||||
return new JsonConverter[] { new DecimalSerializer() };
|
||||
return new JsonConverter[] { new DecimalStrConverter() };
|
||||
}
|
||||
}
|
||||
|
||||
return new JsonConverter[]
|
||||
return GetDefaultJsonSerializers();
|
||||
}
|
||||
|
||||
public static JsonConverter[] GetJsonDeserializers(Type type)
|
||||
{
|
||||
if (type == typeof(BigInteger))
|
||||
{
|
||||
new IsoDateTimeSerializer(),
|
||||
new EnumSerializer(),
|
||||
};
|
||||
return new JsonConverter[] { new BigIntStrConverter() };
|
||||
}
|
||||
|
||||
if (type == typeof(Decimal))
|
||||
{
|
||||
return new JsonConverter[] { new DecimalStrConverter() };
|
||||
}
|
||||
|
||||
return GetDefaultJsonDeserializers();
|
||||
}
|
||||
|
||||
public static string SerializeJSON(object obj, string format = "")
|
||||
@@ -60,7 +107,7 @@ namespace PlexAPI.Utils
|
||||
new JsonSerializerSettings()
|
||||
{
|
||||
NullValueHandling = NullValueHandling.Ignore,
|
||||
Converters = GetJsonConverters(type, format)
|
||||
Converters = GetJsonSerializers(type, format)
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -200,9 +247,12 @@ namespace PlexAPI.Utils
|
||||
|
||||
if (IsDate(obj))
|
||||
{
|
||||
return StripSurroundingQuotes(JsonConvert.SerializeObject(obj, new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new IsoDateTimeSerializer(), new EnumSerializer() }}));
|
||||
return StripSurroundingQuotes(
|
||||
JsonConvert.SerializeObject(obj, GetDefaultJsonSerializerSettings())
|
||||
);
|
||||
}
|
||||
return JsonConvert.SerializeObject(obj, new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new IsoDateTimeSerializer(), new EnumSerializer() }});
|
||||
|
||||
return JsonConvert.SerializeObject(obj, GetDefaultJsonSerializerSettings());
|
||||
}
|
||||
|
||||
public static bool IsContentTypeMatch(string expected, string? actual)
|
||||
|
||||
Reference in New Issue
Block a user