// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package controltower import ( "fmt" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" ) const opDisableControl = "DisableControl" // DisableControlRequest generates a "aws/request.Request" representing the // client's request for the DisableControl operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See DisableControl for more information on using the DisableControl // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the DisableControlRequest method. // req, resp := client.DisableControlRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/DisableControl func (c *ControlTower) DisableControlRequest(input *DisableControlInput) (req *request.Request, output *DisableControlOutput) { op := &request.Operation{ Name: opDisableControl, HTTPMethod: "POST", HTTPPath: "/disable-control", } if input == nil { input = &DisableControlInput{} } output = &DisableControlOutput{} req = c.newRequest(op, input, output) return } // DisableControl API operation for AWS Control Tower. // // This API call turns off a control. It starts an asynchronous operation that // deletes AWS resources on the specified organizational unit and the accounts // it contains. The resources will vary according to the control that you specify. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Control Tower's // API operation DisableControl for usage and error information. // // Returned Error Types: // // - ValidationException // The input fails to satisfy the constraints specified by an AWS service. // // - ConflictException // Updating or deleting a resource can cause an inconsistent state. // // - ServiceQuotaExceededException // Request would cause a service quota to be exceeded. The limit is 10 concurrent // operations. // // - InternalServerException // Unexpected error during processing of request. // // - AccessDeniedException // User does not have sufficient access to perform this action. // // - ThrottlingException // Request was denied due to request throttling. // // - ResourceNotFoundException // Request references a resource which does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/DisableControl func (c *ControlTower) DisableControl(input *DisableControlInput) (*DisableControlOutput, error) { req, out := c.DisableControlRequest(input) return out, req.Send() } // DisableControlWithContext is the same as DisableControl with the addition of // the ability to pass a context and additional request options. // // See DisableControl for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *ControlTower) DisableControlWithContext(ctx aws.Context, input *DisableControlInput, opts ...request.Option) (*DisableControlOutput, error) { req, out := c.DisableControlRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opEnableControl = "EnableControl" // EnableControlRequest generates a "aws/request.Request" representing the // client's request for the EnableControl operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See EnableControl for more information on using the EnableControl // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the EnableControlRequest method. // req, resp := client.EnableControlRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/EnableControl func (c *ControlTower) EnableControlRequest(input *EnableControlInput) (req *request.Request, output *EnableControlOutput) { op := &request.Operation{ Name: opEnableControl, HTTPMethod: "POST", HTTPPath: "/enable-control", } if input == nil { input = &EnableControlInput{} } output = &EnableControlOutput{} req = c.newRequest(op, input, output) return } // EnableControl API operation for AWS Control Tower. // // This API call activates a control. It starts an asynchronous operation that // creates AWS resources on the specified organizational unit and the accounts // it contains. The resources created will vary according to the control that // you specify. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Control Tower's // API operation EnableControl for usage and error information. // // Returned Error Types: // // - ValidationException // The input fails to satisfy the constraints specified by an AWS service. // // - ConflictException // Updating or deleting a resource can cause an inconsistent state. // // - ServiceQuotaExceededException // Request would cause a service quota to be exceeded. The limit is 10 concurrent // operations. // // - InternalServerException // Unexpected error during processing of request. // // - AccessDeniedException // User does not have sufficient access to perform this action. // // - ThrottlingException // Request was denied due to request throttling. // // - ResourceNotFoundException // Request references a resource which does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/EnableControl func (c *ControlTower) EnableControl(input *EnableControlInput) (*EnableControlOutput, error) { req, out := c.EnableControlRequest(input) return out, req.Send() } // EnableControlWithContext is the same as EnableControl with the addition of // the ability to pass a context and additional request options. // // See EnableControl for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *ControlTower) EnableControlWithContext(ctx aws.Context, input *EnableControlInput, opts ...request.Option) (*EnableControlOutput, error) { req, out := c.EnableControlRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opGetControlOperation = "GetControlOperation" // GetControlOperationRequest generates a "aws/request.Request" representing the // client's request for the GetControlOperation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See GetControlOperation for more information on using the GetControlOperation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the GetControlOperationRequest method. // req, resp := client.GetControlOperationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/GetControlOperation func (c *ControlTower) GetControlOperationRequest(input *GetControlOperationInput) (req *request.Request, output *GetControlOperationOutput) { op := &request.Operation{ Name: opGetControlOperation, HTTPMethod: "POST", HTTPPath: "/get-control-operation", } if input == nil { input = &GetControlOperationInput{} } output = &GetControlOperationOutput{} req = c.newRequest(op, input, output) return } // GetControlOperation API operation for AWS Control Tower. // // Returns the status of a particular EnableControl or DisableControl operation. // Displays a message in case of error. Details for an operation are available // for 90 days. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Control Tower's // API operation GetControlOperation for usage and error information. // // Returned Error Types: // // - ValidationException // The input fails to satisfy the constraints specified by an AWS service. // // - InternalServerException // Unexpected error during processing of request. // // - AccessDeniedException // User does not have sufficient access to perform this action. // // - ThrottlingException // Request was denied due to request throttling. // // - ResourceNotFoundException // Request references a resource which does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/GetControlOperation func (c *ControlTower) GetControlOperation(input *GetControlOperationInput) (*GetControlOperationOutput, error) { req, out := c.GetControlOperationRequest(input) return out, req.Send() } // GetControlOperationWithContext is the same as GetControlOperation with the addition of // the ability to pass a context and additional request options. // // See GetControlOperation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *ControlTower) GetControlOperationWithContext(ctx aws.Context, input *GetControlOperationInput, opts ...request.Option) (*GetControlOperationOutput, error) { req, out := c.GetControlOperationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } const opListEnabledControls = "ListEnabledControls" // ListEnabledControlsRequest generates a "aws/request.Request" representing the // client's request for the ListEnabledControls operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // // See ListEnabledControls for more information on using the ListEnabledControls // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // Example sending a request using the ListEnabledControlsRequest method. // req, resp := client.ListEnabledControlsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // // See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ListEnabledControls func (c *ControlTower) ListEnabledControlsRequest(input *ListEnabledControlsInput) (req *request.Request, output *ListEnabledControlsOutput) { op := &request.Operation{ Name: opListEnabledControls, HTTPMethod: "POST", HTTPPath: "/list-enabled-controls", Paginator: &request.Paginator{ InputTokens: []string{"nextToken"}, OutputTokens: []string{"nextToken"}, LimitToken: "maxResults", TruncationToken: "", }, } if input == nil { input = &ListEnabledControlsInput{} } output = &ListEnabledControlsOutput{} req = c.newRequest(op, input, output) return } // ListEnabledControls API operation for AWS Control Tower. // // Lists the controls enabled by AWS Control Tower on the specified organizational // unit and the accounts it contains. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Control Tower's // API operation ListEnabledControls for usage and error information. // // Returned Error Types: // // - ValidationException // The input fails to satisfy the constraints specified by an AWS service. // // - InternalServerException // Unexpected error during processing of request. // // - AccessDeniedException // User does not have sufficient access to perform this action. // // - ThrottlingException // Request was denied due to request throttling. // // - ResourceNotFoundException // Request references a resource which does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/controltower-2018-05-10/ListEnabledControls func (c *ControlTower) ListEnabledControls(input *ListEnabledControlsInput) (*ListEnabledControlsOutput, error) { req, out := c.ListEnabledControlsRequest(input) return out, req.Send() } // ListEnabledControlsWithContext is the same as ListEnabledControls with the addition of // the ability to pass a context and additional request options. // // See ListEnabledControls for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *ControlTower) ListEnabledControlsWithContext(ctx aws.Context, input *ListEnabledControlsInput, opts ...request.Option) (*ListEnabledControlsOutput, error) { req, out := c.ListEnabledControlsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } // ListEnabledControlsPages iterates over the pages of a ListEnabledControls operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // // See ListEnabledControls method for more information on how to use this operation. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over at most 3 pages of a ListEnabledControls operation. // pageNum := 0 // err := client.ListEnabledControlsPages(params, // func(page *controltower.ListEnabledControlsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) func (c *ControlTower) ListEnabledControlsPages(input *ListEnabledControlsInput, fn func(*ListEnabledControlsOutput, bool) bool) error { return c.ListEnabledControlsPagesWithContext(aws.BackgroundContext(), input, fn) } // ListEnabledControlsPagesWithContext same as ListEnabledControlsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *ControlTower) ListEnabledControlsPagesWithContext(ctx aws.Context, input *ListEnabledControlsInput, fn func(*ListEnabledControlsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { var inCpy *ListEnabledControlsInput if input != nil { tmp := *input inCpy = &tmp } req, _ := c.ListEnabledControlsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } for p.Next() { if !fn(p.Page().(*ListEnabledControlsOutput), !p.HasNextPage()) { break } } return p.Err() } // User does not have sufficient access to perform this action. type AccessDeniedException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s AccessDeniedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s AccessDeniedException) GoString() string { return s.String() } func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { return &AccessDeniedException{ RespMetadata: v, } } // Code returns the exception type name. func (s *AccessDeniedException) Code() string { return "AccessDeniedException" } // Message returns the exception's message. func (s *AccessDeniedException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *AccessDeniedException) OrigErr() error { return nil } func (s *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *AccessDeniedException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *AccessDeniedException) RequestID() string { return s.RespMetadata.RequestID } // Updating or deleting a resource can cause an inconsistent state. type ConflictException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ConflictException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ConflictException) GoString() string { return s.String() } func newErrorConflictException(v protocol.ResponseMetadata) error { return &ConflictException{ RespMetadata: v, } } // Code returns the exception type name. func (s *ConflictException) Code() string { return "ConflictException" } // Message returns the exception's message. func (s *ConflictException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *ConflictException) OrigErr() error { return nil } func (s *ConflictException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *ConflictException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *ConflictException) RequestID() string { return s.RespMetadata.RequestID } // An operation performed by the control. type ControlOperation struct { _ struct{} `type:"structure"` // The time that the operation finished. EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` // One of ENABLE_CONTROL or DISABLE_CONTROL. OperationType *string `locationName:"operationType" type:"string" enum:"ControlOperationType"` // The time that the operation began. StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` // One of IN_PROGRESS, SUCEEDED, or FAILED. Status *string `locationName:"status" type:"string" enum:"ControlOperationStatus"` // If the operation result is FAILED, this string contains a message explaining // why the operation failed. StatusMessage *string `locationName:"statusMessage" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ControlOperation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ControlOperation) GoString() string { return s.String() } // SetEndTime sets the EndTime field's value. func (s *ControlOperation) SetEndTime(v time.Time) *ControlOperation { s.EndTime = &v return s } // SetOperationType sets the OperationType field's value. func (s *ControlOperation) SetOperationType(v string) *ControlOperation { s.OperationType = &v return s } // SetStartTime sets the StartTime field's value. func (s *ControlOperation) SetStartTime(v time.Time) *ControlOperation { s.StartTime = &v return s } // SetStatus sets the Status field's value. func (s *ControlOperation) SetStatus(v string) *ControlOperation { s.Status = &v return s } // SetStatusMessage sets the StatusMessage field's value. func (s *ControlOperation) SetStatusMessage(v string) *ControlOperation { s.StatusMessage = &v return s } type DisableControlInput struct { _ struct{} `type:"structure"` // The ARN of the control. Only Strongly recommended and Elective controls are // permitted, with the exception of the Region deny guardrail. // // ControlIdentifier is a required field ControlIdentifier *string `locationName:"controlIdentifier" min:"20" type:"string" required:"true"` // The ARN of the organizational unit. // // TargetIdentifier is a required field TargetIdentifier *string `locationName:"targetIdentifier" min:"20" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableControlInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableControlInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *DisableControlInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DisableControlInput"} if s.ControlIdentifier == nil { invalidParams.Add(request.NewErrParamRequired("ControlIdentifier")) } if s.ControlIdentifier != nil && len(*s.ControlIdentifier) < 20 { invalidParams.Add(request.NewErrParamMinLen("ControlIdentifier", 20)) } if s.TargetIdentifier == nil { invalidParams.Add(request.NewErrParamRequired("TargetIdentifier")) } if s.TargetIdentifier != nil && len(*s.TargetIdentifier) < 20 { invalidParams.Add(request.NewErrParamMinLen("TargetIdentifier", 20)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetControlIdentifier sets the ControlIdentifier field's value. func (s *DisableControlInput) SetControlIdentifier(v string) *DisableControlInput { s.ControlIdentifier = &v return s } // SetTargetIdentifier sets the TargetIdentifier field's value. func (s *DisableControlInput) SetTargetIdentifier(v string) *DisableControlInput { s.TargetIdentifier = &v return s } type DisableControlOutput struct { _ struct{} `type:"structure"` // The ID of the asynchronous operation, which is used to track status. The // operation is available for 90 days. // // OperationIdentifier is a required field OperationIdentifier *string `locationName:"operationIdentifier" min:"36" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableControlOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s DisableControlOutput) GoString() string { return s.String() } // SetOperationIdentifier sets the OperationIdentifier field's value. func (s *DisableControlOutput) SetOperationIdentifier(v string) *DisableControlOutput { s.OperationIdentifier = &v return s } type EnableControlInput struct { _ struct{} `type:"structure"` // The ARN of the control. Only Strongly recommended and Elective controls are // permitted, with the exception of the Region deny guardrail. // // ControlIdentifier is a required field ControlIdentifier *string `locationName:"controlIdentifier" min:"20" type:"string" required:"true"` // The ARN of the organizational unit. // // TargetIdentifier is a required field TargetIdentifier *string `locationName:"targetIdentifier" min:"20" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableControlInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableControlInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *EnableControlInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "EnableControlInput"} if s.ControlIdentifier == nil { invalidParams.Add(request.NewErrParamRequired("ControlIdentifier")) } if s.ControlIdentifier != nil && len(*s.ControlIdentifier) < 20 { invalidParams.Add(request.NewErrParamMinLen("ControlIdentifier", 20)) } if s.TargetIdentifier == nil { invalidParams.Add(request.NewErrParamRequired("TargetIdentifier")) } if s.TargetIdentifier != nil && len(*s.TargetIdentifier) < 20 { invalidParams.Add(request.NewErrParamMinLen("TargetIdentifier", 20)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetControlIdentifier sets the ControlIdentifier field's value. func (s *EnableControlInput) SetControlIdentifier(v string) *EnableControlInput { s.ControlIdentifier = &v return s } // SetTargetIdentifier sets the TargetIdentifier field's value. func (s *EnableControlInput) SetTargetIdentifier(v string) *EnableControlInput { s.TargetIdentifier = &v return s } type EnableControlOutput struct { _ struct{} `type:"structure"` // The ID of the asynchronous operation, which is used to track status. The // operation is available for 90 days. // // OperationIdentifier is a required field OperationIdentifier *string `locationName:"operationIdentifier" min:"36" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableControlOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnableControlOutput) GoString() string { return s.String() } // SetOperationIdentifier sets the OperationIdentifier field's value. func (s *EnableControlOutput) SetOperationIdentifier(v string) *EnableControlOutput { s.OperationIdentifier = &v return s } // A summary of enabled controls. type EnabledControlSummary struct { _ struct{} `type:"structure"` // The ARN of the control. Only Strongly recommended and Elective controls are // permitted, with the exception of the Region deny guardrail. ControlIdentifier *string `locationName:"controlIdentifier" min:"20" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnabledControlSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s EnabledControlSummary) GoString() string { return s.String() } // SetControlIdentifier sets the ControlIdentifier field's value. func (s *EnabledControlSummary) SetControlIdentifier(v string) *EnabledControlSummary { s.ControlIdentifier = &v return s } type GetControlOperationInput struct { _ struct{} `type:"structure"` // The ID of the asynchronous operation, which is used to track status. The // operation is available for 90 days. // // OperationIdentifier is a required field OperationIdentifier *string `locationName:"operationIdentifier" min:"36" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetControlOperationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetControlOperationInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *GetControlOperationInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GetControlOperationInput"} if s.OperationIdentifier == nil { invalidParams.Add(request.NewErrParamRequired("OperationIdentifier")) } if s.OperationIdentifier != nil && len(*s.OperationIdentifier) < 36 { invalidParams.Add(request.NewErrParamMinLen("OperationIdentifier", 36)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetOperationIdentifier sets the OperationIdentifier field's value. func (s *GetControlOperationInput) SetOperationIdentifier(v string) *GetControlOperationInput { s.OperationIdentifier = &v return s } type GetControlOperationOutput struct { _ struct{} `type:"structure"` // An operation performed by the control. // // ControlOperation is a required field ControlOperation *ControlOperation `locationName:"controlOperation" type:"structure" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetControlOperationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s GetControlOperationOutput) GoString() string { return s.String() } // SetControlOperation sets the ControlOperation field's value. func (s *GetControlOperationOutput) SetControlOperation(v *ControlOperation) *GetControlOperationOutput { s.ControlOperation = v return s } // Unexpected error during processing of request. type InternalServerException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InternalServerException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s InternalServerException) GoString() string { return s.String() } func newErrorInternalServerException(v protocol.ResponseMetadata) error { return &InternalServerException{ RespMetadata: v, } } // Code returns the exception type name. func (s *InternalServerException) Code() string { return "InternalServerException" } // Message returns the exception's message. func (s *InternalServerException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *InternalServerException) OrigErr() error { return nil } func (s *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *InternalServerException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *InternalServerException) RequestID() string { return s.RespMetadata.RequestID } type ListEnabledControlsInput struct { _ struct{} `type:"structure"` // How many results to return per API call. MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` // The token to continue the list from a previous API call with the same parameters. NextToken *string `locationName:"nextToken" type:"string"` // The ARN of the organizational unit. // // TargetIdentifier is a required field TargetIdentifier *string `locationName:"targetIdentifier" min:"20" type:"string" required:"true"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListEnabledControlsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListEnabledControlsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. func (s *ListEnabledControlsInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListEnabledControlsInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.TargetIdentifier == nil { invalidParams.Add(request.NewErrParamRequired("TargetIdentifier")) } if s.TargetIdentifier != nil && len(*s.TargetIdentifier) < 20 { invalidParams.Add(request.NewErrParamMinLen("TargetIdentifier", 20)) } if invalidParams.Len() > 0 { return invalidParams } return nil } // SetMaxResults sets the MaxResults field's value. func (s *ListEnabledControlsInput) SetMaxResults(v int64) *ListEnabledControlsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. func (s *ListEnabledControlsInput) SetNextToken(v string) *ListEnabledControlsInput { s.NextToken = &v return s } // SetTargetIdentifier sets the TargetIdentifier field's value. func (s *ListEnabledControlsInput) SetTargetIdentifier(v string) *ListEnabledControlsInput { s.TargetIdentifier = &v return s } type ListEnabledControlsOutput struct { _ struct{} `type:"structure"` // Lists the controls enabled by AWS Control Tower on the specified organizational // unit and the accounts it contains. // // EnabledControls is a required field EnabledControls []*EnabledControlSummary `locationName:"enabledControls" type:"list" required:"true"` // Retrieves the next page of results. If the string is empty, the current response // is the end of the results. NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListEnabledControlsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ListEnabledControlsOutput) GoString() string { return s.String() } // SetEnabledControls sets the EnabledControls field's value. func (s *ListEnabledControlsOutput) SetEnabledControls(v []*EnabledControlSummary) *ListEnabledControlsOutput { s.EnabledControls = v return s } // SetNextToken sets the NextToken field's value. func (s *ListEnabledControlsOutput) SetNextToken(v string) *ListEnabledControlsOutput { s.NextToken = &v return s } // Request references a resource which does not exist. type ResourceNotFoundException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ResourceNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ResourceNotFoundException) GoString() string { return s.String() } func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { return &ResourceNotFoundException{ RespMetadata: v, } } // Code returns the exception type name. func (s *ResourceNotFoundException) Code() string { return "ResourceNotFoundException" } // Message returns the exception's message. func (s *ResourceNotFoundException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *ResourceNotFoundException) OrigErr() error { return nil } func (s *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *ResourceNotFoundException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *ResourceNotFoundException) RequestID() string { return s.RespMetadata.RequestID } // Request would cause a service quota to be exceeded. The limit is 10 concurrent // operations. type ServiceQuotaExceededException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ServiceQuotaExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ServiceQuotaExceededException) GoString() string { return s.String() } func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { return &ServiceQuotaExceededException{ RespMetadata: v, } } // Code returns the exception type name. func (s *ServiceQuotaExceededException) Code() string { return "ServiceQuotaExceededException" } // Message returns the exception's message. func (s *ServiceQuotaExceededException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *ServiceQuotaExceededException) OrigErr() error { return nil } func (s *ServiceQuotaExceededException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *ServiceQuotaExceededException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *ServiceQuotaExceededException) RequestID() string { return s.RespMetadata.RequestID } // Request was denied due to request throttling. type ThrottlingException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` // The ID of the service quota that was exceeded. QuotaCode *string `locationName:"quotaCode" type:"string"` // The number of seconds the caller should wait before retrying. RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` // The ID of the service that is associated with the error. ServiceCode *string `locationName:"serviceCode" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ThrottlingException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ThrottlingException) GoString() string { return s.String() } func newErrorThrottlingException(v protocol.ResponseMetadata) error { return &ThrottlingException{ RespMetadata: v, } } // Code returns the exception type name. func (s *ThrottlingException) Code() string { return "ThrottlingException" } // Message returns the exception's message. func (s *ThrottlingException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *ThrottlingException) OrigErr() error { return nil } func (s *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } // Status code returns the HTTP status code for the request's response error. func (s *ThrottlingException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *ThrottlingException) RequestID() string { return s.RespMetadata.RequestID } // The input fails to satisfy the constraints specified by an AWS service. type ValidationException struct { _ struct{} `type:"structure"` RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` Message_ *string `locationName:"message" type:"string"` } // String returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ValidationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation. // // API parameter values that are decorated as "sensitive" in the API will not // be included in the string output. The member name will be present, but the // value will be replaced with "sensitive". func (s ValidationException) GoString() string { return s.String() } func newErrorValidationException(v protocol.ResponseMetadata) error { return &ValidationException{ RespMetadata: v, } } // Code returns the exception type name. func (s *ValidationException) Code() string { return "ValidationException" } // Message returns the exception's message. func (s *ValidationException) Message() string { if s.Message_ != nil { return *s.Message_ } return "" } // OrigErr always returns nil, satisfies awserr.Error interface. func (s *ValidationException) OrigErr() error { return nil } func (s *ValidationException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } // Status code returns the HTTP status code for the request's response error. func (s *ValidationException) StatusCode() int { return s.RespMetadata.StatusCode } // RequestID returns the service's response RequestID for request. func (s *ValidationException) RequestID() string { return s.RespMetadata.RequestID } const ( // ControlOperationStatusSucceeded is a ControlOperationStatus enum value ControlOperationStatusSucceeded = "SUCCEEDED" // ControlOperationStatusFailed is a ControlOperationStatus enum value ControlOperationStatusFailed = "FAILED" // ControlOperationStatusInProgress is a ControlOperationStatus enum value ControlOperationStatusInProgress = "IN_PROGRESS" ) // ControlOperationStatus_Values returns all elements of the ControlOperationStatus enum func ControlOperationStatus_Values() []string { return []string{ ControlOperationStatusSucceeded, ControlOperationStatusFailed, ControlOperationStatusInProgress, } } const ( // ControlOperationTypeEnableControl is a ControlOperationType enum value ControlOperationTypeEnableControl = "ENABLE_CONTROL" // ControlOperationTypeDisableControl is a ControlOperationType enum value ControlOperationTypeDisableControl = "DISABLE_CONTROL" ) // ControlOperationType_Values returns all elements of the ControlOperationType enum func ControlOperationType_Values() []string { return []string{ ControlOperationTypeEnableControl, ControlOperationTypeDisableControl, } }