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 @@ -97,140 +97,5 @@ public partial interface ISkyboxesClient
string? webhookUrl = default,
global::BlockadeLabs.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Generate Skybox<br/>
/// Used for generating skyboxes, skybox remixes and depth maps.
/// </summary>
/// <param name="prompt">
/// Text prompt describing the skybox world you wish to create. Maximum number of characters: 550. If you are using skybox_style_id then the maximum number of characters is defined in the max-char response parameter defined for each style.<br/>
/// Example: dark forest
/// </param>
/// <param name="negativeText">
/// Describe things to avoid in the skybox world you wish to create. Maximum number of characters: 200. If you are using skybox_style_id then the maximum number of characters is defined in the negative-text-max-char response parameter defined for each style.
/// </param>
/// <param name="enhancePrompt">
/// Have an AI automatically improve your prompt to generate pro-level results every time (default: false)
/// </param>
/// <param name="seed">
/// Send 0 for a random seed generation. Any other number (1-2147483647) set will be used to "freeze" the image generator and create similar images when run again with the same seed and settings.
/// </param>
/// <param name="skyboxStyleId">
/// Predefined styles that influence the overall aesthetic of your skybox generation (Fantasy landscape, Anime art style, etc...).
/// </param>
/// <param name="remixImagineId">
/// ID of a previously generated skybox
/// </param>
/// <param name="controlImage">
/// Control image used to influence the generation. The image needs to be exacly 1024 pixels wide and 512 pixels tall PNG equirectangular projection image of a scribble with black (#00000) background and white (#ffffff) brush strokes. For "scribble" effect you will also need to send control_model="scribble".
/// </param>
/// <param name="controlImagename">
/// Control image used to influence the generation. The image needs to be exacly 1024 pixels wide and 512 pixels tall PNG equirectangular projection image of a scribble with black (#00000) background and white (#ffffff) brush strokes. For "scribble" effect you will also need to send control_model="scribble".
/// </param>
/// <param name="controlModel">
/// Model used for the control_image. Currently, the only option is: "scribble".
/// </param>
/// <param name="initImage">
/// Image (Binary/Base64 string/Absolute URL) to be used as initial image for Skybox generation. Please use equirectangular 360° images. 2:1 aspect ratio recommended. Maximum file size is 50 megabytes.
/// </param>
/// <param name="initImagename">
/// Image (Binary/Base64 string/Absolute URL) to be used as initial image for Skybox generation. Please use equirectangular 360° images. 2:1 aspect ratio recommended. Maximum file size is 50 megabytes.
/// </param>
/// <param name="initStrength">
/// Scale to be used as initial influence of the "Init Image" for Skybox generation. The default value is 0, allowed range is between 0 and 0.97, where 0 represents no influence and 0.97 represents lots of influence. Only has an effect when using an init_image parameter.
/// </param>
/// <param name="returnDepthHq">
/// Request for high quality depth map. It will be returned in the depth_map_url parameter. (default: false)
/// </param>
/// <param name="webhookUrl">
/// Optionally, you may specify a webhook url to specify the destination for progress updates
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::BlockadeLabs.ApiException"></exception>
global::System.Threading.Tasks.Task<global::BlockadeLabs.GenerateSkyboxResponse> GenerateSkyboxAsync(
string prompt,
string? negativeText = default,
bool? enhancePrompt = default,
int? seed = default,
int? skyboxStyleId = default,
int? remixImagineId = default,
global::System.IO.Stream? controlImage = default,
string? controlImagename = default,
string? controlModel = default,
global::System.IO.Stream? initImage = default,
string? initImagename = default,
double? initStrength = default,
bool? returnDepthHq = default,
string? webhookUrl = default,
global::BlockadeLabs.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Generate Skybox<br/>
/// Used for generating skyboxes, skybox remixes and depth maps.
/// </summary>
/// <param name="prompt">
/// Text prompt describing the skybox world you wish to create. Maximum number of characters: 550. If you are using skybox_style_id then the maximum number of characters is defined in the max-char response parameter defined for each style.<br/>
/// Example: dark forest
/// </param>
/// <param name="negativeText">
/// Describe things to avoid in the skybox world you wish to create. Maximum number of characters: 200. If you are using skybox_style_id then the maximum number of characters is defined in the negative-text-max-char response parameter defined for each style.
/// </param>
/// <param name="enhancePrompt">
/// Have an AI automatically improve your prompt to generate pro-level results every time (default: false)
/// </param>
/// <param name="seed">
/// Send 0 for a random seed generation. Any other number (1-2147483647) set will be used to "freeze" the image generator and create similar images when run again with the same seed and settings.
/// </param>
/// <param name="skyboxStyleId">
/// Predefined styles that influence the overall aesthetic of your skybox generation (Fantasy landscape, Anime art style, etc...).
/// </param>
/// <param name="remixImagineId">
/// ID of a previously generated skybox
/// </param>
/// <param name="controlImage">
/// Control image used to influence the generation. The image needs to be exacly 1024 pixels wide and 512 pixels tall PNG equirectangular projection image of a scribble with black (#00000) background and white (#ffffff) brush strokes. For "scribble" effect you will also need to send control_model="scribble".
/// </param>
/// <param name="controlImagename">
/// Control image used to influence the generation. The image needs to be exacly 1024 pixels wide and 512 pixels tall PNG equirectangular projection image of a scribble with black (#00000) background and white (#ffffff) brush strokes. For "scribble" effect you will also need to send control_model="scribble".
/// </param>
/// <param name="controlModel">
/// Model used for the control_image. Currently, the only option is: "scribble".
/// </param>
/// <param name="initImage">
/// Image (Binary/Base64 string/Absolute URL) to be used as initial image for Skybox generation. Please use equirectangular 360° images. 2:1 aspect ratio recommended. Maximum file size is 50 megabytes.
/// </param>
/// <param name="initImagename">
/// Image (Binary/Base64 string/Absolute URL) to be used as initial image for Skybox generation. Please use equirectangular 360° images. 2:1 aspect ratio recommended. Maximum file size is 50 megabytes.
/// </param>
/// <param name="initStrength">
/// Scale to be used as initial influence of the "Init Image" for Skybox generation. The default value is 0, allowed range is between 0 and 0.97, where 0 represents no influence and 0.97 represents lots of influence. Only has an effect when using an init_image parameter.
/// </param>
/// <param name="returnDepthHq">
/// Request for high quality depth map. It will be returned in the depth_map_url parameter. (default: false)
/// </param>
/// <param name="webhookUrl">
/// Optionally, you may specify a webhook url to specify the destination for progress updates
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::BlockadeLabs.ApiException"></exception>
global::System.Threading.Tasks.Task<global::BlockadeLabs.AutoSDKHttpResponse<global::BlockadeLabs.GenerateSkyboxResponse>> GenerateSkyboxAsResponseAsync(
string prompt,
string? negativeText = default,
bool? enhancePrompt = default,
int? seed = default,
int? skyboxStyleId = default,
int? remixImagineId = default,
global::System.IO.Stream? controlImage = default,
string? controlImagename = default,
string? controlModel = default,
global::System.IO.Stream? initImage = default,
string? initImagename = default,
double? initStrength = default,
bool? returnDepthHq = default,
string? webhookUrl = default,
global::BlockadeLabs.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
81 changes: 81 additions & 0 deletions src/libs/BlockadeLabs/Generated/BlockadeLabs.OptionsSupport.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,84 @@ public interface IAutoSDKAuthorizationProvider
global::BlockadeLabs.AutoSDKHookContext context);
}

