diff --git a/src/libs/OpenRouter/Generated/OpenRouter.IOpenRouterClient.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.IOpenRouterClient.g.cs index f230c1f1..d064ebd0 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.IOpenRouterClient.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.IOpenRouterClient.g.cs @@ -129,5 +129,10 @@ public partial interface IOpenRouterClient : global::System.IDisposable /// public SubpackageVideoGenerationClient SubpackageVideoGeneration { get; } + /// + /// + /// + public SubpackageWorkspacesClient SubpackageWorkspaces { get; } + } } \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs new file mode 100644 index 00000000..887da294 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs @@ -0,0 +1,39 @@ +#nullable enable + +namespace OpenRouter +{ + public partial interface ISubpackageWorkspacesClient + { + /// + /// Bulk add members to a workspace
+ /// Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BulkAddWorkspaceMembersAsync( + string id, + + global::OpenRouter.BulkAddWorkspaceMembersRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Bulk add members to a workspace
+ /// Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BulkAddWorkspaceMembersAsync( + string id, + global::System.Collections.Generic.IList userIds, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs new file mode 100644 index 00000000..1e226f89 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs @@ -0,0 +1,39 @@ +#nullable enable + +namespace OpenRouter +{ + public partial interface ISubpackageWorkspacesClient + { + /// + /// Bulk remove members from a workspace
+ /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BulkRemoveWorkspaceMembersAsync( + string id, + + global::OpenRouter.BulkRemoveWorkspaceMembersRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Bulk remove members from a workspace
+ /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// List of user IDs to remove from the workspace + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task BulkRemoveWorkspaceMembersAsync( + string id, + global::System.Collections.Generic.IList userIds, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.CreateWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.CreateWorkspace.g.cs new file mode 100644 index 00000000..1748a95a --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.CreateWorkspace.g.cs @@ -0,0 +1,67 @@ +#nullable enable + +namespace OpenRouter +{ + public partial interface ISubpackageWorkspacesClient + { + /// + /// Create a workspace
+ /// Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateWorkspaceAsync( + + global::OpenRouter.CreateWorkspaceRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a workspace
+ /// Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// Description of the workspace + /// + /// + /// Whether data discount logging is enabled + /// + /// + /// Whether broadcast is enabled + /// + /// + /// Whether private logging is enabled + /// + /// + /// Name for the new workspace + /// + /// + /// URL-friendly slug (lowercase alphanumeric and hyphens only) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreateWorkspaceAsync( + string name, + string slug, + string? defaultImageModel = default, + string? defaultProviderSort = default, + string? defaultTextModel = default, + string? description = default, + bool? isDataDiscountLoggingEnabled = default, + bool? isObservabilityBroadcastEnabled = default, + bool? isObservabilityIoLoggingEnabled = default, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.DeleteWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.DeleteWorkspace.g.cs new file mode 100644 index 00000000..d0498776 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.DeleteWorkspace.g.cs @@ -0,0 +1,20 @@ +#nullable enable + +namespace OpenRouter +{ + public partial interface ISubpackageWorkspacesClient + { + /// + /// Delete a workspace
+ /// Delete an existing workspace. The default workspace cannot be deleted. Workspaces with active API keys cannot be deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteWorkspaceAsync( + string id, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.GetWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.GetWorkspace.g.cs new file mode 100644 index 00000000..b2e91f54 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.GetWorkspace.g.cs @@ -0,0 +1,20 @@ +#nullable enable + +namespace OpenRouter +{ + public partial interface ISubpackageWorkspacesClient + { + /// + /// Get a workspace
+ /// Get a single workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task GetWorkspaceAsync( + string id, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.ListWorkspaces.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.ListWorkspaces.g.cs new file mode 100644 index 00000000..3d97c7e8 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.ListWorkspaces.g.cs @@ -0,0 +1,22 @@ +#nullable enable + +namespace OpenRouter +{ + public partial interface ISubpackageWorkspacesClient + { + /// + /// List workspaces
+ /// List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ListWorkspacesAsync( + int? offset = default, + int? limit = default, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.UpdateWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.UpdateWorkspace.g.cs new file mode 100644 index 00000000..13ed86c5 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.UpdateWorkspace.g.cs @@ -0,0 +1,71 @@ +#nullable enable + +namespace OpenRouter +{ + public partial interface ISubpackageWorkspacesClient + { + /// + /// Update a workspace
+ /// Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateWorkspaceAsync( + string id, + + global::OpenRouter.UpdateWorkspaceRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a workspace
+ /// Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// New description for the workspace + /// + /// + /// Whether data discount logging is enabled + /// + /// + /// Whether broadcast is enabled + /// + /// + /// Whether private logging is enabled + /// + /// + /// New name for the workspace + /// + /// + /// New URL-friendly slug + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateWorkspaceAsync( + string id, + string? defaultImageModel = default, + string? defaultProviderSort = default, + string? defaultTextModel = default, + string? description = default, + bool? isDataDiscountLoggingEnabled = default, + bool? isObservabilityBroadcastEnabled = default, + bool? isObservabilityIoLoggingEnabled = default, + string? name = default, + string? slug = default, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.g.cs new file mode 100644 index 00000000..9274b44e --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageWorkspacesClient.g.cs @@ -0,0 +1,48 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public partial interface ISubpackageWorkspacesClient : global::System.IDisposable + { + /// + /// The HttpClient instance. + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + /// The base URL for the API. + /// + public System.Uri? BaseUri { get; } + + /// + /// The authorizations to use for the requests. + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + /// Gets or sets a value indicating whether the response content should be read as a string. + /// True by default in debug builds, false otherwise. + /// When false, successful responses are deserialized directly from the response stream for better performance. + /// Error responses are always read as strings regardless of this setting, + /// ensuring is populated. + /// + public bool ReadResponseAsString { get; set; } + /// + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// + public global::OpenRouter.AutoSDKClientOptions Options { get; } + + + /// + /// + /// + global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } + + + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.WorkspaceMemberRole.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.WorkspaceMemberRole.g.cs new file mode 100644 index 00000000..82e9e28b --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.WorkspaceMemberRole.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace OpenRouter.JsonConverters +{ + /// + public sealed class WorkspaceMemberRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::OpenRouter.WorkspaceMemberRole 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::OpenRouter.WorkspaceMemberRoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::OpenRouter.WorkspaceMemberRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::OpenRouter.WorkspaceMemberRole); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::OpenRouter.WorkspaceMemberRole value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::OpenRouter.WorkspaceMemberRoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.WorkspaceMemberRoleNullable.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.WorkspaceMemberRoleNullable.g.cs new file mode 100644 index 00000000..464fabf2 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonConverters.WorkspaceMemberRoleNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace OpenRouter.JsonConverters +{ + /// + public sealed class WorkspaceMemberRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::OpenRouter.WorkspaceMemberRole? 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::OpenRouter.WorkspaceMemberRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::OpenRouter.WorkspaceMemberRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::OpenRouter.WorkspaceMemberRole?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::OpenRouter.WorkspaceMemberRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::OpenRouter.WorkspaceMemberRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonSerializerContext.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonSerializerContext.g.cs index 65e2fa7e..b82242e2 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.JsonSerializerContext.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonSerializerContext.g.cs @@ -1441,6 +1441,10 @@ namespace OpenRouter typeof(global::OpenRouter.JsonConverters.VideoModelSupportedSizesItemsNullableJsonConverter), + typeof(global::OpenRouter.JsonConverters.WorkspaceMemberRoleJsonConverter), + + typeof(global::OpenRouter.JsonConverters.WorkspaceMemberRoleNullableJsonConverter), + typeof(global::OpenRouter.JsonConverters.ImageConfigJsonConverter), typeof(global::OpenRouter.JsonConverters.OutputItemReasoningStatusJsonConverter), @@ -2745,6 +2749,25 @@ namespace OpenRouter [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.VideoModelsListResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.Workspace))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.ListWorkspacesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.CreateWorkspaceRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.CreateWorkspaceResponseData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.CreateWorkspaceResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.GetWorkspaceResponseData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.GetWorkspaceResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.DeleteWorkspaceResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.UpdateWorkspaceRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.UpdateWorkspaceResponseData))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.UpdateWorkspaceResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.BulkAddWorkspaceMembersRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.WorkspaceMemberRole), TypeInfoPropertyName = "WorkspaceMemberRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.WorkspaceMember))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.BulkAddWorkspaceMembersResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.BulkRemoveWorkspaceMembersRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.BulkRemoveWorkspaceMembersResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.ExchangeAuthCodeForApiKeyRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.OneOf), TypeInfoPropertyName = "OneOfAuthKeysPostRequestBodyContentApplicationJsonSchemaCodeChallengeMethodObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::OpenRouter.CreateAuthKeysCodeRequest))] @@ -2848,6 +2871,8 @@ namespace OpenRouter [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] public sealed partial class SourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext { } diff --git a/src/libs/OpenRouter/Generated/OpenRouter.JsonSerializerContextTypes.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.JsonSerializerContextTypes.g.cs index 608d4a8f..7eb61027 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.JsonSerializerContextTypes.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.JsonSerializerContextTypes.g.cs @@ -4200,47 +4200,123 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::OpenRouter.ExchangeAuthCodeForApiKeyRequest? Type1043 { get; set; } + public global::OpenRouter.Workspace? Type1043 { get; set; } /// /// /// - public global::OpenRouter.OneOf? Type1044 { get; set; } + public global::OpenRouter.ListWorkspacesResponse? Type1044 { get; set; } /// /// /// - public global::OpenRouter.CreateAuthKeysCodeRequest? Type1045 { get; set; } + public global::System.Collections.Generic.IList? Type1045 { get; set; } /// /// /// - public global::OpenRouter.CreateEmbeddingsRequest? Type1046 { get; set; } + public global::OpenRouter.CreateWorkspaceRequest? Type1046 { get; set; } /// /// /// - public global::OpenRouter.CreateKeysRequest? Type1047 { get; set; } + public global::OpenRouter.CreateWorkspaceResponseData? Type1047 { get; set; } /// /// /// - public global::OpenRouter.OneOf? Type1048 { get; set; } + public global::OpenRouter.CreateWorkspaceResponse? Type1048 { get; set; } /// /// /// - public global::OpenRouter.UpdateKeysRequest? Type1049 { get; set; } + public global::OpenRouter.GetWorkspaceResponseData? Type1049 { get; set; } /// /// /// - public global::OpenRouter.OneOf? Type1050 { get; set; } + public global::OpenRouter.GetWorkspaceResponse? Type1050 { get; set; } /// /// /// - public global::OpenRouter.CreateRerankRequest? Type1051 { get; set; } + public global::OpenRouter.DeleteWorkspaceResponse? Type1051 { get; set; } /// /// /// - public global::OpenRouter.CreateTtsRequest? Type1052 { get; set; } + public global::OpenRouter.UpdateWorkspaceRequest? Type1052 { get; set; } /// /// /// - public byte[]? Type1053 { get; set; } + public global::OpenRouter.UpdateWorkspaceResponseData? Type1053 { get; set; } + /// + /// + /// + public global::OpenRouter.UpdateWorkspaceResponse? Type1054 { get; set; } + /// + /// + /// + public global::OpenRouter.BulkAddWorkspaceMembersRequest? Type1055 { get; set; } + /// + /// + /// + public global::OpenRouter.WorkspaceMemberRole? Type1056 { get; set; } + /// + /// + /// + public global::OpenRouter.WorkspaceMember? Type1057 { get; set; } + /// + /// + /// + public global::OpenRouter.BulkAddWorkspaceMembersResponse? Type1058 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type1059 { get; set; } + /// + /// + /// + public global::OpenRouter.BulkRemoveWorkspaceMembersRequest? Type1060 { get; set; } + /// + /// + /// + public global::OpenRouter.BulkRemoveWorkspaceMembersResponse? Type1061 { get; set; } + /// + /// + /// + public global::OpenRouter.ExchangeAuthCodeForApiKeyRequest? Type1062 { get; set; } + /// + /// + /// + public global::OpenRouter.OneOf? Type1063 { get; set; } + /// + /// + /// + public global::OpenRouter.CreateAuthKeysCodeRequest? Type1064 { get; set; } + /// + /// + /// + public global::OpenRouter.CreateEmbeddingsRequest? Type1065 { get; set; } + /// + /// + /// + public global::OpenRouter.CreateKeysRequest? Type1066 { get; set; } + /// + /// + /// + public global::OpenRouter.OneOf? Type1067 { get; set; } + /// + /// + /// + public global::OpenRouter.UpdateKeysRequest? Type1068 { get; set; } + /// + /// + /// + public global::OpenRouter.OneOf? Type1069 { get; set; } + /// + /// + /// + public global::OpenRouter.CreateRerankRequest? Type1070 { get; set; } + /// + /// + /// + public global::OpenRouter.CreateTtsRequest? Type1071 { get; set; } + /// + /// + /// + public byte[]? Type1072 { get; set; } /// /// @@ -4610,5 +4686,13 @@ public sealed partial class JsonSerializerContextTypes /// /// public global::System.Collections.Generic.List? ListType91 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType92 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType93 { get; set; } } } \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersRequest.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersRequest.Json.g.cs new file mode 100644 index 00000000..d8cac54d --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class BulkAddWorkspaceMembersRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.BulkAddWorkspaceMembersRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.BulkAddWorkspaceMembersRequest), + jsonSerializerContext) as global::OpenRouter.BulkAddWorkspaceMembersRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.BulkAddWorkspaceMembersRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.BulkAddWorkspaceMembersRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.BulkAddWorkspaceMembersRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersRequest.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersRequest.g.cs new file mode 100644 index 00000000..f801491e --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersRequest.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class BulkAddWorkspaceMembersRequest + { + /// + /// List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("user_ids")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList UserIds { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BulkAddWorkspaceMembersRequest( + global::System.Collections.Generic.IList userIds) + { + this.UserIds = userIds ?? throw new global::System.ArgumentNullException(nameof(userIds)); + } + + /// + /// Initializes a new instance of the class. + /// + public BulkAddWorkspaceMembersRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersResponse.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersResponse.Json.g.cs new file mode 100644 index 00000000..0a0918ff --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class BulkAddWorkspaceMembersResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.BulkAddWorkspaceMembersResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.BulkAddWorkspaceMembersResponse), + jsonSerializerContext) as global::OpenRouter.BulkAddWorkspaceMembersResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.BulkAddWorkspaceMembersResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.BulkAddWorkspaceMembersResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.BulkAddWorkspaceMembersResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersResponse.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersResponse.g.cs new file mode 100644 index 00000000..05add8cb --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkAddWorkspaceMembersResponse.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class BulkAddWorkspaceMembersResponse + { + /// + /// Number of workspace memberships created or updated + /// + [global::System.Text.Json.Serialization.JsonPropertyName("added_count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int AddedCount { get; set; } + + /// + /// List of added workspace memberships + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Number of workspace memberships created or updated + /// + /// + /// List of added workspace memberships + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BulkAddWorkspaceMembersResponse( + int addedCount, + global::System.Collections.Generic.IList data) + { + this.AddedCount = addedCount; + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public BulkAddWorkspaceMembersResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersRequest.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersRequest.Json.g.cs new file mode 100644 index 00000000..32b90eaa --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class BulkRemoveWorkspaceMembersRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.BulkRemoveWorkspaceMembersRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.BulkRemoveWorkspaceMembersRequest), + jsonSerializerContext) as global::OpenRouter.BulkRemoveWorkspaceMembersRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.BulkRemoveWorkspaceMembersRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.BulkRemoveWorkspaceMembersRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.BulkRemoveWorkspaceMembersRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersRequest.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersRequest.g.cs new file mode 100644 index 00000000..aa4618bc --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersRequest.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class BulkRemoveWorkspaceMembersRequest + { + /// + /// List of user IDs to remove from the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("user_ids")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList UserIds { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// List of user IDs to remove from the workspace + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BulkRemoveWorkspaceMembersRequest( + global::System.Collections.Generic.IList userIds) + { + this.UserIds = userIds ?? throw new global::System.ArgumentNullException(nameof(userIds)); + } + + /// + /// Initializes a new instance of the class. + /// + public BulkRemoveWorkspaceMembersRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersResponse.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersResponse.Json.g.cs new file mode 100644 index 00000000..a86b5b27 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class BulkRemoveWorkspaceMembersResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.BulkRemoveWorkspaceMembersResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.BulkRemoveWorkspaceMembersResponse), + jsonSerializerContext) as global::OpenRouter.BulkRemoveWorkspaceMembersResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.BulkRemoveWorkspaceMembersResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.BulkRemoveWorkspaceMembersResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.BulkRemoveWorkspaceMembersResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersResponse.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersResponse.g.cs new file mode 100644 index 00000000..90d9c875 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BulkRemoveWorkspaceMembersResponse.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class BulkRemoveWorkspaceMembersResponse + { + /// + /// Number of members removed + /// + [global::System.Text.Json.Serialization.JsonPropertyName("removed_count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int RemovedCount { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Number of members removed + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BulkRemoveWorkspaceMembersResponse( + int removedCount) + { + this.RemovedCount = removedCount; + } + + /// + /// Initializes a new instance of the class. + /// + public BulkRemoveWorkspaceMembersResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceRequest.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceRequest.Json.g.cs new file mode 100644 index 00000000..e892d9d2 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class CreateWorkspaceRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.CreateWorkspaceRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.CreateWorkspaceRequest), + jsonSerializerContext) as global::OpenRouter.CreateWorkspaceRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.CreateWorkspaceRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.CreateWorkspaceRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.CreateWorkspaceRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceRequest.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceRequest.g.cs new file mode 100644 index 00000000..1f8cb883 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceRequest.g.cs @@ -0,0 +1,135 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class CreateWorkspaceRequest + { + /// + /// Default image model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_image_model")] + public string? DefaultImageModel { get; set; } + + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_provider_sort")] + public string? DefaultProviderSort { get; set; } + + /// + /// Default text model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_text_model")] + public string? DefaultTextModel { get; set; } + + /// + /// Description of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Whether data discount logging is enabled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_data_discount_logging_enabled")] + public bool? IsDataDiscountLoggingEnabled { get; set; } + + /// + /// Whether broadcast is enabled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_broadcast_enabled")] + public bool? IsObservabilityBroadcastEnabled { get; set; } + + /// + /// Whether private logging is enabled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_io_logging_enabled")] + public bool? IsObservabilityIoLoggingEnabled { get; set; } + + /// + /// Name for the new workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// URL-friendly slug (lowercase alphanumeric and hyphens only) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("slug")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Slug { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Name for the new workspace + /// + /// + /// URL-friendly slug (lowercase alphanumeric and hyphens only) + /// + /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// Description of the workspace + /// + /// + /// Whether data discount logging is enabled + /// + /// + /// Whether broadcast is enabled + /// + /// + /// Whether private logging is enabled + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateWorkspaceRequest( + string name, + string slug, + string? defaultImageModel, + string? defaultProviderSort, + string? defaultTextModel, + string? description, + bool? isDataDiscountLoggingEnabled, + bool? isObservabilityBroadcastEnabled, + bool? isObservabilityIoLoggingEnabled) + { + this.DefaultImageModel = defaultImageModel; + this.DefaultProviderSort = defaultProviderSort; + this.DefaultTextModel = defaultTextModel; + this.Description = description; + this.IsDataDiscountLoggingEnabled = isDataDiscountLoggingEnabled; + this.IsObservabilityBroadcastEnabled = isObservabilityBroadcastEnabled; + this.IsObservabilityIoLoggingEnabled = isObservabilityIoLoggingEnabled; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); + } + + /// + /// Initializes a new instance of the class. + /// + public CreateWorkspaceRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponse.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponse.Json.g.cs new file mode 100644 index 00000000..a0e520c5 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class CreateWorkspaceResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.CreateWorkspaceResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.CreateWorkspaceResponse), + jsonSerializerContext) as global::OpenRouter.CreateWorkspaceResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.CreateWorkspaceResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.CreateWorkspaceResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.CreateWorkspaceResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponse.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponse.g.cs new file mode 100644 index 00000000..c5ba87dd --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponse.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class CreateWorkspaceResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::OpenRouter.CreateWorkspaceResponseData Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateWorkspaceResponse( + global::OpenRouter.CreateWorkspaceResponseData data) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public CreateWorkspaceResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponseData.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponseData.Json.g.cs new file mode 100644 index 00000000..31b3caec --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponseData.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class CreateWorkspaceResponseData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.CreateWorkspaceResponseData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.CreateWorkspaceResponseData), + jsonSerializerContext) as global::OpenRouter.CreateWorkspaceResponseData; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.CreateWorkspaceResponseData? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.CreateWorkspaceResponseData), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.CreateWorkspaceResponseData; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponseData.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponseData.g.cs new file mode 100644 index 00000000..9b06caf4 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateWorkspaceResponseData.g.cs @@ -0,0 +1,184 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class CreateWorkspaceResponseData + { + /// + /// ISO 8601 timestamp of when the workspace was created + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// User ID of the workspace creator + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_by")] + public string? CreatedBy { get; set; } + + /// + /// Default image model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_image_model")] + public string? DefaultImageModel { get; set; } + + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_provider_sort")] + public string? DefaultProviderSort { get; set; } + + /// + /// Default text model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_text_model")] + public string? DefaultTextModel { get; set; } + + /// + /// Description of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Unique identifier for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Whether data discount logging is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_data_discount_logging_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsDataDiscountLoggingEnabled { get; set; } + + /// + /// Whether broadcast is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_broadcast_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsObservabilityBroadcastEnabled { get; set; } + + /// + /// Whether private logging is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_io_logging_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsObservabilityIoLoggingEnabled { get; set; } + + /// + /// Name of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// URL-friendly slug for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("slug")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Slug { get; set; } + + /// + /// ISO 8601 timestamp of when the workspace was last updated + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + public string? UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ISO 8601 timestamp of when the workspace was created + /// + /// + /// Unique identifier for the workspace + /// + /// + /// Whether data discount logging is enabled for this workspace + /// + /// + /// Whether broadcast is enabled for this workspace + /// + /// + /// Whether private logging is enabled for this workspace + /// + /// + /// Name of the workspace + /// + /// + /// URL-friendly slug for the workspace + /// + /// + /// User ID of the workspace creator + /// + /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// Description of the workspace + /// + /// + /// ISO 8601 timestamp of when the workspace was last updated + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public CreateWorkspaceResponseData( + string createdAt, + global::System.Guid id, + bool isDataDiscountLoggingEnabled, + bool isObservabilityBroadcastEnabled, + bool isObservabilityIoLoggingEnabled, + string name, + string slug, + string? createdBy, + string? defaultImageModel, + string? defaultProviderSort, + string? defaultTextModel, + string? description, + string? updatedAt) + { + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.CreatedBy = createdBy; + this.DefaultImageModel = defaultImageModel; + this.DefaultProviderSort = defaultProviderSort; + this.DefaultTextModel = defaultTextModel; + this.Description = description; + this.Id = id; + this.IsDataDiscountLoggingEnabled = isDataDiscountLoggingEnabled; + this.IsObservabilityBroadcastEnabled = isObservabilityBroadcastEnabled; + this.IsObservabilityIoLoggingEnabled = isObservabilityIoLoggingEnabled; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public CreateWorkspaceResponseData() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.DeleteWorkspaceResponse.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.DeleteWorkspaceResponse.Json.g.cs new file mode 100644 index 00000000..50fa7ffd --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.DeleteWorkspaceResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class DeleteWorkspaceResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.DeleteWorkspaceResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.DeleteWorkspaceResponse), + jsonSerializerContext) as global::OpenRouter.DeleteWorkspaceResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.DeleteWorkspaceResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.DeleteWorkspaceResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.DeleteWorkspaceResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.DeleteWorkspaceResponse.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.DeleteWorkspaceResponse.g.cs new file mode 100644 index 00000000..5f771121 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.DeleteWorkspaceResponse.g.cs @@ -0,0 +1,46 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class DeleteWorkspaceResponse + { + /// + /// Confirmation that the workspace was deleted + /// + [global::System.Text.Json.Serialization.JsonPropertyName("deleted")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool Deleted { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Confirmation that the workspace was deleted + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public DeleteWorkspaceResponse( + bool deleted) + { + this.Deleted = deleted; + } + + /// + /// Initializes a new instance of the class. + /// + public DeleteWorkspaceResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponse.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponse.Json.g.cs new file mode 100644 index 00000000..0c462c61 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class GetWorkspaceResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.GetWorkspaceResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.GetWorkspaceResponse), + jsonSerializerContext) as global::OpenRouter.GetWorkspaceResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.GetWorkspaceResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.GetWorkspaceResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.GetWorkspaceResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponse.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponse.g.cs new file mode 100644 index 00000000..17c22496 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponse.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class GetWorkspaceResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::OpenRouter.GetWorkspaceResponseData Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GetWorkspaceResponse( + global::OpenRouter.GetWorkspaceResponseData data) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public GetWorkspaceResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponseData.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponseData.Json.g.cs new file mode 100644 index 00000000..da40020e --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponseData.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class GetWorkspaceResponseData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.GetWorkspaceResponseData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.GetWorkspaceResponseData), + jsonSerializerContext) as global::OpenRouter.GetWorkspaceResponseData; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.GetWorkspaceResponseData? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.GetWorkspaceResponseData), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.GetWorkspaceResponseData; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponseData.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponseData.g.cs new file mode 100644 index 00000000..1f2be9f4 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetWorkspaceResponseData.g.cs @@ -0,0 +1,184 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class GetWorkspaceResponseData + { + /// + /// ISO 8601 timestamp of when the workspace was created + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// User ID of the workspace creator + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_by")] + public string? CreatedBy { get; set; } + + /// + /// Default image model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_image_model")] + public string? DefaultImageModel { get; set; } + + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_provider_sort")] + public string? DefaultProviderSort { get; set; } + + /// + /// Default text model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_text_model")] + public string? DefaultTextModel { get; set; } + + /// + /// Description of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Unique identifier for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Whether data discount logging is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_data_discount_logging_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsDataDiscountLoggingEnabled { get; set; } + + /// + /// Whether broadcast is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_broadcast_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsObservabilityBroadcastEnabled { get; set; } + + /// + /// Whether private logging is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_io_logging_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsObservabilityIoLoggingEnabled { get; set; } + + /// + /// Name of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// URL-friendly slug for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("slug")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Slug { get; set; } + + /// + /// ISO 8601 timestamp of when the workspace was last updated + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + public string? UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ISO 8601 timestamp of when the workspace was created + /// + /// + /// Unique identifier for the workspace + /// + /// + /// Whether data discount logging is enabled for this workspace + /// + /// + /// Whether broadcast is enabled for this workspace + /// + /// + /// Whether private logging is enabled for this workspace + /// + /// + /// Name of the workspace + /// + /// + /// URL-friendly slug for the workspace + /// + /// + /// User ID of the workspace creator + /// + /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// Description of the workspace + /// + /// + /// ISO 8601 timestamp of when the workspace was last updated + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public GetWorkspaceResponseData( + string createdAt, + global::System.Guid id, + bool isDataDiscountLoggingEnabled, + bool isObservabilityBroadcastEnabled, + bool isObservabilityIoLoggingEnabled, + string name, + string slug, + string? createdBy, + string? defaultImageModel, + string? defaultProviderSort, + string? defaultTextModel, + string? description, + string? updatedAt) + { + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.CreatedBy = createdBy; + this.DefaultImageModel = defaultImageModel; + this.DefaultProviderSort = defaultProviderSort; + this.DefaultTextModel = defaultTextModel; + this.Description = description; + this.Id = id; + this.IsDataDiscountLoggingEnabled = isDataDiscountLoggingEnabled; + this.IsObservabilityBroadcastEnabled = isObservabilityBroadcastEnabled; + this.IsObservabilityIoLoggingEnabled = isObservabilityIoLoggingEnabled; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public GetWorkspaceResponseData() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ListWorkspacesResponse.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ListWorkspacesResponse.Json.g.cs new file mode 100644 index 00000000..b09e68b5 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ListWorkspacesResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class ListWorkspacesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.ListWorkspacesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.ListWorkspacesResponse), + jsonSerializerContext) as global::OpenRouter.ListWorkspacesResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.ListWorkspacesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.ListWorkspacesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.ListWorkspacesResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ListWorkspacesResponse.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ListWorkspacesResponse.g.cs new file mode 100644 index 00000000..2caa88ad --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ListWorkspacesResponse.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class ListWorkspacesResponse + { + /// + /// List of workspaces + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// Total number of workspaces + /// + [global::System.Text.Json.Serialization.JsonPropertyName("total_count")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int TotalCount { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// List of workspaces + /// + /// + /// Total number of workspaces + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ListWorkspacesResponse( + global::System.Collections.Generic.IList data, + int totalCount) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.TotalCount = totalCount; + } + + /// + /// Initializes a new instance of the class. + /// + public ListWorkspacesResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceRequest.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceRequest.Json.g.cs new file mode 100644 index 00000000..06cf1c94 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class UpdateWorkspaceRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.UpdateWorkspaceRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.UpdateWorkspaceRequest), + jsonSerializerContext) as global::OpenRouter.UpdateWorkspaceRequest; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.UpdateWorkspaceRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.UpdateWorkspaceRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.UpdateWorkspaceRequest; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceRequest.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceRequest.g.cs new file mode 100644 index 00000000..b4a646a8 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceRequest.g.cs @@ -0,0 +1,133 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class UpdateWorkspaceRequest + { + /// + /// Default image model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_image_model")] + public string? DefaultImageModel { get; set; } + + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_provider_sort")] + public string? DefaultProviderSort { get; set; } + + /// + /// Default text model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_text_model")] + public string? DefaultTextModel { get; set; } + + /// + /// New description for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Whether data discount logging is enabled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_data_discount_logging_enabled")] + public bool? IsDataDiscountLoggingEnabled { get; set; } + + /// + /// Whether broadcast is enabled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_broadcast_enabled")] + public bool? IsObservabilityBroadcastEnabled { get; set; } + + /// + /// Whether private logging is enabled + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_io_logging_enabled")] + public bool? IsObservabilityIoLoggingEnabled { get; set; } + + /// + /// New name for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// New URL-friendly slug + /// + [global::System.Text.Json.Serialization.JsonPropertyName("slug")] + public string? Slug { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// New description for the workspace + /// + /// + /// Whether data discount logging is enabled + /// + /// + /// Whether broadcast is enabled + /// + /// + /// Whether private logging is enabled + /// + /// + /// New name for the workspace + /// + /// + /// New URL-friendly slug + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateWorkspaceRequest( + string? defaultImageModel, + string? defaultProviderSort, + string? defaultTextModel, + string? description, + bool? isDataDiscountLoggingEnabled, + bool? isObservabilityBroadcastEnabled, + bool? isObservabilityIoLoggingEnabled, + string? name, + string? slug) + { + this.DefaultImageModel = defaultImageModel; + this.DefaultProviderSort = defaultProviderSort; + this.DefaultTextModel = defaultTextModel; + this.Description = description; + this.IsDataDiscountLoggingEnabled = isDataDiscountLoggingEnabled; + this.IsObservabilityBroadcastEnabled = isObservabilityBroadcastEnabled; + this.IsObservabilityIoLoggingEnabled = isObservabilityIoLoggingEnabled; + this.Name = name; + this.Slug = slug; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateWorkspaceRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponse.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponse.Json.g.cs new file mode 100644 index 00000000..078346fb --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponse.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class UpdateWorkspaceResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.UpdateWorkspaceResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.UpdateWorkspaceResponse), + jsonSerializerContext) as global::OpenRouter.UpdateWorkspaceResponse; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.UpdateWorkspaceResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.UpdateWorkspaceResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.UpdateWorkspaceResponse; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponse.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponse.g.cs new file mode 100644 index 00000000..6cdfe2fc --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponse.g.cs @@ -0,0 +1,44 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class UpdateWorkspaceResponse + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::OpenRouter.UpdateWorkspaceResponseData Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateWorkspaceResponse( + global::OpenRouter.UpdateWorkspaceResponseData data) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateWorkspaceResponse() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponseData.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponseData.Json.g.cs new file mode 100644 index 00000000..d77d2201 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponseData.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class UpdateWorkspaceResponseData + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.UpdateWorkspaceResponseData? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.UpdateWorkspaceResponseData), + jsonSerializerContext) as global::OpenRouter.UpdateWorkspaceResponseData; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.UpdateWorkspaceResponseData? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.UpdateWorkspaceResponseData), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.UpdateWorkspaceResponseData; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponseData.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponseData.g.cs new file mode 100644 index 00000000..6c051eff --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateWorkspaceResponseData.g.cs @@ -0,0 +1,184 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class UpdateWorkspaceResponseData + { + /// + /// ISO 8601 timestamp of when the workspace was created + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// User ID of the workspace creator + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_by")] + public string? CreatedBy { get; set; } + + /// + /// Default image model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_image_model")] + public string? DefaultImageModel { get; set; } + + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_provider_sort")] + public string? DefaultProviderSort { get; set; } + + /// + /// Default text model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_text_model")] + public string? DefaultTextModel { get; set; } + + /// + /// Description of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Unique identifier for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Whether data discount logging is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_data_discount_logging_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsDataDiscountLoggingEnabled { get; set; } + + /// + /// Whether broadcast is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_broadcast_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsObservabilityBroadcastEnabled { get; set; } + + /// + /// Whether private logging is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_io_logging_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsObservabilityIoLoggingEnabled { get; set; } + + /// + /// Name of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// URL-friendly slug for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("slug")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Slug { get; set; } + + /// + /// ISO 8601 timestamp of when the workspace was last updated + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + public string? UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ISO 8601 timestamp of when the workspace was created + /// + /// + /// Unique identifier for the workspace + /// + /// + /// Whether data discount logging is enabled for this workspace + /// + /// + /// Whether broadcast is enabled for this workspace + /// + /// + /// Whether private logging is enabled for this workspace + /// + /// + /// Name of the workspace + /// + /// + /// URL-friendly slug for the workspace + /// + /// + /// User ID of the workspace creator + /// + /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// Description of the workspace + /// + /// + /// ISO 8601 timestamp of when the workspace was last updated + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public UpdateWorkspaceResponseData( + string createdAt, + global::System.Guid id, + bool isDataDiscountLoggingEnabled, + bool isObservabilityBroadcastEnabled, + bool isObservabilityIoLoggingEnabled, + string name, + string slug, + string? createdBy, + string? defaultImageModel, + string? defaultProviderSort, + string? defaultTextModel, + string? description, + string? updatedAt) + { + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.CreatedBy = createdBy; + this.DefaultImageModel = defaultImageModel; + this.DefaultProviderSort = defaultProviderSort; + this.DefaultTextModel = defaultTextModel; + this.Description = description; + this.Id = id; + this.IsDataDiscountLoggingEnabled = isDataDiscountLoggingEnabled; + this.IsObservabilityBroadcastEnabled = isObservabilityBroadcastEnabled; + this.IsObservabilityIoLoggingEnabled = isObservabilityIoLoggingEnabled; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public UpdateWorkspaceResponseData() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.Workspace.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.Workspace.Json.g.cs new file mode 100644 index 00000000..95baaea8 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.Workspace.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class Workspace + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.Workspace? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.Workspace), + jsonSerializerContext) as global::OpenRouter.Workspace; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.Workspace? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.Workspace), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.Workspace; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.Workspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.Workspace.g.cs new file mode 100644 index 00000000..1816ba70 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.Workspace.g.cs @@ -0,0 +1,184 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class Workspace + { + /// + /// ISO 8601 timestamp of when the workspace was created + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// User ID of the workspace creator + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_by")] + public string? CreatedBy { get; set; } + + /// + /// Default image model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_image_model")] + public string? DefaultImageModel { get; set; } + + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_provider_sort")] + public string? DefaultProviderSort { get; set; } + + /// + /// Default text model for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("default_text_model")] + public string? DefaultTextModel { get; set; } + + /// + /// Description of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Unique identifier for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Whether data discount logging is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_data_discount_logging_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsDataDiscountLoggingEnabled { get; set; } + + /// + /// Whether broadcast is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_broadcast_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsObservabilityBroadcastEnabled { get; set; } + + /// + /// Whether private logging is enabled for this workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("is_observability_io_logging_enabled")] + [global::System.Text.Json.Serialization.JsonRequired] + public required bool IsObservabilityIoLoggingEnabled { get; set; } + + /// + /// Name of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// URL-friendly slug for the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("slug")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Slug { get; set; } + + /// + /// ISO 8601 timestamp of when the workspace was last updated + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] + public string? UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ISO 8601 timestamp of when the workspace was created + /// + /// + /// Unique identifier for the workspace + /// + /// + /// Whether data discount logging is enabled for this workspace + /// + /// + /// Whether broadcast is enabled for this workspace + /// + /// + /// Whether private logging is enabled for this workspace + /// + /// + /// Name of the workspace + /// + /// + /// URL-friendly slug for the workspace + /// + /// + /// User ID of the workspace creator + /// + /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// Description of the workspace + /// + /// + /// ISO 8601 timestamp of when the workspace was last updated + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Workspace( + string createdAt, + global::System.Guid id, + bool isDataDiscountLoggingEnabled, + bool isObservabilityBroadcastEnabled, + bool isObservabilityIoLoggingEnabled, + string name, + string slug, + string? createdBy, + string? defaultImageModel, + string? defaultProviderSort, + string? defaultTextModel, + string? description, + string? updatedAt) + { + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.CreatedBy = createdBy; + this.DefaultImageModel = defaultImageModel; + this.DefaultProviderSort = defaultProviderSort; + this.DefaultTextModel = defaultTextModel; + this.Description = description; + this.Id = id; + this.IsDataDiscountLoggingEnabled = isDataDiscountLoggingEnabled; + this.IsObservabilityBroadcastEnabled = isObservabilityBroadcastEnabled; + this.IsObservabilityIoLoggingEnabled = isObservabilityIoLoggingEnabled; + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.Slug = slug ?? throw new global::System.ArgumentNullException(nameof(slug)); + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public Workspace() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMember.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMember.Json.g.cs new file mode 100644 index 00000000..06a73e25 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMember.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class WorkspaceMember + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.WorkspaceMember? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.WorkspaceMember), + jsonSerializerContext) as global::OpenRouter.WorkspaceMember; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.WorkspaceMember? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.WorkspaceMember), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.WorkspaceMember; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMember.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMember.g.cs new file mode 100644 index 00000000..af8ad7a7 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMember.g.cs @@ -0,0 +1,95 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class WorkspaceMember + { + /// + /// ISO 8601 timestamp of when the membership was created + /// + [global::System.Text.Json.Serialization.JsonPropertyName("created_at")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string CreatedAt { get; set; } + + /// + /// Unique identifier for the workspace membership + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid Id { get; set; } + + /// + /// Role of the member in the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenRouter.JsonConverters.WorkspaceMemberRoleJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::OpenRouter.WorkspaceMemberRole Role { get; set; } + + /// + /// Clerk user ID of the member + /// + [global::System.Text.Json.Serialization.JsonPropertyName("user_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string UserId { get; set; } + + /// + /// ID of the workspace + /// + [global::System.Text.Json.Serialization.JsonPropertyName("workspace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Guid WorkspaceId { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// ISO 8601 timestamp of when the membership was created + /// + /// + /// Unique identifier for the workspace membership + /// + /// + /// Role of the member in the workspace + /// + /// + /// Clerk user ID of the member + /// + /// + /// ID of the workspace + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public WorkspaceMember( + string createdAt, + global::System.Guid id, + global::OpenRouter.WorkspaceMemberRole role, + string userId, + global::System.Guid workspaceId) + { + this.CreatedAt = createdAt ?? throw new global::System.ArgumentNullException(nameof(createdAt)); + this.Id = id; + this.Role = role; + this.UserId = userId ?? throw new global::System.ArgumentNullException(nameof(userId)); + this.WorkspaceId = workspaceId; + } + + /// + /// Initializes a new instance of the class. + /// + public WorkspaceMember() + { + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMemberRole.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMemberRole.g.cs new file mode 100644 index 00000000..f7fa2371 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.WorkspaceMemberRole.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// Role of the member in the workspace + /// + public enum WorkspaceMemberRole + { + /// + /// + /// + Admin, + /// + /// + /// + Member, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class WorkspaceMemberRoleExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this WorkspaceMemberRole value) + { + return value switch + { + WorkspaceMemberRole.Admin => "admin", + WorkspaceMemberRole.Member => "member", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static WorkspaceMemberRole? ToEnum(string value) + { + return value switch + { + "admin" => WorkspaceMemberRole.Admin, + "member" => WorkspaceMemberRole.Member, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.OpenRouterClient.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.OpenRouterClient.g.cs index ab477ea0..91ff82f9 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.OpenRouterClient.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.OpenRouterClient.g.cs @@ -192,6 +192,15 @@ public sealed partial class OpenRouterClient : global::OpenRouter.IOpenRouterCli JsonSerializerContext = JsonSerializerContext, }; + /// + /// + /// + public SubpackageWorkspacesClient SubpackageWorkspaces => new SubpackageWorkspacesClient(HttpClient, authorizations: Authorizations, options: Options) + { + ReadResponseAsString = ReadResponseAsString, + JsonSerializerContext = JsonSerializerContext, + }; + /// /// Creates a new instance of the OpenRouterClient. /// If no httpClient is provided, a new one will be created. diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs new file mode 100644 index 00000000..0420c2a3 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkAddWorkspaceMembers.g.cs @@ -0,0 +1,615 @@ + +#nullable enable + +namespace OpenRouter +{ + public partial class SubpackageWorkspacesClient + { + + + private static readonly global::OpenRouter.EndPointSecurityRequirement s_BulkAddWorkspaceMembersSecurityRequirement0 = + new global::OpenRouter.EndPointSecurityRequirement + { + Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[] + { new global::OpenRouter.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "Bearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_BulkAddWorkspaceMembersSecurityRequirements = + new global::OpenRouter.EndPointSecurityRequirement[] + { s_BulkAddWorkspaceMembersSecurityRequirement0, + }; + partial void PrepareBulkAddWorkspaceMembersArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::OpenRouter.BulkAddWorkspaceMembersRequest request); + partial void PrepareBulkAddWorkspaceMembersRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::OpenRouter.BulkAddWorkspaceMembersRequest request); + partial void ProcessBulkAddWorkspaceMembersResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessBulkAddWorkspaceMembersResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Bulk add members to a workspace
+ /// Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task BulkAddWorkspaceMembersAsync( + string id, + + global::OpenRouter.BulkAddWorkspaceMembersRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareBulkAddWorkspaceMembersArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BulkAddWorkspaceMembersSecurityRequirements, + operationName: "BulkAddWorkspaceMembersAsync"); + + using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::OpenRouter.PathBuilder( + path: $"/workspaces/{id}/members/add", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareBulkAddWorkspaceMembersRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkAddWorkspaceMembers", + methodName: "BulkAddWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/add\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkAddWorkspaceMembers", + methodName: "BulkAddWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/add\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkAddWorkspaceMembers", + methodName: "BulkAddWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/add\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessBulkAddWorkspaceMembersResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkAddWorkspaceMembers", + methodName: "BulkAddWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/add\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkAddWorkspaceMembers", + methodName: "BulkAddWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/add\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request - Invalid request parameters or malformed input + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::OpenRouter.BadRequestResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Unauthorized - Authentication required or invalid credentials + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::OpenRouter.UnauthorizedResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden - Authentication successful but insufficient permissions + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::OpenRouter.ForbiddenResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Not Found - Resource does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::OpenRouter.NotFoundResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal Server Error - Unexpected server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::OpenRouter.InternalServerResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessBulkAddWorkspaceMembersResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::OpenRouter.BulkAddWorkspaceMembersResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::OpenRouter.BulkAddWorkspaceMembersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Bulk add members to a workspace
+ /// Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task BulkAddWorkspaceMembersAsync( + string id, + global::System.Collections.Generic.IList userIds, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::OpenRouter.BulkAddWorkspaceMembersRequest + { + UserIds = userIds, + }; + + return await BulkAddWorkspaceMembersAsync( + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs new file mode 100644 index 00000000..8929f88f --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.BulkRemoveWorkspaceMembers.g.cs @@ -0,0 +1,615 @@ + +#nullable enable + +namespace OpenRouter +{ + public partial class SubpackageWorkspacesClient + { + + + private static readonly global::OpenRouter.EndPointSecurityRequirement s_BulkRemoveWorkspaceMembersSecurityRequirement0 = + new global::OpenRouter.EndPointSecurityRequirement + { + Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[] + { new global::OpenRouter.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "Bearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_BulkRemoveWorkspaceMembersSecurityRequirements = + new global::OpenRouter.EndPointSecurityRequirement[] + { s_BulkRemoveWorkspaceMembersSecurityRequirement0, + }; + partial void PrepareBulkRemoveWorkspaceMembersArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::OpenRouter.BulkRemoveWorkspaceMembersRequest request); + partial void PrepareBulkRemoveWorkspaceMembersRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::OpenRouter.BulkRemoveWorkspaceMembersRequest request); + partial void ProcessBulkRemoveWorkspaceMembersResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessBulkRemoveWorkspaceMembersResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Bulk remove members from a workspace
+ /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task BulkRemoveWorkspaceMembersAsync( + string id, + + global::OpenRouter.BulkRemoveWorkspaceMembersRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareBulkRemoveWorkspaceMembersArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_BulkRemoveWorkspaceMembersSecurityRequirements, + operationName: "BulkRemoveWorkspaceMembersAsync"); + + using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::OpenRouter.PathBuilder( + path: $"/workspaces/{id}/members/remove", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareBulkRemoveWorkspaceMembersRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkRemoveWorkspaceMembers", + methodName: "BulkRemoveWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/remove\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkRemoveWorkspaceMembers", + methodName: "BulkRemoveWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/remove\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkRemoveWorkspaceMembers", + methodName: "BulkRemoveWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/remove\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessBulkRemoveWorkspaceMembersResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkRemoveWorkspaceMembers", + methodName: "BulkRemoveWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/remove\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "BulkRemoveWorkspaceMembers", + methodName: "BulkRemoveWorkspaceMembersAsync", + pathTemplate: "$\"/workspaces/{id}/members/remove\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request - Invalid request parameters or malformed input + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::OpenRouter.BadRequestResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Unauthorized - Authentication required or invalid credentials + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::OpenRouter.UnauthorizedResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden - Authentication successful but insufficient permissions + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::OpenRouter.ForbiddenResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Not Found - Resource does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::OpenRouter.NotFoundResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal Server Error - Unexpected server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::OpenRouter.InternalServerResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessBulkRemoveWorkspaceMembersResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::OpenRouter.BulkRemoveWorkspaceMembersResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::OpenRouter.BulkRemoveWorkspaceMembersResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Bulk remove members from a workspace
+ /// Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// List of user IDs to remove from the workspace + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task BulkRemoveWorkspaceMembersAsync( + string id, + global::System.Collections.Generic.IList userIds, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::OpenRouter.BulkRemoveWorkspaceMembersRequest + { + UserIds = userIds, + }; + + return await BulkRemoveWorkspaceMembersAsync( + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.CreateWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.CreateWorkspace.g.cs new file mode 100644 index 00000000..694df010 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.CreateWorkspace.g.cs @@ -0,0 +1,608 @@ + +#nullable enable + +namespace OpenRouter +{ + public partial class SubpackageWorkspacesClient + { + + + private static readonly global::OpenRouter.EndPointSecurityRequirement s_CreateWorkspaceSecurityRequirement0 = + new global::OpenRouter.EndPointSecurityRequirement + { + Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[] + { new global::OpenRouter.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "Bearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_CreateWorkspaceSecurityRequirements = + new global::OpenRouter.EndPointSecurityRequirement[] + { s_CreateWorkspaceSecurityRequirement0, + }; + partial void PrepareCreateWorkspaceArguments( + global::System.Net.Http.HttpClient httpClient, + global::OpenRouter.CreateWorkspaceRequest request); + partial void PrepareCreateWorkspaceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::OpenRouter.CreateWorkspaceRequest request); + partial void ProcessCreateWorkspaceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreateWorkspaceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a workspace
+ /// Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateWorkspaceAsync( + + global::OpenRouter.CreateWorkspaceRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreateWorkspaceArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreateWorkspaceSecurityRequirements, + operationName: "CreateWorkspaceAsync"); + + using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::OpenRouter.PathBuilder( + path: "/workspaces", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreateWorkspaceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateWorkspace", + methodName: "CreateWorkspaceAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateWorkspace", + methodName: "CreateWorkspaceAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateWorkspace", + methodName: "CreateWorkspaceAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreateWorkspaceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateWorkspace", + methodName: "CreateWorkspaceAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreateWorkspace", + methodName: "CreateWorkspaceAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request - Invalid request parameters or malformed input + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::OpenRouter.BadRequestResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Unauthorized - Authentication required or invalid credentials + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::OpenRouter.UnauthorizedResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden - Authentication successful but insufficient permissions + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::OpenRouter.ForbiddenResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal Server Error - Unexpected server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::OpenRouter.InternalServerResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreateWorkspaceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::OpenRouter.CreateWorkspaceResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::OpenRouter.CreateWorkspaceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a workspace
+ /// Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// Description of the workspace + /// + /// + /// Whether data discount logging is enabled + /// + /// + /// Whether broadcast is enabled + /// + /// + /// Whether private logging is enabled + /// + /// + /// Name for the new workspace + /// + /// + /// URL-friendly slug (lowercase alphanumeric and hyphens only) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreateWorkspaceAsync( + string name, + string slug, + string? defaultImageModel = default, + string? defaultProviderSort = default, + string? defaultTextModel = default, + string? description = default, + bool? isDataDiscountLoggingEnabled = default, + bool? isObservabilityBroadcastEnabled = default, + bool? isObservabilityIoLoggingEnabled = default, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::OpenRouter.CreateWorkspaceRequest + { + DefaultImageModel = defaultImageModel, + DefaultProviderSort = defaultProviderSort, + DefaultTextModel = defaultTextModel, + Description = description, + IsDataDiscountLoggingEnabled = isDataDiscountLoggingEnabled, + IsObservabilityBroadcastEnabled = isObservabilityBroadcastEnabled, + IsObservabilityIoLoggingEnabled = isObservabilityIoLoggingEnabled, + Name = name, + Slug = slug, + }; + + return await CreateWorkspaceAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.DeleteWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.DeleteWorkspace.g.cs new file mode 100644 index 00000000..6b0064fa --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.DeleteWorkspace.g.cs @@ -0,0 +1,572 @@ + +#nullable enable + +namespace OpenRouter +{ + public partial class SubpackageWorkspacesClient + { + + + private static readonly global::OpenRouter.EndPointSecurityRequirement s_DeleteWorkspaceSecurityRequirement0 = + new global::OpenRouter.EndPointSecurityRequirement + { + Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[] + { new global::OpenRouter.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "Bearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_DeleteWorkspaceSecurityRequirements = + new global::OpenRouter.EndPointSecurityRequirement[] + { s_DeleteWorkspaceSecurityRequirement0, + }; + partial void PrepareDeleteWorkspaceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareDeleteWorkspaceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessDeleteWorkspaceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessDeleteWorkspaceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Delete a workspace
+ /// Delete an existing workspace. The default workspace cannot be deleted. Workspaces with active API keys cannot be deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task DeleteWorkspaceAsync( + string id, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDeleteWorkspaceArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DeleteWorkspaceSecurityRequirements, + operationName: "DeleteWorkspaceAsync"); + + using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::OpenRouter.PathBuilder( + path: $"/workspaces/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDeleteWorkspaceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspace", + methodName: "DeleteWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspace", + methodName: "DeleteWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspace", + methodName: "DeleteWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDeleteWorkspaceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspace", + methodName: "DeleteWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DeleteWorkspace", + methodName: "DeleteWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request - Invalid request parameters or malformed input + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::OpenRouter.BadRequestResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Unauthorized - Authentication required or invalid credentials + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::OpenRouter.UnauthorizedResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden - Authentication successful but insufficient permissions + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::OpenRouter.ForbiddenResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Not Found - Resource does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::OpenRouter.NotFoundResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal Server Error - Unexpected server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::OpenRouter.InternalServerResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessDeleteWorkspaceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::OpenRouter.DeleteWorkspaceResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::OpenRouter.DeleteWorkspaceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.GetWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.GetWorkspace.g.cs new file mode 100644 index 00000000..dd3bc807 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.GetWorkspace.g.cs @@ -0,0 +1,496 @@ + +#nullable enable + +namespace OpenRouter +{ + public partial class SubpackageWorkspacesClient + { + + + private static readonly global::OpenRouter.EndPointSecurityRequirement s_GetWorkspaceSecurityRequirement0 = + new global::OpenRouter.EndPointSecurityRequirement + { + Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[] + { new global::OpenRouter.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "Bearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_GetWorkspaceSecurityRequirements = + new global::OpenRouter.EndPointSecurityRequirement[] + { s_GetWorkspaceSecurityRequirement0, + }; + partial void PrepareGetWorkspaceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id); + partial void PrepareGetWorkspaceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id); + partial void ProcessGetWorkspaceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessGetWorkspaceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a workspace
+ /// Get a single workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task GetWorkspaceAsync( + string id, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetWorkspaceArguments( + httpClient: HttpClient, + id: ref id); + + + var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetWorkspaceSecurityRequirements, + operationName: "GetWorkspaceAsync"); + + using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::OpenRouter.PathBuilder( + path: $"/workspaces/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetWorkspaceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspace", + methodName: "GetWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspace", + methodName: "GetWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspace", + methodName: "GetWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetWorkspaceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspace", + methodName: "GetWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "GetWorkspace", + methodName: "GetWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized - Authentication required or invalid credentials + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::OpenRouter.UnauthorizedResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Not Found - Resource does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::OpenRouter.NotFoundResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal Server Error - Unexpected server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::OpenRouter.InternalServerResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessGetWorkspaceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::OpenRouter.GetWorkspaceResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::OpenRouter.GetWorkspaceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.ListWorkspaces.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.ListWorkspaces.g.cs new file mode 100644 index 00000000..740d15de --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.ListWorkspaces.g.cs @@ -0,0 +1,468 @@ + +#nullable enable + +namespace OpenRouter +{ + public partial class SubpackageWorkspacesClient + { + + + private static readonly global::OpenRouter.EndPointSecurityRequirement s_ListWorkspacesSecurityRequirement0 = + new global::OpenRouter.EndPointSecurityRequirement + { + Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[] + { new global::OpenRouter.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "Bearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_ListWorkspacesSecurityRequirements = + new global::OpenRouter.EndPointSecurityRequirement[] + { s_ListWorkspacesSecurityRequirement0, + }; + partial void PrepareListWorkspacesArguments( + global::System.Net.Http.HttpClient httpClient, + ref int? offset, + ref int? limit); + partial void PrepareListWorkspacesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + int? offset, + int? limit); + partial void ProcessListWorkspacesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessListWorkspacesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List workspaces
+ /// List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ListWorkspacesAsync( + int? offset = default, + int? limit = default, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareListWorkspacesArguments( + httpClient: HttpClient, + offset: ref offset, + limit: ref limit); + + + var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_ListWorkspacesSecurityRequirements, + operationName: "ListWorkspacesAsync"); + + using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::OpenRouter.PathBuilder( + path: "/workspaces", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("offset", offset?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) + ; + var __path = __pathBuilder.ToString(); + __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareListWorkspacesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + offset: offset, + limit: limit); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListWorkspaces", + methodName: "ListWorkspacesAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListWorkspaces", + methodName: "ListWorkspacesAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListWorkspaces", + methodName: "ListWorkspacesAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessListWorkspacesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListWorkspaces", + methodName: "ListWorkspacesAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "ListWorkspaces", + methodName: "ListWorkspacesAsync", + pathTemplate: "\"/workspaces\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Unauthorized - Authentication required or invalid credentials + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::OpenRouter.UnauthorizedResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal Server Error - Unexpected server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::OpenRouter.InternalServerResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessListWorkspacesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::OpenRouter.ListWorkspacesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::OpenRouter.ListWorkspacesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.UpdateWorkspace.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.UpdateWorkspace.g.cs new file mode 100644 index 00000000..17ef08cb --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.UpdateWorkspace.g.cs @@ -0,0 +1,655 @@ + +#nullable enable + +namespace OpenRouter +{ + public partial class SubpackageWorkspacesClient + { + + + private static readonly global::OpenRouter.EndPointSecurityRequirement s_UpdateWorkspaceSecurityRequirement0 = + new global::OpenRouter.EndPointSecurityRequirement + { + Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[] + { new global::OpenRouter.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "Bearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_UpdateWorkspaceSecurityRequirements = + new global::OpenRouter.EndPointSecurityRequirement[] + { s_UpdateWorkspaceSecurityRequirement0, + }; + partial void PrepareUpdateWorkspaceArguments( + global::System.Net.Http.HttpClient httpClient, + ref string id, + global::OpenRouter.UpdateWorkspaceRequest request); + partial void PrepareUpdateWorkspaceRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string id, + global::OpenRouter.UpdateWorkspaceRequest request); + partial void ProcessUpdateWorkspaceResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessUpdateWorkspaceResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update a workspace
+ /// Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UpdateWorkspaceAsync( + string id, + + global::OpenRouter.UpdateWorkspaceRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareUpdateWorkspaceArguments( + httpClient: HttpClient, + id: ref id, + request: request); + + + var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UpdateWorkspaceSecurityRequirements, + operationName: "UpdateWorkspaceAsync"); + + using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + var __pathBuilder = new global::OpenRouter.PathBuilder( + path: $"/workspaces/{id}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareUpdateWorkspaceRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + id: id, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspace", + methodName: "UpdateWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspace", + methodName: "UpdateWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspace", + methodName: "UpdateWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessUpdateWorkspaceResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspace", + methodName: "UpdateWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UpdateWorkspace", + methodName: "UpdateWorkspaceAsync", + pathTemplate: "$\"/workspaces/{id}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request - Invalid request parameters or malformed input + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::OpenRouter.BadRequestResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + statusCode: __response.StatusCode) + { + ResponseBody = __content_400, + ResponseObject = __value_400, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Unauthorized - Authentication required or invalid credentials + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::OpenRouter.UnauthorizedResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + statusCode: __response.StatusCode) + { + ResponseBody = __content_401, + ResponseObject = __value_401, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Forbidden - Authentication successful but insufficient permissions + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::OpenRouter.ForbiddenResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + statusCode: __response.StatusCode) + { + ResponseBody = __content_403, + ResponseObject = __value_403, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Not Found - Resource does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::OpenRouter.NotFoundResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + statusCode: __response.StatusCode) + { + ResponseBody = __content_404, + ResponseObject = __value_404, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + // Internal Server Error - Unexpected server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::OpenRouter.InternalServerResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + throw new global::OpenRouter.ApiException( + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + statusCode: __response.StatusCode) + { + ResponseBody = __content_500, + ResponseObject = __value_500, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessUpdateWorkspaceResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::OpenRouter.UpdateWorkspaceResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return + await global::OpenRouter.UpdateWorkspaceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw new global::OpenRouter.ApiException( + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseBody = __content, + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update a workspace
+ /// Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required. + ///
+ /// + /// + /// Default image model for this workspace + /// + /// + /// Default provider sort preference (price, throughput, latency, exacto) + /// + /// + /// Default text model for this workspace + /// + /// + /// New description for the workspace + /// + /// + /// Whether data discount logging is enabled + /// + /// + /// Whether broadcast is enabled + /// + /// + /// Whether private logging is enabled + /// + /// + /// New name for the workspace + /// + /// + /// New URL-friendly slug + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task UpdateWorkspaceAsync( + string id, + string? defaultImageModel = default, + string? defaultProviderSort = default, + string? defaultTextModel = default, + string? description = default, + bool? isDataDiscountLoggingEnabled = default, + bool? isObservabilityBroadcastEnabled = default, + bool? isObservabilityIoLoggingEnabled = default, + string? name = default, + string? slug = default, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::OpenRouter.UpdateWorkspaceRequest + { + DefaultImageModel = defaultImageModel, + DefaultProviderSort = defaultProviderSort, + DefaultTextModel = defaultTextModel, + Description = description, + IsDataDiscountLoggingEnabled = isDataDiscountLoggingEnabled, + IsObservabilityBroadcastEnabled = isObservabilityBroadcastEnabled, + IsObservabilityIoLoggingEnabled = isObservabilityIoLoggingEnabled, + Name = name, + Slug = slug, + }; + + return await UpdateWorkspaceAsync( + id: id, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.g.cs new file mode 100644 index 00000000..cc957254 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageWorkspacesClient.g.cs @@ -0,0 +1,115 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// If no httpClient is provided, a new one will be created.
+ /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + ///
+ public sealed partial class SubpackageWorkspacesClient : global::OpenRouter.ISubpackageWorkspacesClient, global::System.IDisposable + { + /// + /// + /// + public const string DefaultBaseUrl = "https://openrouter.ai/api/v1"; + + private bool _disposeHttpClient = true; + + /// + public global::System.Net.Http.HttpClient HttpClient { get; } + + /// + public System.Uri? BaseUri => HttpClient.BaseAddress; + + /// + public global::System.Collections.Generic.List Authorizations { get; } + + /// + public bool ReadResponseAsString { get; set; } +#if DEBUG + = true; +#endif + + /// + public global::OpenRouter.AutoSDKClientOptions Options { get; } + /// + /// + /// + public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::OpenRouter.SourceGenerationContext.Default; + + + /// + /// Creates a new instance of the SubpackageWorkspacesClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SubpackageWorkspacesClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + bool disposeHttpClient = true) : this( + httpClient, + baseUri, + authorizations, + options: null, + disposeHttpClient: disposeHttpClient) + { + } + + /// + /// Creates a new instance of the SubpackageWorkspacesClient. + /// If no httpClient is provided, a new one will be created. + /// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. + /// + /// The HttpClient instance. If not provided, a new one will be created. + /// The base URL for the API. If not provided, the default baseUri from OpenAPI spec will be used. + /// The authorizations to use for the requests. + /// Client-wide request defaults such as headers, query parameters, retries, and timeout. + /// Dispose the HttpClient when the instance is disposed. True by default. + public SubpackageWorkspacesClient( + global::System.Net.Http.HttpClient? httpClient = null, + global::System.Uri? baseUri = null, + global::System.Collections.Generic.List? authorizations = null, + global::OpenRouter.AutoSDKClientOptions? options = null, + bool disposeHttpClient = true) + { + + HttpClient = httpClient ?? new global::System.Net.Http.HttpClient(); + HttpClient.BaseAddress ??= baseUri ?? new global::System.Uri(DefaultBaseUrl); + Authorizations = authorizations ?? new global::System.Collections.Generic.List(); + Options = options ?? new global::OpenRouter.AutoSDKClientOptions(); + _disposeHttpClient = disposeHttpClient; + + Initialized(HttpClient); + } + + /// + public void Dispose() + { + if (_disposeHttpClient) + { + HttpClient.Dispose(); + } + } + + partial void Initialized( + global::System.Net.Http.HttpClient client); + partial void PrepareArguments( + global::System.Net.Http.HttpClient client); + partial void PrepareRequest( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpRequestMessage request); + partial void ProcessResponse( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response); + partial void ProcessResponseContent( + global::System.Net.Http.HttpClient client, + global::System.Net.Http.HttpResponseMessage response, + ref string content); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/openapi.yaml b/src/libs/OpenRouter/openapi.yaml index 4e0a7b50..9ef8f37f 100644 --- a/src/libs/OpenRouter/openapi.yaml +++ b/src/libs/OpenRouter/openapi.yaml @@ -3475,191 +3475,741 @@ } } } - } - }, - "servers": [ - { - "url": "https://openrouter.ai/api/v1" - } - ], - "components": { - "schemas": { - "ImageConfig": { - "oneOf": [ - { - "type": "string" - }, + }, + "/workspaces": { + "get": { + "operationId": "list-workspaces", + "summary": "List workspaces", + "description": "List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.", + "tags": [ + "subpackage_workspaces" + ], + "parameters": [ { - "type": "number", - "format": "double" + "name": "offset", + "in": "query", + "description": "Number of records to skip for pagination", + "required": false, + "schema": { + "type": "integer" + } }, { - "type": "array", - "items": { - "description": "Any type" + "name": "limit", + "in": "query", + "description": "Maximum number of records to return (max 100)", + "required": false, + "schema": { + "type": "integer" } } ], - "title": "ImageConfig" - }, - "ResponseIncludesEnum": { - "type": "string", - "enum": [ - "file_search_call.results", - "message.input_image.image_url", - "computer_call_output.output.image_url", - "reasoning.encrypted_content", - "code_interpreter_call.outputs" - ], - "title": "ResponseIncludesEnum" - }, - "ReasoningTextContentType": { - "type": "string", - "enum": [ - "reasoning_text" - ], - "title": "ReasoningTextContentType" - }, - "ReasoningTextContent": { - "type": "object", - "properties": { - "text": { - "type": "string" - }, - "type": { - "$ref": "#/components/schemas/ReasoningTextContentType" - } - }, - "required": [ - "text", - "type" - ], - "title": "ReasoningTextContent" - }, - "OutputItemReasoningStatus0": { - "type": "string", - "enum": [ - "completed" - ], - "title": "OutputItemReasoningStatus0" - }, - "OutputItemReasoningStatus1": { - "type": "string", - "enum": [ - "incomplete" - ], - "title": "OutputItemReasoningStatus1" - }, - "OutputItemReasoningStatus2": { - "type": "string", - "enum": [ - "in_progress" - ], - "title": "OutputItemReasoningStatus2" - }, - "OutputItemReasoningStatus": { - "oneOf": [ - { - "$ref": "#/components/schemas/OutputItemReasoningStatus0" - }, - { - "$ref": "#/components/schemas/OutputItemReasoningStatus1" + "responses": { + "200": { + "description": "List of workspaces", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListWorkspacesResponse" + } + } + } }, - { - "$ref": "#/components/schemas/OutputItemReasoningStatus2" - } - ], - "title": "OutputItemReasoningStatus" - }, - "ReasoningSummaryTextType": { - "type": "string", - "enum": [ - "summary_text" - ], - "title": "ReasoningSummaryTextType" - }, - "ReasoningSummaryText": { - "type": "object", - "properties": { - "text": { - "type": "string" + "401": { + "description": "Unauthorized - Authentication required or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedResponse" + } + } + } }, - "type": { - "$ref": "#/components/schemas/ReasoningSummaryTextType" + "500": { + "description": "Internal Server Error - Unexpected server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerResponse" + } + } + } } - }, - "required": [ - "text", - "type" - ], - "title": "ReasoningSummaryText" - }, - "OutputItemReasoningType": { - "type": "string", - "enum": [ - "reasoning" - ], - "title": "OutputItemReasoningType" + } }, - "ReasoningFormat": { - "type": "string", - "enum": [ - "unknown", - "openai-responses-v1", - "azure-openai-responses-v1", - "xai-responses-v1", - "anthropic-claude-v1", - "google-gemini-v1" + "post": { + "operationId": "create-workspace", + "summary": "Create a workspace", + "description": "Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.", + "tags": [ + "subpackage_workspaces" ], - "title": "ReasoningFormat" - }, - "ReasoningItem": { - "type": "object", - "properties": { - "content": { - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/components/schemas/ReasoningTextContent" + "parameters": [], + "responses": { + "201": { + "description": "Workspace created successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkspaceResponse" + } + } } }, - "encrypted_content": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/OutputItemReasoningStatus" - }, - "summary": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ReasoningSummaryText" + "400": { + "description": "Bad Request - Invalid request parameters or malformed input", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestResponse" + } + } } }, - "type": { - "$ref": "#/components/schemas/OutputItemReasoningType" + "401": { + "description": "Unauthorized - Authentication required or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedResponse" + } + } + } }, - "format": { - "$ref": "#/components/schemas/ReasoningFormat" + "403": { + "description": "Forbidden - Authentication successful but insufficient permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenResponse" + } + } + } }, - "signature": { - "type": [ - "string", - "null" - ] + "500": { + "description": "Internal Server Error - Unexpected server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerResponse" + } + } + } } }, - "required": [ - "id", - "summary", - "type" + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkspaceRequest" + } + } + } + } + } + }, + "/workspaces/{id}": { + "get": { + "operationId": "get-workspace", + "summary": "Get a workspace", + "description": "Get a single workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.", + "tags": [ + "subpackage_workspaces" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The workspace ID (UUID) or slug", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Workspace details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetWorkspaceResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - Authentication required or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedResponse" + } + } + } + }, + "404": { + "description": "Not Found - Resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error - Unexpected server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerResponse" + } + } + } + } + } + }, + "delete": { + "operationId": "delete-workspace", + "summary": "Delete a workspace", + "description": "Delete an existing workspace. The default workspace cannot be deleted. Workspaces with active API keys cannot be deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required.", + "tags": [ + "subpackage_workspaces" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The workspace ID (UUID) or slug", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Workspace deleted successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteWorkspaceResponse" + } + } + } + }, + "400": { + "description": "Bad Request - Invalid request parameters or malformed input", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - Authentication required or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedResponse" + } + } + } + }, + "403": { + "description": "Forbidden - Authentication successful but insufficient permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenResponse" + } + } + } + }, + "404": { + "description": "Not Found - Resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error - Unexpected server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerResponse" + } + } + } + } + } + }, + "patch": { + "operationId": "update-workspace", + "summary": "Update a workspace", + "description": "Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.", + "tags": [ + "subpackage_workspaces" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The workspace ID (UUID) or slug", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Workspace updated successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkspaceResponse" + } + } + } + }, + "400": { + "description": "Bad Request - Invalid request parameters or malformed input", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - Authentication required or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedResponse" + } + } + } + }, + "403": { + "description": "Forbidden - Authentication successful but insufficient permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenResponse" + } + } + } + }, + "404": { + "description": "Not Found - Resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error - Unexpected server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerResponse" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkspaceRequest" + } + } + } + } + } + }, + "/workspaces/{id}/members/add": { + "post": { + "operationId": "bulk-add-workspace-members", + "summary": "Bulk add members to a workspace", + "description": "Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.", + "tags": [ + "subpackage_workspaces" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The workspace ID (UUID) or slug", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Members added successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkAddWorkspaceMembersResponse" + } + } + } + }, + "400": { + "description": "Bad Request - Invalid request parameters or malformed input", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - Authentication required or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedResponse" + } + } + } + }, + "403": { + "description": "Forbidden - Authentication successful but insufficient permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenResponse" + } + } + } + }, + "404": { + "description": "Not Found - Resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error - Unexpected server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerResponse" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkAddWorkspaceMembersRequest" + } + } + } + } + } + }, + "/workspaces/{id}/members/remove": { + "post": { + "operationId": "bulk-remove-workspace-members", + "summary": "Bulk remove members from a workspace", + "description": "Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.", + "tags": [ + "subpackage_workspaces" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The workspace ID (UUID) or slug", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Members removed successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRemoveWorkspaceMembersResponse" + } + } + } + }, + "400": { + "description": "Bad Request - Invalid request parameters or malformed input", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - Authentication required or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedResponse" + } + } + } + }, + "403": { + "description": "Forbidden - Authentication successful but insufficient permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenResponse" + } + } + } + }, + "404": { + "description": "Not Found - Resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error - Unexpected server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerResponse" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkRemoveWorkspaceMembersRequest" + } + } + } + } + } + } + }, + "servers": [ + { + "url": "https://openrouter.ai/api/v1" + } + ], + "components": { + "schemas": { + "ImageConfig": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number", + "format": "double" + }, + { + "type": "array", + "items": { + "description": "Any type" + } + } + ], + "title": "ImageConfig" + }, + "ResponseIncludesEnum": { + "type": "string", + "enum": [ + "file_search_call.results", + "message.input_image.image_url", + "computer_call_output.output.image_url", + "reasoning.encrypted_content", + "code_interpreter_call.outputs" + ], + "title": "ResponseIncludesEnum" + }, + "ReasoningTextContentType": { + "type": "string", + "enum": [ + "reasoning_text" + ], + "title": "ReasoningTextContentType" + }, + "ReasoningTextContent": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ReasoningTextContentType" + } + }, + "required": [ + "text", + "type" + ], + "title": "ReasoningTextContent" + }, + "OutputItemReasoningStatus0": { + "type": "string", + "enum": [ + "completed" + ], + "title": "OutputItemReasoningStatus0" + }, + "OutputItemReasoningStatus1": { + "type": "string", + "enum": [ + "incomplete" + ], + "title": "OutputItemReasoningStatus1" + }, + "OutputItemReasoningStatus2": { + "type": "string", + "enum": [ + "in_progress" + ], + "title": "OutputItemReasoningStatus2" + }, + "OutputItemReasoningStatus": { + "oneOf": [ + { + "$ref": "#/components/schemas/OutputItemReasoningStatus0" + }, + { + "$ref": "#/components/schemas/OutputItemReasoningStatus1" + }, + { + "$ref": "#/components/schemas/OutputItemReasoningStatus2" + } + ], + "title": "OutputItemReasoningStatus" + }, + "ReasoningSummaryTextType": { + "type": "string", + "enum": [ + "summary_text" + ], + "title": "ReasoningSummaryTextType" + }, + "ReasoningSummaryText": { + "type": "object", + "properties": { + "text": { + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/ReasoningSummaryTextType" + } + }, + "required": [ + "text", + "type" + ], + "title": "ReasoningSummaryText" + }, + "OutputItemReasoningType": { + "type": "string", + "enum": [ + "reasoning" + ], + "title": "OutputItemReasoningType" + }, + "ReasoningFormat": { + "type": "string", + "enum": [ + "unknown", + "openai-responses-v1", + "azure-openai-responses-v1", + "xai-responses-v1", + "anthropic-claude-v1", + "google-gemini-v1" + ], + "title": "ReasoningFormat" + }, + "ReasoningItem": { + "type": "object", + "properties": { + "content": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/ReasoningTextContent" + } + }, + "encrypted_content": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/OutputItemReasoningStatus" + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ReasoningSummaryText" + } + }, + "type": { + "$ref": "#/components/schemas/OutputItemReasoningType" + }, + "format": { + "$ref": "#/components/schemas/ReasoningFormat" + }, + "signature": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "summary", + "type" ], "description": "Reasoning output item with signature and format extensions", "title": "ReasoningItem" @@ -21793,1044 +22343,1707 @@ "image_url": { "$ref": "#/components/schemas/ContentPartImageImageUrl" }, - "type": { - "$ref": "#/components/schemas/ContentPartImageType" + "type": { + "$ref": "#/components/schemas/ContentPartImageType" + }, + "frame_type": { + "$ref": "#/components/schemas/FrameImageFrameType", + "description": "Whether this image represents the first or last frame of the video" + } + }, + "required": [ + "image_url", + "type", + "frame_type" + ], + "title": "FrameImage" + }, + "ContentPartImage": { + "type": "object", + "properties": { + "image_url": { + "$ref": "#/components/schemas/ContentPartImageImageUrl" + }, + "type": { + "$ref": "#/components/schemas/ContentPartImageType" + } + }, + "required": [ + "image_url", + "type" + ], + "title": "ContentPartImage" + }, + "VideoGenerationRequestProviderOptions": { + "type": "object", + "properties": { + "01ai": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "ai21": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "aion-labs": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "akashml": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "alibaba": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "amazon-bedrock": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "amazon-nova": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "ambient": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "anthropic": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "anyscale": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "arcee-ai": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "atlas-cloud": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "atoma": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "avian": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "azure": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "baidu": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "baseten": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "black-forest-labs": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "byteplus": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "centml": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "cerebras": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "chutes": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "cirrascale": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "clarifai": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "cloudflare": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "cohere": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "crofai": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "crusoe": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "deepinfra": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "deepseek": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "dekallm": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "enfer": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "fake-provider": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, + "featherless": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } }, - "frame_type": { - "$ref": "#/components/schemas/FrameImageFrameType", - "description": "Whether this image represents the first or last frame of the video" - } - }, - "required": [ - "image_url", - "type", - "frame_type" - ], - "title": "FrameImage" - }, - "ContentPartImage": { - "type": "object", - "properties": { - "image_url": { - "$ref": "#/components/schemas/ContentPartImageImageUrl" + "fireworks": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } }, - "type": { - "$ref": "#/components/schemas/ContentPartImageType" - } - }, - "required": [ - "image_url", - "type" - ], - "title": "ContentPartImage" - }, - "VideoGenerationRequestProviderOptions": { - "type": "object", - "properties": { - "01ai": { + "friendli": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "ai21": { + "gmicloud": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "aion-labs": { + "google-ai-studio": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "akashml": { + "google-vertex": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "alibaba": { + "gopomelo": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "amazon-bedrock": { + "groq": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "amazon-nova": { + "huggingface": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "ambient": { + "hyperbolic": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "anthropic": { + "hyperbolic-quantized": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "anyscale": { + "inception": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "arcee-ai": { + "inceptron": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "atlas-cloud": { + "inference-net": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "atoma": { + "infermatic": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "avian": { + "inflection": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "azure": { + "inocloud": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "baidu": { + "io-net": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "baseten": { + "ionstream": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "black-forest-labs": { + "klusterai": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "byteplus": { + "lambda": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "centml": { + "lepton": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "cerebras": { + "liquid": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "chutes": { + "lynn": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "cirrascale": { + "lynn-private": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "clarifai": { + "mancer": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "cloudflare": { + "mancer-old": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "cohere": { + "mara": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "crofai": { + "meta": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "crusoe": { + "minimax": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "deepinfra": { + "mistral": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "deepseek": { + "modal": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "dekallm": { + "modelrun": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "enfer": { + "modular": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "fake-provider": { + "moonshotai": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "featherless": { + "morph": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "fireworks": { + "ncompass": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "friendli": { + "nebius": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "gmicloud": { + "nextbit": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "google-ai-studio": { + "nineteen": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "google-vertex": { + "novita": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "gopomelo": { + "nvidia": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "groq": { + "octoai": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "huggingface": { + "open-inference": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "hyperbolic": { + "openai": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "hyperbolic-quantized": { + "parasail": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "inception": { + "perplexity": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "inceptron": { + "phala": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "inference-net": { + "recraft": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "infermatic": { + "recursal": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "inflection": { + "reflection": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "inocloud": { + "reka": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "io-net": { + "relace": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "ionstream": { + "replicate": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "klusterai": { + "sambanova": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "lambda": { + "sambanova-cloaked": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "lepton": { + "seed": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "liquid": { + "sf-compute": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "lynn": { + "siliconflow": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "lynn-private": { + "sourceful": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "mancer": { + "stealth": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "mancer-old": { + "stepfun": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "mara": { + "streamlake": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "meta": { + "switchpoint": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "minimax": { + "targon": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "mistral": { + "together": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "modal": { + "together-lite": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "modelrun": { + "ubicloud": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "modular": { + "upstage": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "moonshotai": { + "venice": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "morph": { + "wandb": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "ncompass": { + "xai": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "nebius": { + "xiaomi": { "type": "object", "additionalProperties": { "description": "Any type" } }, - "nextbit": { + "z-ai": { "type": "object", "additionalProperties": { "description": "Any type" } + } + }, + "description": "Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body.", + "title": "VideoGenerationRequestProviderOptions" + }, + "VideoGenerationRequestProvider": { + "type": "object", + "properties": { + "options": { + "$ref": "#/components/schemas/VideoGenerationRequestProviderOptions", + "description": "Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body." + } + }, + "description": "Provider-specific passthrough configuration", + "title": "VideoGenerationRequestProvider" + }, + "VideoGenerationRequestResolution": { + "type": "string", + "enum": [ + "480p", + "720p", + "1080p", + "1K", + "2K", + "4K" + ], + "description": "Resolution of the generated video", + "title": "VideoGenerationRequestResolution" + }, + "VideoGenerationRequest": { + "type": "object", + "properties": { + "aspect_ratio": { + "$ref": "#/components/schemas/VideoGenerationRequestAspectRatio", + "description": "Aspect ratio of the generated video" + }, + "duration": { + "type": "integer", + "description": "Duration of the generated video in seconds" + }, + "frame_images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FrameImage" + }, + "description": "Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame." + }, + "generate_audio": { + "type": "boolean", + "description": "Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set." + }, + "input_references": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContentPartImage" + }, + "description": "Reference images to guide video generation" + }, + "model": { + "type": "string" + }, + "prompt": { + "type": "string" + }, + "provider": { + "$ref": "#/components/schemas/VideoGenerationRequestProvider", + "description": "Provider-specific passthrough configuration" }, - "nineteen": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "resolution": { + "$ref": "#/components/schemas/VideoGenerationRequestResolution", + "description": "Resolution of the generated video" }, - "novita": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "seed": { + "type": "integer", + "description": "If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers." }, - "nvidia": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "size": { + "type": "string", + "description": "Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio." + } + }, + "required": [ + "model", + "prompt" + ], + "title": "VideoGenerationRequest" + }, + "VideoGenerationResponseStatus": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "failed", + "cancelled", + "expired" + ], + "title": "VideoGenerationResponseStatus" + }, + "VideoGenerationUsage": { + "type": "object", + "properties": { + "cost": { + "type": [ + "number", + "null" + ], + "format": "double", + "description": "The cost of the video generation in USD." }, - "octoai": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "is_byok": { + "type": "boolean", + "description": "Whether the request was made using a Bring Your Own Key configuration." + } + }, + "description": "Usage and cost information for the video generation. Available once the job has completed.", + "title": "VideoGenerationUsage" + }, + "VideoGenerationResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" }, - "open-inference": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "generation_id": { + "type": "string", + "description": "The generation ID associated with this video generation job. Available once the job has been processed." }, - "openai": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "id": { + "type": "string" }, - "parasail": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "polling_url": { + "type": "string" }, - "perplexity": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "status": { + "$ref": "#/components/schemas/VideoGenerationResponseStatus" }, - "phala": { - "type": "object", - "additionalProperties": { - "description": "Any type" + "unsigned_urls": { + "type": "array", + "items": { + "type": "string" } }, - "recraft": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "usage": { + "$ref": "#/components/schemas/VideoGenerationUsage" + } + }, + "required": [ + "id", + "polling_url", + "status" + ], + "title": "VideoGenerationResponse" + }, + "VideoModelSupportedAspectRatiosItems": { + "type": "string", + "enum": [ + "16:9", + "9:16", + "1:1", + "4:3", + "3:4", + "21:9", + "9:21" + ], + "title": "VideoModelSupportedAspectRatiosItems" + }, + "VideoModelSupportedFrameImagesItems": { + "type": "string", + "enum": [ + "first_frame", + "last_frame" + ], + "title": "VideoModelSupportedFrameImagesItems" + }, + "VideoModelSupportedResolutionsItems": { + "type": "string", + "enum": [ + "480p", + "720p", + "1080p", + "1K", + "2K", + "4K" + ], + "title": "VideoModelSupportedResolutionsItems" + }, + "VideoModelSupportedSizesItems": { + "type": "string", + "enum": [ + "480x480", + "480x640", + "480x854", + "480x1120", + "640x480", + "720x720", + "720x960", + "720x1280", + "720x1680", + "854x480", + "960x720", + "1080x1080", + "1080x1440", + "1080x1920", + "1080x2520", + "1120x480", + "1280x720", + "1440x1080", + "1680x720", + "1920x1080", + "2160x2160", + "2160x2880", + "2160x3840", + "2160x5040", + "2520x1080", + "2880x2160", + "3840x2160", + "5040x2160" + ], + "title": "VideoModelSupportedSizesItems" + }, + "VideoModel": { + "type": "object", + "properties": { + "allowed_passthrough_parameters": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of parameters that are allowed to be passed through to the provider" }, - "recursal": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "canonical_slug": { + "type": "string", + "description": "Canonical slug for the model" }, - "reflection": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "created": { + "type": "integer", + "description": "Unix timestamp of when the model was created" }, - "reka": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "description": { + "type": "string", + "description": "Description of the model" }, - "relace": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "generate_audio": { + "type": [ + "boolean", + "null" + ], + "description": "Whether the model supports generating audio alongside video" }, - "replicate": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "hugging_face_id": { + "type": [ + "string", + "null" + ], + "description": "Hugging Face model identifier, if applicable" }, - "sambanova": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "id": { + "type": "string", + "description": "Unique identifier for the model" }, - "sambanova-cloaked": { - "type": "object", + "name": { + "type": "string", + "description": "Display name of the model" + }, + "pricing_skus": { + "type": [ + "object", + "null" + ], "additionalProperties": { - "description": "Any type" - } + "type": "string" + }, + "description": "Pricing SKUs with provider prefix stripped, values as strings" }, "seed": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "type": [ + "boolean", + "null" + ], + "description": "Whether the model supports deterministic generation via seed parameter" }, - "sf-compute": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "supported_aspect_ratios": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/VideoModelSupportedAspectRatiosItems" + }, + "description": "Supported output aspect ratios" }, - "siliconflow": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "supported_durations": { + "type": [ + "array", + "null" + ], + "items": { + "type": "integer" + }, + "description": "Supported video durations in seconds" }, - "sourceful": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "supported_frame_images": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/VideoModelSupportedFrameImagesItems" + }, + "description": "Supported frame image types (e.g. first_frame, last_frame)" }, - "stealth": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "supported_resolutions": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/VideoModelSupportedResolutionsItems" + }, + "description": "Supported output resolutions" }, - "stepfun": { - "type": "object", - "additionalProperties": { - "description": "Any type" + "supported_sizes": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/VideoModelSupportedSizesItems" + }, + "description": "Supported output sizes (width x height)" + } + }, + "required": [ + "allowed_passthrough_parameters", + "canonical_slug", + "created", + "generate_audio", + "id", + "name", + "seed", + "supported_aspect_ratios", + "supported_durations", + "supported_frame_images", + "supported_resolutions", + "supported_sizes" + ], + "title": "VideoModel" + }, + "VideoModelsListResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoModel" } + } + }, + "required": [ + "data" + ], + "title": "VideoModelsListResponse" + }, + "Workspace": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "description": "ISO 8601 timestamp of when the workspace was created" }, - "streamlake": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "created_by": { + "type": [ + "string", + "null" + ], + "description": "User ID of the workspace creator" }, - "switchpoint": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "default_image_model": { + "type": [ + "string", + "null" + ], + "description": "Default image model for this workspace" }, - "targon": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "default_provider_sort": { + "type": [ + "string", + "null" + ], + "description": "Default provider sort preference (price, throughput, latency, exacto)" }, - "together": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "default_text_model": { + "type": [ + "string", + "null" + ], + "description": "Default text model for this workspace" }, - "together-lite": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "description": { + "type": [ + "string", + "null" + ], + "description": "Description of the workspace" }, - "ubicloud": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the workspace" }, - "upstage": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "is_data_discount_logging_enabled": { + "type": "boolean", + "description": "Whether data discount logging is enabled for this workspace" }, - "venice": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "is_observability_broadcast_enabled": { + "type": "boolean", + "description": "Whether broadcast is enabled for this workspace" }, - "wandb": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "is_observability_io_logging_enabled": { + "type": "boolean", + "description": "Whether private logging is enabled for this workspace" }, - "xai": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "name": { + "type": "string", + "description": "Name of the workspace" }, - "xiaomi": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } + "slug": { + "type": "string", + "description": "URL-friendly slug for the workspace" }, - "z-ai": { - "type": "object", - "additionalProperties": { - "description": "Any type" - } - } - }, - "description": "Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body.", - "title": "VideoGenerationRequestProviderOptions" - }, - "VideoGenerationRequestProvider": { - "type": "object", - "properties": { - "options": { - "$ref": "#/components/schemas/VideoGenerationRequestProviderOptions", - "description": "Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body." + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "ISO 8601 timestamp of when the workspace was last updated" } }, - "description": "Provider-specific passthrough configuration", - "title": "VideoGenerationRequestProvider" - }, - "VideoGenerationRequestResolution": { - "type": "string", - "enum": [ - "480p", - "720p", - "1080p", - "1K", - "2K", - "4K" + "required": [ + "created_at", + "created_by", + "default_image_model", + "default_provider_sort", + "default_text_model", + "description", + "id", + "is_data_discount_logging_enabled", + "is_observability_broadcast_enabled", + "is_observability_io_logging_enabled", + "name", + "slug", + "updated_at" ], - "description": "Resolution of the generated video", - "title": "VideoGenerationRequestResolution" + "title": "Workspace" }, - "VideoGenerationRequest": { + "ListWorkspacesResponse": { "type": "object", "properties": { - "aspect_ratio": { - "$ref": "#/components/schemas/VideoGenerationRequestAspectRatio", - "description": "Aspect ratio of the generated video" - }, - "duration": { - "type": "integer", - "description": "Duration of the generated video in seconds" - }, - "frame_images": { + "data": { "type": "array", "items": { - "$ref": "#/components/schemas/FrameImage" + "$ref": "#/components/schemas/Workspace" }, - "description": "Images to use as the first and/or last frame of the generated video. Each image must specify a frame_type of first_frame or last_frame." + "description": "List of workspaces" }, - "generate_audio": { - "type": "boolean", - "description": "Whether to generate audio alongside the video. Defaults to the endpoint's generate_audio capability flag, false if not set." + "total_count": { + "type": "integer", + "description": "Total number of workspaces" + } + }, + "required": [ + "data", + "total_count" + ], + "title": "ListWorkspacesResponse" + }, + "CreateWorkspaceRequest": { + "type": "object", + "properties": { + "default_image_model": { + "type": [ + "string", + "null" + ], + "description": "Default image model for this workspace" }, - "input_references": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ContentPartImage" - }, - "description": "Reference images to guide video generation" + "default_provider_sort": { + "type": [ + "string", + "null" + ], + "description": "Default provider sort preference (price, throughput, latency, exacto)" }, - "model": { - "type": "string" + "default_text_model": { + "type": [ + "string", + "null" + ], + "description": "Default text model for this workspace" }, - "prompt": { - "type": "string" + "description": { + "type": [ + "string", + "null" + ], + "description": "Description of the workspace" }, - "provider": { - "$ref": "#/components/schemas/VideoGenerationRequestProvider", - "description": "Provider-specific passthrough configuration" + "is_data_discount_logging_enabled": { + "type": "boolean", + "description": "Whether data discount logging is enabled" }, - "resolution": { - "$ref": "#/components/schemas/VideoGenerationRequestResolution", - "description": "Resolution of the generated video" + "is_observability_broadcast_enabled": { + "type": "boolean", + "description": "Whether broadcast is enabled" }, - "seed": { - "type": "integer", - "description": "If specified, the generation will sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed for all providers." + "is_observability_io_logging_enabled": { + "type": "boolean", + "description": "Whether private logging is enabled" }, - "size": { + "name": { "type": "string", - "description": "Exact pixel dimensions of the generated video in \"WIDTHxHEIGHT\" format (e.g. \"1280x720\"). Interchangeable with resolution + aspect_ratio." + "description": "Name for the new workspace" + }, + "slug": { + "type": "string", + "description": "URL-friendly slug (lowercase alphanumeric and hyphens only)" } }, "required": [ - "model", - "prompt" - ], - "title": "VideoGenerationRequest" - }, - "VideoGenerationResponseStatus": { - "type": "string", - "enum": [ - "pending", - "in_progress", - "completed", - "failed", - "cancelled", - "expired" + "name", + "slug" ], - "title": "VideoGenerationResponseStatus" + "title": "CreateWorkspaceRequest" }, - "VideoGenerationUsage": { + "CreateWorkspaceResponseData": { "type": "object", "properties": { - "cost": { + "created_at": { + "type": "string", + "description": "ISO 8601 timestamp of when the workspace was created" + }, + "created_by": { "type": [ - "number", + "string", "null" ], - "format": "double", - "description": "The cost of the video generation in USD." + "description": "User ID of the workspace creator" }, - "is_byok": { + "default_image_model": { + "type": [ + "string", + "null" + ], + "description": "Default image model for this workspace" + }, + "default_provider_sort": { + "type": [ + "string", + "null" + ], + "description": "Default provider sort preference (price, throughput, latency, exacto)" + }, + "default_text_model": { + "type": [ + "string", + "null" + ], + "description": "Default text model for this workspace" + }, + "description": { + "type": [ + "string", + "null" + ], + "description": "Description of the workspace" + }, + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the workspace" + }, + "is_data_discount_logging_enabled": { "type": "boolean", - "description": "Whether the request was made using a Bring Your Own Key configuration." + "description": "Whether data discount logging is enabled for this workspace" + }, + "is_observability_broadcast_enabled": { + "type": "boolean", + "description": "Whether broadcast is enabled for this workspace" + }, + "is_observability_io_logging_enabled": { + "type": "boolean", + "description": "Whether private logging is enabled for this workspace" + }, + "name": { + "type": "string", + "description": "Name of the workspace" + }, + "slug": { + "type": "string", + "description": "URL-friendly slug for the workspace" + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "ISO 8601 timestamp of when the workspace was last updated" } }, - "description": "Usage and cost information for the video generation. Available once the job has completed.", - "title": "VideoGenerationUsage" + "required": [ + "created_at", + "created_by", + "default_image_model", + "default_provider_sort", + "default_text_model", + "description", + "id", + "is_data_discount_logging_enabled", + "is_observability_broadcast_enabled", + "is_observability_io_logging_enabled", + "name", + "slug", + "updated_at" + ], + "title": "CreateWorkspaceResponseData" }, - "VideoGenerationResponse": { + "CreateWorkspaceResponse": { "type": "object", "properties": { - "error": { - "type": "string" - }, - "generation_id": { + "data": { + "$ref": "#/components/schemas/CreateWorkspaceResponseData" + } + }, + "required": [ + "data" + ], + "title": "CreateWorkspaceResponse" + }, + "GetWorkspaceResponseData": { + "type": "object", + "properties": { + "created_at": { "type": "string", - "description": "The generation ID associated with this video generation job. Available once the job has been processed." + "description": "ISO 8601 timestamp of when the workspace was created" + }, + "created_by": { + "type": [ + "string", + "null" + ], + "description": "User ID of the workspace creator" + }, + "default_image_model": { + "type": [ + "string", + "null" + ], + "description": "Default image model for this workspace" + }, + "default_provider_sort": { + "type": [ + "string", + "null" + ], + "description": "Default provider sort preference (price, throughput, latency, exacto)" + }, + "default_text_model": { + "type": [ + "string", + "null" + ], + "description": "Default text model for this workspace" + }, + "description": { + "type": [ + "string", + "null" + ], + "description": "Description of the workspace" }, "id": { - "type": "string" + "type": "string", + "format": "uuid", + "description": "Unique identifier for the workspace" }, - "polling_url": { - "type": "string" + "is_data_discount_logging_enabled": { + "type": "boolean", + "description": "Whether data discount logging is enabled for this workspace" }, - "status": { - "$ref": "#/components/schemas/VideoGenerationResponseStatus" + "is_observability_broadcast_enabled": { + "type": "boolean", + "description": "Whether broadcast is enabled for this workspace" }, - "unsigned_urls": { - "type": "array", - "items": { - "type": "string" - } + "is_observability_io_logging_enabled": { + "type": "boolean", + "description": "Whether private logging is enabled for this workspace" }, - "usage": { - "$ref": "#/components/schemas/VideoGenerationUsage" + "name": { + "type": "string", + "description": "Name of the workspace" + }, + "slug": { + "type": "string", + "description": "URL-friendly slug for the workspace" + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "ISO 8601 timestamp of when the workspace was last updated" } }, "required": [ + "created_at", + "created_by", + "default_image_model", + "default_provider_sort", + "default_text_model", + "description", "id", - "polling_url", - "status" - ], - "title": "VideoGenerationResponse" - }, - "VideoModelSupportedAspectRatiosItems": { - "type": "string", - "enum": [ - "16:9", - "9:16", - "1:1", - "4:3", - "3:4", - "21:9", - "9:21" - ], - "title": "VideoModelSupportedAspectRatiosItems" - }, - "VideoModelSupportedFrameImagesItems": { - "type": "string", - "enum": [ - "first_frame", - "last_frame" + "is_data_discount_logging_enabled", + "is_observability_broadcast_enabled", + "is_observability_io_logging_enabled", + "name", + "slug", + "updated_at" ], - "title": "VideoModelSupportedFrameImagesItems" - }, - "VideoModelSupportedResolutionsItems": { - "type": "string", - "enum": [ - "480p", - "720p", - "1080p", - "1K", - "2K", - "4K" + "title": "GetWorkspaceResponseData" + }, + "GetWorkspaceResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/GetWorkspaceResponseData" + } + }, + "required": [ + "data" ], - "title": "VideoModelSupportedResolutionsItems" + "title": "GetWorkspaceResponse" }, - "VideoModelSupportedSizesItems": { - "type": "string", - "enum": [ - "480x480", - "480x640", - "480x854", - "480x1120", - "640x480", - "720x720", - "720x960", - "720x1280", - "720x1680", - "854x480", - "960x720", - "1080x1080", - "1080x1440", - "1080x1920", - "1080x2520", - "1120x480", - "1280x720", - "1440x1080", - "1680x720", - "1920x1080", - "2160x2160", - "2160x2880", - "2160x3840", - "2160x5040", - "2520x1080", - "2880x2160", - "3840x2160", - "5040x2160" + "DeleteWorkspaceResponse": { + "type": "object", + "properties": { + "deleted": { + "type": "boolean", + "enum": [ + true + ], + "description": "Confirmation that the workspace was deleted" + } + }, + "required": [ + "deleted" ], - "title": "VideoModelSupportedSizesItems" + "title": "DeleteWorkspaceResponse" }, - "VideoModel": { + "UpdateWorkspaceRequest": { "type": "object", "properties": { - "allowed_passthrough_parameters": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of parameters that are allowed to be passed through to the provider" - }, - "canonical_slug": { - "type": "string", - "description": "Canonical slug for the model" - }, - "created": { - "type": "integer", - "description": "Unix timestamp of when the model was created" + "default_image_model": { + "type": [ + "string", + "null" + ], + "description": "Default image model for this workspace" }, - "description": { - "type": "string", - "description": "Description of the model" + "default_provider_sort": { + "type": [ + "string", + "null" + ], + "description": "Default provider sort preference (price, throughput, latency, exacto)" }, - "generate_audio": { + "default_text_model": { "type": [ - "boolean", + "string", "null" ], - "description": "Whether the model supports generating audio alongside video" + "description": "Default text model for this workspace" }, - "hugging_face_id": { + "description": { "type": [ "string", "null" ], - "description": "Hugging Face model identifier, if applicable" + "description": "New description for the workspace" }, - "id": { - "type": "string", - "description": "Unique identifier for the model" + "is_data_discount_logging_enabled": { + "type": "boolean", + "description": "Whether data discount logging is enabled" + }, + "is_observability_broadcast_enabled": { + "type": "boolean", + "description": "Whether broadcast is enabled" + }, + "is_observability_io_logging_enabled": { + "type": "boolean", + "description": "Whether private logging is enabled" }, "name": { "type": "string", - "description": "Display name of the model" + "description": "New name for the workspace" }, - "pricing_skus": { - "type": [ - "object", - "null" - ], - "additionalProperties": { - "type": "string" - }, - "description": "Pricing SKUs with provider prefix stripped, values as strings" + "slug": { + "type": "string", + "description": "New URL-friendly slug" + } + }, + "title": "UpdateWorkspaceRequest" + }, + "UpdateWorkspaceResponseData": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "description": "ISO 8601 timestamp of when the workspace was created" }, - "seed": { + "created_by": { "type": [ - "boolean", + "string", "null" ], - "description": "Whether the model supports deterministic generation via seed parameter" + "description": "User ID of the workspace creator" }, - "supported_aspect_ratios": { + "default_image_model": { "type": [ - "array", + "string", "null" ], - "items": { - "$ref": "#/components/schemas/VideoModelSupportedAspectRatiosItems" - }, - "description": "Supported output aspect ratios" + "description": "Default image model for this workspace" }, - "supported_durations": { + "default_provider_sort": { "type": [ - "array", + "string", "null" ], - "items": { - "type": "integer" - }, - "description": "Supported video durations in seconds" + "description": "Default provider sort preference (price, throughput, latency, exacto)" }, - "supported_frame_images": { + "default_text_model": { "type": [ - "array", + "string", "null" ], - "items": { - "$ref": "#/components/schemas/VideoModelSupportedFrameImagesItems" - }, - "description": "Supported frame image types (e.g. first_frame, last_frame)" + "description": "Default text model for this workspace" }, - "supported_resolutions": { + "description": { "type": [ - "array", + "string", "null" ], - "items": { - "$ref": "#/components/schemas/VideoModelSupportedResolutionsItems" - }, - "description": "Supported output resolutions" + "description": "Description of the workspace" }, - "supported_sizes": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the workspace" + }, + "is_data_discount_logging_enabled": { + "type": "boolean", + "description": "Whether data discount logging is enabled for this workspace" + }, + "is_observability_broadcast_enabled": { + "type": "boolean", + "description": "Whether broadcast is enabled for this workspace" + }, + "is_observability_io_logging_enabled": { + "type": "boolean", + "description": "Whether private logging is enabled for this workspace" + }, + "name": { + "type": "string", + "description": "Name of the workspace" + }, + "slug": { + "type": "string", + "description": "URL-friendly slug for the workspace" + }, + "updated_at": { "type": [ - "array", + "string", "null" ], + "description": "ISO 8601 timestamp of when the workspace was last updated" + } + }, + "required": [ + "created_at", + "created_by", + "default_image_model", + "default_provider_sort", + "default_text_model", + "description", + "id", + "is_data_discount_logging_enabled", + "is_observability_broadcast_enabled", + "is_observability_io_logging_enabled", + "name", + "slug", + "updated_at" + ], + "title": "UpdateWorkspaceResponseData" + }, + "UpdateWorkspaceResponse": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/UpdateWorkspaceResponseData" + } + }, + "required": [ + "data" + ], + "title": "UpdateWorkspaceResponse" + }, + "BulkAddWorkspaceMembersRequest": { + "type": "object", + "properties": { + "user_ids": { + "type": "array", "items": { - "$ref": "#/components/schemas/VideoModelSupportedSizesItems" + "type": "string" }, - "description": "Supported output sizes (width x height)" + "description": "List of user IDs to add to the workspace. Members are assigned the same role they hold in the organization." } }, "required": [ - "allowed_passthrough_parameters", - "canonical_slug", - "created", - "generate_audio", + "user_ids" + ], + "title": "BulkAddWorkspaceMembersRequest" + }, + "WorkspaceMemberRole": { + "type": "string", + "enum": [ + "admin", + "member" + ], + "description": "Role of the member in the workspace", + "title": "WorkspaceMemberRole" + }, + "WorkspaceMember": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "description": "ISO 8601 timestamp of when the membership was created" + }, + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the workspace membership" + }, + "role": { + "$ref": "#/components/schemas/WorkspaceMemberRole", + "description": "Role of the member in the workspace" + }, + "user_id": { + "type": "string", + "description": "Clerk user ID of the member" + }, + "workspace_id": { + "type": "string", + "format": "uuid", + "description": "ID of the workspace" + } + }, + "required": [ + "created_at", "id", - "name", - "seed", - "supported_aspect_ratios", - "supported_durations", - "supported_frame_images", - "supported_resolutions", - "supported_sizes" + "role", + "user_id", + "workspace_id" ], - "title": "VideoModel" + "title": "WorkspaceMember" }, - "VideoModelsListResponse": { + "BulkAddWorkspaceMembersResponse": { "type": "object", "properties": { + "added_count": { + "type": "integer", + "description": "Number of workspace memberships created or updated" + }, "data": { "type": "array", "items": { - "$ref": "#/components/schemas/VideoModel" - } + "$ref": "#/components/schemas/WorkspaceMember" + }, + "description": "List of added workspace memberships" } }, "required": [ + "added_count", "data" ], - "title": "VideoModelsListResponse" + "title": "BulkAddWorkspaceMembersResponse" + }, + "BulkRemoveWorkspaceMembersRequest": { + "type": "object", + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of user IDs to remove from the workspace" + } + }, + "required": [ + "user_ids" + ], + "title": "BulkRemoveWorkspaceMembersRequest" + }, + "BulkRemoveWorkspaceMembersResponse": { + "type": "object", + "properties": { + "removed_count": { + "type": "integer", + "description": "Number of members removed" + } + }, + "required": [ + "removed_count" + ], + "title": "BulkRemoveWorkspaceMembersResponse" } }, "securitySchemes": {