-
Notifications
You must be signed in to change notification settings - Fork 2
/
collaborations_default.go
39 lines (31 loc) · 1.48 KB
/
collaborations_default.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
// Code generated by go generate; DO NOT EDIT.
package brightbox
import "context"
import "path"
const (
// collaborationAPIPath returns the relative URL path to the Collaboration endpoint
collaborationAPIPath = "collaborations"
)
// Collaborations returns the collection view for Collaboration
func (c *Client) Collaborations(ctx context.Context) ([]Collaboration, error) {
return apiGetCollection[[]Collaboration](ctx, c, collaborationAPIPath)
}
// Collaboration retrieves a detailed view of one resource
func (c *Client) Collaboration(ctx context.Context, identifier string) (*Collaboration, error) {
return apiGet[Collaboration](ctx, c, path.Join(collaborationAPIPath, identifier))
}
// CreateCollaboration creates a new resource from the supplied option map.
//
// It takes an instance of CollaborationOptions. Not all attributes can be
// specified at create time (such as ID, which is allocated for you).
func (c *Client) CreateCollaboration(ctx context.Context, newCollaboration CollaborationOptions) (*Collaboration, error) {
return apiPost[Collaboration](ctx, c, collaborationAPIPath, newCollaboration)
}
// DestroyCollaboration destroys an existing resource.
func (c *Client) DestroyCollaboration(ctx context.Context, identifier string) (*Collaboration, error) {
return apiDelete[Collaboration](ctx, c, path.Join(collaborationAPIPath, identifier))
}
// CreatedAt implements the CreateDated interface for Collaboration
func (s Collaboration) CreatedAtUnix() int64 {
return s.CreatedAt.Unix()
}