func (c *CredentialV2) GetValue() *CredentialValue {
	if c.State == "unset" {  
		return nil
	}
	if c.Value == nil {  
		return nil
	}
	if c.Value.IsUnset() {  
		return nil
	}
	return c.Value
}
GetValue returns the value object, unless unset then returns nil
package apitypes
import (
	"encoding/json"
	"errors"
	"reflect"
	"strconv"
	"github.com/manifoldco/torus-cli/identity"
	"github.com/manifoldco/torus-cli/pathexp"
)
var errMistmatchedType = errors.New("Mismatched type and value in credential")
const (
	unsetCV = iota
	stringCV
	intCV
	floatCV
	undecryptedCV  
)
type CredentialEnvelope struct {
	ID      *identity.ID `json:"id"`
	Version uint8        `json:"version"`
	Body    *Credential  `json:"body"`
}
type CredentialResp struct {
	ID      *identity.ID    `json:"id"`
	Version uint8           `json:"version"`
	Body    json.RawMessage `json:"body"`
}
type Credential interface {
	GetName() string
	GetOrgID() *identity.ID
	GetPathExp() *pathexp.PathExp
	GetProjectID() *identity.ID
	GetValue() *CredentialValue
}
type BaseCredential struct {
	Name      string           `json:"name"`
	OrgID     *identity.ID     `json:"org_id"`
	PathExp   *pathexp.PathExp `json:"pathexp"`
	ProjectID *identity.ID     `json:"project_id"`
	Value     *CredentialValue `json:"value"`
}
func (c *BaseCredential) GetName() string {
	return c.Name
}
func (c *BaseCredential) GetOrgID() *identity.ID {
	return c.OrgID
}
func (c *BaseCredential) GetPathExp() *pathexp.PathExp {
	return c.PathExp
}
func (c *BaseCredential) GetProjectID() *identity.ID {
	return c.ProjectID
}
func (c *BaseCredential) GetValue() *CredentialValue {
	if c.Value.cvtype == unsetCV {
		return nil
	}
	return c.Value
}
type CredentialV2 struct {
	BaseCredential
	State string `json:"state"`
}