mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
remove Coderd infix
This commit is contained in:
@@ -53,7 +53,7 @@ func (r *RootCmd) aiGatewayKeysCreate() *serpent.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
res, err := client.CreateAIGatewayCoderdKey(inv.Context(), codersdk.CreateAIGatewayCoderdKeyRequest{
|
||||
res, err := client.CreateAIGatewayKey(inv.Context(), codersdk.CreateAIGatewayKeyRequest{
|
||||
Name: inv.Args[0],
|
||||
})
|
||||
if err != nil {
|
||||
@@ -75,7 +75,7 @@ func (r *RootCmd) aiGatewayKeysCreate() *serpent.Command {
|
||||
|
||||
func (r *RootCmd) aiGatewayKeysList() *serpent.Command {
|
||||
formatter := cliui.NewOutputFormatter(
|
||||
cliui.TableFormat([]codersdk.AIGatewayCoderdKey{}, []string{"id", "name", "key prefix", "last used at", "created at"}),
|
||||
cliui.TableFormat([]codersdk.AIGatewayKey{}, []string{"id", "name", "key prefix", "last used at", "created at"}),
|
||||
cliui.JSONFormat(),
|
||||
)
|
||||
|
||||
@@ -91,7 +91,7 @@ func (r *RootCmd) aiGatewayKeysList() *serpent.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
keys, err := client.ListAIGatewayCoderdKeys(inv.Context())
|
||||
keys, err := client.ListAIGatewayKeys(inv.Context())
|
||||
if err != nil {
|
||||
return xerrors.Errorf("list AI Gateway keys: %w", err)
|
||||
}
|
||||
@@ -144,7 +144,7 @@ func (r *RootCmd) aiGatewayKeysDelete() *serpent.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
err = client.DeleteAIGatewayCoderdKey(inv.Context(), key.ID)
|
||||
err = client.DeleteAIGatewayKey(inv.Context(), key.ID)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("delete AI Gateway key %q: %w", key.Name, err)
|
||||
}
|
||||
@@ -157,10 +157,10 @@ func (r *RootCmd) aiGatewayKeysDelete() *serpent.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func aiGatewayKeyByNameOrID(ctx context.Context, client *codersdk.Client, nameOrID string) (codersdk.AIGatewayCoderdKey, error) {
|
||||
keys, err := client.ListAIGatewayCoderdKeys(ctx)
|
||||
func aiGatewayKeyByNameOrID(ctx context.Context, client *codersdk.Client, nameOrID string) (codersdk.AIGatewayKey, error) {
|
||||
keys, err := client.ListAIGatewayKeys(ctx)
|
||||
if err != nil {
|
||||
return codersdk.AIGatewayCoderdKey{}, xerrors.Errorf("list AI Gateway keys: %w", err)
|
||||
return codersdk.AIGatewayKey{}, xerrors.Errorf("list AI Gateway keys: %w", err)
|
||||
}
|
||||
|
||||
for _, key := range keys {
|
||||
@@ -174,5 +174,5 @@ func aiGatewayKeyByNameOrID(ctx context.Context, client *codersdk.Client, nameOr
|
||||
}
|
||||
}
|
||||
|
||||
return codersdk.AIGatewayCoderdKey{}, xerrors.Errorf("AI Gateway key %q not found", nameOrID)
|
||||
return codersdk.AIGatewayKey{}, xerrors.Errorf("AI Gateway key %q not found", nameOrID)
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ func TestAIGatewayKeys(t *testing.T) {
|
||||
err = inv.WithContext(ctx).Run()
|
||||
require.NoError(t, err)
|
||||
|
||||
var listed []codersdk.AIGatewayCoderdKey
|
||||
var listed []codersdk.AIGatewayKey
|
||||
require.NoError(t, json.Unmarshal(out.Bytes(), &listed))
|
||||
require.Len(t, listed, 2)
|
||||
for i, key := range listed {
|
||||
|
||||
Reference in New Issue
Block a user