From 8dbd1fdc06f1162cced851afdf4c06c94ec16e87 Mon Sep 17 00:00:00 2001 From: Darren Reid Date: Mon, 25 Nov 2024 18:06:29 +1100 Subject: [PATCH] Remove use of description in favour of API member --- AiServer.ServiceModel/GenerationAdmin.cs | 7 -- AiServer.ServiceModel/Generations.cs | 15 --- AiServer.ServiceModel/OpenAiChatServer.cs | 6 -- AiServer.ServiceModel/QueueGenerations.cs | 99 +------------------ AiServer.ServiceModel/QueueMediaTransforms.cs | 90 ++--------------- 5 files changed, 11 insertions(+), 206 deletions(-) diff --git a/AiServer.ServiceModel/GenerationAdmin.cs b/AiServer.ServiceModel/GenerationAdmin.cs index db1cfab..5a4b0ec 100644 --- a/AiServer.ServiceModel/GenerationAdmin.cs +++ b/AiServer.ServiceModel/GenerationAdmin.cs @@ -6,7 +6,6 @@ namespace AiServer.ServiceModel; [Tag(Tags.AiInfo)] [ValidateApiKey] -[Description("Media Providers")] public class QueryMediaProviders : QueryDb { public int? Id { get; set; } @@ -15,23 +14,17 @@ public class QueryMediaProviders : QueryDb [Tag(Tags.Admin)] [ValidateAuthSecret] -[Description("Add an API Provider to Generation API Providers")] [AutoPopulate(nameof(MediaProvider.CreatedDate), Eval = "utcNow")] public class CreateMediaProvider : ICreateDb, IReturn { - [Description("The name of the API Provider")] public string Name { get; set; } - [Description("The API Key to use for this Provider")] public string? ApiKey { get; set; } - [Description("Send the API Key in the Header instead of Authorization Bearer")] public string? ApiKeyHeader { get; set; } - [Description("Base URL for the Generation Provider")] public string? ApiBaseUrl { get; set; } - [Description("Url to check if the API is online")] [Input(Type = "hidden")] public string? HeartbeatUrl { get; set; } diff --git a/AiServer.ServiceModel/Generations.cs b/AiServer.ServiceModel/Generations.cs index f0b57fe..09a51d2 100644 --- a/AiServer.ServiceModel/Generations.cs +++ b/AiServer.ServiceModel/Generations.cs @@ -11,80 +11,65 @@ public class ActiveMediaModels : IGet, IReturn {} [ValidateApiKey] [Tag(Tags.AI)] [Api("Convert speech to text")] -[Description("Transcribe audio content to text")] [SystemJson(UseSystemJson.Response)] public class SpeechToText : IGeneration, IReturn { [ApiMember(Description = "The audio stream containing the speech to be transcribed")] - [Description("The audio stream containing the speech to be transcribed")] [Required] [Input(Type = "file")] public Stream Audio { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } [ValidateApiKey] [Tag(Tags.AI)] [Api("Convert text to speech")] -[Description("Generate speech audio from text input")] [SystemJson(UseSystemJson.Response)] public class TextToSpeech : IGeneration, IReturn { [ApiMember(Description = "The text to be converted to speech")] - [Description("The text to be converted to speech")] [ValidateNotEmpty] public string Input { get; set; } [ApiMember(Description = "Optional specific model and voice to use for speech generation")] - [Description("Optional specific model and voice to use for speech generation")] public string? Model { get; set; } [ApiMember(Description = "Optional seed for reproducible results in speech generation")] - [Description("Optional seed for reproducible results in speech generation")] [Range(0, int.MaxValue)] public int? Seed { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } [ValidateApiKey] [Tag(Tags.AI)] [Api("Generate image from text description")] -[Description("Create an image based on a text prompt")] [SystemJson(UseSystemJson.Response)] public class TextToImage : IGeneration, IReturn { [ApiMember(Description = "The main prompt describing the desired image")] - [Description("The main prompt describing the desired image")] [ValidateNotEmpty] [Input(Type = "textarea")] public string PositivePrompt { get; set; } [ApiMember(Description = "Optional prompt specifying what should not be in the image")] - [Description("Optional prompt specifying what should not be in the image")] [Input(Type = "textarea")] public string? NegativePrompt { get; set; } [ApiMember(Description = "Desired width of the generated image")] - [Description("Desired width of the generated image")] [Range(64, 2048)] public int? Width { get; set; } [ApiMember(Description = "Desired height of the generated image")] - [Description("Desired height of the generated image")] [Range(64, 2048)] public int? Height { get; set; } diff --git a/AiServer.ServiceModel/OpenAiChatServer.cs b/AiServer.ServiceModel/OpenAiChatServer.cs index 50294fe..fa223a1 100644 --- a/AiServer.ServiceModel/OpenAiChatServer.cs +++ b/AiServer.ServiceModel/OpenAiChatServer.cs @@ -29,27 +29,21 @@ public class GetOpenAiChatStatus : IGet, IReturn public class GetOpenAiChatStatusResponse { [ApiMember(Description = "Unique identifier of the background job")] - [Description("Unique identifier of the background job")] public long JobId { get; set; } [ApiMember(Description = "Client-provided identifier for the request")] - [Description("Client-provided identifier for the request")] public string RefId { get; set; } [ApiMember(Description = "Current state of the background job")] - [Description("Current state of the background job")] public BackgroundJobState JobState { get; set; } [ApiMember(Description = "Current status of the generation request")] - [Description("Current status of the generation request")] public string? Status { get; set; } [ApiMember(Description = "Detailed response status information")] - [Description("Detailed response status information")] public ResponseStatus? ResponseStatus { get; set; } [ApiMember(Description = "Chat result")] - [Description("Chat result")] public OpenAiChatResponse? Result { get; set; } } diff --git a/AiServer.ServiceModel/QueueGenerations.cs b/AiServer.ServiceModel/QueueGenerations.cs index b4f4305..76b87e0 100644 --- a/AiServer.ServiceModel/QueueGenerations.cs +++ b/AiServer.ServiceModel/QueueGenerations.cs @@ -7,29 +7,23 @@ namespace AiServer.ServiceModel; [ValidateApiKey] [Tag(Tags.AI)] [Api("Convert speech to text")] -[Description("Transcribe audio content to text")] public class QueueSpeechToText : IQueueGeneration, IReturn { [ApiMember(Description = "The audio stream containing the speech to be transcribed")] - [Description("The audio stream containing the speech to be transcribed")] [Required] [Input(Type = "file")] public Stream Audio { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } [ApiMember(Description = "Optional state to associate with the request")] - [Description("Optional state to associate with the request")] [Input(Type = "hidden")] public string? State { get; set; } } @@ -37,37 +31,29 @@ public class QueueSpeechToText : IQueueGeneration, IReturn { [ApiMember(Description = "The text to be converted to speech")] - [Description("The text to be converted to speech")] [Required] public string Text { get; set; } [ApiMember(Description = "Optional seed for reproducible results in speech generation")] - [Description("Optional seed for reproducible results in speech generation")] [Range(0, int.MaxValue)] public int? Seed { get; set; } [ApiMember(Description = "The AI model to use for speech generation")] - [Description("The AI model to use for speech generation")] public string? Model { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } [ApiMember(Description = "Optional state to associate with the request")] - [Description("Optional state to associate with the request")] [Input(Type = "hidden")] public string? State { get; set; } } @@ -75,58 +61,46 @@ public class QueueTextToSpeech : IQueueGeneration, IReturn { [ApiMember(Description = "The main prompt describing the desired image")] - [Description("The main prompt describing the desired image")] [ValidateNotEmpty] [Input(Type = "textarea")] public string PositivePrompt { get; set; } [ApiMember(Description = "Optional prompt specifying what should not be in the image")] - [Description("Optional prompt specifying what should not be in the image")] [Input(Type = "textarea")] public string? NegativePrompt { get; set; } [ApiMember(Description = "Desired width of the generated image")] - [Description("Desired width of the generated image")] [Range(64, 2048)] public int? Width { get; set; } [ApiMember(Description = "Desired height of the generated image")] - [Description("Desired height of the generated image")] [Range(64, 2048)] public int? Height { get; set; } [ApiMember(Description = "Number of images to generate in a single batch")] - [Description("Number of images to generate in a single batch")] [Range(1, 10)] public int? BatchSize { get; set; } [ApiMember(Description = "The AI model to use for image generation")] - [Description("The AI model to use for image generation")] public string? Model { get; set; } [ApiMember(Description = "Optional seed for reproducible results")] - [Description("Optional seed for reproducible results")] [Range(0, int.MaxValue)] public int? Seed { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } [ApiMember(Description = "Optional state to associate with the request")] - [Description("Optional state to associate with the request")] [Input(Type = "hidden")] public string? State { get; set; } } @@ -134,94 +108,75 @@ public class QueueTextToImage : IQueueGeneration, IReturn { [ApiMember(Description = "The image to use as input")] - [Description("The image to use as input")] [Required] [Input(Type = "file")] public Stream Image { get; set; } [ApiMember(Description = "Prompt describing the desired output")] - [Description("Prompt describing the desired output")] [ValidateNotEmpty] [Input(Type = "textarea")] public string PositivePrompt { get; set; } [ApiMember(Description = "Negative prompt describing what should not be in the image")] - [Description("Negative prompt describing what should not be in the image")] [Input(Type = "textarea")] public string? NegativePrompt { get; set; } [ApiMember(Description = "The AI model to use for image generation")] - [Description("The AI model to use for image generation")] public string? Model { get; set; } [ApiMember(Description = "Optional specific amount of denoise to apply")] - [Description("Optional specific amount of denoise to apply")] [Range(0, 1)] public float? Denoise { get; set; } [ApiMember(Description = "Number of images to generate in a single batch")] - [Description("Number of images to generate in a single batch")] [Range(1, 10)] public int? BatchSize { get; set; } [ApiMember(Description = "Optional seed for reproducible results in image generation")] - [Description("Optional seed for reproducible results in image generation")] [Range(0, int.MaxValue)] public int? Seed { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Optional state to associate with the request")] - [Description("Optional state to associate with the request")] [Input(Type = "hidden")] public string? State { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } [ValidateApiKey] [Tag(Tags.AI)] [Api("Upscale an image")] -[Description("Increase the resolution and quality of an input image")] public class QueueImageUpscale : IQueueGeneration, IReturn { [ApiMember(Description = "The image to upscale")] - [Description("The image to upscale")] [Required] [Input(Type = "file")] - public Stream Image { get; set; } + public string Image { get; set; } [ApiMember(Description = "Optional seed for reproducible results in image generation")] - [Description("Optional seed for reproducible results in image generation")] [Range(0, int.MaxValue)] public int? Seed { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } [ApiMember(Description = "Optional state to associate with the request")] - [Description("Optional state to associate with the request")] [Input(Type = "hidden")] public string? State { get; set; } } @@ -229,56 +184,45 @@ public class QueueImageUpscale : IQueueGeneration, IReturn { [ApiMember(Description = "Prompt describing the desired output in the masked area")] - [Description("Prompt describing the desired output in the masked area")] [ValidateNotEmpty] [Input(Type = "textarea")] public string PositivePrompt { get; set; } [ApiMember(Description = "Negative prompt describing what should not be in the masked area")] - [Description("Negative prompt describing what should not be in the masked area")] [Input(Type = "textarea")] public string? NegativePrompt { get; set; } [ApiMember(Description = "The image to use as input")] - [Description("The image to use as input")] [Required] [Input(Type = "file")] - public Stream Image { get; set; } + public string Image { get; set; } [ApiMember(Description = "The mask to use as input")] - [Description("The mask to use as input")] [Required] [Input(Type = "file")] - public Stream Mask { get; set; } + public string Mask { get; set; } [ApiMember(Description = "Optional specific amount of denoise to apply")] - [Description("Optional specific amount of denoise to apply")] [Range(0, 1)] public float? Denoise { get; set; } [ApiMember(Description = "Optional seed for reproducible results in image generation")] - [Description("Optional seed for reproducible results in image generation")] [Range(0, int.MaxValue)] public int? Seed { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } [ApiMember(Description = "Optional state to associate with the request")] - [Description("Optional state to associate with the request")] [Input(Type = "hidden")] public string? State { get; set; } } @@ -286,29 +230,23 @@ public class QueueImageWithMask : IQueueGeneration, IReturn { [ApiMember(Description = "The image to convert to text")] - [Description("The image to convert to text")] [Required] [Input(Type = "file")] - public Stream Image { get; set; } + public string Image { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } [ApiMember(Description = "Optional state to associate with the request")] - [Description("Optional state to associate with the request")] [Input(Type = "hidden")] public string? State { get; set; } } @@ -328,130 +266,101 @@ public interface IQueueGeneration [ValidateApiKey] [Tag(Tags.Admin)] [Api("Get job status")] -[Description("Retrieve the status of a background job")] public class GetArtifactGenerationStatus : IGet, IReturn { [ApiMember(Description = "Unique identifier of the background job")] - [Description("Unique identifier of the background job")] public long? JobId { get; set; } [ApiMember(Description = "Client-provided identifier for the request")] - [Description("Client-provided identifier for the request")] public string? RefId { get; set; } } public class GetArtifactGenerationStatusResponse { [ApiMember(Description = "Unique identifier of the background job")] - [Description("Unique identifier of the background job")] public long JobId { get; set; } [ApiMember(Description = "Client-provided identifier for the request")] - [Description("Client-provided identifier for the request")] public string RefId { get; set; } [ApiMember(Description = "Current state of the background job")] - [Description("Current state of the background job")] public BackgroundJobState JobState { get; set; } [ApiMember(Description = "Current status of the generation request")] - [Description("Current status of the generation request")] public string Status { get; set; } [ApiMember(Description = "List of generated outputs")] - [Description("List of generated outputs")] public List? Results { get; set; } [ApiMember(Description = "Detailed response status information")] - [Description("Detailed response status information")] public ResponseStatus? ResponseStatus { get; set; } } public class GetTextGenerationStatus : IGet, IReturn { [ApiMember(Description = "Unique identifier of the background job")] - [Description("Unique identifier of the background job")] public long? JobId { get; set; } [ApiMember(Description = "Client-provided identifier for the request")] - [Description("Client-provided identifier for the request")] public string? RefId { get; set; } } public class GetTextGenerationStatusResponse { [ApiMember(Description = "Unique identifier of the background job")] - [Description("Unique identifier of the background job")] public long JobId { get; set; } [ApiMember(Description = "Client-provided identifier for the request")] - [Description("Client-provided identifier for the request")] public string RefId { get; set; } [ApiMember(Description = "Current state of the background job")] - [Description("Current state of the background job")] public BackgroundJobState JobState { get; set; } [ApiMember(Description = "Current status of the generation request")] - [Description("Current status of the generation request")] public string Status { get; set; } [ApiMember(Description = "Generated text")] - [Description("Generated text")] public List? Results { get; set; } [ApiMember(Description = "Detailed response status information")] - [Description("Detailed response status information")] public ResponseStatus? ResponseStatus { get; set; } } public class QueueGenerationResponse { [ApiMember(Description = "Unique identifier of the background job")] - [Description("Unique identifier of the background job")] public long JobId { get; set; } [ApiMember(Description = "Client-provided identifier for the request")] - [Description("Client-provided identifier for the request")] public string RefId { get; set; } [ApiMember(Description = "Current state of the background job")] - [Description("Current state of the background job")] public BackgroundJobState JobState { get; set; } [ApiMember(Description = "Current status of the generation request")] - [Description("Current status of the generation request")] public string? Status { get; set; } [ApiMember(Description = "Detailed response status information")] - [Description("Detailed response status information")] public ResponseStatus? ResponseStatus { get; set; } [ApiMember(Description = "URL to check the status of the generation request")] - [Description("URL to check the status of the generation request")] public string StatusUrl { get; set; } } -[Description("Output object for generated artifacts")] public class ArtifactOutput { [ApiMember(Description = "URL to access the generated image")] - [Description("URL to access the generated image")] public string? Url { get; set; } [ApiMember(Description = "Filename of the generated image")] - [Description("Filename of the generated image")] public string? FileName { get; set; } [ApiMember(Description = "Provider used for image generation")] - [Description("Provider used for image generation")] public string? Provider { get; set; } } -[Description("Output object for generated text")] public class TextOutput { [ApiMember(Description = "The generated text")] - [Description("The generated text")] public string? Text { get; set; } } \ No newline at end of file diff --git a/AiServer.ServiceModel/QueueMediaTransforms.cs b/AiServer.ServiceModel/QueueMediaTransforms.cs index c909ef1..b1542f2 100644 --- a/AiServer.ServiceModel/QueueMediaTransforms.cs +++ b/AiServer.ServiceModel/QueueMediaTransforms.cs @@ -8,70 +8,56 @@ namespace AiServer.ServiceModel; [ValidateApiKey] [Tag(Tags.Media)] [Api("Scale video")] -[Description("Scale a video to specified dimensions")] public class QueueScaleVideo : IQueueMediaTransform, IReturn { [ApiMember(Description = "The video file to be scaled")] - [Description("The video file to be scaled")] [Required] [Input(Type = "file")] - public Stream? Video { get; set; } + public string? Video { get; set; } [ApiMember(Description = "Desired width of the scaled video")] - [Description("Desired width of the scaled video")] [Range(1, 7680)] // Assuming 8K as max resolution public int? Width { get; set; } [ApiMember(Description = "Desired height of the scaled video")] - [Description("Desired height of the scaled video")] [Range(1, 4320)] // Assuming 8K as max resolution public int? Height { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } [ValidateApiKey] [Tag(Tags.Media)] [Api("Watermark video")] -[Description("Add a watermark to a video")] public class QueueWatermarkVideo : IQueueMediaTransform, IReturn { [ApiMember(Description = "The video file to be watermarked")] - [Description("The video file to be watermarked")] [Required] [Input(Type = "file")] - public Stream? Video { get; set; } + public string? Video { get; set; } [ApiMember(Description = "The image file to use as a watermark")] - [Description("The image file to use as a watermark")] [Required] [Input(Type = "file")] public Stream? Watermark { get; set; } [ApiMember(Description = "Position of the watermark")] - [Description("Position of the watermark")] public WatermarkPosition? Position { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } @@ -82,225 +68,177 @@ public interface IQueueMediaTransform public string? ReplyTo { get; set; } } -[Description("Base class for queueable transformation requests")] public class QueueMediaTransformResponse { [ApiMember(Description = "Unique identifier of the background job")] - [Description("Unique identifier of the background job")] public long JobId { get; set; } [ApiMember(Description = "Client-provided identifier for the request")] - [Description("Client-provided identifier for the request")] public string RefId { get; set; } [ApiMember(Description = "Current state of the background job")] - [Description("Current state of the background job")] public BackgroundJobState JobState { get; set; } [ApiMember(Description = "Current status of the transformation request")] - [Description("Current status of the transformation request")] public string? Status { get; set; } [ApiMember(Description = "Detailed response status information")] - [Description("Detailed response status information")] public ResponseStatus? ResponseStatus { get; set; } [ApiMember(Description = "URL to check the status of the request")] - [Description("URL to check the status of the request")] public string StatusUrl { get; set; } } -[Description("Convert an image to a different format")] [Tag(Tags.Media)] [ValidateApiKey] public class QueueConvertImage : IQueueMediaTransform, IPost, IReturn { [ApiMember(Description = "The image file to be converted")] - [Description("The image file to be converted")] [Required] [Input(Type = "file")] - public Stream Image { get; set; } + public string? Image { get; set; } [ApiMember(Description = "The desired output format for the converted image")] - [Description("The desired output format for the converted image")] [Required] public ImageOutputFormat? OutputFormat { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } -[Description("Crop an image to a specified area")] [Tag(Tags.Media)] [ValidateApiKey] public class QueueCropImage : IQueueMediaTransform, IPost, IReturn { [ApiMember(Description = "The X-coordinate of the top-left corner of the crop area")] - [Description("The X-coordinate of the top-left corner of the crop area")] public int X { get; set; } [ApiMember(Description = "The Y-coordinate of the top-left corner of the crop area")] - [Description("The Y-coordinate of the top-left corner of the crop area")] public int Y { get; set; } [ApiMember(Description = "The width of the crop area")] - [Description("The width of the crop area")] public int Width { get; set; } [ApiMember(Description = "The height of the crop area")] - [Description("The height of the crop area")] public int Height { get; set; } [ApiMember(Description = "The image file to be cropped")] - [Description("The image file to be cropped")] [Required] [Input(Type = "file")] - public Stream Image { get; set; } + public string? Image { get; set; } - [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } -[Description("Add a watermark to an image")] [Tag(Tags.Media)] [ValidateApiKey] public class QueueWatermarkImage : IQueueMediaTransform, IPost, IReturn { [ApiMember(Description = "The image file to be watermarked")] - [Description("The image file to be watermarked")] [Required] [Input(Type = "file")] - public Stream Image { get; set; } + public string? Image { get; set; } [ApiMember(Description = "The position of the watermark on the image")] - [Description("The position of the watermark on the image")] public WatermarkPosition Position { get; set; } [ApiMember(Description = "The opacity of the watermark (0.0 to 1.0)")] - [Description("The opacity of the watermark (0.0 to 1.0)")] public float Opacity { get; set; } = 0.5f; [ApiMember(Description = "Scale of the watermark relative")] - [Description("Scale of the watermark relative")] public float WatermarkScale { get; set; } = 1.0f; [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } -[Description("Scale an image to a specified size")] [Tag(Tags.Media)] [ValidateApiKey] public class QueueScaleImage : IQueueMediaTransform,IPost, IReturn { [ApiMember(Description = "The image file to be scaled")] - [Description("The image file to be scaled")] [Required] [Input(Type = "file")] - public Stream Image { get; set; } + public string? Image { get; set; } [ApiMember(Description = "Desired width of the scaled image")] - [Description("Desired width of the scaled image")] public int? Width { get; set; } [ApiMember(Description = "Desired height of the scaled image")] - [Description("Desired height of the scaled image")] public int? Height { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } -[Description("Convert a video to a different format")] [Tag(Tags.Media)] [ValidateApiKey] public class QueueConvertVideo : IQueueMediaTransform, IReturn { [ApiMember(Description = "The desired output format for the converted video")] - [Description("The desired output format for the converted video")] [Required] public ConvertVideoOutputFormat OutputFormat { get; set; } [Required] [Input(Type = "file")] - public Stream Video { get; set; } + public string? Video { get; set; } [ApiMember(Description = "Optional client-provided identifier for the request")] - [Description("Optional client-provided identifier for the request")] public string? RefId { get; set; } [ApiMember(Description = "Optional queue or topic to reply to")] - [Description("Optional queue or topic to reply to")] public string? ReplyTo { get; set; } [ApiMember(Description = "Tag to identify the request")] - [Description("Tag to identify the request")] public string? Tag { get; set; } } -[Description("Crop a video to a specified area")] [Tag(Tags.Media)] [ValidateApiKey] public class QueueCropVideo : IQueueMediaTransform, IReturn { [ApiMember(Description = "The X-coordinate of the top-left corner of the crop area")] - [Description("The X-coordinate of the top-left corner of the crop area")] [ValidateGreaterThan(0)] [Required] public int X { get; set; } [ApiMember(Description = "The Y-coordinate of the top-left corner of the crop area")] - [Description("The Y-coordinate of the top-left corner of the crop area")] [ValidateGreaterThan(0)] [Required] public int Y { get; set; } [ApiMember(Description = "The width of the crop area")] - [Description("The width of the crop area")] [ValidateGreaterThan(0)] [Required] public int Width { get; set; } [ApiMember(Description = "The height of the crop area")] - [Description("The height of the crop area")] [ValidateGreaterThan(0)] [Required] public int Height { get; set; } @@ -310,30 +248,24 @@ public class QueueCropVideo : IQueueMediaTransform, IReturn { [ApiMember(Description = "The start time of the trimmed video (format: HH:MM:SS)")] - [Description("The start time of the trimmed video (format: HH:MM:SS)")] [Required] public string StartTime { get; set; } [ApiMember(Description = "The end time of the trimmed video (format: HH:MM:SS)")] - [Description("The end time of the trimmed video (format: HH:MM:SS)")] public string? EndTime { get; set; } [Required] @@ -341,25 +273,20 @@ public class QueueTrimVideo : IQueueMediaTransform, IReturn { [ApiMember(Description = "The desired output format for the converted audio")] - [Description("The desired output format for the converted audio")] [Required] public AudioFormat OutputFormat { get; set; } @@ -368,15 +295,12 @@ public class QueueConvertAudio : IQueueMediaTransform, IReturn