diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageGuardrailsClient.CreateGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageGuardrailsClient.CreateGuardrail.g.cs index cd572105..d70d6826 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageGuardrailsClient.CreateGuardrail.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageGuardrailsClient.CreateGuardrail.g.cs @@ -48,6 +48,9 @@ public partial interface ISubpackageGuardrailsClient /// /// Interval at which the limit resets (daily, weekly, monthly) /// + /// + /// The workspace to create the guardrail in. Defaults to the default workspace if not provided. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -61,6 +64,7 @@ public partial interface ISubpackageGuardrailsClient global::System.Collections.Generic.IList? ignoredProviders = default, double? limitUsd = default, global::OpenRouter.GuardrailInterval? resetInterval = default, + global::System.Guid? workspaceId = default, global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageGuardrailsClient.ListGuardrails.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageGuardrailsClient.ListGuardrails.g.cs index fa9a80a0..8bf2f73a 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageGuardrailsClient.ListGuardrails.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackageGuardrailsClient.ListGuardrails.g.cs @@ -10,12 +10,14 @@ public partial interface ISubpackageGuardrailsClient /// /// /// + /// /// 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 ListGuardrailsAsync( int? offset = default, int? limit = default, + global::System.Guid? workspaceId = default, global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateGuardrailRequest.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateGuardrailRequest.g.cs index a1115224..38bb837e 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateGuardrailRequest.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateGuardrailRequest.g.cs @@ -64,6 +64,12 @@ public sealed partial class CreateGuardrailRequest [global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenRouter.JsonConverters.GuardrailIntervalJsonConverter))] public global::OpenRouter.GuardrailInterval? ResetInterval { get; set; } + /// + /// The workspace to create the guardrail in. Defaults to the default workspace if not provided. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("workspace_id")] + public global::System.Guid? WorkspaceId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -100,6 +106,9 @@ public sealed partial class CreateGuardrailRequest /// /// Interval at which the limit resets (daily, weekly, monthly) /// + /// + /// The workspace to create the guardrail in. Defaults to the default workspace if not provided. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -112,7 +121,8 @@ public CreateGuardrailRequest( global::System.Collections.Generic.IList? ignoredModels, global::System.Collections.Generic.IList? ignoredProviders, double? limitUsd, - global::OpenRouter.GuardrailInterval? resetInterval) + global::OpenRouter.GuardrailInterval? resetInterval, + global::System.Guid? workspaceId) { this.AllowedModels = allowedModels; this.AllowedProviders = allowedProviders; @@ -123,6 +133,7 @@ public CreateGuardrailRequest( this.LimitUsd = limitUsd; this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.ResetInterval = resetInterval; + this.WorkspaceId = workspaceId; } /// diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateGuardrailResponseData.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateGuardrailResponseData.g.cs index 9faac32e..d557801a 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateGuardrailResponseData.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.CreateGuardrailResponseData.g.cs @@ -84,6 +84,13 @@ public sealed partial class CreateGuardrailResponseData [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] public string? UpdatedAt { get; set; } + /// + /// The workspace ID this guardrail belongs to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("workspace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string WorkspaceId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -102,6 +109,9 @@ public sealed partial class CreateGuardrailResponseData /// /// Name of the guardrail /// + /// + /// The workspace ID this guardrail belongs to. + /// /// /// Array of model canonical_slugs (immutable identifiers) /// @@ -136,6 +146,7 @@ public CreateGuardrailResponseData( string createdAt, global::System.Guid id, string name, + string workspaceId, global::System.Collections.Generic.IList? allowedModels, global::System.Collections.Generic.IList? allowedProviders, string? description, @@ -158,6 +169,7 @@ public CreateGuardrailResponseData( this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.ResetInterval = resetInterval; this.UpdatedAt = updatedAt; + this.WorkspaceId = workspaceId ?? throw new global::System.ArgumentNullException(nameof(workspaceId)); } /// diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.GetGuardrailResponseData.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetGuardrailResponseData.g.cs index 67732ba8..846d2feb 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.GetGuardrailResponseData.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.GetGuardrailResponseData.g.cs @@ -84,6 +84,13 @@ public sealed partial class GetGuardrailResponseData [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] public string? UpdatedAt { get; set; } + /// + /// The workspace ID this guardrail belongs to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("workspace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string WorkspaceId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -102,6 +109,9 @@ public sealed partial class GetGuardrailResponseData /// /// Name of the guardrail /// + /// + /// The workspace ID this guardrail belongs to. + /// /// /// Array of model canonical_slugs (immutable identifiers) /// @@ -136,6 +146,7 @@ public GetGuardrailResponseData( string createdAt, global::System.Guid id, string name, + string workspaceId, global::System.Collections.Generic.IList? allowedModels, global::System.Collections.Generic.IList? allowedProviders, string? description, @@ -158,6 +169,7 @@ public GetGuardrailResponseData( this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.ResetInterval = resetInterval; this.UpdatedAt = updatedAt; + this.WorkspaceId = workspaceId ?? throw new global::System.ArgumentNullException(nameof(workspaceId)); } /// diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.Guardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.Guardrail.g.cs index 110a59d7..2196f161 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.Guardrail.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.Guardrail.g.cs @@ -84,6 +84,13 @@ public sealed partial class Guardrail [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] public string? UpdatedAt { get; set; } + /// + /// The workspace ID this guardrail belongs to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("workspace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string WorkspaceId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -102,6 +109,9 @@ public sealed partial class Guardrail /// /// Name of the guardrail /// + /// + /// The workspace ID this guardrail belongs to. + /// /// /// Array of model canonical_slugs (immutable identifiers) /// @@ -136,6 +146,7 @@ public Guardrail( string createdAt, global::System.Guid id, string name, + string workspaceId, global::System.Collections.Generic.IList? allowedModels, global::System.Collections.Generic.IList? allowedProviders, string? description, @@ -158,6 +169,7 @@ public Guardrail( this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.ResetInterval = resetInterval; this.UpdatedAt = updatedAt; + this.WorkspaceId = workspaceId ?? throw new global::System.ArgumentNullException(nameof(workspaceId)); } /// diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateGuardrailResponseData.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateGuardrailResponseData.g.cs index 934e9d09..8706c8c9 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateGuardrailResponseData.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.UpdateGuardrailResponseData.g.cs @@ -84,6 +84,13 @@ public sealed partial class UpdateGuardrailResponseData [global::System.Text.Json.Serialization.JsonPropertyName("updated_at")] public string? UpdatedAt { get; set; } + /// + /// The workspace ID this guardrail belongs to. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("workspace_id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string WorkspaceId { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -102,6 +109,9 @@ public sealed partial class UpdateGuardrailResponseData /// /// Name of the guardrail /// + /// + /// The workspace ID this guardrail belongs to. + /// /// /// Array of model canonical_slugs (immutable identifiers) /// @@ -136,6 +146,7 @@ public UpdateGuardrailResponseData( string createdAt, global::System.Guid id, string name, + string workspaceId, global::System.Collections.Generic.IList? allowedModels, global::System.Collections.Generic.IList? allowedProviders, string? description, @@ -158,6 +169,7 @@ public UpdateGuardrailResponseData( this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); this.ResetInterval = resetInterval; this.UpdatedAt = updatedAt; + this.WorkspaceId = workspaceId ?? throw new global::System.ArgumentNullException(nameof(workspaceId)); } /// diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.CreateGuardrail.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.CreateGuardrail.g.cs index 1e066c7a..b9f0eb13 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.CreateGuardrail.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.CreateGuardrail.g.cs @@ -371,6 +371,44 @@ partial void ProcessCreateGuardrailResponseContent( 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) { @@ -532,6 +570,9 @@ partial void ProcessCreateGuardrailResponseContent( /// /// Interval at which the limit resets (daily, weekly, monthly) /// + /// + /// The workspace to create the guardrail in. Defaults to the default workspace if not provided. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -545,6 +586,7 @@ partial void ProcessCreateGuardrailResponseContent( global::System.Collections.Generic.IList? ignoredProviders = default, double? limitUsd = default, global::OpenRouter.GuardrailInterval? resetInterval = default, + global::System.Guid? workspaceId = default, global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -559,6 +601,7 @@ partial void ProcessCreateGuardrailResponseContent( LimitUsd = limitUsd, Name = name, ResetInterval = resetInterval, + WorkspaceId = workspaceId, }; return await CreateGuardrailAsync( diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrails.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrails.g.cs index 9b757829..f8cd900e 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrails.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackageGuardrailsClient.ListGuardrails.g.cs @@ -28,12 +28,14 @@ public partial class SubpackageGuardrailsClient partial void PrepareListGuardrailsArguments( global::System.Net.Http.HttpClient httpClient, ref int? offset, - ref int? limit); + ref int? limit, + ref global::System.Guid? workspaceId); partial void PrepareListGuardrailsRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, int? offset, - int? limit); + int? limit, + global::System.Guid? workspaceId); partial void ProcessListGuardrailsResponse( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpResponseMessage httpResponseMessage); @@ -49,12 +51,14 @@ partial void ProcessListGuardrailsResponseContent( /// /// /// + /// /// 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 ListGuardrailsAsync( int? offset = default, int? limit = default, + global::System.Guid? workspaceId = default, global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -63,7 +67,8 @@ partial void ProcessListGuardrailsResponseContent( PrepareListGuardrailsArguments( httpClient: HttpClient, offset: ref offset, - limit: ref limit); + limit: ref limit, + workspaceId: ref workspaceId); var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( @@ -92,7 +97,8 @@ partial void ProcessListGuardrailsResponseContent( baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("offset", offset?.ToString()) - .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("workspace_id", workspaceId?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -135,7 +141,8 @@ partial void ProcessListGuardrailsResponseContent( httpClient: HttpClient, httpRequestMessage: __httpRequest, offset: offset, - limit: limit); + limit: limit, + workspaceId: workspaceId); return __httpRequest; } diff --git a/src/libs/OpenRouter/openapi.yaml b/src/libs/OpenRouter/openapi.yaml index 30d8edec..4e0a7b50 100644 --- a/src/libs/OpenRouter/openapi.yaml +++ b/src/libs/OpenRouter/openapi.yaml @@ -1039,6 +1039,16 @@ "schema": { "type": "integer" } + }, + { + "name": "workspace_id", + "in": "query", + "description": "Filter guardrails by workspace ID. By default, guardrails in the default workspace are returned.", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } } ], "responses": { @@ -1113,6 +1123,16 @@ } } }, + "403": { + "description": "Forbidden - Authentication successful but insufficient permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenResponse" + } + } + } + }, "500": { "description": "Internal Server Error - Unexpected server error", "content": { @@ -14287,12 +14307,17 @@ "null" ], "description": "ISO 8601 timestamp of when the guardrail was last updated" + }, + "workspace_id": { + "type": "string", + "description": "The workspace ID this guardrail belongs to." } }, "required": [ "created_at", "id", - "name" + "name", + "workspace_id" ], "title": "Guardrail" }, @@ -14388,6 +14413,11 @@ }, "reset_interval": { "$ref": "#/components/schemas/GuardrailInterval" + }, + "workspace_id": { + "type": "string", + "format": "uuid", + "description": "The workspace to create the guardrail in. Defaults to the default workspace if not provided." } }, "required": [ @@ -14482,12 +14512,17 @@ "null" ], "description": "ISO 8601 timestamp of when the guardrail was last updated" + }, + "workspace_id": { + "type": "string", + "description": "The workspace ID this guardrail belongs to." } }, "required": [ "created_at", "id", - "name" + "name", + "workspace_id" ], "title": "CreateGuardrailResponseData" }, @@ -14590,12 +14625,17 @@ "null" ], "description": "ISO 8601 timestamp of when the guardrail was last updated" + }, + "workspace_id": { + "type": "string", + "description": "The workspace ID this guardrail belongs to." } }, "required": [ "created_at", "id", - "name" + "name", + "workspace_id" ], "title": "GetGuardrailResponseData" }, @@ -14789,12 +14829,17 @@ "null" ], "description": "ISO 8601 timestamp of when the guardrail was last updated" + }, + "workspace_id": { + "type": "string", + "description": "The workspace ID this guardrail belongs to." } }, "required": [ "created_at", "id", - "name" + "name", + "workspace_id" ], "title": "UpdateGuardrailResponseData" },