Skip to content
Merged
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
Expand Up @@ -14,19 +14,28 @@ namespace Ideogram
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<object>), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(string))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(int))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(long))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<string>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetReferenceUsageResponse))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Ideogram.AssetReferenceUsageItem>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetReferenceUsageItem))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetIdentifier))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList<global::Ideogram.AttributeInfo>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeInfo))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType), TypeInfoPropertyName = "AssetType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeValueType), TypeInfoPropertyName = "AttributeValueType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(long?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AssetType?), TypeInfoPropertyName = "NullableAssetType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Ideogram.AttributeValueType?), TypeInfoPropertyName = "NullableAttributeValueType2")]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<string>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Ideogram.AssetReferenceUsageItem>))]
[global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List<global::Ideogram.AttributeInfo>))]
internal sealed partial class AssetReferenceUsageSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext
{
}
Expand Down Expand Up @@ -98,7 +107,11 @@ public override bool CanConvert(global::System.Type typeToConvert)
return
typeToConvert == typeof(global::Ideogram.AssetType)

|| typeToConvert == typeof(global::Ideogram.AssetType?);
|| typeToConvert == typeof(global::Ideogram.AssetType?)

|| typeToConvert == typeof(global::Ideogram.AttributeValueType)

|| typeToConvert == typeof(global::Ideogram.AttributeValueType?);
}

