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 @@ -27,6 +27,13 @@ internal static partial class ProjectsListProjectApiKeysCommandApiCommand
",
};

private static Option<global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess?> OwnerProjectAccess { get; } = new(
name: @"--owner-project-access")
{
Description = @"Filter API keys by whether the owner currently has effective access to the project. Use `active` for owners with access, `inactive` for owners without access, or `any` for all enabled project API keys. If omitted, the endpoint applies its existing membership-based visibility rules, which may exclude some enabled keys.
",
};

private static string FormatResponse(ParseResult parseResult, global::tryAGI.OpenAI.ProjectApiKeyListResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings)
{
string? text = null;
Expand All @@ -53,6 +60,7 @@ public static Command Create()
command.Arguments.Add(ProjectId);
command.Options.Add(Limit);
command.Options.Add(After);
command.Options.Add(OwnerProjectAccess);


command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
Expand All @@ -61,13 +69,15 @@ await CliRuntime.RunAsync(async () =>
var projectId = parseResult.GetRequiredValue(ProjectId);
var limit = parseResult.GetValue(Limit);
var after = parseResult.GetValue(After);
var ownerProjectAccess = parseResult.GetValue(OwnerProjectAccess);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Projects.ListProjectApiKeysAsync(
projectId: projectId,
limit: limit,
after: after,
ownerProjectAccess: ownerProjectAccess,
cancellationToken: cancellationToken).ConfigureAwait(false);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ public partial interface IProjectsClient
/// Default Value: 20
/// </param>
/// <param name="after"></param>
/// <param name="ownerProjectAccess"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::tryAGI.OpenAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.ProjectApiKeyListResponse> ListProjectApiKeysAsync(
string projectId,
int? limit = default,
string? after = default,
global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess? ownerProjectAccess = default,
global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
/// <summary>
Expand All @@ -29,13 +31,15 @@ public partial interface IProjectsClient
/// Default Value: 20
/// </param>
/// <param name="after"></param>
/// <param name="ownerProjectAccess"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::tryAGI.OpenAI.ApiException"></exception>
global::System.Threading.Tasks.Task<global::tryAGI.OpenAI.AutoSDKHttpResponse<global::tryAGI.OpenAI.ProjectApiKeyListResponse>> ListProjectApiKeysAsResponseAsync(
string projectId,
int? limit = default,
string? after = default,
global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess? ownerProjectAccess = default,
global::tryAGI.OpenAI.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);

Expand All @@ -45,11 +49,13 @@ public partial interface IProjectsClient
/// <param name="projectId"></param>
/// <param name="limit">
/// Default Value: 20
/// </param>
/// </param>
/// <param name="ownerProjectAccess"></param>
/// <param name="after">Initial cursor to start enumerating from. Defaults to null (first page).</param>
/// <param name="cancellationToken"></param>
global::System.Collections.Generic.IAsyncEnumerable<global::tryAGI.OpenAI.ProjectApiKey> ListProjectApiKeysAutoPagingAsync(
string projectId, int? limit = default,
global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess? ownerProjectAccess = default,
string? after = null,
global::System.Threading.CancellationToken cancellationToken = default);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class WebhookSafetyIdentifierBlockedObjectJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject>
public sealed class ListProjectApiKeysOwnerProjectAccessJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject Read(
public override global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class WebhookSafetyIdentifierBlockedObjectJsonConverter : global::
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObjectExtensions.ToEnum(stringValue) ?? default;
return global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccessExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject)numValue;
return (global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject);
return default(global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,12 +42,12 @@ public sealed class WebhookSafetyIdentifierBlockedObjectJsonConverter : global::
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject value,
global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObjectExtensions.ToValueString(value));
writer.WriteStringValue(global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccessExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class WebhookSafetyIdentifierBlockedObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject?>
public sealed class ListProjectApiKeysOwnerProjectAccessNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess?>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject? Read(
public override global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class WebhookSafetyIdentifierBlockedObjectNullableJsonConverter :
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObjectExtensions.ToEnum(stringValue);
return global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccessExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject)numValue;
return (global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject?);
return default(global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,7 +42,7 @@ public sealed class WebhookSafetyIdentifierBlockedObjectNullableJsonConverter :
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObject? value,
global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccess? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
Expand All @@ -53,7 +53,7 @@ public override void Write(
}
else
{
writer.WriteStringValue(global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedObjectExtensions.ToValueString(value.Value));
writer.WriteStringValue(global::tryAGI.OpenAI.ListProjectApiKeysOwnerProjectAccessExtensions.ToValueString(value.Value));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class WebhookSafetyIdentifierBlockedTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType>
public sealed class ProjectApiKeyOwnerProjectAccessJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType Read(
public override global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class WebhookSafetyIdentifierBlockedTypeJsonConverter : global::Sy
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedTypeExtensions.ToEnum(stringValue) ?? default;
return global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccessExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType)numValue;
return (global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType);
return default(global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,12 +42,12 @@ public sealed class WebhookSafetyIdentifierBlockedTypeJsonConverter : global::Sy
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType value,
global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedTypeExtensions.ToValueString(value));
writer.WriteStringValue(global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccessExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class WebhookSafetyIdentifierBlockedTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType?>
public sealed class ProjectApiKeyOwnerProjectAccessNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess?>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType? Read(
public override global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,19 +18,19 @@ public sealed class WebhookSafetyIdentifierBlockedTypeNullableJsonConverter : gl
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedTypeExtensions.ToEnum(stringValue);
return global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccessExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType)numValue;
return (global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess)numValue;
}
case global::System.Text.Json.JsonTokenType.Null:
{
return default(global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType?);
return default(global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess?);
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -42,7 +42,7 @@ public sealed class WebhookSafetyIdentifierBlockedTypeNullableJsonConverter : gl
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedType? value,
global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccess? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
Expand All @@ -53,7 +53,7 @@ public override void Write(
}
else
{
writer.WriteStringValue(global::tryAGI.OpenAI.WebhookSafetyIdentifierBlockedTypeExtensions.ToValueString(value.Value));
writer.WriteStringValue(global::tryAGI.OpenAI.ProjectApiKeyOwnerProjectAccessExtensions.ToValueString(value.Value));
}
}
}
Expand Down
Loading