Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Add Color Palette Classes, Enums, and JSON Converters in Ideogram Namespace #10

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>();
}
}
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,
};
}
}
}
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>();
}
}
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>();
}
}
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
Comment on lines +17 to +20
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Property Name in Property Declaration

The property declaration is missing a property name, which will result in a syntax error.

Apply this diff to fix the issue:

#if NET6_0_OR_GREATER
-            public global::Ideogram.ColorPaletteWithPresetName?  { get; init; }
+            public global::Ideogram.ColorPaletteWithPresetName? PresetName { get; init; }
#else
-            public global::Ideogram.ColorPaletteWithPresetName?  { get; }
+            public global::Ideogram.ColorPaletteWithPresetName? PresetName { get; }
#endif
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public global::Ideogram.ColorPaletteWithPresetName? { get; init; }
#else
public global::Ideogram.ColorPaletteWithPresetName? { get; }
#endif
#if NET6_0_OR_GREATER
public global::Ideogram.ColorPaletteWithPresetName? PresetName { get; init; }
#else
public global::Ideogram.ColorPaletteWithPresetName? PresetName { get; }
#endif


/// <summary>
///
/// </summary>
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof())]
#endif
public bool Is => != null;

Comment on lines +28 to +29
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Identifier in Property

The property Is is using an incomplete expression != null, which is missing the variable or property being checked.

Apply this diff to fix the issue:

-            public bool Is =>  != null;
+            public bool HasPresetName => PresetName != null;

Note: Renamed the property to HasPresetName to clarify its purpose and avoid naming conflicts.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public bool Is => != null;
public bool HasPresetName => PresetName != 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.;

Comment on lines +38 to +39
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Incomplete Expression in Implicit Operator

The implicit operator is returning @this., which is incomplete and missing the property name.

Apply this diff to fix the issue:

-            public static implicit operator global::Ideogram.ColorPaletteWithPresetName?(ColorPaletteWithPresetNameOrMembers @this) => @this.;
+            public static implicit operator global::Ideogram.ColorPaletteWithPresetName?(ColorPaletteWithPresetNameOrMembers @this) => @this.PresetName;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static implicit operator global::Ideogram.ColorPaletteWithPresetName?(ColorPaletteWithPresetNameOrMembers @this) => @this.;
public static implicit operator global::Ideogram.ColorPaletteWithPresetName?(ColorPaletteWithPresetNameOrMembers @this) => @this.PresetName;

/// <summary>
///
/// </summary>
public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithPresetName? value)
{
= value;
}
Comment on lines +43 to +46
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Property Name in Constructor Assignment

In the constructor, the property assignment is missing the property name.

Apply this diff to fix the issue:

public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithPresetName? value)
{
-                = value;
+            PresetName = value;
}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithPresetName? value)
{
= value;
}
public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithPresetName? value)
{
PresetName = 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
Comment on lines +52 to +55
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Property Name in Property Declaration

The property declaration is missing a property name, which will result in a syntax error.

Apply this diff to fix the issue:

#if NET6_0_OR_GREATER
-            public global::Ideogram.ColorPaletteWithMembers?  { get; init; }
+            public global::Ideogram.ColorPaletteWithMembers? Members { get; init; }
#else
-            public global::Ideogram.ColorPaletteWithMembers?  { get; }
+            public global::Ideogram.ColorPaletteWithMembers? Members { get; }
#endif
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public global::Ideogram.ColorPaletteWithMembers? { get; init; }
#else
public global::Ideogram.ColorPaletteWithMembers? { get; }
#endif
#if NET6_0_OR_GREATER
public global::Ideogram.ColorPaletteWithMembers? Members { get; init; }
#else
public global::Ideogram.ColorPaletteWithMembers? Members { get; }
#endif


/// <summary>
///
/// </summary>
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof())]
#endif
public bool Is => != null;

Comment on lines +63 to +64
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Identifier in Property

The property Is is using an incomplete expression != null, which is missing the variable or property being checked.

Apply this diff to fix the issue:

-            public bool Is =>  != null;
+            public bool HasMembers => Members != null;

Note: Renamed the property to HasMembers to clarify its purpose and avoid naming conflicts.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public bool Is => != null;
public bool HasMembers => Members != 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.;

Comment on lines +73 to +74
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Incomplete Expression in Implicit Operator

The implicit operator is returning @this., which is incomplete and missing the property name.

Apply this diff to fix the issue:

-            public static implicit operator global::Ideogram.ColorPaletteWithMembers?(ColorPaletteWithPresetNameOrMembers @this) => @this.;
+            public static implicit operator global::Ideogram.ColorPaletteWithMembers?(ColorPaletteWithPresetNameOrMembers @this) => @this.Members;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static implicit operator global::Ideogram.ColorPaletteWithMembers?(ColorPaletteWithPresetNameOrMembers @this) => @this.;
public static implicit operator global::Ideogram.ColorPaletteWithMembers?(ColorPaletteWithPresetNameOrMembers @this) => @this.Members;

/// <summary>
///
/// </summary>
public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithMembers? value)
{
= value;
}
Comment on lines +78 to +81
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Property Name in Constructor Assignment

