@@ -11,9 +11,15 @@ import (
11
11
type ACMClient struct {
12
12
cert map [string ]* acm.GetCertificateOutput
13
13
tags map [string ]* acm.ListTagsForCertificateOutput
14
+ err map [string ]error
14
15
}
15
16
16
17
func (m * ACMClient ) ListCertificates (ctx context.Context , input * acm.ListCertificatesInput , fn ... func (* acm.Options )) (* acm.ListCertificatesOutput , error ) {
18
+ if m .err != nil {
19
+ if err , ok := m .err ["ListCertificates" ]; ok {
20
+ return nil , err
21
+ }
22
+ }
17
23
output := & acm.ListCertificatesOutput {
18
24
CertificateSummaryList : make ([]types.CertificateSummary , 0 ),
19
25
}
@@ -26,6 +32,11 @@ func (m *ACMClient) ListCertificates(ctx context.Context, input *acm.ListCertifi
26
32
}
27
33
28
34
func (m * ACMClient ) GetCertificate (ctx context.Context , input * acm.GetCertificateInput , fn ... func (* acm.Options )) (* acm.GetCertificateOutput , error ) {
35
+ if m .err != nil {
36
+ if err , ok := m .err ["GetCertificate" ]; ok {
37
+ return nil , err
38
+ }
39
+ }
29
40
if input .CertificateArn == nil {
30
41
return nil , fmt .Errorf ("expected a valid CertificateArn, got: nil" )
31
42
}
@@ -38,6 +49,11 @@ func (m *ACMClient) GetCertificate(ctx context.Context, input *acm.GetCertificat
38
49
}
39
50
40
51
func (m * ACMClient ) ListTagsForCertificate (ctx context.Context , in * acm.ListTagsForCertificateInput , fn ... func (* acm.Options )) (* acm.ListTagsForCertificateOutput , error ) {
52
+ if m .err != nil {
53
+ if err , ok := m .err ["ListTagsForCertificate" ]; ok {
54
+ return nil , err
55
+ }
56
+ }
41
57
if in .CertificateArn == nil {
42
58
return nil , fmt .Errorf ("expected a valid CertificateArn, got: nil" )
43
59
}
@@ -48,10 +64,12 @@ func (m *ACMClient) ListTagsForCertificate(ctx context.Context, in *acm.ListTags
48
64
func NewACMClient (
49
65
cert map [string ]* acm.GetCertificateOutput ,
50
66
tags map [string ]* acm.ListTagsForCertificateOutput ,
67
+ err map [string ]error ,
51
68
) * ACMClient {
52
69
c := & ACMClient {
53
70
cert : cert ,
54
71
tags : tags ,
72
+ err : err ,
55
73
}
56
74
return c
57
75
}
0 commit comments