-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathteams.go
More file actions
73 lines (65 loc) · 2.05 KB
/
Copy pathteams.go
File metadata and controls
73 lines (65 loc) · 2.05 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Code generated by internal/cmd/gen; DO NOT EDIT.
package flashduty
import "context"
// TeamsService handles the "Platform/Teams" API resource.
type TeamsService service
// Get team detail.
//
// Return a single team by ID, name, or external reference ID.
//
// API: POST /team/info (team-read-info).
func (s *TeamsService) ReadInfo(ctx context.Context, req *TeamInfoRequest) (*TeamItem, *Response, error) {
out := new(TeamItem)
resp, err := s.client.do(ctx, "/team/info", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Batch get teams.
//
// Return basic info for multiple teams by their IDs in a single request.
//
// API: POST /team/infos (team-read-infos).
func (s *TeamsService) ReadInfos(ctx context.Context, req *TeamInfosRequest) (*TeamInfosResponse, *Response, error) {
out := new(TeamInfosResponse)
resp, err := s.client.do(ctx, "/team/infos", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// List teams.
//
// Return a paginated list of teams in the current account.
//
// API: POST /team/list (team-read-list).
func (s *TeamsService) ReadList(ctx context.Context, req *TeamListRequest) (*TeamListResponse, *Response, error) {
out := new(TeamListResponse)
resp, err := s.client.do(ctx, "/team/list", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}
// Delete a team.
//
// Permanently delete a team by ID, name, or external reference ID.
//
// API: POST /team/delete (team-write-delete).
func (s *TeamsService) WriteDelete(ctx context.Context, req *TeamDeleteRequest) (*Response, error) {
return s.client.do(ctx, "/team/delete", req, nil)
}
// Create or update a team.
//
// Create a new team or update an existing one. Pass `team_id` to update.
//
// API: POST /team/upsert (team-write-upsert).
func (s *TeamsService) WriteUpsert(ctx context.Context, req *TeamUpsertRequest) (*TeamUpsertResponse, *Response, error) {
out := new(TeamUpsertResponse)
resp, err := s.client.do(ctx, "/team/upsert", req, out)
if err != nil {
return nil, resp, err
}
return out, resp, nil
}