In the constructor, the property assignment is missing the property name.

Apply this diff to fix the issue:

public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithMembers? value)
{
-                = value;
+            Members = value;
}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithMembers? value)
{
= value;
}
public ColorPaletteWithPresetNameOrMembers(global::Ideogram.ColorPaletteWithMembers? value)
{
Members = value;
}


/// <summary>
///
/// </summary>
public ColorPaletteWithPresetNameOrMembers(
global::Ideogram.ColorPaletteWithPresetName? ,
global::Ideogram.ColorPaletteWithMembers?
)
{
= ;
= ;
}
Comment on lines +86 to +93
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Property Names and Variable Names in Constructor

In the constructor, property assignments are missing both property names and parameter names, leading to syntax errors.

Apply this diff to fix the issue:

public ColorPaletteWithPresetNameOrMembers(
    global::Ideogram.ColorPaletteWithPresetName? presetName,
    global::Ideogram.ColorPaletteWithMembers? members
    )
{
-                = ;
-                = ;
+            PresetName = presetName;
+            Members = members;
}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public ColorPaletteWithPresetNameOrMembers(
global::Ideogram.ColorPaletteWithPresetName? ,
global::Ideogram.ColorPaletteWithMembers?
)
{
= ;
= ;
}
public ColorPaletteWithPresetNameOrMembers(
global::Ideogram.ColorPaletteWithPresetName? presetName,
global::Ideogram.ColorPaletteWithMembers? members
)
{
PresetName = presetName;
Members = members;
}


/// <summary>
///
/// </summary>
public object? Object =>
as object ??
as object
;
Comment on lines +98 to +101
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Property Names in Object Getter

The Object property getter is missing property names, resulting in incomplete expressions.

Apply this diff to fix the issue:

public object? Object =>
-                 as object ??
-                 as object ;
+            PresetName as object ??
+            Members as object;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public object? Object =>
as object ??
as object
;
public object? Object =>
PresetName as object ??
Members as object;

Syntax Error: Missing Property Names in Object Getter

The Object property getter is missing property names, resulting in incomplete expressions.

Apply this diff to fix the issue:

public object? Object =>
-                 as object ??
-                 as object ;
+            PresetName as object ??
+            Members as object;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public object? Object =>
as object ??
as object
;
public object? Object =>
PresetName as object ??
Members as object;


/// <summary>
///
/// </summary>
public bool Validate()
{
return Is && !Is || !Is && Is;
}
Comment on lines +106 to +109
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update Validation Logic After Renaming Properties

After renaming the Is properties to HasPresetName and HasMembers, the Validate method should be updated accordingly.

Apply this diff to fix the method:

public bool Validate()
{
-                return Is && !Is || !Is && Is;
+            return (HasPresetName && !HasMembers) || (!HasPresetName && HasMembers);
}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public bool Validate()
{
return Is && !Is || !Is && Is;
}
public bool Validate()
{
return (HasPresetName && !HasMembers) || (!HasPresetName && HasMembers);
}


/// <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);
}
Comment on lines +116 to +129
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Property Names in GetHashCode Method

In the GetHashCode method, the fields array is missing property names, which will cause errors during hash code computation.

Apply this diff to fix the issue:

var fields = new object?[]
{
-                    ,
+                PresetName,
    typeof(global::Ideogram.ColorPaletteWithPresetName),
-                    ,
+                Members,
    typeof(global::Ideogram.ColorPaletteWithMembers),
};
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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);
}
var fields = new object?[]
{
PresetName,
typeof(global::Ideogram.ColorPaletteWithPresetName),
Members,
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.)
;
Comment on lines +134 to +139
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax Error: Missing Property Names in Equality Comparison

In the Equals method, the properties used in the comparison are missing, leading to syntax errors.

Apply this diff to fix the issue:

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.) ;
+                global::System.Collections.Generic.EqualityComparer<global::Ideogram.ColorPaletteWithPresetName?>.Default.Equals(PresetName, other.PresetName) &&
+                global::System.Collections.Generic.EqualityComparer<global::Ideogram.ColorPaletteWithMembers?>.Default.Equals(Members, other.Members);
}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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.)
;
public bool Equals(ColorPaletteWithPresetNameOrMembers other)
{
return
global::System.Collections.Generic.EqualityComparer<global::Ideogram.ColorPaletteWithPresetName?>.Default.Equals(PresetName, other.PresetName) &&
global::System.Collections.Generic.EqualityComparer<global::Ideogram.ColorPaletteWithMembers?>.Default.Equals(Members, other.Members);
}

}

/// <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);
}
}
}
7 changes: 7 additions & 0 deletions src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ public sealed partial class ImageRequest
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ResolutionJsonConverter))]
public global::Ideogram.Resolution? Resolution { get; set; }

/// <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>
[global::System.Text.Json.Serialization.JsonPropertyName("color_palette")]
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::Ideogram.JsonConverters.ColorPaletteWithPresetNameOrMembersJsonConverter))]
public global::Ideogram.ColorPaletteWithPresetNameOrMembers? ColorPalette { get; set; }

/// <summary>
/// Additional properties that are not explicitly defined in the schema
/// </summary>
Expand Down
Loading