func WithProposePresentation(msg *ProposePresentation) presentproof.Opt {
	origin := presentproof.ProposePresentation(*msg)
	return presentproof.WithProposePresentation(&origin)
}
WithProposePresentation allows providing ProposePresentation message
Use this option to respond to RequestPresentation.
package presentproof
import (
	"errors"
	"github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service"
	"github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/decorator"
	"github.com/hyperledger/aries-framework-go/pkg/didcomm/protocol/presentproof"
	"github.com/hyperledger/aries-framework-go/pkg/doc/verifiable"
)
type (
	RequestPresentation presentproof.RequestPresentation
	Presentation presentproof.Presentation
	ProposePresentation presentproof.ProposePresentation
	RequestPresentationV3 presentproof.RequestPresentationV3
	PresentationV3 presentproof.PresentationV3
	ProposePresentationV3 presentproof.ProposePresentationV3
	Action presentproof.Action
)
const (
	webRedirectDecorator  = "~web-redirect"
	webRedirectStatusOK   = "OK"
	webRedirectStatusFAIL = "FAIL"
)
var (
	errEmptyRequestPresentation = errors.New("request presentation message is empty")
	errEmptyProposePresentation = errors.New("propose presentation message is empty")
)
type Provider interface {
	Service(id string) (interface{}, error)
}
type ProtocolService interface {
	service.DIDComm
	Actions() ([]presentproof.Action, error)
	ActionContinue(piID string, opt ...presentproof.Opt) error
	ActionStop(piID string, err error, opt ...presentproof.Opt) error
}
type Client struct {
	service.Event
	service ProtocolService
}
func New(ctx Provider) (*Client, error) {
	raw, err := ctx.Service(presentproof.Name)
	if err != nil {
		return nil, err
	}
	svc, ok := raw.(ProtocolService)
	if !ok {
		return nil, errors.New("cast service to presentproof service failed")
	}
	return &Client{
		Event:   svc,
		service: svc,
	}, nil
}
func (c *Client) Actions() ([]Action, error) {
	actions, err := c.service.Actions()
	if err != nil {
		return nil, err
	}
	result := make([]Action, len(actions))
	for i, action := range actions {
		result[i] = Action(action)
	}
	return result, nil
}
func (c *Client) SendRequestPresentation(msg *RequestPresentation, myDID, theirDID string) (string, error) {
	if msg == nil {
		return "", errEmptyRequestPresentation
	}
	msg.Type = presentproof.RequestPresentationMsgTypeV2
	return c.service.HandleOutbound(service.NewDIDCommMsgMap(msg), myDID, theirDID)
}
func (c *Client) SendRequestPresentationV3(msg *RequestPresentationV3, myDID, theirDID string) (string, error) {
	if msg == nil {
		return "", errEmptyRequestPresentation
	}
	msg.Type = presentproof.RequestPresentationMsgTypeV3
	return c.service.HandleOutbound(service.NewDIDCommMsgMap(msg), myDID, theirDID)
}
type addProof func(presentation *verifiable.Presentation) error
func (c *Client) AcceptRequestPresentation(piID string, msg *Presentation, sign addProof) error {
	return c.service.ActionContinue(piID, WithMultiOptions(WithPresentation(msg), WithAddProofFn(sign)))
}
func (c *Client) AcceptRequestPresentationV3(piID string, msg *PresentationV3, sign addProof) error {
	return c.service.ActionContinue(piID, WithMultiOptions(WithPresentationV3(msg), WithAddProofFn(sign)))
}
func (c *Client) NegotiateRequestPresentation(piID string, msg *ProposePresentation) error {
	return c.service.ActionContinue(piID, WithProposePresentation(msg))
}
func (c *Client) NegotiateRequestPresentationV3(piID string, msg *ProposePresentationV3) error {
	return c.service.ActionContinue(piID, WithProposePresentationV3(msg))
}
func (c *Client) DeclineRequestPresentation(piID, reason string) error {
	return c.service.ActionStop(piID, errors.New(reason))
}
func (c *Client) SendProposePresentation(msg *ProposePresentation, myDID, theirDID string) (string, error) {
	if msg == nil {
		return "", errEmptyProposePresentation
	}
	msg.Type = presentproof.ProposePresentationMsgTypeV2
	return c.service.HandleOutbound(service.NewDIDCommMsgMap(msg), myDID, theirDID)
}
func (c *Client) SendProposePresentationV3(msg *ProposePresentationV3, myDID, theirDID string) (string, error) {
	if msg == nil {
		return "", errEmptyProposePresentation
	}
	msg.Type = presentproof.ProposePresentationMsgTypeV3
	return c.service.HandleOutbound(service.NewDIDCommMsgMap(msg), myDID, theirDID)
}
func (c *Client) AcceptProposePresentation(piID string, msg *RequestPresentation) error {
	return c.service.ActionContinue(piID, WithRequestPresentation(msg))
}
func (c *Client) AcceptProposePresentationV3(piID string, msg *RequestPresentationV3) error {
	return c.service.ActionContinue(piID, WithRequestPresentationV3(msg))
}
func (c *Client) DeclineProposePresentation(piID string, options ...DeclinePresentationOptions) error {
	opts := &declinePresentationOpts{}
	for _, option := range options {
		option(opts)
	}
	return c.service.ActionStop(piID, opts.reason, prepareRedirectProperties(opts.redirect, webRedirectStatusFAIL))
}
func (c *Client) AcceptPresentation(piID string, options ...AcceptPresentationOptions) error {
	opts := &acceptPresentationOpts{}
	for _, option := range options {
		option(opts)
	}
	return c.service.ActionContinue(piID, presentproof.WithFriendlyNames(opts.names...),
		prepareRedirectProperties(opts.redirect, webRedirectStatusOK))
}
func (c *Client) DeclinePresentation(piID string, options ...DeclinePresentationOptions) error {
	opts := &declinePresentationOpts{}
	for _, option := range options {
		option(opts)
	}
	return c.service.ActionStop(piID, opts.reason, prepareRedirectProperties(opts.redirect, webRedirectStatusFAIL))
}
func (c *Client) AcceptProblemReport(piID string) error {
	return c.service.ActionContinue(piID)
}
func WithPresentation(msg *Presentation) presentproof.Opt {
	origin := presentproof.Presentation(*msg)
	return presentproof.WithPresentation(&origin)
}
func WithPresentationV3(msg *PresentationV3) presentproof.Opt {
	origin := presentproof.PresentationV3(*msg)
	return presentproof.WithPresentationV3(&origin)
}
func WithMultiOptions(opts ...presentproof.Opt) presentproof.Opt {
	return presentproof.WithMultiOptions(opts...)
}
func WithAddProofFn(sign addProof) presentproof.Opt {
	return presentproof.WithAddProofFn(sign)
}