Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ private static string FormatResponse(ParseResult parseResult, global::tryAGI.Ope
public static Command Create(string? commandName = null)
{
var command = new Command(commandName ?? @"delete-project-api-key", @"Delete project API key
Deletes an API key from the project.
Deletes an API key from the project, including keys owned by service accounts.

Returns confirmation of the key deletion, or an error if the key belonged to
a service account.
Requires permission to write project API keys. Deleting a service-account key
does not delete the service account or its other keys.

Returns confirmation of the key deletion.
");
command.Arguments.Add(ProjectId);
command.Arguments.Add(ApiKeyId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ public partial interface IProjectsClient
{
/// <summary>
/// Delete project API key<br/>
/// Deletes an API key from the project.<br/>
/// Returns confirmation of the key deletion, or an error if the key belonged to<br/>
/// a service account.
/// Deletes an API key from the project, including keys owned by service accounts.<br/>
/// Requires permission to write project API keys. Deleting a service-account key<br/>
/// does not delete the service account or its other keys.<br/>
/// Returns confirmation of the key deletion.
/// </summary>
/// <param name="projectId"></param>
/// <param name="apiKeyId"></param>
Expand All @@ -22,9 +23,10 @@ public partial interface IProjectsClient
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
/// Delete project API key<br/>
/// Deletes an API key from the project.<br/>
/// Returns confirmation of the key deletion, or an error if the key belonged to<br/>
/// a service account.
/// Deletes an API key from the project, including keys owned by service accounts.<br/>
/// Requires permission to write project API keys. Deleting a service-account key<br/>
/// does not delete the service account or its other keys.<br/>
/// Returns confirmation of the key deletion.
/// </summary>
/// <param name="projectId"></param>
/// <param name="apiKeyId"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,43 +478,6 @@ partial void ProcessCreateanAPIkeyforaserviceaccountResponseContent(
h => h.Key,
h => h.Value));
}
// The service account already has an API key and cannot create another.
if ((int)__response.StatusCode == 409)
{
string? __content_409 = null;
global::System.Exception? __exception_409 = null;
global::tryAGI.OpenAI.ErrorResponse? __value_409 = null;
try
{
if (__effectiveReadResponseAsString)
{
__content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
__value_409 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_409, JsonSerializerContext);
}
else
{
__content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);

__value_409 = global::tryAGI.OpenAI.ErrorResponse.FromJson(__content_409, JsonSerializerContext);
}
}
catch (global::System.Exception __ex)
{
__exception_409 = __ex;
}


throw global::tryAGI.OpenAI.ApiException<global::tryAGI.OpenAI.ErrorResponse>.Create(
statusCode: __response.StatusCode,
message: __content_409 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_409,
responseBody: __content_409,
responseObject: __value_409,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value));
}
// Too many management requests. Reduce the request rate and try again later.
if ((int)__response.StatusCode == 429)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ partial void ProcessDeleteProjectApiKeyResponseContent(

/// <summary>
/// Delete project API key<br/>
/// Deletes an API key from the project.<br/>
/// Returns confirmation of the key deletion, or an error if the key belonged to<br/>
/// a service account.
/// Deletes an API key from the project, including keys owned by service accounts.<br/>
/// Requires permission to write project API keys. Deleting a service-account key<br/>
/// does not delete the service account or its other keys.<br/>
/// Returns confirmation of the key deletion.
/// </summary>
/// <param name="projectId"></param>
/// <param name="apiKeyId"></param>
Expand All @@ -71,9 +72,10 @@ partial void ProcessDeleteProjectApiKeyResponseContent(
}
/// <summary>
/// Delete project API key<br/>
/// Deletes an API key from the project.<br/>
/// Returns confirmation of the key deletion, or an error if the key belonged to<br/>
/// a service account.
/// Deletes an API key from the project, including keys owned by service accounts.<br/>
/// Requires permission to write project API keys. Deleting a service-account key<br/>
/// does not delete the service account or its other keys.<br/>
/// Returns confirmation of the key deletion.
/// </summary>
/// <param name="projectId"></param>
/// <param name="apiKeyId"></param>
Expand Down
18 changes: 8 additions & 10 deletions src/libs/tryAGI.OpenAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14139,13 +14139,17 @@ paths:
- AdminApiKeyAuth: []
summary: Delete project API key
description: >
Deletes an API key from the project.
Deletes an API key from the project, including keys owned by service
accounts.


Returns confirmation of the key deletion, or an error if the key
belonged to
Requires permission to write project API keys. Deleting a
service-account key

a service account.
does not delete the service account or its other keys.


Returns confirmation of the key deletion.
operationId: delete-project-api-key
tags:
- Projects
Expand Down Expand Up @@ -29693,12 +29697,6 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"409":
description: The service account already has an API key and cannot create another.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"429":
description: Too many management requests. Reduce the request rate and try again
later.
Expand Down
Loading