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 @@ -129,17 +129,45 @@ partial void ProcessCreativeUpscaleResponseContent(
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{billing?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((billing).HasValue ? (billing).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"billing\"");
}
if (request.Expire != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Expire}"),
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Expire, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"expire\"");
}
var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty<byte>());
__contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.Imagename is null
? "application/octet-stream"
: (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch
{
".aac" => "audio/aac",
".flac" => "audio/flac",
".gif" => "image/gif",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".json" => "application/json",
".m4a" => "audio/mp4",
".mp3" => "audio/mpeg",
".mp4" => "video/mp4",
".mpeg" => "audio/mpeg",
".mpga" => "audio/mpeg",
".oga" => "audio/ogg",
".ogg" => "audio/ogg",
".opus" => "audio/ogg",
".pdf" => "application/pdf",
".png" => "image/png",
".txt" => "text/plain",
".wav" => "audio/wav",
".weba" => "audio/webm",
".webm" => "video/webm",
".webp" => "image/webp",
_ => "application/octet-stream",
});
__httpRequestContent.Add(
content: __contentImage,
name: "\"image\"",
Expand All @@ -152,21 +180,21 @@ partial void ProcessCreativeUpscaleResponseContent(
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.ImageFormat?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((request.ImageFormat).HasValue ? (request.ImageFormat).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"image_format\"");
}
if (request.ResponseFormat != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.ResponseFormat?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"response_format\"");
}
if (request.Upscale != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Upscale?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((request.Upscale).HasValue ? (request.Upscale).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"upscale\"");
}
__httpRequest.Content = __httpRequestContent;
Expand Down
38 changes: 33 additions & 5 deletions src/libs/Recraft/Generated/Recraft.ImageClient.CrispUpscale.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,45 @@ partial void ProcessCrispUpscaleResponseContent(
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{billing?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((billing).HasValue ? (billing).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"billing\"");
}
if (request.Expire != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Expire}"),
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Expire, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"expire\"");
}
var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty<byte>());
__contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.Imagename is null
? "application/octet-stream"
: (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch
{
".aac" => "audio/aac",
".flac" => "audio/flac",
".gif" => "image/gif",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".json" => "application/json",
".m4a" => "audio/mp4",
".mp3" => "audio/mpeg",
".mp4" => "video/mp4",
".mpeg" => "audio/mpeg",
".mpga" => "audio/mpeg",
".oga" => "audio/ogg",
".ogg" => "audio/ogg",
".opus" => "audio/ogg",
".pdf" => "application/pdf",
".png" => "image/png",
".txt" => "text/plain",
".wav" => "audio/wav",
".weba" => "audio/webm",
".webm" => "video/webm",
".webp" => "image/webp",
_ => "application/octet-stream",
});
__httpRequestContent.Add(
content: __contentImage,
name: "\"image\"",
Expand All @@ -152,21 +180,21 @@ partial void ProcessCrispUpscaleResponseContent(
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.ImageFormat?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((request.ImageFormat).HasValue ? (request.ImageFormat).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"image_format\"");
}
if (request.ResponseFormat != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.ResponseFormat?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"response_format\"");
}
if (request.Upscale != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Upscale?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((request.Upscale).HasValue ? (request.Upscale).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"upscale\"");
}
__httpRequest.Content = __httpRequestContent;
Expand Down
64 changes: 60 additions & 4 deletions src/libs/Recraft/Generated/Recraft.ImageClient.EraseRegion.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,45 @@ partial void ProcessEraseRegionResponseContent(
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{billing?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((billing).HasValue ? (billing).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"billing\"");
}
if (request.Expire != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Expire}"),
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Expire, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"expire\"");
}
var __contentImage = new global::System.Net.Http.ByteArrayContent(request.Image ?? global::System.Array.Empty<byte>());
__contentImage.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.Imagename is null
? "application/octet-stream"
: (global::System.IO.Path.GetExtension(request.Imagename) ?? string.Empty).ToLowerInvariant() switch
{
".aac" => "audio/aac",
".flac" => "audio/flac",
".gif" => "image/gif",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".json" => "application/json",
".m4a" => "audio/mp4",
".mp3" => "audio/mpeg",
".mp4" => "video/mp4",
".mpeg" => "audio/mpeg",
".mpga" => "audio/mpeg",
".oga" => "audio/ogg",
".ogg" => "audio/ogg",
".opus" => "audio/ogg",
".pdf" => "application/pdf",
".png" => "image/png",
".txt" => "text/plain",
".wav" => "audio/wav",
".weba" => "audio/webm",
".webm" => "video/webm",
".webp" => "image/webp",
_ => "application/octet-stream",
});
__httpRequestContent.Add(
content: __contentImage,
name: "\"image\"",
Expand All @@ -152,10 +180,38 @@ partial void ProcessEraseRegionResponseContent(
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.ImageFormat?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((request.ImageFormat).HasValue ? (request.ImageFormat).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"image_format\"");
}
var __contentMask = new global::System.Net.Http.ByteArrayContent(request.Mask ?? global::System.Array.Empty<byte>());
__contentMask.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.Maskname is null
? "application/octet-stream"
: (global::System.IO.Path.GetExtension(request.Maskname) ?? string.Empty).ToLowerInvariant() switch
{
".aac" => "audio/aac",
".flac" => "audio/flac",
".gif" => "image/gif",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".json" => "application/json",
".m4a" => "audio/mp4",
".mp3" => "audio/mpeg",
".mp4" => "video/mp4",
".mpeg" => "audio/mpeg",
".mpga" => "audio/mpeg",
".oga" => "audio/ogg",
".ogg" => "audio/ogg",
".opus" => "audio/ogg",
".pdf" => "application/pdf",
".png" => "image/png",
".txt" => "text/plain",
".wav" => "audio/wav",
".weba" => "audio/webm",
".webm" => "video/webm",
".webp" => "image/webp",
_ => "application/octet-stream",
});
__httpRequestContent.Add(
content: __contentMask,
name: "\"mask\"",
Expand All @@ -168,7 +224,7 @@ partial void ProcessEraseRegionResponseContent(
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.ResponseFormat?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((request.ResponseFormat).HasValue ? (request.ResponseFormat).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"response_format\"");
}
__httpRequest.Content = __httpRequestContent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ partial void ProcessGenerateBackgroundResponseContent(
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{billing?.ToValueString()}"),
content: new global::System.Net.Http.StringContent((billing).HasValue ? (billing).GetValueOrDefault().ToValueString() : string.Empty),
name: "\"billing\"");
}
__httpRequest.Content = __httpRequestContent;
Expand Down
Loading
Loading