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 @@ -125,7 +125,7 @@ partial void ProcessGetMaybeBatchResultsResponseContent(
PrepareGetMaybeBatchResultsRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
jobId: jobId);
jobId: jobId!);

return __httpRequest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ partial void ProcessGetDatasetResponseContent(
PrepareGetDatasetRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
datasetId: datasetId);
datasetId: datasetId!);

return __httpRequest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ partial void ProcessTrainDatasetModelResponseContent(
PrepareTrainDatasetModelRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
datasetId: datasetId,
datasetId: datasetId!,
request: request);

return __httpRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ partial void ProcessUploadDatasetAssetsResponseContent(
}
var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{datasetId}"),
content: new global::System.Net.Http.StringContent(datasetId ?? string.Empty),
name: "\"dataset_id\"");
for (var __iFiles = 0; __iFiles < request.Files.Count; __iFiles++)
{
var __contentFiles = new global::System.Net.Http.ByteArrayContent(request.Files[__iFiles]);
__contentFiles.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue("application/octet-stream");
__httpRequestContent.Add(
content: __contentFiles,
name: "\"files\"",
Expand All @@ -150,7 +151,7 @@ partial void ProcessUploadDatasetAssetsResponseContent(
PrepareUploadDatasetAssetsRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
datasetId: datasetId,
datasetId: datasetId!,
request: request);

return __httpRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,34 @@ partial void ProcessPostEditImageResponseContent(
}
var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
var __contentImageFile = new global::System.Net.Http.ByteArrayContent(request.ImageFile ?? global::System.Array.Empty<byte>());
__contentImageFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.ImageFilename is null
? "application/octet-stream"
: (global::System.IO.Path.GetExtension(request.ImageFilename) ?? 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: __contentImageFile,
name: "\"image_file\"",
Expand All @@ -131,6 +159,34 @@ partial void ProcessPostEditImageResponseContent(
__contentImageFile.Headers.ContentDisposition.FileNameStar = null;
}
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 @@ -140,37 +196,37 @@ partial void ProcessPostEditImageResponseContent(
__contentMask.Headers.ContentDisposition.FileNameStar = null;
}
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Prompt}"),
content: new global::System.Net.Http.StringContent(request.Prompt ?? string.Empty),
name: "\"prompt\"");
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Model.ToValueString()}"),
content: new global::System.Net.Http.StringContent(request.Model.ToValueString()),
name: "\"model\"");
if (request.MagicPromptOption != default)
{

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

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.NumImages}"),
content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.NumImages, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty),
name: "\"num_images\"");
}
if (request.Seed != default)
{

__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"{request.Seed}"),
content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Seed, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty),
name: "\"seed\"");
}
if (request.StyleType != default)
{

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