-
-
Notifications
You must be signed in to change notification settings - Fork 353
/
ses_identity_types.go
54 lines (43 loc) · 1.2 KB
/
ses_identity_types.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
package resources
import (
"context"
awsgo "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ses"
"github.com/aws/aws-sdk-go/service/ses/sesiface"
"github.com/gruntwork-io/cloud-nuke/config"
"github.com/gruntwork-io/go-commons/errors"
)
// SesIdentities - represents all SES identities
type SesIdentities struct {
BaseAwsResource
Client sesiface.SESAPI
Region string
Ids []string
}
func (Sid *SesIdentities) Init(session *session.Session) {
Sid.Client = ses.New(session)
}
func (Sid *SesIdentities) ResourceName() string {
return "ses-identity"
}
func (Sid *SesIdentities) MaxBatchSize() int {
return maxBatchSize
}
func (Sid *SesIdentities) ResourceIdentifiers() []string {
return Sid.Ids
}
func (Sid *SesIdentities) GetAndSetIdentifiers(c context.Context, configObj config.Config) ([]string, error) {
identifiers, err := Sid.getAll(c, configObj)
if err != nil {
return nil, err
}
Sid.Ids = awsgo.StringValueSlice(identifiers)
return Sid.Ids, nil
}
func (Sid *SesIdentities) Nuke(identifiers []string) error {
if err := Sid.nukeAll(awsgo.StringSlice(identifiers)); err != nil {
return errors.WithStackTrace(err)
}
return nil
}