func (m *Mediator) Status(request *models.RequestEnvelope) *models.ResponseEnvelope {
	args := mediator.StatusRequest{}
	if err := json.Unmarshal(request.Payload, &args); err != nil {
		return &models.ResponseEnvelope{Error: &models.CommandError{Message: err.Error()}}
	}
	response, cmdErr := exec(m.handlers[mediator.StatusCommandMethod], args)
	if cmdErr != nil {
		return &models.ResponseEnvelope{Error: cmdErr}
	}
	return &models.ResponseEnvelope{Payload: response}
}
Status returns details about pending messages for given connection.
package command
import (
	"encoding/json"
	"github.com/hyperledger/aries-framework-go/cmd/aries-agent-mobile/pkg/wrappers/models"
	"github.com/hyperledger/aries-framework-go/pkg/controller/command"
	"github.com/hyperledger/aries-framework-go/pkg/controller/command/mediator"
)
type Mediator struct {
	handlers map[string]command.Exec
}
func (m *Mediator) Register(request *models.RequestEnvelope) *models.ResponseEnvelope {
	args := mediator.RegisterRoute{}
	if err := json.Unmarshal(request.Payload, &args); err != nil {
		return &models.ResponseEnvelope{Error: &models.CommandError{Message: err.Error()}}
	}
	response, cmdErr := exec(m.handlers[mediator.RegisterCommandMethod], args)
	if cmdErr != nil {
		return &models.ResponseEnvelope{Error: cmdErr}
	}
	return &models.ResponseEnvelope{Payload: response}
}
func (m *Mediator) Unregister(request *models.RequestEnvelope) *models.ResponseEnvelope {
	response, cmdErr := exec(m.handlers[mediator.UnregisterCommandMethod], request.Payload)
	if cmdErr != nil {
		return &models.ResponseEnvelope{Error: cmdErr}
	}
	return &models.ResponseEnvelope{Payload: response}
}
func (m *Mediator) Connections(request *models.RequestEnvelope) *models.ResponseEnvelope {
	response, cmdErr := exec(m.handlers[mediator.GetConnectionsCommandMethod], request.Payload)
	if cmdErr != nil {
		return &models.ResponseEnvelope{Error: cmdErr}
	}
	return &models.ResponseEnvelope{Payload: response}
}
func (m *Mediator) Reconnect(request *models.RequestEnvelope) *models.ResponseEnvelope {
	args := mediator.RegisterRoute{}
	if err := json.Unmarshal(request.Payload, &args); err != nil {
		return &models.ResponseEnvelope{Error: &models.CommandError{Message: err.Error()}}
	}
	response, cmdErr := exec(m.handlers[mediator.ReconnectCommandMethod], args)
	if cmdErr != nil {
		return &models.ResponseEnvelope{Error: cmdErr}
	}
	return &models.ResponseEnvelope{Payload: response}
}
func (m *Mediator) ReconnectAll(request *models.RequestEnvelope) *models.ResponseEnvelope {
	response, cmdErr := exec(m.handlers[mediator.ReconnectAllCommandMethod], request.Payload)
	if cmdErr != nil {
		return &models.ResponseEnvelope{Error: cmdErr}
	}
	return &models.ResponseEnvelope{Payload: response}
}