func (c *Command) GetHandlers() []command.Handler {
	return []command.Handler{
		cmdutil.NewCommandHandler(CommandName, Actions, c.Actions),
		cmdutil.NewCommandHandler(CommandName, SendOffer, c.SendOffer),
		cmdutil.NewCommandHandler(CommandName, SendProposal, c.SendProposal),
		cmdutil.NewCommandHandler(CommandName, SendRequest, c.SendRequest),
		cmdutil.NewCommandHandler(CommandName, AcceptProposal, c.AcceptProposal),
		cmdutil.NewCommandHandler(CommandName, DeclineProposal, c.DeclineProposal),
		cmdutil.NewCommandHandler(CommandName, AcceptOffer, c.AcceptOffer),
		cmdutil.NewCommandHandler(CommandName, AcceptProblemReport, c.AcceptProblemReport),
		cmdutil.NewCommandHandler(CommandName, DeclineOffer, c.DeclineOffer),
		cmdutil.NewCommandHandler(CommandName, NegotiateProposal, c.NegotiateProposal),
		cmdutil.NewCommandHandler(CommandName, AcceptRequest, c.AcceptRequest),
		cmdutil.NewCommandHandler(CommandName, DeclineRequest, c.DeclineRequest),
		cmdutil.NewCommandHandler(CommandName, AcceptCredential, c.AcceptCredential),
		cmdutil.NewCommandHandler(CommandName, DeclineCredential, c.DeclineCredential),
	}
}
GetHandlers returns list of all commands supported by this controller command.
package issuecredential
import (
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"github.com/hyperledger/aries-framework-go/pkg/client/issuecredential"
	"github.com/hyperledger/aries-framework-go/pkg/client/issuecredential/rfc0593"
	"github.com/hyperledger/aries-framework-go/pkg/common/log"
	"github.com/hyperledger/aries-framework-go/pkg/controller/command"
	"github.com/hyperledger/aries-framework-go/pkg/controller/internal/cmdutil"
	"github.com/hyperledger/aries-framework-go/pkg/controller/webnotifier"
	"github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service"
	protocol "github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/issuecredential"
	"github.com/hyperledger/aries-framework-go/pkg/internal/logutil"
)
var logger = log.New("aries-framework/controller/issuecredential")
const (
	InvalidRequestErrorCode = command.Code(iota + command.IssueCredential)
	AcceptProposalErrorCode
	AcceptOfferErrorCode
	AcceptRequestErrorCode
	AcceptCredentialErrorCode
	AcceptProblemReportErrorCode
	NegotiateProposalErrorCode
	DeclineProposalErrorCode
	DeclineOfferErrorCode
	DeclineRequestErrorCode
	DeclineCredentialErrorCode
	SendProposalErrorCode
	SendOfferErrorCode
	SendRequestErrorCode
	ActionsErrorCode
)
const (
	CommandName = "issuecredential"
	Actions             = "Actions"
	SendOffer           = "SendOffer"
	SendProposal        = "SendProposal"
	SendRequest         = "SendRequest"
	AcceptProposal      = "AcceptProposal"
	DeclineProposal     = "DeclineProposal"
	AcceptOffer         = "AcceptOffer"
	DeclineOffer        = "DeclineOffer"
	NegotiateProposal   = "NegotiateProposal"
	AcceptRequest       = "AcceptRequest"
	DeclineRequest      = "DeclineRequest"
	AcceptCredential    = "AcceptCredential"
	DeclineCredential   = "DeclineCredential"
	AcceptProblemReport = "AcceptProblemReport"
)
const (
	errEmptyPIID              = "empty PIID"
	errEmptyMyDID             = "empty MyDID"
	errEmptyTheirDID          = "empty TheirDID"
	errEmptyOfferCredential   = "empty OfferCredential"
	errEmptyIssueCredential   = "empty IssueCredential"
	errEmptyProposeCredential = "empty ProposeCredential"
	errEmptyRequestCredential = "empty RequestCredential"
	successString = "success"
	_actions = "_actions"
	_states  = "_states"
)
type Options struct {
	rfc0593Provider rfc0593.Provider
}
type Option func(*Options)
func WithAutoExecuteRFC0593(p rfc0593.Provider) Option {
	return func(o *Options) {
		o.rfc0593Provider = p
	}
}
type Command struct {
	client *issuecredential.Client
}
func New(ctx issuecredential.Provider, notifier command.Notifier, options ...Option) (*Command, error) {
	opts := &Options{}
	for i := range options {
		options[i](opts)
	}
	client, err := issuecredential.New(ctx)
	if err != nil {
		return nil, fmt.Errorf("cannot create a client: %w", err)
	}
	states := make(chan service.StateMsg)
	if err = client.RegisterMsgEvent(states); err != nil {
		return nil, fmt.Errorf("register msg event: %w", err)
	}
	obs := webnotifier.NewObserver(notifier)
	obs.RegisterStateMsg(protocol.Name+_states, states)
	actions := make(chan service.DIDCommAction)
	if err = client.RegisterActionEvent(actions); err != nil {
		return nil, fmt.Errorf("register action event: %w", err)
	}
	if opts.rfc0593Provider != nil {
		mw, err := rfc0593.NewMiddleware(opts.rfc0593Provider)
		if err != nil {
			return nil, fmt.Errorf("failed to init rfc0593 middleware: %w", err)
		}
		err = rfc0593.RegisterMiddleware(mw, ctx)
		if err != nil {
			return nil, fmt.Errorf("failed to register rfc0593 middleware: %w", err)
		}
		next := make(chan service.DIDCommAction)
		go rfc0593.AutoExecute(opts.rfc0593Provider, next)(actions)
		obs.RegisterAction(protocol.Name+_actions, next)
	} else {
		obs.RegisterAction(protocol.Name+_actions, actions)
	}
	return &Command{client: client}, nil
}