func (group *Group) SetUserAsOwner(userID int) error {
	endpoint := fmt.Sprintf("%s/SetUserAsOwner(%d)", group.ToURL(), userID)
	client := NewHTTPClient(group.client)
	_, err := client.Post(endpoint, nil, group.config)
	return err
}
SetUserAsOwner sets a user as owner (available only in SPO)
package api
import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/url"
	"github.com/koltyakov/gosip"
	"github.com/koltyakov/gosip/csom"
)
type Group struct {
	client    *gosip.SPClient
	config    *RequestConfig
	endpoint  string
	modifiers *ODataMods
}
type GroupInfo struct {
	AllowMembersEditMembership     bool   `json:"AllowMembersEditMembership"`
	AllowRequestToJoinLeave        bool   `json:"AllowRequestToJoinLeave"`
	AutoAcceptRequestToJoinLeave   bool   `json:"AutoAcceptRequestToJoinLeave"`
	Description                    string `json:"Description"`
	ID                             int    `json:"Id"`
	IsHiddenInUI                   bool   `json:"IsHiddenInUI"`
	LoginName                      string `json:"LoginName"`
	OnlyAllowMembersViewMembership bool   `json:"OnlyAllowMembersViewMembership"`
	OwnerTitle                     string `json:"OwnerTitle"`
	PrincipalType                  int    `json:"PrincipalType"`
	RequestToJoinLeaveEmailSetting bool   `json:"RequestToJoinLeaveEmailSetting"`
	Title                          string `json:"Title"`
}
type GroupResp []byte
func NewGroup(client *gosip.SPClient, endpoint string, config *RequestConfig) *Group {
	return &Group{
		client:    client,
		endpoint:  endpoint,
		config:    config,
		modifiers: NewODataMods(),
	}
}
func (group *Group) ToURL() string {
	return toURL(group.endpoint, group.modifiers)
}
func (group *Group) Get() (GroupResp, error) {
	client := NewHTTPClient(group.client)
	return client.Get(group.ToURL(), group.config)
}
func (group *Group) Update(body []byte) (GroupResp, error) {
	body = patchMetadataType(body, "SP.Group")
	client := NewHTTPClient(group.client)
	return client.Update(group.endpoint, bytes.NewBuffer(body), group.config)
}
func (group *Group) Users() *Users {
	return NewUsers(
		group.client,
		fmt.Sprintf("%s/Users", group.endpoint),
		group.config,
	)
}
func (group *Group) AddUser(loginName string) error {
	endpoint := fmt.Sprintf("%s/Users", group.ToURL())
	client := NewHTTPClient(group.client)
	metadata := make(map[string]interface{})
	metadata["__metadata"] = map[string]string{
		"type": "SP.User",
	}
	metadata["LoginName"] = loginName
	body, _ := json.Marshal(metadata)
	_, err := client.Post(endpoint, bytes.NewBuffer(body), group.config)
	return err
}
func (group *Group) AddUserByID(userID int) error {
	sp := NewSP(group.client)
	user, err := sp.Web().SiteUsers().Select("LoginName").GetByID(userID).Get()
	if err != nil {
		return err
	}
	return group.AddUser(user.Data().LoginName)
}