-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloud_ips_default.go
43 lines (35 loc) · 1.58 KB
/
cloud_ips_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
40
41
42
43
// Code generated by go generate; DO NOT EDIT.
package brightbox
import "context"
import "path"
const (
// cloudipAPIPath returns the relative URL path to the CloudIP endpoint
cloudipAPIPath = "cloud_ips"
)
// CloudIPs returns the collection view for CloudIP
func (c *Client) CloudIPs(ctx context.Context) ([]CloudIP, error) {
return apiGetCollection[[]CloudIP](ctx, c, cloudipAPIPath)
}
// CloudIP retrieves a detailed view of one resource
func (c *Client) CloudIP(ctx context.Context, identifier string) (*CloudIP, error) {
return apiGet[CloudIP](ctx, c, path.Join(cloudipAPIPath, identifier))
}
// CreateCloudIP creates a new resource from the supplied option map.
//
// It takes an instance of CloudIPOptions. Not all attributes can be
// specified at create time (such as ID, which is allocated for you).
func (c *Client) CreateCloudIP(ctx context.Context, newCloudIP CloudIPOptions) (*CloudIP, error) {
return apiPost[CloudIP](ctx, c, cloudipAPIPath, newCloudIP)
}
// UpdateCloudIP updates an existing resources's attributes. Not all
// attributes can be changed (such as ID).
//
// It takes an instance of CloudIPOptions. Specify the resource you
// want to update using the ID field.
func (c *Client) UpdateCloudIP(ctx context.Context, updateCloudIP CloudIPOptions) (*CloudIP, error) {
return apiPut[CloudIP](ctx, c, path.Join(cloudipAPIPath, updateCloudIP.ID), updateCloudIP)
}
// DestroyCloudIP destroys an existing resource.
func (c *Client) DestroyCloudIP(ctx context.Context, identifier string) (*CloudIP, error) {
return apiDelete[CloudIP](ctx, c, path.Join(cloudipAPIPath, identifier))
}