-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_op_DeleteStackInstances.go
174 lines (143 loc) · 5.41 KB
/
api_op_DeleteStackInstances.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
165
166
167
168
169
170
171
172
173
174
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudformation
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type DeleteStackInstancesInput struct {
_ struct{} `type:"structure"`
// The names of the AWS accounts that you want to delete stack instances for.
//
// Accounts is a required field
Accounts []string `type:"list" required:"true"`
// The unique identifier for this stack set operation.
//
// If you don't specify an operation ID, the SDK generates one automatically.
//
// The operation ID also functions as an idempotency token, to ensure that AWS
// CloudFormation performs the stack set operation only once, even if you retry
// the request multiple times. You can retry stack set operation requests to
// ensure that AWS CloudFormation successfully received them.
//
// Repeating this stack set operation with a new operation ID retries all stack
// instances whose status is OUTDATED.
OperationId *string `min:"1" type:"string" idempotencyToken:"true"`
// Preferences for how AWS CloudFormation performs this stack set operation.
OperationPreferences *StackSetOperationPreferences `type:"structure"`
// The regions where you want to delete stack set instances.
//
// Regions is a required field
Regions []string `type:"list" required:"true"`
// Removes the stack instances from the specified stack set, but doesn't delete
// the stacks. You can't reassociate a retained stack or add an existing, saved
// stack to a new stack set.
//
// For more information, see Stack set operation options (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options).
//
// RetainStacks is a required field
RetainStacks *bool `type:"boolean" required:"true"`
// The name or unique ID of the stack set that you want to delete stack instances
// for.
//
// StackSetName is a required field
StackSetName *string `type:"string" required:"true"`
}
// String returns the string representation
func (s DeleteStackInstancesInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteStackInstancesInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DeleteStackInstancesInput"}
if s.Accounts == nil {
invalidParams.Add(aws.NewErrParamRequired("Accounts"))
}
if s.OperationId != nil && len(*s.OperationId) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("OperationId", 1))
}
if s.Regions == nil {
invalidParams.Add(aws.NewErrParamRequired("Regions"))
}
if s.RetainStacks == nil {
invalidParams.Add(aws.NewErrParamRequired("RetainStacks"))
}
if s.StackSetName == nil {
invalidParams.Add(aws.NewErrParamRequired("StackSetName"))
}
if s.OperationPreferences != nil {
if err := s.OperationPreferences.Validate(); err != nil {
invalidParams.AddNested("OperationPreferences", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type DeleteStackInstancesOutput struct {
_ struct{} `type:"structure"`
// The unique identifier for this stack set operation.
OperationId *string `min:"1" type:"string"`
}
// String returns the string representation
func (s DeleteStackInstancesOutput) String() string {
return awsutil.Prettify(s)
}
const opDeleteStackInstances = "DeleteStackInstances"
// DeleteStackInstancesRequest returns a request value for making API operation for
// AWS CloudFormation.
//
// Deletes stack instances for the specified accounts, in the specified regions.
//
// // Example sending a request using DeleteStackInstancesRequest.
// req := client.DeleteStackInstancesRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteStackInstances
func (c *Client) DeleteStackInstancesRequest(input *DeleteStackInstancesInput) DeleteStackInstancesRequest {
op := &aws.Operation{
Name: opDeleteStackInstances,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteStackInstancesInput{}
}
req := c.newRequest(op, input, &DeleteStackInstancesOutput{})
return DeleteStackInstancesRequest{Request: req, Input: input, Copy: c.DeleteStackInstancesRequest}
}
// DeleteStackInstancesRequest is the request type for the
// DeleteStackInstances API operation.
type DeleteStackInstancesRequest struct {
*aws.Request
Input *DeleteStackInstancesInput
Copy func(*DeleteStackInstancesInput) DeleteStackInstancesRequest
}
// Send marshals and sends the DeleteStackInstances API request.
func (r DeleteStackInstancesRequest) Send(ctx context.Context) (*DeleteStackInstancesResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &DeleteStackInstancesResponse{
DeleteStackInstancesOutput: r.Request.Data.(*DeleteStackInstancesOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// DeleteStackInstancesResponse is the response type for the
// DeleteStackInstances API operation.
type DeleteStackInstancesResponse struct {
*DeleteStackInstancesOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// DeleteStackInstances request.
func (r *DeleteStackInstancesResponse) SDKResponseMetdata() *aws.Response {
return r.response
}