Skip to content

Commit 8f7e122

Browse files
committed
Call DeleteAccountSetting for TestContainerInstanceTags
1 parent af5ba9f commit 8f7e122

File tree

3 files changed

+183
-0
lines changed

3 files changed

+183
-0
lines changed

agent/ecs_client/model/api/api-2.json

+28
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@
4646
{"shape":"AccessDeniedException"}
4747
]
4848
},
49+
"DeleteAccountSetting":{
50+
"name":"DeleteAccountSetting",
51+
"http":{
52+
"method":"POST",
53+
"requestUri":"/"
54+
},
55+
"input":{"shape":"DeleteAccountSettingRequest"},
56+
"output":{"shape":"DeleteAccountSettingResponse"},
57+
"errors":[
58+
{"shape":"ServerException"},
59+
{"shape":"ClientException"},
60+
{"shape":"InvalidParameterException"}
61+
]
62+
},
4963
"DeleteAttributes":{
5064
"name":"DeleteAttributes",
5165
"http":{
@@ -849,6 +863,20 @@
849863
"service":{"shape":"Service"}
850864
}
851865
},
866+
"DeleteAccountSettingRequest":{
867+
"type":"structure",
868+
"required":["name"],
869+
"members":{
870+
"name":{"shape":"SettingName"},
871+
"principalArn":{"shape":"String"}
872+
}
873+
},
874+
"DeleteAccountSettingResponse":{
875+
"type":"structure",
876+
"members":{
877+
"setting":{"shape":"Setting"}
878+
}
879+
},
852880
"DeleteAttributesRequest":{
853881
"type":"structure",
854882
"required":["attributes"],

agent/ecs_client/model/ecs/api.go

+149
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,89 @@ func (c *ECS) CreateServiceWithContext(ctx aws.Context, input *CreateServiceInpu
281281
return out, req.Send()
282282
}
283283

284+
const opDeleteAccountSetting = "DeleteAccountSetting"
285+
286+
// DeleteAccountSettingRequest generates a "aws/request.Request" representing the
287+
// client's request for the DeleteAccountSetting operation. The "output" return
288+
// value will be populated with the request's response once the request completes
289+
// successfuly.
290+
//
291+
// Use "Send" method on the returned Request to send the API call to the service.
292+
// the "output" return value is not valid until after Send returns without error.
293+
//
294+
// See DeleteAccountSetting for more information on using the DeleteAccountSetting
295+
// API call, and error handling.
296+
//
297+
// This method is useful when you want to inject custom logic or configuration
298+
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
299+
//
300+
//
301+
// // Example sending a request using the DeleteAccountSettingRequest method.
302+
// req, resp := client.DeleteAccountSettingRequest(params)
303+
//
304+
// err := req.Send()
305+
// if err == nil { // resp is now filled
306+
// fmt.Println(resp)
307+
// }
308+
func (c *ECS) DeleteAccountSettingRequest(input *DeleteAccountSettingInput) (req *request.Request, output *DeleteAccountSettingOutput) {
309+
op := &request.Operation{
310+
Name: opDeleteAccountSetting,
311+
HTTPMethod: "POST",
312+
HTTPPath: "/",
313+
}
314+
315+
if input == nil {
316+
input = &DeleteAccountSettingInput{}
317+
}
318+
319+
output = &DeleteAccountSettingOutput{}
320+
req = c.newRequest(op, input, output)
321+
return
322+
}
323+
324+
// DeleteAccountSetting API operation for Amazon EC2 Container Service.
325+
//
326+
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
327+
// with awserr.Error's Code and Message methods to get detailed information about
328+
// the error.
329+
//
330+
// See the AWS API reference guide for Amazon EC2 Container Service's
331+
// API operation DeleteAccountSetting for usage and error information.
332+
//
333+
// Returned Error Codes:
334+
// * ErrCodeServerException "ServerException"
335+
// These errors are usually caused by a server issue.
336+
//
337+
// * ErrCodeClientException "ClientException"
338+
// These errors are usually caused by a client action, such as using an action
339+
// or resource on behalf of a user that doesn't have permissions to use the
340+
// action or resource, or specifying an identifier that is not valid.
341+
//
342+
// * ErrCodeInvalidParameterException "InvalidParameterException"
343+
// The specified parameter is invalid. Review the available parameters for the
344+
// API request.
345+
//
346+
func (c *ECS) DeleteAccountSetting(input *DeleteAccountSettingInput) (*DeleteAccountSettingOutput, error) {
347+
req, out := c.DeleteAccountSettingRequest(input)
348+
return out, req.Send()
349+
}
350+
351+
// DeleteAccountSettingWithContext is the same as DeleteAccountSetting with the addition of
352+
// the ability to pass a context and additional request options.
353+
//
354+
// See DeleteAccountSetting for details on how to use this API operation.
355+
//
356+
// The context must be non-nil and will be used for request cancellation. If
357+
// the context is nil a panic will occur. In the future the SDK may create
358+
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
359+
// for more information on using Contexts.
360+
func (c *ECS) DeleteAccountSettingWithContext(ctx aws.Context, input *DeleteAccountSettingInput, opts ...request.Option) (*DeleteAccountSettingOutput, error) {
361+
req, out := c.DeleteAccountSettingRequest(input)
362+
req.SetContext(ctx)
363+
req.ApplyOptions(opts...)
364+
return out, req.Send()
365+
}
366+
284367
const opDeleteAttributes = "DeleteAttributes"
285368

286369
// DeleteAttributesRequest generates a "aws/request.Request" representing the
@@ -5429,6 +5512,72 @@ func (s *CreateServiceOutput) SetService(v *Service) *CreateServiceOutput {
54295512
return s
54305513
}
54315514

5515+
type DeleteAccountSettingInput struct {
5516+
_ struct{} `type:"structure"`
5517+
5518+
// Name is a required field
5519+
Name *string `locationName:"name" type:"string" required:"true" enum:"SettingName"`
5520+
5521+
PrincipalArn *string `locationName:"principalArn" type:"string"`
5522+
}
5523+
5524+
// String returns the string representation
5525+
func (s DeleteAccountSettingInput) String() string {
5526+
return awsutil.Prettify(s)
5527+
}
5528+
5529+
// GoString returns the string representation
5530+
func (s DeleteAccountSettingInput) GoString() string {
5531+
return s.String()
5532+
}
5533+
5534+
// Validate inspects the fields of the type to determine if they are valid.
5535+
func (s *DeleteAccountSettingInput) Validate() error {
5536+
invalidParams := request.ErrInvalidParams{Context: "DeleteAccountSettingInput"}
5537+
if s.Name == nil {
5538+
invalidParams.Add(request.NewErrParamRequired("Name"))
5539+
}
5540+
5541+
if invalidParams.Len() > 0 {
5542+
return invalidParams
5543+
}
5544+
return nil
5545+
}
5546+
5547+
// SetName sets the Name field's value.
5548+
func (s *DeleteAccountSettingInput) SetName(v string) *DeleteAccountSettingInput {
5549+
s.Name = &v
5550+
return s
5551+
}
5552+
5553+
// SetPrincipalArn sets the PrincipalArn field's value.
5554+
func (s *DeleteAccountSettingInput) SetPrincipalArn(v string) *DeleteAccountSettingInput {
5555+
s.PrincipalArn = &v
5556+
return s
5557+
}
5558+
5559+
type DeleteAccountSettingOutput struct {
5560+
_ struct{} `type:"structure"`
5561+
5562+
Setting *Setting `locationName:"setting" type:"structure"`
5563+
}
5564+
5565+
// String returns the string representation
5566+
func (s DeleteAccountSettingOutput) String() string {
5567+
return awsutil.Prettify(s)
5568+
}
5569+
5570+
// GoString returns the string representation
5571+
func (s DeleteAccountSettingOutput) GoString() string {
5572+
return s.String()
5573+
}
5574+
5575+
// SetSetting sets the Setting field's value.
5576+
func (s *DeleteAccountSettingOutput) SetSetting(v *Setting) *DeleteAccountSettingOutput {
5577+
s.Setting = v
5578+
return s
5579+
}
5580+
54325581
type DeleteAttributesInput struct {
54335582
_ struct{} `type:"structure"`
54345583

agent/functional_tests/tests/functionaltests_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -712,4 +712,10 @@ func TestContainerInstanceTags(t *testing.T) {
712712
}
713713
}
714714
assert.Zero(t, len(expectedTagsMap))
715+
716+
DeleteAccountSettingInput := ecsapi.DeleteAccountSettingInput{
717+
Name: aws.String("containerInstanceLongArnFormat"),
718+
}
719+
_, err = ECS.DeleteAccountSetting(&DeleteAccountSettingInput)
720+
assert.NoError(t, err)
715721
}

0 commit comments

Comments
 (0)