-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapi_clients_default.go
50 lines (41 loc) · 2.02 KB
/
api_clients_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
44
45
46
47
48
49
50
// Code generated by go generate; DO NOT EDIT.
package brightbox
import "context"
import "path"
const (
// apiclientAPIPath returns the relative URL path to the APIClient endpoint
apiclientAPIPath = "api_clients"
)
// APIClients returns the collection view for APIClient
func (c *Client) APIClients(ctx context.Context) ([]APIClient, error) {
return apiGetCollection[[]APIClient](ctx, c, apiclientAPIPath)
}
// APIClient retrieves a detailed view of one resource
func (c *Client) APIClient(ctx context.Context, identifier string) (*APIClient, error) {
return apiGet[APIClient](ctx, c, path.Join(apiclientAPIPath, identifier))
}
// CreateAPIClient creates a new resource from the supplied option map.
//
// It takes an instance of APIClientOptions. Not all attributes can be
// specified at create time (such as ID, which is allocated for you).
func (c *Client) CreateAPIClient(ctx context.Context, newAPIClient APIClientOptions) (*APIClient, error) {
return apiPost[APIClient](ctx, c, apiclientAPIPath, newAPIClient)
}
// UpdateAPIClient updates an existing resources's attributes. Not all
// attributes can be changed (such as ID).
//
// It takes an instance of APIClientOptions. Specify the resource you
// want to update using the ID field.
func (c *Client) UpdateAPIClient(ctx context.Context, updateAPIClient APIClientOptions) (*APIClient, error) {
return apiPut[APIClient](ctx, c, path.Join(apiclientAPIPath, updateAPIClient.ID), updateAPIClient)
}
// DestroyAPIClient destroys an existing resource.
func (c *Client) DestroyAPIClient(ctx context.Context, identifier string) (*APIClient, error) {
return apiDelete[APIClient](ctx, c, path.Join(apiclientAPIPath, identifier))
}
// ResetAPIClientPassword resets the password in APIClient, returning it
// in the returned resource. This is the only time the new password is
// available in plaintext.
func (c *Client) ResetAPIClientPassword(ctx context.Context, identifier string) (*APIClient, error) {
return apiPost[APIClient](ctx, c, path.Join(apiclientAPIPath, identifier, "reset_secret"), nil)
}