-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcollaborations.go
40 lines (34 loc) · 1.13 KB
/
collaborations.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 brightbox
import (
"context"
"path"
"time"
"github.com/brightbox/gobrightbox/v2/enums/collaborationstatus"
)
//go:generate ./generate_enum collaborationstatus pending accepted rejected cancelled ended
// Collaboration represents an API client.
// https://api.gb1.brightbox.com/1.0/#api_client
type Collaboration struct {
ResourceRef
ID string
Email string
Role string
RoleLabel string `json:"role_label"`
Status collaborationstatus.Enum
CreatedAt *time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at"`
FinishedAt *time.Time `json:"finished_at"`
Account *Account
User *User
Inviter *User
}
// CollaborationOptions is used to create and update api clients
type CollaborationOptions struct {
ID string `json:"-"`
Email *string `json:"email,omitempty"`
Role *string `json:"role,omitempty"`
}
// ResendCollaboration resends the invitation email to the collaborator.
func (c *Client) ResendCollaboration(ctx context.Context, identifier string) (*Collaboration, error) {
return apiPost[Collaboration](ctx, c, path.Join(collaborationAPIPath, identifier, "resend"), nil)
}