func NewApproveSubRequest(serviceId, reqID string, apprForm *Form) (Message, error) {
	if serviceId == "" {
		return Message{}, errors.New("need a target service serviceId send approval serviceId")
	}
	if reqID == "" {
		return Message{}, errors.New("the request ID is empty but must be used for the approval")
	}
	if apprForm == nil {
		return Message{}, errors.New("approval form is nil")
	}
	apprMess := NewMessage(Attrs{To: serviceId})
	apprMess.Extensions = []MsgExtension{apprForm}
	apprMess.Id = reqID
	return apprMess, nil
}
NewApproveSubRequest creates a new sub approval response to a request from the service to the owner of the node
In order to approve the request, the owner shall submit the form and set the "pubsub#allow" field to a value of "1" or "true"
For tracking purposes the message MUST reflect the 'id' attribute originally provided in the request.
See 8.6 Manage Subscription Requests
package stanza
import (
	"encoding/xml"
	"errors"
	"strings"
)
type PubSubOwner struct {
	XMLName      xml.Name `xml:"http://jabber.org/protocol/pubsub#owner pubsub"`
	OwnerUseCase OwnerUseCase
	ResultSet *ResultSet `xml:"set,omitempty"`
}
func (pso *PubSubOwner) Namespace() string {
	return pso.XMLName.Space
}
func (pso *PubSubOwner) GetSet() *ResultSet {
	return pso.ResultSet
}
type OwnerUseCase interface {
	UseCase() string
}
type AffiliationsOwner struct {
	XMLName      xml.Name           `xml:"affiliations"`
	Affiliations []AffiliationOwner `xml:"affiliation,omitempty"`
	Node         string             `xml:"node,attr"`
}
func (AffiliationsOwner) UseCase() string {
	return "affiliations"
}
type AffiliationOwner struct {
	XMLName           xml.Name `xml:"affiliation"`
	AffiliationStatus string   `xml:"affiliation,attr"`
	Jid               string   `xml:"jid,attr"`
}
const (
	AffiliationStatusMember      = "member"
	AffiliationStatusNone        = "none"
	AffiliationStatusOutcast     = "outcast"
	AffiliationStatusOwner       = "owner"
	AffiliationStatusPublisher   = "publisher"
	AffiliationStatusPublishOnly = "publish-only"
)
type ConfigureOwner struct {
	XMLName xml.Name `xml:"configure"`
	Node    string   `xml:"node,attr,omitempty"`
	Form    *Form    `xml:"x,omitempty"`
}
func (*ConfigureOwner) UseCase() string {
	return "configure"
}
type DefaultOwner struct {
	XMLName xml.Name `xml:"default"`
	Form    *Form    `xml:"x,omitempty"`
}
func (*DefaultOwner) UseCase() string {
	return "default"
}
type DeleteOwner struct {
	XMLName       xml.Name       `xml:"delete"`
	RedirectOwner *RedirectOwner `xml:"redirect,omitempty"`
	Node          string         `xml:"node,attr,omitempty"`
}
func (*DeleteOwner) UseCase() string {
	return "delete"
}
type RedirectOwner struct {
	XMLName xml.Name `xml:"redirect"`
	URI     string   `xml:"uri,attr"`
}
type PurgeOwner struct {
	XMLName xml.Name `xml:"purge"`
	Node    string   `xml:"node,attr"`
}
func (*PurgeOwner) UseCase() string {
	return "purge"
}
type SubscriptionsOwner struct {
	XMLName       xml.Name            `xml:"subscriptions"`
	Subscriptions []SubscriptionOwner `xml:"subscription"`
	Node          string              `xml:"node,attr"`
}
func (*SubscriptionsOwner) UseCase() string {
	return "subscriptions"
}
type SubscriptionOwner struct {
	SubscriptionStatus string `xml:"subscription"`
	Jid                string `xml:"jid,attr"`
}
const (
	SubscriptionStatusNone         = "none"
	SubscriptionStatusPending      = "pending"
	SubscriptionStatusSubscribed   = "subscribed"
	SubscriptionStatusUnconfigured = "unconfigured"
)
func NewConfigureNode(serviceId, nodeName string) (*IQ, error) {
	iq, err := NewIQ(Attrs{Type: IQTypeGet, To: serviceId})
	if err != nil {
		return nil, err
	}
	iq.Payload = &PubSubOwner{
		OwnerUseCase: &ConfigureOwner{Node: nodeName},
	}
	return iq, nil
}
func NewDelNode(serviceId, nodeID string) (*IQ, error) {
	if strings.TrimSpace(nodeID) == "" {
		return nil, errors.New("cannot delete a node without a target node ID")
	}
	iq, err := NewIQ(Attrs{Type: IQTypeSet, To: serviceId})
	if err != nil {
		return nil, err
	}
	iq.Payload = &PubSubOwner{
		OwnerUseCase: &DeleteOwner{Node: nodeID},
	}
	return iq, nil
}
func NewPurgeAllItems(serviceId, nodeId string) (*IQ, error) {
	iq, err := NewIQ(Attrs{Type: IQTypeSet, To: serviceId})
	if err != nil {
		return nil, err
	}
	iq.Payload = &PubSubOwner{
		OwnerUseCase: &PurgeOwner{Node: nodeId},
	}
	return iq, nil
}
func NewRequestDefaultConfig(serviceId string) (*IQ, error) {
	iq, err := NewIQ(Attrs{Type: IQTypeGet, To: serviceId})
	if err != nil {
		return nil, err
	}
	iq.Payload = &PubSubOwner{
		OwnerUseCase: &DefaultOwner{},
	}
	return iq, nil
}