public override global::System.Text.Json.Serialization.JsonConverter CreateConverter(
Expand All @@ -114,6 +127,16 @@ public override bool CanConvert(global::System.Type typeToConvert)
{
return new global::Ideogram.JsonConverters.AssetTypeNullableJsonConverter();
}

if (typeToConvert == typeof(global::Ideogram.AttributeValueType))
{
return new global::Ideogram.JsonConverters.AttributeValueTypeJsonConverter();
}

if (typeToConvert == typeof(global::Ideogram.AttributeValueType?))
{
return new global::Ideogram.JsonConverters.AttributeValueTypeNullableJsonConverter();
}
throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ public partial class AssetReferenceUsageClient
};
partial void PrepareGetAssetReferenceUsageArguments(
global::System.Net.Http.HttpClient httpClient,
ref int? limit,
global::System.Collections.Generic.IList<string>? collectionIds,
ref bool? includeCollections,
ref global::System.DateTime startDate,
ref global::System.DateTime endDate,
ref string? cursor);
partial void PrepareGetAssetReferenceUsageRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
int? limit,
global::System.Collections.Generic.IList<string>? collectionIds,
bool? includeCollections,
global::System.DateTime startDate,
global::System.DateTime endDate,
Expand All @@ -49,8 +53,12 @@ partial void ProcessGetAssetReferenceUsageResponseContent(

/// <summary>
/// Rank edit reference assets used by organization requests<br/>
/// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.
/// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.
/// </summary>
/// <param name="limit">
/// Default Value: 50
/// </param>
/// <param name="collectionIds"></param>
/// <param name="includeCollections">
/// Default Value: false
/// </param>
Expand All @@ -63,6 +71,8 @@ partial void ProcessGetAssetReferenceUsageResponseContent(
public async global::System.Threading.Tasks.Task<global::Ideogram.AssetReferenceUsageResponse> GetAssetReferenceUsageAsync(
global::System.DateTime startDate,
global::System.DateTime endDate,
int? limit = default,
global::System.Collections.Generic.IList<string>? collectionIds = default,
bool? includeCollections = default,
string? cursor = default,
global::Ideogram.AutoSDKRequestOptions? requestOptions = default,
Expand All @@ -71,6 +81,8 @@ partial void ProcessGetAssetReferenceUsageResponseContent(
var __response = await GetAssetReferenceUsageAsResponseAsync(
startDate: startDate,
endDate: endDate,
limit: limit,
collectionIds: collectionIds,
includeCollections: includeCollections,
cursor: cursor,
requestOptions: requestOptions,
Expand All @@ -81,8 +93,12 @@ partial void ProcessGetAssetReferenceUsageResponseContent(
}
/// <summary>
/// Rank edit reference assets used by organization requests<br/>
/// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.
/// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.
/// </summary>
/// <param name="limit">
/// Default Value: 50
/// </param>
/// <param name="collectionIds"></param>
/// <param name="includeCollections">
/// Default Value: false
/// </param>
Expand All @@ -95,6 +111,8 @@ partial void ProcessGetAssetReferenceUsageResponseContent(
public async global::System.Threading.Tasks.Task<global::Ideogram.AutoSDKHttpResponse<global::Ideogram.AssetReferenceUsageResponse>> GetAssetReferenceUsageAsResponseAsync(
global::System.DateTime startDate,
global::System.DateTime endDate,
int? limit = default,
global::System.Collections.Generic.IList<string>? collectionIds = default,
bool? includeCollections = default,
string? cursor = default,
global::Ideogram.AutoSDKRequestOptions? requestOptions = default,
Expand All @@ -104,6 +122,8 @@ partial void ProcessGetAssetReferenceUsageResponseContent(
client: HttpClient);
PrepareGetAssetReferenceUsageArguments(
httpClient: HttpClient,
limit: ref limit,
collectionIds: collectionIds,
includeCollections: ref includeCollections,
startDate: ref startDate,
endDate: ref endDate,
Expand Down Expand Up @@ -136,6 +156,8 @@ partial void ProcessGetAssetReferenceUsageResponseContent(
path: "/v2/assets/reference-usage",
baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("limit", limit?.ToString())
.AddOptionalParameter("collection_ids", collectionIds, delimiter: ",", explode: true)
.AddOptionalParameter("include_collections", includeCollections?.ToString().ToLowerInvariant())
.AddRequiredParameter("start_date", startDate.ToString("yyyy-MM-dd"))
.AddRequiredParameter("end_date", endDate.ToString("yyyy-MM-dd"))
Expand Down Expand Up @@ -181,6 +203,8 @@ partial void ProcessGetAssetReferenceUsageResponseContent(
PrepareGetAssetReferenceUsageRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
limit: limit,
collectionIds: collectionIds,
includeCollections: includeCollections,
startDate: startDate,
endDate: endDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ public partial interface IAssetReferenceUsageClient
{
/// <summary>
/// Rank edit reference assets used by organization requests<br/>
/// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.
/// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.
/// </summary>
/// <param name="limit">
/// Default Value: 50
/// </param>
/// <param name="collectionIds"></param>
/// <param name="includeCollections">
/// Default Value: false
/// </param>
Expand All @@ -20,14 +24,20 @@ public partial interface IAssetReferenceUsageClient
global::System.Threading.Tasks.Task<global::Ideogram.AssetReferenceUsageResponse> GetAssetReferenceUsageAsync(
global::System.DateTime startDate,
global::System.DateTime endDate,
int? limit = default,
global::System.Collections.Generic.IList<string>? collectionIds = default,
bool? includeCollections = default,
string? cursor = default,
global::Ideogram.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Rank edit reference assets used by organization requests<br/>
/// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.
/// Counts completed requests made by the authenticated organization that used each existing asset as an edit input during the UTC date range. Direct file uploads without saved asset identifiers are excluded. Results are independent of current asset ownership, collection membership, and sharing. Returning an identifier does not grant access to its image. Tracking begins when enabled; earlier history is not included. Returns 50 assets per page by default, up to 100 with limit. Rankings may change between pages when daily counts are updated; cursors do not pin a historical snapshot.
/// </summary>
/// <param name="limit">
/// Default Value: 50
/// </param>
/// <param name="collectionIds"></param>
/// <param name="includeCollections">
/// Default Value: false
/// </param>
Expand All @@ -40,6 +50,8 @@ public partial interface IAssetReferenceUsageClient
global::System.Threading.Tasks.Task<global::Ideogram.AutoSDKHttpResponse<global::Ideogram.AssetReferenceUsageResponse>> GetAssetReferenceUsageAsResponseAsync(
global::System.DateTime startDate,
global::System.DateTime endDate,
int? limit = default,
global::System.Collections.Generic.IList<string>? collectionIds = default,
bool? includeCollections = default,
string? cursor = default,
global::Ideogram.AutoSDKRequestOptions? requestOptions = default,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace Ideogram.JsonConverters
{
/// <inheritdoc />
public sealed class AttributeValueTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Ideogram.AttributeValueType>
{
/// <inheritdoc />
public override global::Ideogram.AttributeValueType Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case global::System.Text.Json.JsonTokenType.String:
{
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::Ideogram.AttributeValueTypeExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::Ideogram.AttributeValueType)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::Ideogram.AttributeValueType);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
}

return default;
}

/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::Ideogram.AttributeValueType value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::Ideogram.AttributeValueTypeExtensions.ToValueString(value));
}
}
}
Loading
Loading