-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathclientlists.go
92 lines (73 loc) · 3.19 KB
/
clientlists.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Package clientlists provides access to Akamai Client Lists APIs
//
// See: https://techdocs.akamai.com/client-lists/reference/api
package clientlists
import (
"context"
"errors"
"github.com/akamai/AkamaiOPEN-edgegrid-golang/v9/pkg/session"
)
var (
// ErrStructValidation is returned when given struct validation failed
ErrStructValidation = errors.New("struct validation")
)
type (
// ClientLists is the API interface for Client Lists
ClientLists interface {
// Activations
// GetActivation retrieves details of a specified activation ID.
//
// See: https://techdocs.akamai.com/client-lists/reference/get-retrieve-activation-status
GetActivation(ctx context.Context, params GetActivationRequest) (*GetActivationResponse, error)
// GetActivationStatus retrieves activation status for a client list in a network environment.
//
// See: https://techdocs.akamai.com/client-lists/reference/get-activation-status
GetActivationStatus(ctx context.Context, params GetActivationStatusRequest) (*GetActivationStatusResponse, error)
// CreateActivation activates a client list
//
// See: https://techdocs.akamai.com/client-lists/reference/post-activate-list
CreateActivation(ctx context.Context, params CreateActivationRequest) (*CreateActivationResponse, error)
// Lists
// GetClientLists lists all client lists accessible for an authenticated user
//
// See: https://techdocs.akamai.com/client-lists/reference/get-lists
GetClientLists(ctx context.Context, params GetClientListsRequest) (*GetClientListsResponse, error)
// GetClientList retrieves client list with specific list id
//
// See: https://techdocs.akamai.com/client-lists/reference/get-list
GetClientList(ctx context.Context, params GetClientListRequest) (*GetClientListResponse, error)
// CreateClientList creates a new client list
//
// See: https://techdocs.akamai.com/client-lists/reference/post-create-list
CreateClientList(ctx context.Context, params CreateClientListRequest) (*CreateClientListResponse, error)
// UpdateClientList updates existing client list
//
// See: https://techdocs.akamai.com/client-lists/reference/put-update-list
UpdateClientList(ctx context.Context, params UpdateClientListRequest) (*UpdateClientListResponse, error)
// UpdateClientListItems updates items/entries of an existing client lists
//
// See: https://techdocs.akamai.com/client-lists/reference/post-update-items
UpdateClientListItems(ctx context.Context, params UpdateClientListItemsRequest) (*UpdateClientListItemsResponse, error)
// DeleteClientList removes a client list
//
// See: https://techdocs.akamai.com/client-lists/reference/delete-list
DeleteClientList(ctx context.Context, params DeleteClientListRequest) error
}
clientlists struct {
session.Session
}
// Option defines a clientlists option
Option func(*clientlists)
// ClientFunc is a clientlists client new method, this can be used for mocking
ClientFunc func(sess session.Session, opts ...Option) ClientLists
)
// Client returns a new clientlists Client instance with the specified controller
func Client(sess session.Session, opts ...Option) ClientLists {
p := &clientlists{
Session: sess,
}
for _, opt := range opts {
opt(p)
}
return p
}