generated from tryAGI/SdkTemplate
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
github-actions[bot]
committed
Sep 21, 2024
1 parent
95f8105
commit d24bd65
Showing
12 changed files
with
666 additions
and
30 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Ideogram | ||
{ | ||
/// <summary> | ||
/// A member of a color palette. | ||
/// </summary> | ||
public sealed partial class ColorPaletteMember | ||
{ | ||
/// <summary> | ||
/// The hexadecimal representation of the color with an optional chosen weight<br/> | ||
/// Example: #FFFFFF | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("color_hex")] | ||
[global::System.Text.Json.Serialization.JsonRequired] | ||
public required string ColorHex { get; set; } | ||
|
||
/// <summary> | ||
/// The weight of the color in the color palette.<br/> | ||
/// Example: 0.25 | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("color_weight")] | ||
[global::System.Text.Json.Serialization.JsonRequired] | ||
public required double ColorWeight { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
src/libs/Ideogram/Generated/Ideogram.Models.ColorPalettePresetName.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Ideogram | ||
{ | ||
/// <summary> | ||
/// A color palette preset value<br/> | ||
/// Example: PASTEL | ||
/// </summary> | ||
public enum ColorPalettePresetName | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
EMBER, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
FRESH, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
JUNGLE, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
MAGIC, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
MELON, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
MOSAIC, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
PASTEL, | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
ULTRAMARINE, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ColorPalettePresetNameExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ColorPalettePresetName value) | ||
{ | ||
return value switch | ||
{ | ||
ColorPalettePresetName.EMBER => "EMBER", | ||
ColorPalettePresetName.FRESH => "FRESH", | ||
ColorPalettePresetName.JUNGLE => "JUNGLE", | ||
ColorPalettePresetName.MAGIC => "MAGIC", | ||
ColorPalettePresetName.MELON => "MELON", | ||
ColorPalettePresetName.MOSAIC => "MOSAIC", | ||
ColorPalettePresetName.PASTEL => "PASTEL", | ||
ColorPalettePresetName.ULTRAMARINE => "ULTRAMARINE", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ColorPalettePresetName? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"EMBER" => ColorPalettePresetName.EMBER, | ||
"FRESH" => ColorPalettePresetName.FRESH, | ||
"JUNGLE" => ColorPalettePresetName.JUNGLE, | ||
"MAGIC" => ColorPalettePresetName.MAGIC, | ||
"MELON" => ColorPalettePresetName.MELON, | ||
"MOSAIC" => ColorPalettePresetName.MOSAIC, | ||
"PASTEL" => ColorPalettePresetName.PASTEL, | ||
"ULTRAMARINE" => ColorPalettePresetName.ULTRAMARINE, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Ideogram | ||
{ | ||
/// <summary> | ||
/// A color palette represented only via its members | ||
/// </summary> | ||
public sealed partial class ColorPaletteWithMembers | ||
{ | ||
/// <summary> | ||
/// A list of ColorPaletteMembers that define the color palette. | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("members")] | ||
[global::System.Text.Json.Serialization.JsonRequired] | ||
public required global::System.Collections.Generic.IList<global::Ideogram.ColorPaletteMember> Members { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Ideogram | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public sealed partial class ColorPaletteWithPresetName | ||
{ | ||
/// <summary> | ||
/// A color palette preset value<br/> | ||
/// Example: PASTEL | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonPropertyName("name")] | ||
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPalettePresetNameJsonConverter))] | ||
[global::System.Text.Json.Serialization.JsonRequired] | ||
public required global::Ideogram.ColorPalettePresetName Name { get; set; } | ||
|
||
/// <summary> | ||
/// Additional properties that are not explicitly defined in the schema | ||
/// </summary> | ||
[global::System.Text.Json.Serialization.JsonExtensionData] | ||
public global::System.Collections.Generic.IDictionary<string, object> AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary<string, object>(); | ||
} | ||
} |
166 changes: 166 additions & 0 deletions
166
src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
using System.Linq; | ||
#pragma warning disable CS0618 // Type or member is obsolete | ||
|
||
#nullable enable | ||
|
||
namespace Ideogram | ||
{ | ||
/// <summary> | ||
/// A color palette for generation, must EITHER be specified via one of the presets (name) or explicitly via hexadecimal representations of the color with optional weights (members). | ||
/// </summary> | ||
public readonly partial struct ColorPaletteWithPresetNameOrMembers : global::System.IEquatable<ColorPaletteWithPresetNameOrMembers> | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
#if NET6_0_OR_GREATER | ||
public global::Ideogram.ColorPaletteWithPresetName? { get; init; } | ||
#else | ||
public global::Ideogram.ColorPaletteWithPresetName? { get; } | ||
#endif | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
#if NET6_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof())] | ||
#endif | ||
public bool Is => != null; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public static implicit operator ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithPresetName value) => new ColorPaletteWithPresetNameOrMembers(value); | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public static implicit operator global::Ideogram.ColorPaletteWithPresetName?(ColorPaletteWithPresetNameOrMembers @this) => @this.; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithPresetName? value) | ||
{ | ||
= value; | ||
} | ||
|
||
/// <summary> | ||
/// A color palette represented only via its members | ||
/// </summary> | ||
#if NET6_0_OR_GREATER | ||
public global::Ideogram.ColorPaletteWithMembers? { get; init; } | ||
#else | ||
public global::Ideogram.ColorPaletteWithMembers? { get; } | ||
#endif | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
#if NET6_0_OR_GREATER | ||
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof())] | ||
#endif | ||
public bool Is => != null; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public static implicit operator ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithMembers value) => new ColorPaletteWithPresetNameOrMembers(value); | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public static implicit operator global::Ideogram.ColorPaletteWithMembers?(ColorPaletteWithPresetNameOrMembers @this) => @this.; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithMembers? value) | ||
{ | ||
= value; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public ColorPaletteWithPresetNameOrMembers( | ||
global::Ideogram.ColorPaletteWithPresetName? , | ||
global::Ideogram.ColorPaletteWithMembers? | ||
) | ||
{ | ||
= ; | ||
= ; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public object? Object => | ||
as object ?? | ||
as object | ||
; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public bool Validate() | ||
{ | ||
return Is && !Is || !Is && Is; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public override int GetHashCode() | ||
{ | ||
var fields = new object?[] | ||
{ | ||
, | ||
typeof(global::Ideogram.ColorPaletteWithPresetName), | ||
, | ||
typeof(global::Ideogram.ColorPaletteWithMembers), | ||
}; | ||
const int offset = unchecked((int)2166136261); | ||
const int prime = 16777619; | ||
static int HashCodeAggregator(int hashCode, object? value) => value == null | ||
? (hashCode ^ 0) * prime | ||
: (hashCode ^ value.GetHashCode()) * prime; | ||
return fields.Aggregate(offset, HashCodeAggregator); | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public bool Equals(ColorPaletteWithPresetNameOrMembers other) | ||
{ | ||
return | ||
global::System.Collections.Generic.EqualityComparer<global::Ideogram.ColorPaletteWithPresetName?>.Default.Equals(, other.) && | ||
global::System.Collections.Generic.EqualityComparer<global::Ideogram.ColorPaletteWithMembers?>.Default.Equals(, other.) | ||
; | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public static bool operator ==(ColorPaletteWithPresetNameOrMembers obj1, ColorPaletteWithPresetNameOrMembers obj2) | ||
{ | ||
return global::System.Collections.Generic.EqualityComparer<ColorPaletteWithPresetNameOrMembers>.Default.Equals(obj1, obj2); | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public static bool operator !=(ColorPaletteWithPresetNameOrMembers obj1, ColorPaletteWithPresetNameOrMembers obj2) | ||
{ | ||
return !(obj1 == obj2); | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
public override bool Equals(object? obj) | ||
{ | ||
return obj is ColorPaletteWithPresetNameOrMembers o && Equals(o); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.