// Code generated by sdkgen-v2. DO NOT EDIT.
package kmssdk

import (
	"context"

	kms "github.com/yandex-cloud/go-genproto/yandex/cloud/kms/v1"
	"github.com/yandex-cloud/go-sdk/v2/pkg/sdkresolvers"
)

type symmetricKeyResolver struct {
	client SymmetricKeyClient
	sdkresolvers.BaseNameResolver
}

func SymmetricKeyResolver(name string, client SymmetricKeyClient, opts ...sdkresolvers.ResolveOption) sdkresolvers.Resolver {
	return &symmetricKeyResolver{
		client:           client,
		BaseNameResolver: sdkresolvers.NewBaseNameResolver(name, "SymmetricKey", opts...),
	}
}

func (r *symmetricKeyResolver) Run(ctx context.Context) error {
	resp := r.client.Iterator(ctx, &kms.ListSymmetricKeysRequest{
		FolderId: r.FolderID(),

		PageSize: sdkresolvers.DefaultResolverPageSize,
	})
	return r.FindName(resp.TakeAll())
}