/// <summary>
/// Marker keys stamped onto outgoing <see cref="global::System.Net.Http.HttpRequestMessage"/>
/// instances so consumer <see cref="global::System.Net.Http.DelegatingHandler"/>s — and any
/// other transport-layer code that runs after AutoSDK's send pipeline — can observe whether
/// the resolved Authorization is call-scoped and opt out of overwriting it with a
/// rotation-aware account-level credential.
/// </summary>
public static class AutoSDKHttpRequestOptions
{
/// <summary>
/// Key under which <see cref="StampAuthorizationOverride"/> records the marker. Exposed
/// for handlers that target frameworks older than .NET 5 and need to read the value
/// through the legacy <c>HttpRequestMessage.Properties</c> bag.
/// </summary>
public const string AuthorizationOverrideKey = "AutoSDK.AuthorizationOverride";

#if NET5_0_OR_GREATER
/// <summary>
/// Strongly-typed <see cref="global::System.Net.Http.HttpRequestOptionsKey{TValue}"/> for
/// the call-scoped Authorization marker on .NET 5+ targets. Consumers should prefer this
/// over the legacy <c>HttpRequestMessage.Properties</c> bag where available.
/// </summary>
public static readonly global::System.Net.Http.HttpRequestOptionsKey<bool> AuthorizationOverride =
new global::System.Net.Http.HttpRequestOptionsKey<bool>(AuthorizationOverrideKey);
#endif

/// <summary>
/// Stamps the call-scoped Authorization marker on <paramref name="request"/>. AutoSDK's
/// built-in <see cref="AutoSDKAuthorizationProviderHook"/> calls this whenever the
/// resolved auth came from a per-request override or a client-level
/// <see cref="IAutoSDKAuthorizationProvider"/>. Hand-written SDK extensions that set a
/// non-default <c>Authorization</c> header (e.g. a session-scoped bearer returned by an
/// upstream poll) should call this too so downstream rotation handlers know to skip the
/// overwrite.
/// </summary>
/// <param name="request"></param>
public static void StampAuthorizationOverride(
global::System.Net.Http.HttpRequestMessage? request)
{
if (request is null)
{
return;
}

#if NET5_0_OR_GREATER
request.Options.Set(AuthorizationOverride, true);
#else
#pragma warning disable CS0618 // HttpRequestMessage.Properties is obsolete in NET5+, but the only option below it.
request.Properties[AuthorizationOverrideKey] = true;
#pragma warning restore CS0618
#endif
}

/// <summary>
/// Returns true when <see cref="StampAuthorizationOverride"/> previously marked the
/// request as carrying a call-scoped Authorization.
/// </summary>
/// <param name="request"></param>
public static bool HasAuthorizationOverride(
global::System.Net.Http.HttpRequestMessage? request)
{
if (request is null)
{
return false;
}

#if NET5_0_OR_GREATER
return request.Options.TryGetValue(AuthorizationOverride, out var value) && value;
#else
#pragma warning disable CS0618
return request.Properties.TryGetValue(AuthorizationOverrideKey, out var raw) &&
raw is bool flag &&
flag;
#pragma warning restore CS0618
#endif
}
}

/// <summary>
/// Built-in <see cref="IAutoSDKHook"/> that consults
/// <see cref="AutoSDKClientOptions.AuthorizationProvider"/> before every outgoing
Expand All @@ -176,6 +254,7 @@ public sealed class AutoSDKAuthorizationProviderHook : global::BlockadeLabs.Auto
ApplyAuthorization(context.Request, perRequest[index]);
}

global::BlockadeLabs.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request);
return;
}

Expand All @@ -195,6 +274,8 @@ public sealed class AutoSDKAuthorizationProviderHook : global::BlockadeLabs.Auto
{
ApplyAuthorization(context.Request, resolved[index]);
}

global::BlockadeLabs.AutoSDKHttpRequestOptions.StampAuthorizationOverride(context.Request);
}

private static void ApplyAuthorization(
Expand Down
Loading