func (cl *MockClient) DestroySecretVersion(project, id, version string) error {
	version, err := cl.ValidateAndConvertVersion(project, id, version)
	if err != nil {
		return err
	}
	cl.Secrets[project][id].Versions[version].State = secretmanagerpb.SecretVersion_DESTROYED
	return nil
}
DestroySecretVersion changes the state of secret version to DESTROYED
returns nil if successful, otherwise error.
package tests
import (
	"fmt"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
	"strconv"
	"time"
	secretmanagerpb "google.golang.org/genproto/googleapis/cloud/secretmanager/v1"
)
type MockClient struct {
	Secrets map[string]map[string]*Secret
}
type Secret struct {
	Versions map[string]*Version
	Labels   map[string]string
}
type Version struct {
	CreateTime time.Time
	Data       []byte
	State      secretmanagerpb.SecretVersion_State
}
func (cl *MockClient) ValidateProject(project string) error {
	_, ok := cl.Secrets[project]
	if !ok {
		return status.Error(codes.NotFound, fmt.Sprintf("Project [projects/%s] not found.", project))
	}
	return nil
}
func (cl *MockClient) ValidateSecret(project, id string) error {
	_, ok := cl.Secrets[project][id]
	if !ok {
		return status.Error(codes.NotFound, fmt.Sprintf("Secret [projects/%s/secrets/%s] not found or has no versions.", project, id))
	}
	return nil
}
func (cl *MockClient) ValidateSecretVersion(project, id, version string) error {
	err := cl.ValidateSecret(project, id)
	if err != nil {
		return err
	}
	if version == "latest" {
		version = strconv.Itoa(len(cl.Secrets[project][id].Versions))
	}
	_, ok := cl.Secrets[project][id].Versions[version]
	if !ok {
		return status.Error(codes.NotFound, fmt.Sprintf("Secret Version [projects/%s/secrets/%s/versions/%s] not found.", project, id, version))
	}
	return nil
}
func (cl *MockClient) ValidateAndConvertVersion(project, id, version string) (string, error) {
	err := cl.ValidateSecretVersion(project, id, version)
	if version == "latest" {
		version = strconv.Itoa(len(cl.Secrets[project][id].Versions))
	}
	return version, err
}
func (cl *MockClient) CreateSecret(project, id string) error {
	err := cl.ValidateProject(project)
	if err != nil {
		return err
	}
	cl.Secrets[project][id] = new(Secret)
	return nil
}
func (cl *MockClient) UpsertSecret(project, id string, data []byte) (string, error) {
	err := cl.ValidateProject(project)
	if err != nil {
		return "", err
	}
	err = cl.ValidateSecret(project, id)
	if err != nil {
		cl.Secrets[project][id] = new(Secret)
	}
	version := strconv.Itoa(len(cl.Secrets[project][id].Versions) + 1)
	cl.Secrets[project][id].Versions[version] = &Version{
		Data:  data,
		State: secretmanagerpb.SecretVersion_ENABLED,
	}
	return version, nil
}
func (cl *MockClient) GetCreateTime(project, id, version string) (time.Time, error) {
	version, err := cl.ValidateAndConvertVersion(project, id, version)
	if err != nil {
		return time.Time{}, err
	}
	creatTime := cl.Secrets[project][id].Versions[version].CreateTime
	return creatTime, nil
}
func (cl *MockClient) GetSecretLabels(project, id string) (map[string]string, error) {
	err := cl.ValidateSecret(project, id)
	if err != nil {
		return nil, err
	}
	ret := make(map[string]string)
	for key, val := range cl.Secrets[project][id].Labels {
		ret[key] = val
	}
	return ret, nil
}
func (cl *MockClient) GetSecretVersionData(project, id, version string) ([]byte, error) {
	version, err := cl.ValidateAndConvertVersion(project, id, version)
	if err != nil {
		return nil, err
	}
	return cl.Secrets[project][id].Versions[version].Data, nil
}
func (cl *MockClient) GetSecretVersionState(project, id, version string) (secretmanagerpb.SecretVersion_State, error) {
	version, err := cl.ValidateAndConvertVersion(project, id, version)
	if err != nil {
		return 0, err
	}
	return cl.Secrets[project][id].Versions[version].State, nil
}
func (cl *MockClient) EnableSecretVersion(project, id, version string) error {
	version, err := cl.ValidateAndConvertVersion(project, id, version)
	if err != nil {
		return err
	}
	cl.Secrets[project][id].Versions[version].State = secretmanagerpb.SecretVersion_ENABLED
	return nil
}
func (cl *MockClient) DisableSecretVersion(project, id, version string) error {
	version, err := cl.ValidateAndConvertVersion(project, id, version)
	if err != nil {
		return err
	}
	cl.Secrets[project][id].Versions[version].State = secretmanagerpb.SecretVersion_DISABLED
	return nil
}