forked from koltyakov/gosip
/
associatedGroups.go
53 lines (45 loc) · 1.39 KB
/
associatedGroups.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package api
import (
"fmt"
"github.com/pnocera/gosip"
)
//go:generate ggen -ent AssociatedGroups -conf -coll
// AssociatedGroups web associated groups scope constructor
// Always use NewAssociatedGroups constructor instead of &AssociatedGroups{}
type AssociatedGroups struct {
client *gosip.SPClient
config *RequestConfig
endpoint string
}
// NewAssociatedGroups - AssociatedGroups struct constructor function
func NewAssociatedGroups(client *gosip.SPClient, endpoint string, config *RequestConfig) *AssociatedGroups {
return &AssociatedGroups{
client: client,
endpoint: endpoint,
config: config,
}
}
// Visitors gets web associated visitors group API object
func (associatedGroups *AssociatedGroups) Visitors() *Group {
return NewGroup(
associatedGroups.client,
fmt.Sprintf("%s/AssociatedVisitorGroup", associatedGroups.endpoint),
associatedGroups.config,
)
}
// Members gets web associated members group API object
func (associatedGroups *AssociatedGroups) Members() *Group {
return NewGroup(
associatedGroups.client,
fmt.Sprintf("%s/AssociatedMemberGroup", associatedGroups.endpoint),
associatedGroups.config,
)
}
// Owners gets web associated owners group API object
func (associatedGroups *AssociatedGroups) Owners() *Group {
return NewGroup(
associatedGroups.client,
fmt.Sprintf("%s/AssociatedOwnerGroup", associatedGroups.endpoint),
associatedGroups.config,
)
}