-
Notifications
You must be signed in to change notification settings - Fork 1
/
client_teams.go
40 lines (36 loc) · 1.04 KB
/
client_teams.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
package monta
import (
"context"
"net/url"
)
// ListTeamsRequest is the request input to the [Client.ListTeams] method.
type ListTeamsRequest struct {
PageFilters
// Filter teams by partner external id. To filter only resources without PartnerExternalID use "".
PartnerExternalID *string
// If the team can be deleted.
IncludeDeleted bool
}
// ListTeamsResponse is the response output from the [Client.ListTeams] method.
type ListTeamsResponse struct {
// Teams in the current page.
Teams []*Team `json:"data"`
// PageMeta with metadata about the current page.
PageMeta PageMeta `json:"meta"`
}
// ListTeams to retrieve your teams.
func (c *clientImpl) ListTeams(
ctx context.Context,
request *ListTeamsRequest,
) (*ListTeamsResponse, error) {
path := "/v1/teams"
query := url.Values{}
request.PageFilters.Apply(query)
if request.PartnerExternalID != nil {
query.Set("partnerExternalId", *request.PartnerExternalID)
}
if request.IncludeDeleted {
query.Set("includeDeleted", "true")
}
return doGet[ListTeamsResponse](ctx, c, path, query)
}