-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_op_AddTagsToCertificate.go
164 lines (140 loc) · 5.46 KB
/
api_op_AddTagsToCertificate.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package acm
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
"github.com/aws/aws-sdk-go-v2/private/protocol/jsonrpc"
)
type AddTagsToCertificateInput struct {
_ struct{} `type:"structure"`
// String that contains the ARN of the ACM certificate to which the tag is to
// be applied. This must be of the form:
//
// arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012
//
// For more information about ARNs, see Amazon Resource Names (ARNs) and AWS
// Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
//
// CertificateArn is a required field
CertificateArn *string `min:"20" type:"string" required:"true"`
// The key-value pair that defines the tag. The tag value is optional.
//
// Tags is a required field
Tags []Tag `min:"1" type:"list" required:"true"`
}
// String returns the string representation
func (s AddTagsToCertificateInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *AddTagsToCertificateInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "AddTagsToCertificateInput"}
if s.CertificateArn == nil {
invalidParams.Add(aws.NewErrParamRequired("CertificateArn"))
}
if s.CertificateArn != nil && len(*s.CertificateArn) < 20 {
invalidParams.Add(aws.NewErrParamMinLen("CertificateArn", 20))
}
if s.Tags == nil {
invalidParams.Add(aws.NewErrParamRequired("Tags"))
}
if s.Tags != nil && len(s.Tags) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Tags", 1))
}
if s.Tags != nil {
for i, v := range s.Tags {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(aws.ErrInvalidParams))
}
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type AddTagsToCertificateOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s AddTagsToCertificateOutput) String() string {
return awsutil.Prettify(s)
}
const opAddTagsToCertificate = "AddTagsToCertificate"
// AddTagsToCertificateRequest returns a request value for making API operation for
// AWS Certificate Manager.
//
// Adds one or more tags to an ACM certificate. Tags are labels that you can
// use to identify and organize your AWS resources. Each tag consists of a key
// and an optional value. You specify the certificate on input by its Amazon
// Resource Name (ARN). You specify the tag by using a key-value pair.
//
// You can apply a tag to just one certificate if you want to identify a specific
// characteristic of that certificate, or you can apply the same tag to multiple
// certificates if you want to filter for a common relationship among those
// certificates. Similarly, you can apply the same tag to multiple resources
// if you want to specify a relationship among those resources. For example,
// you can add the same tag to an ACM certificate and an Elastic Load Balancing
// load balancer to indicate that they are both used by the same website. For
// more information, see Tagging ACM certificates (https://docs.aws.amazon.com/acm/latest/userguide/tags.html).
//
// To remove one or more tags, use the RemoveTagsFromCertificate action. To
// view all of the tags that have been applied to the certificate, use the ListTagsForCertificate
// action.
//
// // Example sending a request using AddTagsToCertificateRequest.
// req := client.AddTagsToCertificateRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/AddTagsToCertificate
func (c *Client) AddTagsToCertificateRequest(input *AddTagsToCertificateInput) AddTagsToCertificateRequest {
op := &aws.Operation{
Name: opAddTagsToCertificate,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AddTagsToCertificateInput{}
}
req := c.newRequest(op, input, &AddTagsToCertificateOutput{})
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
return AddTagsToCertificateRequest{Request: req, Input: input, Copy: c.AddTagsToCertificateRequest}
}
// AddTagsToCertificateRequest is the request type for the
// AddTagsToCertificate API operation.
type AddTagsToCertificateRequest struct {
*aws.Request
Input *AddTagsToCertificateInput
Copy func(*AddTagsToCertificateInput) AddTagsToCertificateRequest
}
// Send marshals and sends the AddTagsToCertificate API request.
func (r AddTagsToCertificateRequest) Send(ctx context.Context) (*AddTagsToCertificateResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &AddTagsToCertificateResponse{
AddTagsToCertificateOutput: r.Request.Data.(*AddTagsToCertificateOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// AddTagsToCertificateResponse is the response type for the
// AddTagsToCertificate API operation.
type AddTagsToCertificateResponse struct {
*AddTagsToCertificateOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// AddTagsToCertificate request.
func (r *AddTagsToCertificateResponse) SDKResponseMetdata() *aws.Response {
return r.response
}