-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
WalkthroughThe changes introduce several new classes, enums, and JSON converters related to color palettes within the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ImageRequest
participant ColorPalette
participant JsonConverter
User->>ImageRequest: Create request with color palette
ImageRequest->>ColorPalette: Specify color palette (preset or members)
ColorPalette->>JsonConverter: Serialize color palette to JSON
JsonConverter-->>ImageRequest: Return serialized JSON
User-->>ImageRequest: Submit request with JSON
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 23
Outside diff range and nitpick comments (3)
src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs (1)
6-8
: Improve the class documentation.Consider providing a more detailed description of the
ColorPaletteWithPresetName
class in the XML documentation comment. Explain what a color palette preset is, how it relates to theColorPalettePresetName
enum, and how this class is intended to be used.src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs (1)
14-15
: Enhancement: Add Descriptions to XML Documentation CommentsMultiple methods and properties have XML documentation comments with empty
<summary>
tags. Providing meaningful descriptions improves code readability and maintainability.Consider adding appropriate summaries to the following sections:
- Lines 14-15: Property or method summary is missing.
- Lines 22-24: Property or method summary is missing.
- Lines 30-32: Method summary is missing.
- Lines 35-37: Method summary is missing.
- Lines 40-42: Method summary is missing.
- Lines 48-50: Property summary is missing.
- Lines 57-59: Property or method summary is missing.
- Lines 65-67: Method summary is missing.
- Lines 70-72: Method summary is missing.
- Lines 75-77: Method summary is missing.
- Lines 83-85: Constructor summary is missing.
- Lines 95-97: Property summary is missing.
- Lines 103-105: Method summary is missing.
- Lines 111-113: Method summary is missing.
- Lines 131-133: Method summary is missing.
- Lines 142-144: Operator method summary is missing.
- Lines 150-152: Operator method summary is missing.
- Lines 158-160: Method summary is missing.
Adding meaningful descriptions will help other developers understand the purpose and usage of these members.
Also applies to: 22-24, 30-32, 35-37, 40-42, 48-50, 57-59, 65-67, 70-72, 75-77, 83-85, 95-97, 103-105, 111-113, 131-133, 142-144, 150-152, 158-160
src/libs/Ideogram/Generated/JsonSerializerContextTypes.g.cs (1)
72-212
: Consider enhancing property naming for clarityThe properties are named sequentially (e.g.,
Type14
,Type15
, ...,Type49
), which may reduce code readability and maintainability. Descriptive property names can improve understanding and make the codebase easier to navigate. If possible, consider renaming the properties to reflect their purpose or associated types.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (12)
- src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs (1 hunks)
- src/libs/Ideogram/Generated/Ideogram.Models.ColorPalettePresetName.g.cs (1 hunks)
- src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs (1 hunks)
- src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs (1 hunks)
- src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetNameOrMembers.g.cs (1 hunks)
- src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs (1 hunks)
- src/libs/Ideogram/Generated/JsonConverters.ColorPalettePresetName.g.cs (1 hunks)
- src/libs/Ideogram/Generated/JsonConverters.ColorPalettePresetNameNullable.g.cs (1 hunks)
- src/libs/Ideogram/Generated/JsonConverters.ColorPaletteWithPresetNameOrMembers.g.cs (1 hunks)
- src/libs/Ideogram/Generated/JsonSerializerContext.g.cs (1 hunks)
- src/libs/Ideogram/Generated/JsonSerializerContextTypes.g.cs (1 hunks)
- src/libs/Ideogram/openapi.yaml (2 hunks)
Additional context used
GitHub Check: Test / Build, test and publish
src/libs/Ideogram/Generated/JsonConverters.ColorPaletteWithPresetNameOrMembers.g.cs
[failure] 20-20:
Invalid expression term '='
[failure] 20-20:
Syntax error, ':' expected
[failure] 20-20:
Invalid expression term ';'
[failure] 24-24:
Invalid expression term '='
[failure] 32-32:
Invalid expression term '='
[failure] 32-32:
Syntax error, ':' expected
[failure] 32-32:
Invalid expression term ';'
[failure] 36-36:
Invalid expression term '='
[failure] 43-43:
Argument missing
[failure] 44-44:
Invalid expression term ')'
Additional comments not posted (16)
src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithMembers.g.cs (3)
1-10
: LGTM!The namespace and class definition follow the C# naming conventions and the XML documentation comment provides a clear description of the class purpose.
11-17
: LGTM!The
Members
property is correctly defined with the required attribute and has a clear XML documentation comment.
18-24
: LGTM!The
AdditionalProperties
property is correctly defined with the[JsonExtensionData]
attribute and has a clear XML documentation comment.src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteWithPresetName.g.cs (2)
11-18
: LGTM!The
Name
property is well-defined with appropriate attributes and documentation.
20-24
: LGTM!The
AdditionalProperties
property is well-defined with appropriate attributes and documentation.src/libs/Ideogram/Generated/Ideogram.Models.ColorPaletteMember.g.cs (3)
15-17
: LGTM!The
ColorHex
property is correctly defined as a required string with a clear description and example. The JSON property name follows the snake_case convention.
23-25
: LGTM!The
ColorWeight
property is correctly defined as a required double with a clear description and example. The JSON property name follows the snake_case convention.
30-31
: LGTM!The
AdditionalProperties
property is correctly defined as a dictionary with theJsonExtensionData
attribute. This allows the class to handle additional JSON properties flexibly.src/libs/Ideogram/Generated/JsonSerializerContext.g.cs (1)
26-28
: LGTM!The addition of the new JSON converters for color palette-related data types is consistent with the PR objectives and the AI-generated summary. The changes expand the serialization capabilities of the
JsonSerializerContext
without modifying existing functionality.The converters are correctly added to the
Converters
array attribute of theJsonSourceGenerationOptions
attribute, ensuring their automatic usage during JSON serialization and deserialization.No issues or concerns are identified with these changes.
src/libs/Ideogram/Generated/JsonConverters.ColorPalettePresetName.g.cs (3)
6-6
: LGTM!The class declaration is correct and follows best practices.
9-36
: LGTM!The
Read
method implementation is correct and handles deserialization of theColorPalettePresetName
enum from both string and number JSON tokens.
39-47
: LGTM!The
Write
method implementation is correct and handles serialization of theColorPalettePresetName
enum to JSON using theToValueString
extension method.src/libs/Ideogram/Generated/Ideogram.Models.ColorPalettePresetName.g.cs (1)
1-88
: LGTM!The code defining the
ColorPalettePresetName
enum and its associated extension methods looks good:
- The enum values are well-defined and represent a set of predefined color palette presets.
- The
ToValueString
andToEnum
extension methods provide a convenient way to convert between the enum and string representations.- The methods are implemented using switch expressions, which is a concise and efficient approach.
- The code follows naming conventions and is well-structured.
One minor suggestion: Consider adding brief descriptions to the empty XML documentation comments for each enum value to provide more context.
Also, keep in mind that this is a generated code file (as indicated by the ".g.cs" extension), so any manual changes made directly to this file may be overwritten by the code generation process. If changes are needed, they should likely be made in the code generation template or configuration.
src/libs/Ideogram/Generated/Ideogram.Models.ImageRequest.g.cs (1)
74-79
: LGTM!The new
ColorPalette
property is well-designed and documented. The use of a custom JSON converter and nullable type provides flexibility in specifying color palettes for image generation.src/libs/Ideogram/openapi.yaml (1)
Line range hint
456-1116
: Excellent addition of the color palette feature!The introduction of the
color_palette
property in theImageRequest
schema, along with the supporting schemas forColorPaletteWithPresetNameOrMembers
,ColorPaletteWithPresetName
,ColorPaletteWithMembers
,ColorPaletteMember
, andColorPaletteMembers
, greatly enhances the functionality and flexibility of specifying color palettes for image generation.The union type approach for
ColorPaletteWithPresetNameOrMembers
provides a convenient way to use predefined color palettes through theColorPaletteWithPresetName
schema, while also allowing for fine-grained control over custom color palettes using theColorPaletteWithMembers
schema.The
ColorPaletteMember
schema ensures a consistent structure for defining individual colors and their weights, and theColorPaletteMembers
schema enforces reasonable constraints on the number of color members in a palette.Overall, this feature offers users the flexibility to choose between quick and easy preset color schemes or precise custom color compositions, catering to different preferences and requirements. The implementation is well-structured and thoughtfully designed.
src/libs/Ideogram/Generated/JsonSerializerContextTypes.g.cs (1)
72-212
: Verify that updates to property types are reflected across the codebaseThe property types in
JsonSerializerContextTypes
have been updated to new classes related to color palettes and image requests. These changes may impact serialization and any code that relies on these properties. Please verify that all references and usages of these properties have been updated accordingly to prevent runtime errors or serialization issues.Run the following script to locate usages of the updated properties:
Verification successful
Changes to property types are isolated and do not require further updates
The updated property types (Type14 to Type49) are only present in the generated file
src/libs/Ideogram/Generated/JsonSerializerContextTypes.g.cs
. There are no direct references to these types in other parts of the codebase. As this is a generated file, the changes are likely handled automatically by the code generation process and do not require manual updates in other areas of the project.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Find all references to the updated properties in the codebase. # List of updated property names properties="Type14 Type15 Type16 Type17 Type18 Type19 Type20 Type21 Type22 Type23 Type24 Type25 Type26 Type27 Type28 Type29 Type30 Type31 Type32 Type33 Type34 Type35 Type36 Type37 Type38 Type39 Type40 Type41 Type42 Type43 Type44 Type45 Type46 Type47 Type48 Type49" # Loop through each property and search for its usage for prop in $properties; do echo "Searching for usages of $prop:" rg --type cs "\b$prop\b" --context 5 doneLength of output: 42739
return default; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw JsonException
instead of returning default when parsing fails
Returning a default value may mask parsing errors and lead to unexpected behavior. Throwing a JsonException
explicitly indicates a failure to parse the JSON value.
Apply this diff to throw an exception on parsing failure:
- return default;
+ throw new global::System.Text.Json.JsonException("Failed to parse ColorPalettePresetName from the provided JSON 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.
return default; | |
} | |
throw new global::System.Text.Json.JsonException("Failed to parse ColorPalettePresetName from the provided JSON value."); | |
} |
switch (reader.TokenType) | ||
{ | ||
case global::System.Text.Json.JsonTokenType.String: | ||
{ | ||
var stringValue = reader.GetString(); | ||
if (stringValue != null) | ||
{ | ||
return global::Ideogram.ColorPalettePresetNameExtensions.ToEnum(stringValue); | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Ideogram.ColorPalettePresetName)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use JsonException
instead of ArgumentOutOfRangeException
for unexpected token types
In the Read
method, throwing a JsonException
when encountering an unexpected JsonTokenType
provides clearer context about JSON parsing errors than ArgumentOutOfRangeException
, which is typically used for invalid arguments.
Apply this diff to update the exception handling:
default:
- throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ throw new global::System.Text.Json.JsonException($"Unexpected token type '{reader.TokenType}' when parsing ColorPalettePresetName.");
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.
switch (reader.TokenType) | |
{ | |
case global::System.Text.Json.JsonTokenType.String: | |
{ | |
var stringValue = reader.GetString(); | |
if (stringValue != null) | |
{ | |
return global::Ideogram.ColorPalettePresetNameExtensions.ToEnum(stringValue); | |
} | |
break; | |
} | |
case global::System.Text.Json.JsonTokenType.Number: | |
{ | |
var numValue = reader.GetInt32(); | |
return (global::Ideogram.ColorPalettePresetName)numValue; | |
} | |
default: | |
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | |
} | |
return default; | |
} | |
switch (reader.TokenType) | |
{ | |
case global::System.Text.Json.JsonTokenType.String: | |
{ | |
var stringValue = reader.GetString(); | |
if (stringValue != null) | |
{ | |
return global::Ideogram.ColorPalettePresetNameExtensions.ToEnum(stringValue); | |
} | |
break; | |
} | |
case global::System.Text.Json.JsonTokenType.Number: | |
{ | |
var numValue = reader.GetInt32(); | |
return (global::Ideogram.ColorPalettePresetName)numValue; | |
} | |
default: | |
throw new global::System.Text.Json.JsonException($"Unexpected token type '{reader.TokenType}' when parsing ColorPalettePresetName."); | |
} | |
return default; | |
} |
|
||
var | ||
readerCopy = reader; | ||
global::Ideogram.ColorPaletteWithPresetName? = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare variable 'colorPaletteWithPresetName' before assignment
At lines 20 and 25, the variable colorPaletteWithPresetName
is being assigned a value without being properly declared. You need to specify the variable name before the =
operator.
Apply this diff to fix the issue:
- global::Ideogram.ColorPaletteWithPresetName? = default;
+ global::Ideogram.ColorPaletteWithPresetName? colorPaletteWithPresetName = default;
...
- = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
+ colorPaletteWithPresetName = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
Also applies to: 25-25
Tools
GitHub Check: Test / Build, test and publish
[failure] 20-20:
Invalid expression term '='
[failure] 20-20:
Syntax error, ':' expected
[failure] 20-20:
Invalid expression term ';'
} | ||
|
||
readerCopy = reader; | ||
global::Ideogram.ColorPaletteWithMembers? = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare variable 'colorPaletteWithMembers' before assignment
Similarly, at lines 32 and 37, the variable colorPaletteWithMembers
is being used without being properly declared. Ensure you specify the variable name before the =
operator.
Apply this diff to fix the issue:
- global::Ideogram.ColorPaletteWithMembers? = default;
+ global::Ideogram.ColorPaletteWithMembers? colorPaletteWithMembers = default;
...
- = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
+ colorPaletteWithMembers = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
Also applies to: 37-37
Tools
GitHub Check: Test / Build, test and publish
[failure] 32-32:
Invalid expression term '='
[failure] 32-32:
Syntax error, ':' expected
[failure] 32-32:
Invalid expression term ';'
var | ||
readerCopy = reader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix incomplete variable declaration of 'readerCopy'
There is an incomplete variable declaration at lines 18-19. The var
keyword should be followed by the variable name before initialization.
Apply this diff to fix the variable declaration:
- var
- readerCopy = reader;
+ var readerCopy = reader;
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.
var | |
readerCopy = reader; | |
var readerCopy = reader; |
public global::Ideogram.ColorPaletteWithPresetName? { get; init; } | ||
#else | ||
public global::Ideogram.ColorPaletteWithPresetName? { get; } | ||
#endif |
There was a problem hiding this comment.
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.
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 |
public ColorPaletteWithPresetNameOrMembers( | ||
global::Ideogram.ColorPaletteWithPresetName? , | ||
global::Ideogram.ColorPaletteWithMembers? | ||
) | ||
{ | ||
= ; | ||
= ; | ||
} |
There was a problem hiding this comment.
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.
public ColorPaletteWithPresetNameOrMembers( | |
global::Ideogram.ColorPaletteWithPresetName? , | |
global::Ideogram.ColorPaletteWithMembers? | |
) | |
{ | |
= ; | |
= ; | |
} | |
public ColorPaletteWithPresetNameOrMembers( | |
global::Ideogram.ColorPaletteWithPresetName? presetName, | |
global::Ideogram.ColorPaletteWithMembers? members | |
) | |
{ | |
PresetName = presetName; | |
Members = members; | |
} |
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.) | ||
; |
There was a problem hiding this comment.
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.
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); | |
} |
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); | ||
} |
There was a problem hiding this comment.
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.
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); | |
} |
public global::Ideogram.ImageObject? Type28 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public double? Type29 { get; set; } | ||
public bool? Type29 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.RechargeSettingsResponse? Type30 { get; set; } | ||
public global::Ideogram.GenerateImageSafetyError? Type30 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.PostApiSubscriptionResponse? Type31 { get; set; } | ||
public global::Ideogram.ImageSafetyError? Type31 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.PostApiSubscriptionError? Type32 { get; set; } | ||
public global::Ideogram.ManageApiSubscriptionResponse? Type32 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::System.Collections.Generic.IList<string>? Type33 { get; set; } | ||
public global::Ideogram.MetronomeLinks? Type33 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.PostApiSubscriptionRequest? Type34 { get; set; } | ||
public global::Ideogram.RechargeSettings? Type34 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.PostApiReactivateResponse? Type35 { get; set; } | ||
public global::Ideogram.Price? Type35 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.GetApiKeysResponse? Type36 { get; set; } | ||
public global::Ideogram.RechargeSettingsResponse? Type36 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::System.Collections.Generic.IList<global::Ideogram.RedactedApiKey>? Type37 { get; set; } | ||
public global::Ideogram.PostApiSubscriptionResponse? Type37 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.RedactedApiKey? Type38 { get; set; } | ||
public global::Ideogram.PostApiSubscriptionError? Type38 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.PostApiKeyResponse? Type39 { get; set; } | ||
public global::System.Collections.Generic.IList<string>? Type39 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.ManageApiStripeSubscriptionResponse? Type40 { get; set; } | ||
public global::Ideogram.PostApiSubscriptionRequest? Type40 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.GetApiTermsResponse? Type41 { get; set; } | ||
public global::Ideogram.PostApiReactivateResponse? Type41 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.ApiTerms? Type42 { get; set; } | ||
public global::Ideogram.GetApiKeysResponse? Type42 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.PostApiTermsRequest? Type43 { get; set; } | ||
public global::System.Collections.Generic.IList<global::Ideogram.RedactedApiKey>? Type43 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.RedactedApiKey? Type44 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.PostApiKeyResponse? Type45 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.ManageApiStripeSubscriptionResponse? Type46 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.GetApiTermsResponse? Type47 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.ApiTerms? Type48 { get; set; } | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
public global::Ideogram.PostApiTermsRequest? Type49 { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution: Modifications to generated code may be overwritten
This file appears to be auto-generated (as indicated by the .g.cs
extension and the Generated
directory). Manual changes to generated files can be overwritten when the code generation tool runs again. Please ensure that the changes to the property types are made in the code generation templates or source models to persist these updates.
Pull request was closed
Summary by CodeRabbit
Release Notes
New Features
ColorPaletteMember
,ColorPaletteWithMembers
, andColorPaletteWithPresetName
.Documentation
color_palette
property and new schemas for color palette management.