From ba5f19bc14777d08eb93f07a8e4619a40e651c86 Mon Sep 17 00:00:00 2001 From: Qu Xuan Date: Mon, 11 Jan 2021 11:25:28 +0800 Subject: [PATCH] fix(cloudevent): add aws cloudevent --- go.mod | 4 +- go.sum | 8 +- pkg/multicloud/aws/aws.go | 9 + pkg/multicloud/aws/cloudtrail.go | 173 + pkg/multicloud/aws/provider/provider.go | 12 + pkg/multicloud/aws/region.go | 3 + pkg/multicloud/aws/shell/cloudtrail.go | 37 + .../aws/aws-sdk-go/service/cloudtrail/api.go | 7888 +++++++++++++++++ .../aws/aws-sdk-go/service/cloudtrail/doc.go | 48 + .../aws-sdk-go/service/cloudtrail/errors.go | 369 + .../aws-sdk-go/service/cloudtrail/service.go | 103 + vendor/modules.txt | 5 +- .../yunion.io/x/pkg/util/compare/compare.go | 15 + 13 files changed, 8666 insertions(+), 8 deletions(-) create mode 100644 pkg/multicloud/aws/cloudtrail.go create mode 100644 pkg/multicloud/aws/shell/cloudtrail.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go create mode 100644 vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go diff --git a/go.mod b/go.mod index eff836fec8..98afecd26b 100644 --- a/go.mod +++ b/go.mod @@ -141,11 +141,11 @@ require ( k8s.io/apimachinery v0.19.3 k8s.io/client-go v0.19.3 k8s.io/cluster-bootstrap v0.19.3 - yunion.io/x/executor v0.0.0-20201201131200-44fa553abd9e + yunion.io/x/executor v0.0.0-20201231064744-df32f32165a9 yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769 yunion.io/x/log v0.0.0-20201210064738-43181789dc74 yunion.io/x/ovsdb v0.0.0-20200526071744-27bf0940cbc7 - yunion.io/x/pkg v0.0.0-20201123083159-ca3aea986ff2 + yunion.io/x/pkg v0.0.0-20210109071527-7e72daf56747 yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e yunion.io/x/sqlchemy v0.0.0-20201219153152-2d901261898c yunion.io/x/structarg v0.0.0-20200720093445-9f850fa222ce diff --git a/go.sum b/go.sum index 82fe3ac03f..82f161e505 100644 --- a/go.sum +++ b/go.sum @@ -918,8 +918,8 @@ sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -yunion.io/x/executor v0.0.0-20201201131200-44fa553abd9e h1:NRtqiegW4NME0v10rpChORZnJnuAUbpv31R5DsqqczQ= -yunion.io/x/executor v0.0.0-20201201131200-44fa553abd9e/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= +yunion.io/x/executor v0.0.0-20201231064744-df32f32165a9 h1:TyKy58HHgjkTJYrZgD0haz4bItoC+QwcOQ+GtMuGTjw= +yunion.io/x/executor v0.0.0-20201231064744-df32f32165a9/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634= yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769 h1:LIQ4hhLGQuQK+XxlV+8JrKBuL37WUT+5ZTVxBwHOTD4= yunion.io/x/jsonutils v0.0.0-20201110084044-3e4e1cb49769/go.mod h1:p0nyMqGA/apTxxyLIU/o1k4V7Vujl2O6ey30L594sYE= @@ -933,8 +933,8 @@ yunion.io/x/pkg v0.0.0-20190620104149-945c25821dbf/go.mod h1:t6rEGG2sQ4J7DhFxSZV yunion.io/x/pkg v0.0.0-20190628082551-f4033ba2ea30/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E= yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6 h1:UarEDTBGkgcgc+nc+PZ75uo9M9+jiOGd5P2B90TxDNw= yunion.io/x/pkg v0.0.0-20200814072949-4f1b541857d6/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E= -yunion.io/x/pkg v0.0.0-20201123083159-ca3aea986ff2 h1:NeCr2J8HjcIuJvEhP0rwWA1UKP8ReOv6HVf5k9YPtyA= -yunion.io/x/pkg v0.0.0-20201123083159-ca3aea986ff2/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E= +yunion.io/x/pkg v0.0.0-20210109071527-7e72daf56747 h1:sTr6mjWW8aAMKkrnnU2SG8EqhLRl/D3rGnBhaP2ksTI= +yunion.io/x/pkg v0.0.0-20210109071527-7e72daf56747/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E= yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo= yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo= yunion.io/x/sqlchemy v0.0.0-20201219153152-2d901261898c h1:71nVDQq1oUjvZknEUNfetdiOB1jZMEfmoQlMUaoPIJs= diff --git a/pkg/multicloud/aws/aws.go b/pkg/multicloud/aws/aws.go index 15792ab6bc..36216084ac 100644 --- a/pkg/multicloud/aws/aws.go +++ b/pkg/multicloud/aws/aws.go @@ -249,6 +249,15 @@ func (client *SAwsClient) getAwsRoute53Session() (*session.Session, error) { return session, nil } +func (client *SAwsClient) getAwsCloudtrailSession() (*session.Session, error) { + session, err := client.getDefaultSession() + if err != nil { + return nil, errors.Wrap(err, "client.getDefaultSession()") + } + session.ClientConfig(CLOUD_TRAIL_SERVICE_NAME) + return session, nil +} + func (self *SAwsClient) invalidateIBuckets() { self.iBuckets = nil } diff --git a/pkg/multicloud/aws/cloudtrail.go b/pkg/multicloud/aws/cloudtrail.go new file mode 100644 index 0000000000..ee47734125 --- /dev/null +++ b/pkg/multicloud/aws/cloudtrail.go @@ -0,0 +1,173 @@ +// Copyright 2019 Yunion +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aws + +import ( + "fmt" + "strings" + "time" + + "github.com/aws/aws-sdk-go/service/cloudtrail" + + "yunion.io/x/jsonutils" + "yunion.io/x/pkg/errors" + + "yunion.io/x/onecloud/pkg/cloudprovider" +) + +type SEventResource struct { + // The name of the resource referenced by the event returned. These are user-created + // names whose values will depend on the environment. For example, the resource + // name might be "auto-scaling-test-group" for an Auto Scaling Group or "i-1234567" + // for an EC2 Instance. + ResourceName string `type:"string"` + + // The type of a resource referenced by the event returned. When the resource + // type cannot be determined, null is returned. Some examples of resource types + // are: Instance for EC2, Trail for CloudTrail, DBInstance for RDS, and AccessKey + // for IAM. To learn more about how to look up and filter events by the resource + // types supported for a service, see Filtering CloudTrail Events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-console.html#filtering-cloudtrail-events). + ResourceType string `type:"string"` +} + +type SEvent struct { + // The AWS access key ID that was used to sign the request. If the request was + // made with temporary security credentials, this is the access key ID of the + // temporary credentials. + AccessKeyId string `type:"string"` + + // A JSON string that contains a representation of the event returned. + CloudTrailEvent string `type:"string"` + + // The CloudTrail ID of the event returned. + EventId string `type:"string"` + + // The name of the event returned. + EventName string `type:"string"` + + // The AWS service that the request was made to. + EventSource string `type:"string"` + + // The date and time of the event returned. + EventTime time.Time `type:"timestamp"` + + // Information about whether the event is a write event or a read event. + ReadOnly string `type:"string"` + + // A list of resources referenced by the event returned. + Resources []SEventResource `type:"list"` + + // A user name or role name of the requester that called the API in the event + // returned. + Username string `type:"string"` +} + +func (self *SEvent) GetName() string { + return self.EventName +} + +func (self *SEvent) GetService() string { + return self.EventSource +} + +func (self *SEvent) GetAction() string { + return self.EventName +} + +func (self *SEvent) GetResourceType() string { + return self.EventSource +} + +func (self *SEvent) GetRequestId() string { + return self.EventId +} + +func (self *SEvent) GetRequest() jsonutils.JSONObject { + obj, _ := jsonutils.Parse([]byte(self.CloudTrailEvent)) + return obj +} + +func (self *SEvent) GetAccount() string { + return fmt.Sprintf("%s(%s)", self.AccessKeyId, self.Username) +} + +func (self *SEvent) IsSuccess() bool { + return !strings.Contains(self.CloudTrailEvent, "errorMessage") +} + +func (self *SEvent) GetCreatedAt() time.Time { + return self.EventTime +} + +func (self *SAwsClient) LookupEvents(start, end time.Time) ([]SEvent, error) { + s, err := self.getAwsCloudtrailSession() + if err != nil { + return nil, errors.Wrapf(err, "getAwsCloudtrailSession") + } + client := cloudtrail.New(s) + input := &cloudtrail.LookupEventsInput{} + if !start.IsZero() { + input.SetStartTime(start) + } + if !end.IsZero() { + input.SetEndTime(end) + } + events := []SEvent{} + nextToken := "" + for { + if len(nextToken) > 0 { + input.SetNextToken(nextToken) + } + output, err := client.LookupEvents(input) + if err != nil { + return nil, errors.Wrapf(err, "LookupEvents") + } + for i := range output.Events { + err := FillZero(output.Events[i]) + if err != nil { + return nil, errors.Wrapf(err, "FillZero") + } + event := SEvent{} + err = jsonutils.Update(&event, jsonutils.Marshal(output.Events[i])) + if err != nil { + return nil, errors.Wrapf(err, "jsonutils.Update") + } + events = append(events, event) + } + nextToken = "" + if output.NextToken != nil { + nextToken = *output.NextToken + } + if len(nextToken) == 0 { + break + } + } + return events, nil +} + +func (self *SRegion) GetICloudEvents(start time.Time, end time.Time, withReadEvent bool) ([]cloudprovider.ICloudEvent, error) { + events, err := self.client.LookupEvents(start, end) + if err != nil { + return nil, errors.Wrapf(err, "LookupEvents(%s, %s)", start, end) + } + ret := []cloudprovider.ICloudEvent{} + for i := range events { + if !withReadEvent && events[i].ReadOnly == "true" { + continue + } + ret = append(ret, &events[i]) + } + return ret, nil +} diff --git a/pkg/multicloud/aws/provider/provider.go b/pkg/multicloud/aws/provider/provider.go index ad6b093ed9..0baa0941c5 100644 --- a/pkg/multicloud/aws/provider/provider.go +++ b/pkg/multicloud/aws/provider/provider.go @@ -39,6 +39,18 @@ func (self *SAwsProviderFactory) GetName() string { return aws.CLOUD_PROVIDER_AWS_CN } +func (self *SAwsProviderFactory) IsCloudeventRegional() bool { + return true +} + +func (self *SAwsProviderFactory) GetMaxCloudEventSyncDays() int { + return 1 +} + +func (self *SAwsProviderFactory) GetMaxCloudEventKeepDays() int { + return 90 +} + func (self *SAwsProviderFactory) IsSupportPrepaidResources() bool { return false } diff --git a/pkg/multicloud/aws/region.go b/pkg/multicloud/aws/region.go index d1184e5458..5c63f5718c 100644 --- a/pkg/multicloud/aws/region.go +++ b/pkg/multicloud/aws/region.go @@ -116,6 +116,9 @@ const ( CLOUDWATCH_SERVICE_NAME = "monitoring" CLOUDWATCH_SERVICE_ID = "CloudWatch" + CLOUD_TRAIL_SERVICE_NAME = "CloudTrail" + CLOUD_TRAIL_SERVICE_ID = "cloudtrail" + ROUTE53_SERVICE_NAME = "route53" ) diff --git a/pkg/multicloud/aws/shell/cloudtrail.go b/pkg/multicloud/aws/shell/cloudtrail.go new file mode 100644 index 0000000000..fc49a7fa27 --- /dev/null +++ b/pkg/multicloud/aws/shell/cloudtrail.go @@ -0,0 +1,37 @@ +// Copyright 2019 Yunion +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package shell + +import ( + "time" + + "yunion.io/x/onecloud/pkg/multicloud/aws" + "yunion.io/x/onecloud/pkg/util/shellutils" +) + +func init() { + type EventListOptions struct { + Start time.Time + End time.Time + } + shellutils.R(&EventListOptions{}, "event-list", "List events", func(cli *aws.SRegion, args *EventListOptions) error { + events, err := cli.GetClient().LookupEvents(args.Start, args.End) + if err != nil { + return err + } + printList(events, 0, 0, 0, []string{}) + return nil + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go new file mode 100644 index 0000000000..3dcad2dafd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go @@ -0,0 +1,7888 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package cloudtrail + +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" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" +) + +const opAddTags = "AddTags" + +// AddTagsRequest generates a "aws/request.Request" representing the +// client's request for the AddTags 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 AddTags for more information on using the AddTags +// 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 AddTagsRequest method. +// req, resp := client.AddTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags +func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { + op := &request.Operation{ + Name: opAddTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddTagsInput{} + } + + output = &AddTagsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// AddTags API operation for AWS CloudTrail. +// +// Adds one or more tags to a trail, up to a limit of 50. Overwrites an existing +// tag's value when a new value is specified for an existing tag key. Tag key +// names must be unique for a trail; you cannot have two keys with the same +// name but different values. If you specify a key without a value, the tag +// will be created with the specified key and a value of null. You can tag a +// trail that applies to all AWS Regions only from the Region in which the trail +// was created (also known as its home region). +// +// 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 CloudTrail's +// API operation AddTags for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// This exception is thrown when the specified resource is not found. +// +// * ARNInvalidException +// This exception is thrown when an operation is called with an invalid trail +// ARN. The format of a trail ARN is: +// +// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail +// +// * ResourceTypeNotSupportedException +// This exception is thrown when the specified resource type is not supported +// by CloudTrail. +// +// * TagsLimitExceededException +// The number of tags per trail has exceeded the permitted amount. Currently, +// the limit is 50. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * InvalidTagParameterException +// This exception is thrown when the specified tag key or values are not valid. +// It can also occur if there are duplicate tags or too many tags on the resource. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags +func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + return out, req.Send() +} + +// AddTagsWithContext is the same as AddTags with the addition of +// the ability to pass a context and additional request options. +// +// See AddTags 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 *CloudTrail) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) { + req, out := c.AddTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateTrail = "CreateTrail" + +// CreateTrailRequest generates a "aws/request.Request" representing the +// client's request for the CreateTrail 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 CreateTrail for more information on using the CreateTrail +// 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 CreateTrailRequest method. +// req, resp := client.CreateTrailRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail +func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.Request, output *CreateTrailOutput) { + op := &request.Operation{ + Name: opCreateTrail, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTrailInput{} + } + + output = &CreateTrailOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTrail API operation for AWS CloudTrail. +// +// Creates a trail that specifies the settings for delivery of log data to an +// Amazon S3 bucket. +// +// 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 CloudTrail's +// API operation CreateTrail for usage and error information. +// +// Returned Error Types: +// * MaximumNumberOfTrailsExceededException +// This exception is thrown when the maximum number of trails is reached. +// +// * TrailAlreadyExistsException +// This exception is thrown when the specified trail already exists. +// +// * S3BucketDoesNotExistException +// This exception is thrown when the specified S3 bucket does not exist. +// +// * InsufficientS3BucketPolicyException +// This exception is thrown when the policy on the S3 bucket is not sufficient. +// +// * InsufficientSnsTopicPolicyException +// This exception is thrown when the policy on the SNS topic is not sufficient. +// +// * InsufficientEncryptionPolicyException +// This exception is thrown when the policy on the S3 bucket or KMS key is not +// sufficient. +// +// * InvalidS3BucketNameException +// This exception is thrown when the provided S3 bucket name is not valid. +// +// * InvalidS3PrefixException +// This exception is thrown when the provided S3 prefix is not valid. +// +// * InvalidSnsTopicNameException +// This exception is thrown when the provided SNS topic name is not valid. +// +// * InvalidKmsKeyIdException +// This exception is thrown when the KMS key ARN is invalid. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * TrailNotProvidedException +// This exception is no longer in use. +// +// * InvalidParameterCombinationException +// This exception is thrown when the combination of parameters provided is not +// valid. +// +// * KmsKeyNotFoundException +// This exception is thrown when the KMS key does not exist, or when the S3 +// bucket and the KMS key are not in the same region. +// +// * KmsKeyDisabledException +// This exception is no longer in use. +// +// * KmsException +// This exception is thrown when there is an issue with the specified KMS key +// and the trail can’t be updated. +// +// * InvalidCloudWatchLogsLogGroupArnException +// This exception is thrown when the provided CloudWatch log group is not valid. +// +// * InvalidCloudWatchLogsRoleArnException +// This exception is thrown when the provided role is not valid. +// +// * CloudWatchLogsDeliveryUnavailableException +// Cannot set a CloudWatch Logs delivery for this region. +// +// * InvalidTagParameterException +// This exception is thrown when the specified tag key or values are not valid. +// It can also occur if there are duplicate tags or too many tags on the resource. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * AccessNotEnabledException +// This exception is thrown when trusted access has not been enabled between +// AWS CloudTrail and AWS Organizations. For more information, see Enabling +// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) +// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * OrganizationsNotInUseException +// This exception is thrown when the request is made from an AWS account that +// is not a member of an organization. To make this request, sign in using the +// credentials of an account that belongs to an organization. +// +// * OrganizationNotInAllFeaturesModeException +// This exception is thrown when AWS Organizations is not configured to support +// all features. All features must be enabled in AWS Organization to support +// creating an organization trail. For more information, see Prepare For Creating +// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail +func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) { + req, out := c.CreateTrailRequest(input) + return out, req.Send() +} + +// CreateTrailWithContext is the same as CreateTrail with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTrail 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 *CloudTrail) CreateTrailWithContext(ctx aws.Context, input *CreateTrailInput, opts ...request.Option) (*CreateTrailOutput, error) { + req, out := c.CreateTrailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteTrail = "DeleteTrail" + +// DeleteTrailRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTrail 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 DeleteTrail for more information on using the DeleteTrail +// 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 DeleteTrailRequest method. +// req, resp := client.DeleteTrailRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail +func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.Request, output *DeleteTrailOutput) { + op := &request.Operation{ + Name: opDeleteTrail, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteTrailInput{} + } + + output = &DeleteTrailOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteTrail API operation for AWS CloudTrail. +// +// Deletes a trail. This operation must be called from the region in which the +// trail was created. DeleteTrail cannot be called on the shadow trails (replicated +// trails in other regions) of a trail that is enabled in all regions. +// +// 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 CloudTrail's +// API operation DeleteTrail for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * InvalidHomeRegionException +// This exception is thrown when an operation is called on a trail from a region +// other than the region in which the trail was created. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail +func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) { + req, out := c.DeleteTrailRequest(input) + return out, req.Send() +} + +// DeleteTrailWithContext is the same as DeleteTrail with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTrail 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 *CloudTrail) DeleteTrailWithContext(ctx aws.Context, input *DeleteTrailInput, opts ...request.Option) (*DeleteTrailOutput, error) { + req, out := c.DeleteTrailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeTrails = "DescribeTrails" + +// DescribeTrailsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTrails 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 DescribeTrails for more information on using the DescribeTrails +// 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 DescribeTrailsRequest method. +// req, resp := client.DescribeTrailsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails +func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *request.Request, output *DescribeTrailsOutput) { + op := &request.Operation{ + Name: opDescribeTrails, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTrailsInput{} + } + + output = &DescribeTrailsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTrails API operation for AWS CloudTrail. +// +// Retrieves settings for one or more trails associated with the current region +// for your account. +// +// 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 CloudTrail's +// API operation DescribeTrails for usage and error information. +// +// Returned Error Types: +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails +func (c *CloudTrail) DescribeTrails(input *DescribeTrailsInput) (*DescribeTrailsOutput, error) { + req, out := c.DescribeTrailsRequest(input) + return out, req.Send() +} + +// DescribeTrailsWithContext is the same as DescribeTrails with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTrails 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 *CloudTrail) DescribeTrailsWithContext(ctx aws.Context, input *DescribeTrailsInput, opts ...request.Option) (*DescribeTrailsOutput, error) { + req, out := c.DescribeTrailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetEventSelectors = "GetEventSelectors" + +// GetEventSelectorsRequest generates a "aws/request.Request" representing the +// client's request for the GetEventSelectors 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 GetEventSelectors for more information on using the GetEventSelectors +// 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 GetEventSelectorsRequest method. +// req, resp := client.GetEventSelectorsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors +func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) (req *request.Request, output *GetEventSelectorsOutput) { + op := &request.Operation{ + Name: opGetEventSelectors, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetEventSelectorsInput{} + } + + output = &GetEventSelectorsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetEventSelectors API operation for AWS CloudTrail. +// +// Describes the settings for the event selectors that you configured for your +// trail. The information returned for your event selectors includes the following: +// +// * If your event selector includes read-only events, write-only events, +// or all events. This applies to both management events and data events. +// +// * If your event selector includes management events. +// +// * If your event selector includes data events, the Amazon S3 objects or +// AWS Lambda functions that you are logging for data events. +// +// For more information, see Logging Data and Management Events for Trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html) +// in the AWS CloudTrail User Guide. +// +// 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 CloudTrail's +// API operation GetEventSelectors for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors +func (c *CloudTrail) GetEventSelectors(input *GetEventSelectorsInput) (*GetEventSelectorsOutput, error) { + req, out := c.GetEventSelectorsRequest(input) + return out, req.Send() +} + +// GetEventSelectorsWithContext is the same as GetEventSelectors with the addition of +// the ability to pass a context and additional request options. +// +// See GetEventSelectors 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 *CloudTrail) GetEventSelectorsWithContext(ctx aws.Context, input *GetEventSelectorsInput, opts ...request.Option) (*GetEventSelectorsOutput, error) { + req, out := c.GetEventSelectorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetInsightSelectors = "GetInsightSelectors" + +// GetInsightSelectorsRequest generates a "aws/request.Request" representing the +// client's request for the GetInsightSelectors 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 GetInsightSelectors for more information on using the GetInsightSelectors +// 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 GetInsightSelectorsRequest method. +// req, resp := client.GetInsightSelectorsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetInsightSelectors +func (c *CloudTrail) GetInsightSelectorsRequest(input *GetInsightSelectorsInput) (req *request.Request, output *GetInsightSelectorsOutput) { + op := &request.Operation{ + Name: opGetInsightSelectors, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetInsightSelectorsInput{} + } + + output = &GetInsightSelectorsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetInsightSelectors API operation for AWS CloudTrail. +// +// Describes the settings for the Insights event selectors that you configured +// for your trail. GetInsightSelectors shows if CloudTrail Insights event logging +// is enabled on the trail, and if it is, which insight types are enabled. If +// you run GetInsightSelectors on a trail that does not have Insights events +// enabled, the operation throws the exception InsightNotEnabledException +// +// For more information, see Logging CloudTrail Insights Events for Trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html) +// in the AWS CloudTrail User Guide. +// +// 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 CloudTrail's +// API operation GetInsightSelectors for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * InsightNotEnabledException +// If you run GetInsightSelectors on a trail that does not have Insights events +// enabled, the operation throws the exception InsightNotEnabledException. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetInsightSelectors +func (c *CloudTrail) GetInsightSelectors(input *GetInsightSelectorsInput) (*GetInsightSelectorsOutput, error) { + req, out := c.GetInsightSelectorsRequest(input) + return out, req.Send() +} + +// GetInsightSelectorsWithContext is the same as GetInsightSelectors with the addition of +// the ability to pass a context and additional request options. +// +// See GetInsightSelectors 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 *CloudTrail) GetInsightSelectorsWithContext(ctx aws.Context, input *GetInsightSelectorsInput, opts ...request.Option) (*GetInsightSelectorsOutput, error) { + req, out := c.GetInsightSelectorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetTrail = "GetTrail" + +// GetTrailRequest generates a "aws/request.Request" representing the +// client's request for the GetTrail 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 GetTrail for more information on using the GetTrail +// 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 GetTrailRequest method. +// req, resp := client.GetTrailRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrail +func (c *CloudTrail) GetTrailRequest(input *GetTrailInput) (req *request.Request, output *GetTrailOutput) { + op := &request.Operation{ + Name: opGetTrail, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetTrailInput{} + } + + output = &GetTrailOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTrail API operation for AWS CloudTrail. +// +// Returns settings information for a specified trail. +// +// 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 CloudTrail's +// API operation GetTrail for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrail +func (c *CloudTrail) GetTrail(input *GetTrailInput) (*GetTrailOutput, error) { + req, out := c.GetTrailRequest(input) + return out, req.Send() +} + +// GetTrailWithContext is the same as GetTrail with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrail 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 *CloudTrail) GetTrailWithContext(ctx aws.Context, input *GetTrailInput, opts ...request.Option) (*GetTrailOutput, error) { + req, out := c.GetTrailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetTrailStatus = "GetTrailStatus" + +// GetTrailStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetTrailStatus 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 GetTrailStatus for more information on using the GetTrailStatus +// 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 GetTrailStatusRequest method. +// req, resp := client.GetTrailStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus +func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *request.Request, output *GetTrailStatusOutput) { + op := &request.Operation{ + Name: opGetTrailStatus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetTrailStatusInput{} + } + + output = &GetTrailStatusOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTrailStatus API operation for AWS CloudTrail. +// +// Returns a JSON-formatted list of information about the specified trail. Fields +// include information on delivery errors, Amazon SNS and Amazon S3 errors, +// and start and stop logging times for each trail. This operation returns trail +// status from a single region. To return trail status from all regions, you +// must call the operation on each region. +// +// 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 CloudTrail's +// API operation GetTrailStatus for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus +func (c *CloudTrail) GetTrailStatus(input *GetTrailStatusInput) (*GetTrailStatusOutput, error) { + req, out := c.GetTrailStatusRequest(input) + return out, req.Send() +} + +// GetTrailStatusWithContext is the same as GetTrailStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetTrailStatus 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 *CloudTrail) GetTrailStatusWithContext(ctx aws.Context, input *GetTrailStatusInput, opts ...request.Option) (*GetTrailStatusOutput, error) { + req, out := c.GetTrailStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListPublicKeys = "ListPublicKeys" + +// ListPublicKeysRequest generates a "aws/request.Request" representing the +// client's request for the ListPublicKeys 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 ListPublicKeys for more information on using the ListPublicKeys +// 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 ListPublicKeysRequest method. +// req, resp := client.ListPublicKeysRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys +func (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) (req *request.Request, output *ListPublicKeysOutput) { + op := &request.Operation{ + Name: opListPublicKeys, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListPublicKeysInput{} + } + + output = &ListPublicKeysOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListPublicKeys API operation for AWS CloudTrail. +// +// Returns all public keys whose private keys were used to sign the digest files +// within the specified time range. The public key is needed to validate digest +// files that were signed with its corresponding private key. +// +// CloudTrail uses different private/public key pairs per region. Each digest +// file is signed with a private key unique to its region. Therefore, when you +// validate a digest file from a particular region, you must look in the same +// region for its corresponding public key. +// +// 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 CloudTrail's +// API operation ListPublicKeys for usage and error information. +// +// Returned Error Types: +// * InvalidTimeRangeException +// Occurs if the timestamp values are invalid. Either the start time occurs +// after the end time or the time range is outside the range of possible values. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * InvalidTokenException +// Reserved for future use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys +func (c *CloudTrail) ListPublicKeys(input *ListPublicKeysInput) (*ListPublicKeysOutput, error) { + req, out := c.ListPublicKeysRequest(input) + return out, req.Send() +} + +// ListPublicKeysWithContext is the same as ListPublicKeys with the addition of +// the ability to pass a context and additional request options. +// +// See ListPublicKeys 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 *CloudTrail) ListPublicKeysWithContext(ctx aws.Context, input *ListPublicKeysInput, opts ...request.Option) (*ListPublicKeysOutput, error) { + req, out := c.ListPublicKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListPublicKeysPages iterates over the pages of a ListPublicKeys operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListPublicKeys 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 ListPublicKeys operation. +// pageNum := 0 +// err := client.ListPublicKeysPages(params, +// func(page *cloudtrail.ListPublicKeysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudTrail) ListPublicKeysPages(input *ListPublicKeysInput, fn func(*ListPublicKeysOutput, bool) bool) error { + return c.ListPublicKeysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListPublicKeysPagesWithContext same as ListPublicKeysPages 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 *CloudTrail) ListPublicKeysPagesWithContext(ctx aws.Context, input *ListPublicKeysInput, fn func(*ListPublicKeysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPublicKeysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPublicKeysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListPublicKeysOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTags = "ListTags" + +// ListTagsRequest generates a "aws/request.Request" representing the +// client's request for the ListTags 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 ListTags for more information on using the ListTags +// 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 ListTagsRequest method. +// req, resp := client.ListTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags +func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { + op := &request.Operation{ + Name: opListTags, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTagsInput{} + } + + output = &ListTagsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTags API operation for AWS CloudTrail. +// +// Lists the tags for the trail in the current region. +// +// 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 CloudTrail's +// API operation ListTags for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// This exception is thrown when the specified resource is not found. +// +// * ARNInvalidException +// This exception is thrown when an operation is called with an invalid trail +// ARN. The format of a trail ARN is: +// +// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail +// +// * ResourceTypeNotSupportedException +// This exception is thrown when the specified resource type is not supported +// by CloudTrail. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * InvalidTokenException +// Reserved for future use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags +func (c *CloudTrail) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) + return out, req.Send() +} + +// ListTagsWithContext is the same as ListTags with the addition of +// the ability to pass a context and additional request options. +// +// See ListTags 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 *CloudTrail) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTagsPages iterates over the pages of a ListTags operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTags 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 ListTags operation. +// pageNum := 0 +// err := client.ListTagsPages(params, +// func(page *cloudtrail.ListTagsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudTrail) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { + return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTagsPagesWithContext same as ListTagsPages 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 *CloudTrail) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTagsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTagsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTrails = "ListTrails" + +// ListTrailsRequest generates a "aws/request.Request" representing the +// client's request for the ListTrails 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 ListTrails for more information on using the ListTrails +// 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 ListTrailsRequest method. +// req, resp := client.ListTrailsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTrails +func (c *CloudTrail) ListTrailsRequest(input *ListTrailsInput) (req *request.Request, output *ListTrailsOutput) { + op := &request.Operation{ + Name: opListTrails, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTrailsInput{} + } + + output = &ListTrailsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrails API operation for AWS CloudTrail. +// +// Lists trails that are in the current account. +// +// 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 CloudTrail's +// API operation ListTrails for usage and error information. +// +// Returned Error Types: +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTrails +func (c *CloudTrail) ListTrails(input *ListTrailsInput) (*ListTrailsOutput, error) { + req, out := c.ListTrailsRequest(input) + return out, req.Send() +} + +// ListTrailsWithContext is the same as ListTrails with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrails 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 *CloudTrail) ListTrailsWithContext(ctx aws.Context, input *ListTrailsInput, opts ...request.Option) (*ListTrailsOutput, error) { + req, out := c.ListTrailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTrailsPages iterates over the pages of a ListTrails operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTrails 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 ListTrails operation. +// pageNum := 0 +// err := client.ListTrailsPages(params, +// func(page *cloudtrail.ListTrailsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudTrail) ListTrailsPages(input *ListTrailsInput, fn func(*ListTrailsOutput, bool) bool) error { + return c.ListTrailsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTrailsPagesWithContext same as ListTrailsPages 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 *CloudTrail) ListTrailsPagesWithContext(ctx aws.Context, input *ListTrailsInput, fn func(*ListTrailsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTrailsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTrailsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTrailsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opLookupEvents = "LookupEvents" + +// LookupEventsRequest generates a "aws/request.Request" representing the +// client's request for the LookupEvents 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 LookupEvents for more information on using the LookupEvents +// 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 LookupEventsRequest method. +// req, resp := client.LookupEventsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents +func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request.Request, output *LookupEventsOutput) { + op := &request.Operation{ + Name: opLookupEvents, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &LookupEventsInput{} + } + + output = &LookupEventsOutput{} + req = c.newRequest(op, input, output) + return +} + +// LookupEvents API operation for AWS CloudTrail. +// +// Looks up management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-management-events) +// or CloudTrail Insights events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-insights-events) +// that are captured by CloudTrail. You can look up events that occurred in +// a region within the last 90 days. Lookup supports the following attributes +// for management events: +// +// * AWS access key +// +// * Event ID +// +// * Event name +// +// * Event source +// +// * Read only +// +// * Resource name +// +// * Resource type +// +// * User name +// +// Lookup supports the following attributes for Insights events: +// +// * Event ID +// +// * Event name +// +// * Event source +// +// All attributes are optional. The default number of results returned is 50, +// with a maximum of 50 possible. The response includes a token that you can +// use to get the next page of results. +// +// The rate of lookup requests is limited to two per second per account. If +// this limit is exceeded, a throttling error occurs. +// +// 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 CloudTrail's +// API operation LookupEvents for usage and error information. +// +// Returned Error Types: +// * InvalidLookupAttributesException +// Occurs when an invalid lookup attribute is specified. +// +// * InvalidTimeRangeException +// Occurs if the timestamp values are invalid. Either the start time occurs +// after the end time or the time range is outside the range of possible values. +// +// * InvalidMaxResultsException +// This exception is thrown if the limit specified is invalid. +// +// * InvalidNextTokenException +// Invalid token or token that was previously used in a request with different +// parameters. This exception is thrown if the token is invalid. +// +// * InvalidEventCategoryException +// Occurs if an event category that is not valid is specified as a value of +// EventCategory. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents +func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput, error) { + req, out := c.LookupEventsRequest(input) + return out, req.Send() +} + +// LookupEventsWithContext is the same as LookupEvents with the addition of +// the ability to pass a context and additional request options. +// +// See LookupEvents 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 *CloudTrail) LookupEventsWithContext(ctx aws.Context, input *LookupEventsInput, opts ...request.Option) (*LookupEventsOutput, error) { + req, out := c.LookupEventsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// LookupEventsPages iterates over the pages of a LookupEvents operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See LookupEvents 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 LookupEvents operation. +// pageNum := 0 +// err := client.LookupEventsPages(params, +// func(page *cloudtrail.LookupEventsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudTrail) LookupEventsPages(input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool) error { + return c.LookupEventsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// LookupEventsPagesWithContext same as LookupEventsPages 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 *CloudTrail) LookupEventsPagesWithContext(ctx aws.Context, input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *LookupEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.LookupEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*LookupEventsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opPutEventSelectors = "PutEventSelectors" + +// PutEventSelectorsRequest generates a "aws/request.Request" representing the +// client's request for the PutEventSelectors 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 PutEventSelectors for more information on using the PutEventSelectors +// 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 PutEventSelectorsRequest method. +// req, resp := client.PutEventSelectorsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors +func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (req *request.Request, output *PutEventSelectorsOutput) { + op := &request.Operation{ + Name: opPutEventSelectors, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutEventSelectorsInput{} + } + + output = &PutEventSelectorsOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutEventSelectors API operation for AWS CloudTrail. +// +// Configures an event selector for your trail. Use event selectors to further +// specify the management and data event settings for your trail. By default, +// trails created without specific event selectors will be configured to log +// all read and write management events, and no data events. +// +// When an event occurs in your account, CloudTrail evaluates the event selectors +// in all trails. For each trail, if the event matches any event selector, the +// trail processes and logs the event. If the event doesn't match any event +// selector, the trail doesn't log the event. +// +// Example +// +// You create an event selector for a trail and specify that you want write-only +// events. +// +// The EC2 GetConsoleOutput and RunInstances API operations occur in your account. +// +// CloudTrail evaluates whether the events match your event selectors. +// +// The RunInstances is a write-only event and it matches your event selector. +// The trail logs the event. +// +// The GetConsoleOutput is a read-only event but it doesn't match your event +// selector. The trail doesn't log the event. +// +// The PutEventSelectors operation must be called from the region in which the +// trail was created; otherwise, an InvalidHomeRegionException is thrown. +// +// You can configure up to five event selectors for each trail. For more information, +// see Logging Data and Management Events for Trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html) +// and Limits in AWS CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) +// in the AWS CloudTrail User Guide. +// +// 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 CloudTrail's +// API operation PutEventSelectors for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * InvalidHomeRegionException +// This exception is thrown when an operation is called on a trail from a region +// other than the region in which the trail was created. +// +// * InvalidEventSelectorsException +// This exception is thrown when the PutEventSelectors operation is called with +// a number of event selectors or data resources that is not valid. The combination +// of event selectors and data resources is not valid. A trail can have up to +// 5 event selectors. A trail is limited to 250 data resources. These data resources +// can be distributed across event selectors, but the overall total cannot exceed +// 250. +// +// You can: +// +// * Specify a valid number of event selectors (1 to 5) for a trail. +// +// * Specify a valid number of data resources (1 to 250) for an event selector. +// The limit of number of resources on an individual event selector is configurable +// up to 250. However, this upper limit is allowed only if the total number +// of data resources does not exceed 250 across all event selectors for a +// trail. +// +// * Specify a valid value for a parameter. For example, specifying the ReadWriteType +// parameter with a value of read-only is invalid. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors +func (c *CloudTrail) PutEventSelectors(input *PutEventSelectorsInput) (*PutEventSelectorsOutput, error) { + req, out := c.PutEventSelectorsRequest(input) + return out, req.Send() +} + +// PutEventSelectorsWithContext is the same as PutEventSelectors with the addition of +// the ability to pass a context and additional request options. +// +// See PutEventSelectors 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 *CloudTrail) PutEventSelectorsWithContext(ctx aws.Context, input *PutEventSelectorsInput, opts ...request.Option) (*PutEventSelectorsOutput, error) { + req, out := c.PutEventSelectorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutInsightSelectors = "PutInsightSelectors" + +// PutInsightSelectorsRequest generates a "aws/request.Request" representing the +// client's request for the PutInsightSelectors 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 PutInsightSelectors for more information on using the PutInsightSelectors +// 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 PutInsightSelectorsRequest method. +// req, resp := client.PutInsightSelectorsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutInsightSelectors +func (c *CloudTrail) PutInsightSelectorsRequest(input *PutInsightSelectorsInput) (req *request.Request, output *PutInsightSelectorsOutput) { + op := &request.Operation{ + Name: opPutInsightSelectors, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutInsightSelectorsInput{} + } + + output = &PutInsightSelectorsOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutInsightSelectors API operation for AWS CloudTrail. +// +// Lets you enable Insights event logging by specifying the Insights selectors +// that you want to enable on an existing trail. You also use PutInsightSelectors +// to turn off Insights event logging, by passing an empty list of insight types. +// In this release, only ApiCallRateInsight is supported as an Insights selector. +// +// 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 CloudTrail's +// API operation PutInsightSelectors for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * InvalidHomeRegionException +// This exception is thrown when an operation is called on a trail from a region +// other than the region in which the trail was created. +// +// * InvalidInsightSelectorsException +// The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors +// or GetInsightSelectors request is not valid, or the specified insight type +// in the InsightSelectors statement is not a valid insight type. +// +// * InsufficientS3BucketPolicyException +// This exception is thrown when the policy on the S3 bucket is not sufficient. +// +// * InsufficientEncryptionPolicyException +// This exception is thrown when the policy on the S3 bucket or KMS key is not +// sufficient. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutInsightSelectors +func (c *CloudTrail) PutInsightSelectors(input *PutInsightSelectorsInput) (*PutInsightSelectorsOutput, error) { + req, out := c.PutInsightSelectorsRequest(input) + return out, req.Send() +} + +// PutInsightSelectorsWithContext is the same as PutInsightSelectors with the addition of +// the ability to pass a context and additional request options. +// +// See PutInsightSelectors 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 *CloudTrail) PutInsightSelectorsWithContext(ctx aws.Context, input *PutInsightSelectorsInput, opts ...request.Option) (*PutInsightSelectorsOutput, error) { + req, out := c.PutInsightSelectorsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemoveTags = "RemoveTags" + +// RemoveTagsRequest generates a "aws/request.Request" representing the +// client's request for the RemoveTags 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 RemoveTags for more information on using the RemoveTags +// 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 RemoveTagsRequest method. +// req, resp := client.RemoveTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags +func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { + op := &request.Operation{ + Name: opRemoveTags, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RemoveTagsInput{} + } + + output = &RemoveTagsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// RemoveTags API operation for AWS CloudTrail. +// +// Removes the specified tags from a trail. +// +// 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 CloudTrail's +// API operation RemoveTags for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// This exception is thrown when the specified resource is not found. +// +// * ARNInvalidException +// This exception is thrown when an operation is called with an invalid trail +// ARN. The format of a trail ARN is: +// +// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail +// +// * ResourceTypeNotSupportedException +// This exception is thrown when the specified resource type is not supported +// by CloudTrail. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * InvalidTagParameterException +// This exception is thrown when the specified tag key or values are not valid. +// It can also occur if there are duplicate tags or too many tags on the resource. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags +func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + return out, req.Send() +} + +// RemoveTagsWithContext is the same as RemoveTags with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTags 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 *CloudTrail) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartLogging = "StartLogging" + +// StartLoggingRequest generates a "aws/request.Request" representing the +// client's request for the StartLogging 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 StartLogging for more information on using the StartLogging +// 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 StartLoggingRequest method. +// req, resp := client.StartLoggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging +func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request.Request, output *StartLoggingOutput) { + op := &request.Operation{ + Name: opStartLogging, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartLoggingInput{} + } + + output = &StartLoggingOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StartLogging API operation for AWS CloudTrail. +// +// Starts the recording of AWS API calls and log file delivery for a trail. +// For a trail that is enabled in all regions, this operation must be called +// from the region in which the trail was created. This operation cannot be +// called on the shadow trails (replicated trails in other regions) of a trail +// that is enabled in all regions. +// +// 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 CloudTrail's +// API operation StartLogging for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * InvalidHomeRegionException +// This exception is thrown when an operation is called on a trail from a region +// other than the region in which the trail was created. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging +func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) { + req, out := c.StartLoggingRequest(input) + return out, req.Send() +} + +// StartLoggingWithContext is the same as StartLogging with the addition of +// the ability to pass a context and additional request options. +// +// See StartLogging 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 *CloudTrail) StartLoggingWithContext(ctx aws.Context, input *StartLoggingInput, opts ...request.Option) (*StartLoggingOutput, error) { + req, out := c.StartLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopLogging = "StopLogging" + +// StopLoggingRequest generates a "aws/request.Request" representing the +// client's request for the StopLogging 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 StopLogging for more information on using the StopLogging +// 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 StopLoggingRequest method. +// req, resp := client.StopLoggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging +func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.Request, output *StopLoggingOutput) { + op := &request.Operation{ + Name: opStopLogging, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopLoggingInput{} + } + + output = &StopLoggingOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopLogging API operation for AWS CloudTrail. +// +// Suspends the recording of AWS API calls and log file delivery for the specified +// trail. Under most circumstances, there is no need to use this action. You +// can update a trail without stopping it first. This action is the only way +// to stop recording. For a trail enabled in all regions, this operation must +// be called from the region in which the trail was created, or an InvalidHomeRegionException +// will occur. This operation cannot be called on the shadow trails (replicated +// trails in other regions) of a trail enabled in all regions. +// +// 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 CloudTrail's +// API operation StopLogging for usage and error information. +// +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * InvalidHomeRegionException +// This exception is thrown when an operation is called on a trail from a region +// other than the region in which the trail was created. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging +func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) { + req, out := c.StopLoggingRequest(input) + return out, req.Send() +} + +// StopLoggingWithContext is the same as StopLogging with the addition of +// the ability to pass a context and additional request options. +// +// See StopLogging 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 *CloudTrail) StopLoggingWithContext(ctx aws.Context, input *StopLoggingInput, opts ...request.Option) (*StopLoggingOutput, error) { + req, out := c.StopLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTrail = "UpdateTrail" + +// UpdateTrailRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTrail 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 UpdateTrail for more information on using the UpdateTrail +// 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 UpdateTrailRequest method. +// req, resp := client.UpdateTrailRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail +func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.Request, output *UpdateTrailOutput) { + op := &request.Operation{ + Name: opUpdateTrail, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateTrailInput{} + } + + output = &UpdateTrailOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTrail API operation for AWS CloudTrail. +// +// Updates the settings that specify delivery of log files. Changes to a trail +// do not require stopping the CloudTrail service. Use this action to designate +// an existing bucket for log delivery. If the existing bucket has previously +// been a target for CloudTrail log files, an IAM policy exists for the bucket. +// UpdateTrail must be called from the region in which the trail was created; +// otherwise, an InvalidHomeRegionException is thrown. +// +// 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 CloudTrail's +// API operation UpdateTrail for usage and error information. +// +// Returned Error Types: +// * S3BucketDoesNotExistException +// This exception is thrown when the specified S3 bucket does not exist. +// +// * InsufficientS3BucketPolicyException +// This exception is thrown when the policy on the S3 bucket is not sufficient. +// +// * InsufficientSnsTopicPolicyException +// This exception is thrown when the policy on the SNS topic is not sufficient. +// +// * InsufficientEncryptionPolicyException +// This exception is thrown when the policy on the S3 bucket or KMS key is not +// sufficient. +// +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidS3BucketNameException +// This exception is thrown when the provided S3 bucket name is not valid. +// +// * InvalidS3PrefixException +// This exception is thrown when the provided S3 prefix is not valid. +// +// * InvalidSnsTopicNameException +// This exception is thrown when the provided SNS topic name is not valid. +// +// * InvalidKmsKeyIdException +// This exception is thrown when the KMS key ARN is invalid. +// +// * InvalidTrailNameException +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +// +// * TrailNotProvidedException +// This exception is no longer in use. +// +// * InvalidEventSelectorsException +// This exception is thrown when the PutEventSelectors operation is called with +// a number of event selectors or data resources that is not valid. The combination +// of event selectors and data resources is not valid. A trail can have up to +// 5 event selectors. A trail is limited to 250 data resources. These data resources +// can be distributed across event selectors, but the overall total cannot exceed +// 250. +// +// You can: +// +// * Specify a valid number of event selectors (1 to 5) for a trail. +// +// * Specify a valid number of data resources (1 to 250) for an event selector. +// The limit of number of resources on an individual event selector is configurable +// up to 250. However, this upper limit is allowed only if the total number +// of data resources does not exceed 250 across all event selectors for a +// trail. +// +// * Specify a valid value for a parameter. For example, specifying the ReadWriteType +// parameter with a value of read-only is invalid. +// +// * InvalidParameterCombinationException +// This exception is thrown when the combination of parameters provided is not +// valid. +// +// * InvalidHomeRegionException +// This exception is thrown when an operation is called on a trail from a region +// other than the region in which the trail was created. +// +// * KmsKeyNotFoundException +// This exception is thrown when the KMS key does not exist, or when the S3 +// bucket and the KMS key are not in the same region. +// +// * KmsKeyDisabledException +// This exception is no longer in use. +// +// * KmsException +// This exception is thrown when there is an issue with the specified KMS key +// and the trail can’t be updated. +// +// * InvalidCloudWatchLogsLogGroupArnException +// This exception is thrown when the provided CloudWatch log group is not valid. +// +// * InvalidCloudWatchLogsRoleArnException +// This exception is thrown when the provided role is not valid. +// +// * CloudWatchLogsDeliveryUnavailableException +// Cannot set a CloudWatch Logs delivery for this region. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * AccessNotEnabledException +// This exception is thrown when trusted access has not been enabled between +// AWS CloudTrail and AWS Organizations. For more information, see Enabling +// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) +// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * OrganizationsNotInUseException +// This exception is thrown when the request is made from an AWS account that +// is not a member of an organization. To make this request, sign in using the +// credentials of an account that belongs to an organization. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * OrganizationNotInAllFeaturesModeException +// This exception is thrown when AWS Organizations is not configured to support +// all features. All features must be enabled in AWS Organization to support +// creating an organization trail. For more information, see Prepare For Creating +// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail +func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) { + req, out := c.UpdateTrailRequest(input) + return out, req.Send() +} + +// UpdateTrailWithContext is the same as UpdateTrail with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrail 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 *CloudTrail) UpdateTrailWithContext(ctx aws.Context, input *UpdateTrailInput, opts ...request.Option) (*UpdateTrailOutput, error) { + req, out := c.UpdateTrailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// This exception is thrown when an operation is called with an invalid trail +// ARN. The format of a trail ARN is: +// +// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail +type ARNInvalidException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ARNInvalidException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ARNInvalidException) GoString() string { + return s.String() +} + +func newErrorARNInvalidException(v protocol.ResponseMetadata) error { + return &ARNInvalidException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ARNInvalidException) Code() string { + return "CloudTrailARNInvalidException" +} + +// Message returns the exception's message. +func (s *ARNInvalidException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ARNInvalidException) OrigErr() error { + return nil +} + +func (s *ARNInvalidException) 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 *ARNInvalidException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ARNInvalidException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when trusted access has not been enabled between +// AWS CloudTrail and AWS Organizations. For more information, see Enabling +// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) +// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +type AccessNotEnabledException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessNotEnabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessNotEnabledException) GoString() string { + return s.String() +} + +func newErrorAccessNotEnabledException(v protocol.ResponseMetadata) error { + return &AccessNotEnabledException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *AccessNotEnabledException) Code() string { + return "CloudTrailAccessNotEnabledException" +} + +// Message returns the exception's message. +func (s *AccessNotEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *AccessNotEnabledException) OrigErr() error { + return nil +} + +func (s *AccessNotEnabledException) 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 *AccessNotEnabledException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *AccessNotEnabledException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Specifies the tags to add to a trail. +type AddTagsInput struct { + _ struct{} `type:"structure"` + + // Specifies the ARN of the trail to which one or more tags will be added. The + // format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // ResourceId is a required field + ResourceId *string `type:"string" required:"true"` + + // Contains a list of CloudTrail tags, up to a limit of 50 + TagsList []*Tag `type:"list"` +} + +// String returns the string representation +func (s AddTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + if s.TagsList != nil { + for i, v := range s.TagsList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceId sets the ResourceId field's value. +func (s *AddTagsInput) SetResourceId(v string) *AddTagsInput { + s.ResourceId = &v + return s +} + +// SetTagsList sets the TagsList field's value. +func (s *AddTagsInput) SetTagsList(v []*Tag) *AddTagsInput { + s.TagsList = v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type AddTagsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AddTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddTagsOutput) GoString() string { + return s.String() +} + +// Cannot set a CloudWatch Logs delivery for this region. +type CloudWatchLogsDeliveryUnavailableException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CloudWatchLogsDeliveryUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudWatchLogsDeliveryUnavailableException) GoString() string { + return s.String() +} + +func newErrorCloudWatchLogsDeliveryUnavailableException(v protocol.ResponseMetadata) error { + return &CloudWatchLogsDeliveryUnavailableException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *CloudWatchLogsDeliveryUnavailableException) Code() string { + return "CloudWatchLogsDeliveryUnavailableException" +} + +// Message returns the exception's message. +func (s *CloudWatchLogsDeliveryUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *CloudWatchLogsDeliveryUnavailableException) OrigErr() error { + return nil +} + +func (s *CloudWatchLogsDeliveryUnavailableException) 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 *CloudWatchLogsDeliveryUnavailableException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *CloudWatchLogsDeliveryUnavailableException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Specifies the settings for each trail. +type CreateTrailInput struct { + _ struct{} `type:"structure"` + + // Specifies a log group name using an Amazon Resource Name (ARN), a unique + // identifier that represents the log group to which CloudTrail logs will be + // delivered. Not required unless you specify CloudWatchLogsRoleArn. + CloudWatchLogsLogGroupArn *string `type:"string"` + + // Specifies the role for the CloudWatch Logs endpoint to assume to write to + // a user's log group. + CloudWatchLogsRoleArn *string `type:"string"` + + // Specifies whether log file integrity validation is enabled. The default is + // false. + // + // When you disable log file integrity validation, the chain of digest files + // is broken after one hour. CloudTrail will not create digest files for log + // files that were delivered during a period in which log file integrity validation + // was disabled. For example, if you enable log file integrity validation at + // noon on January 1, disable it at noon on January 2, and re-enable it at noon + // on January 10, digest files will not be created for the log files delivered + // from noon on January 2 to noon on January 10. The same applies whenever you + // stop CloudTrail logging or delete a trail. + EnableLogFileValidation *bool `type:"boolean"` + + // Specifies whether the trail is publishing events from global services such + // as IAM to the log files. + IncludeGlobalServiceEvents *bool `type:"boolean"` + + // Specifies whether the trail is created in the current region or in all regions. + // The default is false, which creates a trail only in the region where you + // are signed in. As a best practice, consider creating trails that log events + // in all regions. + IsMultiRegionTrail *bool `type:"boolean"` + + // Specifies whether the trail is created for all accounts in an organization + // in AWS Organizations, or only for the current AWS account. The default is + // false, and cannot be true unless the call is made on behalf of an AWS account + // that is the master account for an organization in AWS Organizations. + IsOrganizationTrail *bool `type:"boolean"` + + // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. + // The value can be an alias name prefixed by "alias/", a fully specified ARN + // to an alias, a fully specified ARN to a key, or a globally unique identifier. + // + // Examples: + // + // * alias/MyAliasName + // + // * arn:aws:kms:us-east-2:123456789012:alias/MyAliasName + // + // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 + // + // * 12345678-1234-1234-1234-123456789012 + KmsKeyId *string `type:"string"` + + // Specifies the name of the trail. The name must meet the following requirements: + // + // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores + // (_), or dashes (-) + // + // * Start with a letter or number, and end with a letter or number + // + // * Be between 3 and 128 characters + // + // * Have no adjacent periods, underscores or dashes. Names like my-_namespace + // and my--namespace are invalid. + // + // * Not be in IP address format (for example, 192.168.5.4) + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // Specifies the name of the Amazon S3 bucket designated for publishing log + // files. See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). + // + // S3BucketName is a required field + S3BucketName *string `type:"string" required:"true"` + + // Specifies the Amazon S3 key prefix that comes after the name of the bucket + // you have designated for log file delivery. For more information, see Finding + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + // The maximum length is 200 characters. + S3KeyPrefix *string `type:"string"` + + // Specifies the name of the Amazon SNS topic defined for notification of log + // file delivery. The maximum length is 256 characters. + SnsTopicName *string `type:"string"` + + // A list of tags. + TagsList []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateTrailInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrailInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTrailInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrailInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.S3BucketName == nil { + invalidParams.Add(request.NewErrParamRequired("S3BucketName")) + } + if s.TagsList != nil { + for i, v := range s.TagsList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. +func (s *CreateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailInput { + s.CloudWatchLogsLogGroupArn = &v + return s +} + +// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. +func (s *CreateTrailInput) SetCloudWatchLogsRoleArn(v string) *CreateTrailInput { + s.CloudWatchLogsRoleArn = &v + return s +} + +// SetEnableLogFileValidation sets the EnableLogFileValidation field's value. +func (s *CreateTrailInput) SetEnableLogFileValidation(v bool) *CreateTrailInput { + s.EnableLogFileValidation = &v + return s +} + +// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. +func (s *CreateTrailInput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailInput { + s.IncludeGlobalServiceEvents = &v + return s +} + +// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. +func (s *CreateTrailInput) SetIsMultiRegionTrail(v bool) *CreateTrailInput { + s.IsMultiRegionTrail = &v + return s +} + +// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. +func (s *CreateTrailInput) SetIsOrganizationTrail(v bool) *CreateTrailInput { + s.IsOrganizationTrail = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CreateTrailInput) SetKmsKeyId(v string) *CreateTrailInput { + s.KmsKeyId = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateTrailInput) SetName(v string) *CreateTrailInput { + s.Name = &v + return s +} + +// SetS3BucketName sets the S3BucketName field's value. +func (s *CreateTrailInput) SetS3BucketName(v string) *CreateTrailInput { + s.S3BucketName = &v + return s +} + +// SetS3KeyPrefix sets the S3KeyPrefix field's value. +func (s *CreateTrailInput) SetS3KeyPrefix(v string) *CreateTrailInput { + s.S3KeyPrefix = &v + return s +} + +// SetSnsTopicName sets the SnsTopicName field's value. +func (s *CreateTrailInput) SetSnsTopicName(v string) *CreateTrailInput { + s.SnsTopicName = &v + return s +} + +// SetTagsList sets the TagsList field's value. +func (s *CreateTrailInput) SetTagsList(v []*Tag) *CreateTrailInput { + s.TagsList = v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type CreateTrailOutput struct { + _ struct{} `type:"structure"` + + // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail + // logs will be delivered. + CloudWatchLogsLogGroupArn *string `type:"string"` + + // Specifies the role for the CloudWatch Logs endpoint to assume to write to + // a user's log group. + CloudWatchLogsRoleArn *string `type:"string"` + + // Specifies whether the trail is publishing events from global services such + // as IAM to the log files. + IncludeGlobalServiceEvents *bool `type:"boolean"` + + // Specifies whether the trail exists in one region or in all regions. + IsMultiRegionTrail *bool `type:"boolean"` + + // Specifies whether the trail is an organization trail. + IsOrganizationTrail *bool `type:"boolean"` + + // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. + // The value is a fully specified ARN to a KMS key in the format: + // + // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 + KmsKeyId *string `type:"string"` + + // Specifies whether log file integrity validation is enabled. + LogFileValidationEnabled *bool `type:"boolean"` + + // Specifies the name of the trail. + Name *string `type:"string"` + + // Specifies the name of the Amazon S3 bucket designated for publishing log + // files. + S3BucketName *string `type:"string"` + + // Specifies the Amazon S3 key prefix that comes after the name of the bucket + // you have designated for log file delivery. For more information, see Finding + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + S3KeyPrefix *string `type:"string"` + + // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications + // when log files are delivered. The format of a topic ARN is: + // + // arn:aws:sns:us-east-2:123456789012:MyTopic + SnsTopicARN *string `type:"string"` + + // This field is no longer in use. Use SnsTopicARN. + // + // Deprecated: SnsTopicName has been deprecated + SnsTopicName *string `deprecated:"true" type:"string"` + + // Specifies the ARN of the trail that was created. The format of a trail ARN + // is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s CreateTrailOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrailOutput) GoString() string { + return s.String() +} + +// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. +func (s *CreateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailOutput { + s.CloudWatchLogsLogGroupArn = &v + return s +} + +// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. +func (s *CreateTrailOutput) SetCloudWatchLogsRoleArn(v string) *CreateTrailOutput { + s.CloudWatchLogsRoleArn = &v + return s +} + +// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. +func (s *CreateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailOutput { + s.IncludeGlobalServiceEvents = &v + return s +} + +// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. +func (s *CreateTrailOutput) SetIsMultiRegionTrail(v bool) *CreateTrailOutput { + s.IsMultiRegionTrail = &v + return s +} + +// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. +func (s *CreateTrailOutput) SetIsOrganizationTrail(v bool) *CreateTrailOutput { + s.IsOrganizationTrail = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CreateTrailOutput) SetKmsKeyId(v string) *CreateTrailOutput { + s.KmsKeyId = &v + return s +} + +// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. +func (s *CreateTrailOutput) SetLogFileValidationEnabled(v bool) *CreateTrailOutput { + s.LogFileValidationEnabled = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateTrailOutput) SetName(v string) *CreateTrailOutput { + s.Name = &v + return s +} + +// SetS3BucketName sets the S3BucketName field's value. +func (s *CreateTrailOutput) SetS3BucketName(v string) *CreateTrailOutput { + s.S3BucketName = &v + return s +} + +// SetS3KeyPrefix sets the S3KeyPrefix field's value. +func (s *CreateTrailOutput) SetS3KeyPrefix(v string) *CreateTrailOutput { + s.S3KeyPrefix = &v + return s +} + +// SetSnsTopicARN sets the SnsTopicARN field's value. +func (s *CreateTrailOutput) SetSnsTopicARN(v string) *CreateTrailOutput { + s.SnsTopicARN = &v + return s +} + +// SetSnsTopicName sets the SnsTopicName field's value. +func (s *CreateTrailOutput) SetSnsTopicName(v string) *CreateTrailOutput { + s.SnsTopicName = &v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *CreateTrailOutput) SetTrailARN(v string) *CreateTrailOutput { + s.TrailARN = &v + return s +} + +// The Amazon S3 buckets or AWS Lambda functions that you specify in your event +// selectors for your trail to log data events. Data events provide information +// about the resource operations performed on or within a resource itself. These +// are also known as data plane operations. You can specify up to 250 data resources +// for a trail. +// +// The total number of allowed data resources is 250. This number can be distributed +// between 1 and 5 event selectors, but the total cannot exceed 250 across all +// selectors. +// +// The following example demonstrates how logging works when you configure logging +// of all data events for an S3 bucket named bucket-1. In this example, the +// CloudTrail user specified an empty prefix, and the option to log both Read +// and Write data events. +// +// A user uploads an image file to bucket-1. +// +// The PutObject API operation is an Amazon S3 object-level API. It is recorded +// as a data event in CloudTrail. Because the CloudTrail user specified an S3 +// bucket with an empty prefix, events that occur on any object in that bucket +// are logged. The trail processes and logs the event. +// +// A user uploads an object to an Amazon S3 bucket named arn:aws:s3:::bucket-2. +// +// The PutObject API operation occurred for an object in an S3 bucket that the +// CloudTrail user didn't specify for the trail. The trail doesn’t log the +// event. +// +// The following example demonstrates how logging works when you configure logging +// of AWS Lambda data events for a Lambda function named MyLambdaFunction, but +// not for all AWS Lambda functions. +// +// A user runs a script that includes a call to the MyLambdaFunction function +// and the MyOtherLambdaFunction function. +// +// The Invoke API operation on MyLambdaFunction is an AWS Lambda API. It is +// recorded as a data event in CloudTrail. Because the CloudTrail user specified +// logging data events for MyLambdaFunction, any invocations of that function +// are logged. The trail processes and logs the event. +// +// The Invoke API operation on MyOtherLambdaFunction is an AWS Lambda API. Because +// the CloudTrail user did not specify logging data events for all Lambda functions, +// the Invoke operation for MyOtherLambdaFunction does not match the function +// specified for the trail. The trail doesn’t log the event. +type DataResource struct { + _ struct{} `type:"structure"` + + // The resource type in which you want to log data events. You can specify AWS::S3::Object + // or AWS::Lambda::Function resources. + Type *string `type:"string"` + + // An array of Amazon Resource Name (ARN) strings or partial ARN strings for + // the specified objects. + // + // * To log data events for all objects in all S3 buckets in your AWS account, + // specify the prefix as arn:aws:s3:::. This will also enable logging of + // data event activity performed by any user or role in your AWS account, + // even if that activity is performed on a bucket that belongs to another + // AWS account. + // + // * To log data events for all objects in an S3 bucket, specify the bucket + // and an empty object prefix such as arn:aws:s3:::bucket-1/. The trail logs + // data events for all objects in this S3 bucket. + // + // * To log data events for specific objects, specify the S3 bucket and object + // prefix such as arn:aws:s3:::bucket-1/example-images. The trail logs data + // events for objects in this S3 bucket that match the prefix. + // + // * To log data events for all functions in your AWS account, specify the + // prefix as arn:aws:lambda. This will also enable logging of Invoke activity + // performed by any user or role in your AWS account, even if that activity + // is performed on a function that belongs to another AWS account. + // + // * To log data events for a specific Lambda function, specify the function + // ARN. Lambda function ARNs are exact. For example, if you specify a function + // ARN arn:aws:lambda:us-west-2:111111111111:function:helloworld, data events + // will only be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld. + // They will not be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld2. + Values []*string `type:"list"` +} + +// String returns the string representation +func (s DataResource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataResource) GoString() string { + return s.String() +} + +// SetType sets the Type field's value. +func (s *DataResource) SetType(v string) *DataResource { + s.Type = &v + return s +} + +// SetValues sets the Values field's value. +func (s *DataResource) SetValues(v []*string) *DataResource { + s.Values = v + return s +} + +// The request that specifies the name of a trail to delete. +type DeleteTrailInput struct { + _ struct{} `type:"structure"` + + // Specifies the name or the CloudTrail ARN of the trail to be deleted. The + // format of a trail ARN is: arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // Name is a required field + Name *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTrailInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrailInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTrailInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrailInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DeleteTrailInput) SetName(v string) *DeleteTrailInput { + s.Name = &v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type DeleteTrailOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteTrailOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrailOutput) GoString() string { + return s.String() +} + +// Returns information about the trail. +type DescribeTrailsInput struct { + _ struct{} `type:"structure"` + + // Specifies whether to include shadow trails in the response. A shadow trail + // is the replication in a region of a trail that was created in a different + // region, or in the case of an organization trail, the replication of an organization + // trail in member accounts. If you do not include shadow trails, organization + // trails in a member account and region replication trails will not be returned. + // The default is true. + IncludeShadowTrails *bool `locationName:"includeShadowTrails" type:"boolean"` + + // Specifies a list of trail names, trail ARNs, or both, of the trails to describe. + // The format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // If an empty list is specified, information for the trail in the current region + // is returned. + // + // * If an empty list is specified and IncludeShadowTrails is false, then + // information for all trails in the current region is returned. + // + // * If an empty list is specified and IncludeShadowTrails is null or true, + // then information for all trails in the current region and any associated + // shadow trails in other regions is returned. + // + // If one or more trail names are specified, information is returned only if + // the names match the names of trails belonging only to the current region. + // To return information about a trail in another region, you must specify its + // trail ARN. + TrailNameList []*string `locationName:"trailNameList" type:"list"` +} + +// String returns the string representation +func (s DescribeTrailsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTrailsInput) GoString() string { + return s.String() +} + +// SetIncludeShadowTrails sets the IncludeShadowTrails field's value. +func (s *DescribeTrailsInput) SetIncludeShadowTrails(v bool) *DescribeTrailsInput { + s.IncludeShadowTrails = &v + return s +} + +// SetTrailNameList sets the TrailNameList field's value. +func (s *DescribeTrailsInput) SetTrailNameList(v []*string) *DescribeTrailsInput { + s.TrailNameList = v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type DescribeTrailsOutput struct { + _ struct{} `type:"structure"` + + // The list of trail objects. Trail objects with string values are only returned + // if values for the objects exist in a trail's configuration. For example, + // SNSTopicName and SNSTopicARN are only returned in results if a trail is configured + // to send SNS notifications. Similarly, KMSKeyId only appears in results if + // a trail's log files are encrypted with AWS KMS-managed keys. + TrailList []*Trail `locationName:"trailList" type:"list"` +} + +// String returns the string representation +func (s DescribeTrailsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTrailsOutput) GoString() string { + return s.String() +} + +// SetTrailList sets the TrailList field's value. +func (s *DescribeTrailsOutput) SetTrailList(v []*Trail) *DescribeTrailsOutput { + s.TrailList = v + return s +} + +// Contains information about an event that was returned by a lookup request. +// The result includes a representation of a CloudTrail event. +type Event struct { + _ struct{} `type:"structure"` + + // The AWS access key ID that was used to sign the request. If the request was + // made with temporary security credentials, this is the access key ID of the + // temporary credentials. + AccessKeyId *string `type:"string"` + + // A JSON string that contains a representation of the event returned. + CloudTrailEvent *string `type:"string"` + + // The CloudTrail ID of the event returned. + EventId *string `type:"string"` + + // The name of the event returned. + EventName *string `type:"string"` + + // The AWS service that the request was made to. + EventSource *string `type:"string"` + + // The date and time of the event returned. + EventTime *time.Time `type:"timestamp"` + + // Information about whether the event is a write event or a read event. + ReadOnly *string `type:"string"` + + // A list of resources referenced by the event returned. + Resources []*Resource `type:"list"` + + // A user name or role name of the requester that called the API in the event + // returned. + Username *string `type:"string"` +} + +// String returns the string representation +func (s Event) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Event) GoString() string { + return s.String() +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *Event) SetAccessKeyId(v string) *Event { + s.AccessKeyId = &v + return s +} + +// SetCloudTrailEvent sets the CloudTrailEvent field's value. +func (s *Event) SetCloudTrailEvent(v string) *Event { + s.CloudTrailEvent = &v + return s +} + +// SetEventId sets the EventId field's value. +func (s *Event) SetEventId(v string) *Event { + s.EventId = &v + return s +} + +// SetEventName sets the EventName field's value. +func (s *Event) SetEventName(v string) *Event { + s.EventName = &v + return s +} + +// SetEventSource sets the EventSource field's value. +func (s *Event) SetEventSource(v string) *Event { + s.EventSource = &v + return s +} + +// SetEventTime sets the EventTime field's value. +func (s *Event) SetEventTime(v time.Time) *Event { + s.EventTime = &v + return s +} + +// SetReadOnly sets the ReadOnly field's value. +func (s *Event) SetReadOnly(v string) *Event { + s.ReadOnly = &v + return s +} + +// SetResources sets the Resources field's value. +func (s *Event) SetResources(v []*Resource) *Event { + s.Resources = v + return s +} + +// SetUsername sets the Username field's value. +func (s *Event) SetUsername(v string) *Event { + s.Username = &v + return s +} + +// Use event selectors to further specify the management and data event settings +// for your trail. By default, trails created without specific event selectors +// will be configured to log all read and write management events, and no data +// events. When an event occurs in your account, CloudTrail evaluates the event +// selector for all trails. For each trail, if the event matches any event selector, +// the trail processes and logs the event. If the event doesn't match any event +// selector, the trail doesn't log the event. +// +// You can configure up to five event selectors for a trail. +type EventSelector struct { + _ struct{} `type:"structure"` + + // CloudTrail supports data event logging for Amazon S3 objects and AWS Lambda + // functions. You can specify up to 250 resources for an individual event selector, + // but the total number of data resources cannot exceed 250 across all event + // selectors in a trail. This limit does not apply if you configure resource + // logging for all data events. + // + // For more information, see Data Events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html#logging-data-events) + // and Limits in AWS CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) + // in the AWS CloudTrail User Guide. + DataResources []*DataResource `type:"list"` + + // An optional list of service event sources from which you do not want management + // events to be logged on your trail. In this release, the list can be empty + // (disables the filter), or it can filter out AWS Key Management Service events + // by containing "kms.amazonaws.com". By default, ExcludeManagementEventSources + // is empty, and AWS KMS events are included in events that are logged to your + // trail. + ExcludeManagementEventSources []*string `type:"list"` + + // Specify if you want your event selector to include management events for + // your trail. + // + // For more information, see Management Events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html#logging-management-events) + // in the AWS CloudTrail User Guide. + // + // By default, the value is true. + IncludeManagementEvents *bool `type:"boolean"` + + // Specify if you want your trail to log read-only events, write-only events, + // or all. For example, the EC2 GetConsoleOutput is a read-only API operation + // and RunInstances is a write-only API operation. + // + // By default, the value is All. + ReadWriteType *string `type:"string" enum:"ReadWriteType"` +} + +// String returns the string representation +func (s EventSelector) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EventSelector) GoString() string { + return s.String() +} + +// SetDataResources sets the DataResources field's value. +func (s *EventSelector) SetDataResources(v []*DataResource) *EventSelector { + s.DataResources = v + return s +} + +// SetExcludeManagementEventSources sets the ExcludeManagementEventSources field's value. +func (s *EventSelector) SetExcludeManagementEventSources(v []*string) *EventSelector { + s.ExcludeManagementEventSources = v + return s +} + +// SetIncludeManagementEvents sets the IncludeManagementEvents field's value. +func (s *EventSelector) SetIncludeManagementEvents(v bool) *EventSelector { + s.IncludeManagementEvents = &v + return s +} + +// SetReadWriteType sets the ReadWriteType field's value. +func (s *EventSelector) SetReadWriteType(v string) *EventSelector { + s.ReadWriteType = &v + return s +} + +type GetEventSelectorsInput struct { + _ struct{} `type:"structure"` + + // Specifies the name of the trail or trail ARN. If you specify a trail name, + // the string must meet the following requirements: + // + // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores + // (_), or dashes (-) + // + // * Start with a letter or number, and end with a letter or number + // + // * Be between 3 and 128 characters + // + // * Have no adjacent periods, underscores or dashes. Names like my-_namespace + // and my--namespace are not valid. + // + // * Not be in IP address format (for example, 192.168.5.4) + // + // If you specify a trail ARN, it must be in the format: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetEventSelectorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetEventSelectorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetEventSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetEventSelectorsInput"} + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrailName sets the TrailName field's value. +func (s *GetEventSelectorsInput) SetTrailName(v string) *GetEventSelectorsInput { + s.TrailName = &v + return s +} + +type GetEventSelectorsOutput struct { + _ struct{} `type:"structure"` + + // The event selectors that are configured for the trail. + EventSelectors []*EventSelector `type:"list"` + + // The specified trail ARN that has the event selectors. + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s GetEventSelectorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetEventSelectorsOutput) GoString() string { + return s.String() +} + +// SetEventSelectors sets the EventSelectors field's value. +func (s *GetEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *GetEventSelectorsOutput { + s.EventSelectors = v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *GetEventSelectorsOutput) SetTrailARN(v string) *GetEventSelectorsOutput { + s.TrailARN = &v + return s +} + +type GetInsightSelectorsInput struct { + _ struct{} `type:"structure"` + + // Specifies the name of the trail or trail ARN. If you specify a trail name, + // the string must meet the following requirements: + // + // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores + // (_), or dashes (-) + // + // * Start with a letter or number, and end with a letter or number + // + // * Be between 3 and 128 characters + // + // * Have no adjacent periods, underscores or dashes. Names like my-_namespace + // and my--namespace are not valid. + // + // * Not be in IP address format (for example, 192.168.5.4) + // + // If you specify a trail ARN, it must be in the format: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetInsightSelectorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetInsightSelectorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetInsightSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetInsightSelectorsInput"} + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrailName sets the TrailName field's value. +func (s *GetInsightSelectorsInput) SetTrailName(v string) *GetInsightSelectorsInput { + s.TrailName = &v + return s +} + +type GetInsightSelectorsOutput struct { + _ struct{} `type:"structure"` + + // A JSON string that contains the insight types you want to log on a trail. + // In this release, only ApiCallRateInsight is supported as an insight type. + InsightSelectors []*InsightSelector `type:"list"` + + // The Amazon Resource Name (ARN) of a trail for which you want to get Insights + // selectors. + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s GetInsightSelectorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetInsightSelectorsOutput) GoString() string { + return s.String() +} + +// SetInsightSelectors sets the InsightSelectors field's value. +func (s *GetInsightSelectorsOutput) SetInsightSelectors(v []*InsightSelector) *GetInsightSelectorsOutput { + s.InsightSelectors = v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *GetInsightSelectorsOutput) SetTrailARN(v string) *GetInsightSelectorsOutput { + s.TrailARN = &v + return s +} + +type GetTrailInput struct { + _ struct{} `type:"structure"` + + // The name or the Amazon Resource Name (ARN) of the trail for which you want + // to retrieve settings information. + // + // Name is a required field + Name *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetTrailInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrailInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTrailInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTrailInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *GetTrailInput) SetName(v string) *GetTrailInput { + s.Name = &v + return s +} + +type GetTrailOutput struct { + _ struct{} `type:"structure"` + + // The settings for a trail. + Trail *Trail `type:"structure"` +} + +// String returns the string representation +func (s GetTrailOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrailOutput) GoString() string { + return s.String() +} + +// SetTrail sets the Trail field's value. +func (s *GetTrailOutput) SetTrail(v *Trail) *GetTrailOutput { + s.Trail = v + return s +} + +// The name of a trail about which you want the current status. +type GetTrailStatusInput struct { + _ struct{} `type:"structure"` + + // Specifies the name or the CloudTrail ARN of the trail for which you are requesting + // status. To get the status of a shadow trail (a replication of the trail in + // another region), you must specify its ARN. The format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // Name is a required field + Name *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetTrailStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrailStatusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTrailStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTrailStatusInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *GetTrailStatusInput) SetName(v string) *GetTrailStatusInput { + s.Name = &v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type GetTrailStatusOutput struct { + _ struct{} `type:"structure"` + + // Whether the CloudTrail is currently logging AWS API calls. + IsLogging *bool `type:"boolean"` + + // Displays any CloudWatch Logs error that CloudTrail encountered when attempting + // to deliver logs to CloudWatch Logs. + LatestCloudWatchLogsDeliveryError *string `type:"string"` + + // Displays the most recent date and time when CloudTrail delivered logs to + // CloudWatch Logs. + LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp"` + + // This field is no longer in use. + LatestDeliveryAttemptSucceeded *string `type:"string"` + + // This field is no longer in use. + LatestDeliveryAttemptTime *string `type:"string"` + + // Displays any Amazon S3 error that CloudTrail encountered when attempting + // to deliver log files to the designated bucket. For more information see the + // topic Error Responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) + // in the Amazon S3 API Reference. + // + // This error occurs only when there is a problem with the destination S3 bucket + // and will not occur for timeouts. To resolve the issue, create a new bucket + // and call UpdateTrail to specify the new bucket, or fix the existing objects + // so that CloudTrail can again write to the bucket. + LatestDeliveryError *string `type:"string"` + + // Specifies the date and time that CloudTrail last delivered log files to an + // account's Amazon S3 bucket. + LatestDeliveryTime *time.Time `type:"timestamp"` + + // Displays any Amazon S3 error that CloudTrail encountered when attempting + // to deliver a digest file to the designated bucket. For more information see + // the topic Error Responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) + // in the Amazon S3 API Reference. + // + // This error occurs only when there is a problem with the destination S3 bucket + // and will not occur for timeouts. To resolve the issue, create a new bucket + // and call UpdateTrail to specify the new bucket, or fix the existing objects + // so that CloudTrail can again write to the bucket. + LatestDigestDeliveryError *string `type:"string"` + + // Specifies the date and time that CloudTrail last delivered a digest file + // to an account's Amazon S3 bucket. + LatestDigestDeliveryTime *time.Time `type:"timestamp"` + + // This field is no longer in use. + LatestNotificationAttemptSucceeded *string `type:"string"` + + // This field is no longer in use. + LatestNotificationAttemptTime *string `type:"string"` + + // Displays any Amazon SNS error that CloudTrail encountered when attempting + // to send a notification. For more information about Amazon SNS errors, see + // the Amazon SNS Developer Guide (https://docs.aws.amazon.com/sns/latest/dg/welcome.html). + LatestNotificationError *string `type:"string"` + + // Specifies the date and time of the most recent Amazon SNS notification that + // CloudTrail has written a new log file to an account's Amazon S3 bucket. + LatestNotificationTime *time.Time `type:"timestamp"` + + // Specifies the most recent date and time when CloudTrail started recording + // API calls for an AWS account. + StartLoggingTime *time.Time `type:"timestamp"` + + // Specifies the most recent date and time when CloudTrail stopped recording + // API calls for an AWS account. + StopLoggingTime *time.Time `type:"timestamp"` + + // This field is no longer in use. + TimeLoggingStarted *string `type:"string"` + + // This field is no longer in use. + TimeLoggingStopped *string `type:"string"` +} + +// String returns the string representation +func (s GetTrailStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrailStatusOutput) GoString() string { + return s.String() +} + +// SetIsLogging sets the IsLogging field's value. +func (s *GetTrailStatusOutput) SetIsLogging(v bool) *GetTrailStatusOutput { + s.IsLogging = &v + return s +} + +// SetLatestCloudWatchLogsDeliveryError sets the LatestCloudWatchLogsDeliveryError field's value. +func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryError(v string) *GetTrailStatusOutput { + s.LatestCloudWatchLogsDeliveryError = &v + return s +} + +// SetLatestCloudWatchLogsDeliveryTime sets the LatestCloudWatchLogsDeliveryTime field's value. +func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryTime(v time.Time) *GetTrailStatusOutput { + s.LatestCloudWatchLogsDeliveryTime = &v + return s +} + +// SetLatestDeliveryAttemptSucceeded sets the LatestDeliveryAttemptSucceeded field's value. +func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptSucceeded(v string) *GetTrailStatusOutput { + s.LatestDeliveryAttemptSucceeded = &v + return s +} + +// SetLatestDeliveryAttemptTime sets the LatestDeliveryAttemptTime field's value. +func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptTime(v string) *GetTrailStatusOutput { + s.LatestDeliveryAttemptTime = &v + return s +} + +// SetLatestDeliveryError sets the LatestDeliveryError field's value. +func (s *GetTrailStatusOutput) SetLatestDeliveryError(v string) *GetTrailStatusOutput { + s.LatestDeliveryError = &v + return s +} + +// SetLatestDeliveryTime sets the LatestDeliveryTime field's value. +func (s *GetTrailStatusOutput) SetLatestDeliveryTime(v time.Time) *GetTrailStatusOutput { + s.LatestDeliveryTime = &v + return s +} + +// SetLatestDigestDeliveryError sets the LatestDigestDeliveryError field's value. +func (s *GetTrailStatusOutput) SetLatestDigestDeliveryError(v string) *GetTrailStatusOutput { + s.LatestDigestDeliveryError = &v + return s +} + +// SetLatestDigestDeliveryTime sets the LatestDigestDeliveryTime field's value. +func (s *GetTrailStatusOutput) SetLatestDigestDeliveryTime(v time.Time) *GetTrailStatusOutput { + s.LatestDigestDeliveryTime = &v + return s +} + +// SetLatestNotificationAttemptSucceeded sets the LatestNotificationAttemptSucceeded field's value. +func (s *GetTrailStatusOutput) SetLatestNotificationAttemptSucceeded(v string) *GetTrailStatusOutput { + s.LatestNotificationAttemptSucceeded = &v + return s +} + +// SetLatestNotificationAttemptTime sets the LatestNotificationAttemptTime field's value. +func (s *GetTrailStatusOutput) SetLatestNotificationAttemptTime(v string) *GetTrailStatusOutput { + s.LatestNotificationAttemptTime = &v + return s +} + +// SetLatestNotificationError sets the LatestNotificationError field's value. +func (s *GetTrailStatusOutput) SetLatestNotificationError(v string) *GetTrailStatusOutput { + s.LatestNotificationError = &v + return s +} + +// SetLatestNotificationTime sets the LatestNotificationTime field's value. +func (s *GetTrailStatusOutput) SetLatestNotificationTime(v time.Time) *GetTrailStatusOutput { + s.LatestNotificationTime = &v + return s +} + +// SetStartLoggingTime sets the StartLoggingTime field's value. +func (s *GetTrailStatusOutput) SetStartLoggingTime(v time.Time) *GetTrailStatusOutput { + s.StartLoggingTime = &v + return s +} + +// SetStopLoggingTime sets the StopLoggingTime field's value. +func (s *GetTrailStatusOutput) SetStopLoggingTime(v time.Time) *GetTrailStatusOutput { + s.StopLoggingTime = &v + return s +} + +// SetTimeLoggingStarted sets the TimeLoggingStarted field's value. +func (s *GetTrailStatusOutput) SetTimeLoggingStarted(v string) *GetTrailStatusOutput { + s.TimeLoggingStarted = &v + return s +} + +// SetTimeLoggingStopped sets the TimeLoggingStopped field's value. +func (s *GetTrailStatusOutput) SetTimeLoggingStopped(v string) *GetTrailStatusOutput { + s.TimeLoggingStopped = &v + return s +} + +// If you run GetInsightSelectors on a trail that does not have Insights events +// enabled, the operation throws the exception InsightNotEnabledException. +type InsightNotEnabledException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InsightNotEnabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsightNotEnabledException) GoString() string { + return s.String() +} + +func newErrorInsightNotEnabledException(v protocol.ResponseMetadata) error { + return &InsightNotEnabledException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InsightNotEnabledException) Code() string { + return "InsightNotEnabledException" +} + +// Message returns the exception's message. +func (s *InsightNotEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InsightNotEnabledException) OrigErr() error { + return nil +} + +func (s *InsightNotEnabledException) 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 *InsightNotEnabledException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InsightNotEnabledException) RequestID() string { + return s.RespMetadata.RequestID +} + +// A JSON string that contains a list of insight types that are logged on a +// trail. +type InsightSelector struct { + _ struct{} `type:"structure"` + + // The type of insights to log on a trail. In this release, only ApiCallRateInsight + // is supported as an insight type. + InsightType *string `type:"string" enum:"InsightType"` +} + +// String returns the string representation +func (s InsightSelector) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsightSelector) GoString() string { + return s.String() +} + +// SetInsightType sets the InsightType field's value. +func (s *InsightSelector) SetInsightType(v string) *InsightSelector { + s.InsightType = &v + return s +} + +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +type InsufficientDependencyServiceAccessPermissionException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InsufficientDependencyServiceAccessPermissionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsufficientDependencyServiceAccessPermissionException) GoString() string { + return s.String() +} + +func newErrorInsufficientDependencyServiceAccessPermissionException(v protocol.ResponseMetadata) error { + return &InsufficientDependencyServiceAccessPermissionException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InsufficientDependencyServiceAccessPermissionException) Code() string { + return "InsufficientDependencyServiceAccessPermissionException" +} + +// Message returns the exception's message. +func (s *InsufficientDependencyServiceAccessPermissionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InsufficientDependencyServiceAccessPermissionException) OrigErr() error { + return nil +} + +func (s *InsufficientDependencyServiceAccessPermissionException) 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 *InsufficientDependencyServiceAccessPermissionException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InsufficientDependencyServiceAccessPermissionException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the policy on the S3 bucket or KMS key is not +// sufficient. +type InsufficientEncryptionPolicyException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InsufficientEncryptionPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsufficientEncryptionPolicyException) GoString() string { + return s.String() +} + +func newErrorInsufficientEncryptionPolicyException(v protocol.ResponseMetadata) error { + return &InsufficientEncryptionPolicyException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InsufficientEncryptionPolicyException) Code() string { + return "InsufficientEncryptionPolicyException" +} + +// Message returns the exception's message. +func (s *InsufficientEncryptionPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InsufficientEncryptionPolicyException) OrigErr() error { + return nil +} + +func (s *InsufficientEncryptionPolicyException) 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 *InsufficientEncryptionPolicyException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InsufficientEncryptionPolicyException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the policy on the S3 bucket is not sufficient. +type InsufficientS3BucketPolicyException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InsufficientS3BucketPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsufficientS3BucketPolicyException) GoString() string { + return s.String() +} + +func newErrorInsufficientS3BucketPolicyException(v protocol.ResponseMetadata) error { + return &InsufficientS3BucketPolicyException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InsufficientS3BucketPolicyException) Code() string { + return "InsufficientS3BucketPolicyException" +} + +// Message returns the exception's message. +func (s *InsufficientS3BucketPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InsufficientS3BucketPolicyException) OrigErr() error { + return nil +} + +func (s *InsufficientS3BucketPolicyException) 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 *InsufficientS3BucketPolicyException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InsufficientS3BucketPolicyException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the policy on the SNS topic is not sufficient. +type InsufficientSnsTopicPolicyException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InsufficientSnsTopicPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsufficientSnsTopicPolicyException) GoString() string { + return s.String() +} + +func newErrorInsufficientSnsTopicPolicyException(v protocol.ResponseMetadata) error { + return &InsufficientSnsTopicPolicyException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InsufficientSnsTopicPolicyException) Code() string { + return "InsufficientSnsTopicPolicyException" +} + +// Message returns the exception's message. +func (s *InsufficientSnsTopicPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InsufficientSnsTopicPolicyException) OrigErr() error { + return nil +} + +func (s *InsufficientSnsTopicPolicyException) 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 *InsufficientSnsTopicPolicyException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InsufficientSnsTopicPolicyException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the provided CloudWatch log group is not valid. +type InvalidCloudWatchLogsLogGroupArnException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCloudWatchLogsLogGroupArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCloudWatchLogsLogGroupArnException) GoString() string { + return s.String() +} + +func newErrorInvalidCloudWatchLogsLogGroupArnException(v protocol.ResponseMetadata) error { + return &InvalidCloudWatchLogsLogGroupArnException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidCloudWatchLogsLogGroupArnException) Code() string { + return "InvalidCloudWatchLogsLogGroupArnException" +} + +// Message returns the exception's message. +func (s *InvalidCloudWatchLogsLogGroupArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidCloudWatchLogsLogGroupArnException) OrigErr() error { + return nil +} + +func (s *InvalidCloudWatchLogsLogGroupArnException) 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 *InvalidCloudWatchLogsLogGroupArnException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidCloudWatchLogsLogGroupArnException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the provided role is not valid. +type InvalidCloudWatchLogsRoleArnException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCloudWatchLogsRoleArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCloudWatchLogsRoleArnException) GoString() string { + return s.String() +} + +func newErrorInvalidCloudWatchLogsRoleArnException(v protocol.ResponseMetadata) error { + return &InvalidCloudWatchLogsRoleArnException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidCloudWatchLogsRoleArnException) Code() string { + return "InvalidCloudWatchLogsRoleArnException" +} + +// Message returns the exception's message. +func (s *InvalidCloudWatchLogsRoleArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidCloudWatchLogsRoleArnException) OrigErr() error { + return nil +} + +func (s *InvalidCloudWatchLogsRoleArnException) 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 *InvalidCloudWatchLogsRoleArnException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidCloudWatchLogsRoleArnException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Occurs if an event category that is not valid is specified as a value of +// EventCategory. +type InvalidEventCategoryException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEventCategoryException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEventCategoryException) GoString() string { + return s.String() +} + +func newErrorInvalidEventCategoryException(v protocol.ResponseMetadata) error { + return &InvalidEventCategoryException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidEventCategoryException) Code() string { + return "InvalidEventCategoryException" +} + +// Message returns the exception's message. +func (s *InvalidEventCategoryException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidEventCategoryException) OrigErr() error { + return nil +} + +func (s *InvalidEventCategoryException) 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 *InvalidEventCategoryException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidEventCategoryException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the PutEventSelectors operation is called with +// a number of event selectors or data resources that is not valid. The combination +// of event selectors and data resources is not valid. A trail can have up to +// 5 event selectors. A trail is limited to 250 data resources. These data resources +// can be distributed across event selectors, but the overall total cannot exceed +// 250. +// +// You can: +// +// * Specify a valid number of event selectors (1 to 5) for a trail. +// +// * Specify a valid number of data resources (1 to 250) for an event selector. +// The limit of number of resources on an individual event selector is configurable +// up to 250. However, this upper limit is allowed only if the total number +// of data resources does not exceed 250 across all event selectors for a +// trail. +// +// * Specify a valid value for a parameter. For example, specifying the ReadWriteType +// parameter with a value of read-only is invalid. +type InvalidEventSelectorsException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEventSelectorsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEventSelectorsException) GoString() string { + return s.String() +} + +func newErrorInvalidEventSelectorsException(v protocol.ResponseMetadata) error { + return &InvalidEventSelectorsException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidEventSelectorsException) Code() string { + return "InvalidEventSelectorsException" +} + +// Message returns the exception's message. +func (s *InvalidEventSelectorsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidEventSelectorsException) OrigErr() error { + return nil +} + +func (s *InvalidEventSelectorsException) 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 *InvalidEventSelectorsException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidEventSelectorsException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when an operation is called on a trail from a region +// other than the region in which the trail was created. +type InvalidHomeRegionException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidHomeRegionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidHomeRegionException) GoString() string { + return s.String() +} + +func newErrorInvalidHomeRegionException(v protocol.ResponseMetadata) error { + return &InvalidHomeRegionException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidHomeRegionException) Code() string { + return "InvalidHomeRegionException" +} + +// Message returns the exception's message. +func (s *InvalidHomeRegionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidHomeRegionException) OrigErr() error { + return nil +} + +func (s *InvalidHomeRegionException) 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 *InvalidHomeRegionException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidHomeRegionException) RequestID() string { + return s.RespMetadata.RequestID +} + +// The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors +// or GetInsightSelectors request is not valid, or the specified insight type +// in the InsightSelectors statement is not a valid insight type. +type InvalidInsightSelectorsException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidInsightSelectorsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInsightSelectorsException) GoString() string { + return s.String() +} + +func newErrorInvalidInsightSelectorsException(v protocol.ResponseMetadata) error { + return &InvalidInsightSelectorsException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidInsightSelectorsException) Code() string { + return "InvalidInsightSelectorsException" +} + +// Message returns the exception's message. +func (s *InvalidInsightSelectorsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidInsightSelectorsException) OrigErr() error { + return nil +} + +func (s *InvalidInsightSelectorsException) 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 *InvalidInsightSelectorsException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidInsightSelectorsException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the KMS key ARN is invalid. +type InvalidKmsKeyIdException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidKmsKeyIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidKmsKeyIdException) GoString() string { + return s.String() +} + +func newErrorInvalidKmsKeyIdException(v protocol.ResponseMetadata) error { + return &InvalidKmsKeyIdException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidKmsKeyIdException) Code() string { + return "InvalidKmsKeyIdException" +} + +// Message returns the exception's message. +func (s *InvalidKmsKeyIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidKmsKeyIdException) OrigErr() error { + return nil +} + +func (s *InvalidKmsKeyIdException) 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 *InvalidKmsKeyIdException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidKmsKeyIdException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Occurs when an invalid lookup attribute is specified. +type InvalidLookupAttributesException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidLookupAttributesException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidLookupAttributesException) GoString() string { + return s.String() +} + +func newErrorInvalidLookupAttributesException(v protocol.ResponseMetadata) error { + return &InvalidLookupAttributesException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidLookupAttributesException) Code() string { + return "InvalidLookupAttributesException" +} + +// Message returns the exception's message. +func (s *InvalidLookupAttributesException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidLookupAttributesException) OrigErr() error { + return nil +} + +func (s *InvalidLookupAttributesException) 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 *InvalidLookupAttributesException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidLookupAttributesException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown if the limit specified is invalid. +type InvalidMaxResultsException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidMaxResultsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidMaxResultsException) GoString() string { + return s.String() +} + +func newErrorInvalidMaxResultsException(v protocol.ResponseMetadata) error { + return &InvalidMaxResultsException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidMaxResultsException) Code() string { + return "InvalidMaxResultsException" +} + +// Message returns the exception's message. +func (s *InvalidMaxResultsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidMaxResultsException) OrigErr() error { + return nil +} + +func (s *InvalidMaxResultsException) 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 *InvalidMaxResultsException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidMaxResultsException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Invalid token or token that was previously used in a request with different +// parameters. This exception is thrown if the token is invalid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s *InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s *InvalidNextTokenException) 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 *InvalidNextTokenException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidNextTokenException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the combination of parameters provided is not +// valid. +type InvalidParameterCombinationException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterCombinationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterCombinationException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterCombinationException(v protocol.ResponseMetadata) error { + return &InvalidParameterCombinationException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidParameterCombinationException) Code() string { + return "InvalidParameterCombinationException" +} + +// Message returns the exception's message. +func (s *InvalidParameterCombinationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidParameterCombinationException) OrigErr() error { + return nil +} + +func (s *InvalidParameterCombinationException) 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 *InvalidParameterCombinationException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidParameterCombinationException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the provided S3 bucket name is not valid. +type InvalidS3BucketNameException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidS3BucketNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidS3BucketNameException) GoString() string { + return s.String() +} + +func newErrorInvalidS3BucketNameException(v protocol.ResponseMetadata) error { + return &InvalidS3BucketNameException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidS3BucketNameException) Code() string { + return "InvalidS3BucketNameException" +} + +// Message returns the exception's message. +func (s *InvalidS3BucketNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidS3BucketNameException) OrigErr() error { + return nil +} + +func (s *InvalidS3BucketNameException) 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 *InvalidS3BucketNameException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidS3BucketNameException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the provided S3 prefix is not valid. +type InvalidS3PrefixException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidS3PrefixException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidS3PrefixException) GoString() string { + return s.String() +} + +func newErrorInvalidS3PrefixException(v protocol.ResponseMetadata) error { + return &InvalidS3PrefixException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidS3PrefixException) Code() string { + return "InvalidS3PrefixException" +} + +// Message returns the exception's message. +func (s *InvalidS3PrefixException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidS3PrefixException) OrigErr() error { + return nil +} + +func (s *InvalidS3PrefixException) 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 *InvalidS3PrefixException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidS3PrefixException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the provided SNS topic name is not valid. +type InvalidSnsTopicNameException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidSnsTopicNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidSnsTopicNameException) GoString() string { + return s.String() +} + +func newErrorInvalidSnsTopicNameException(v protocol.ResponseMetadata) error { + return &InvalidSnsTopicNameException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidSnsTopicNameException) Code() string { + return "InvalidSnsTopicNameException" +} + +// Message returns the exception's message. +func (s *InvalidSnsTopicNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidSnsTopicNameException) OrigErr() error { + return nil +} + +func (s *InvalidSnsTopicNameException) 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 *InvalidSnsTopicNameException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidSnsTopicNameException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the specified tag key or values are not valid. +// It can also occur if there are duplicate tags or too many tags on the resource. +type InvalidTagParameterException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidTagParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTagParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidTagParameterException(v protocol.ResponseMetadata) error { + return &InvalidTagParameterException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidTagParameterException) Code() string { + return "InvalidTagParameterException" +} + +// Message returns the exception's message. +func (s *InvalidTagParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidTagParameterException) OrigErr() error { + return nil +} + +func (s *InvalidTagParameterException) 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 *InvalidTagParameterException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidTagParameterException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Occurs if the timestamp values are invalid. Either the start time occurs +// after the end time or the time range is outside the range of possible values. +type InvalidTimeRangeException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidTimeRangeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTimeRangeException) GoString() string { + return s.String() +} + +func newErrorInvalidTimeRangeException(v protocol.ResponseMetadata) error { + return &InvalidTimeRangeException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidTimeRangeException) Code() string { + return "InvalidTimeRangeException" +} + +// Message returns the exception's message. +func (s *InvalidTimeRangeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidTimeRangeException) OrigErr() error { + return nil +} + +func (s *InvalidTimeRangeException) 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 *InvalidTimeRangeException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidTimeRangeException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Reserved for future use. +type InvalidTokenException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidTokenException(v protocol.ResponseMetadata) error { + return &InvalidTokenException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidTokenException) Code() string { + return "InvalidTokenException" +} + +// Message returns the exception's message. +func (s *InvalidTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidTokenException) OrigErr() error { + return nil +} + +func (s *InvalidTokenException) 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 *InvalidTokenException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidTokenException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the provided trail name is not valid. Trail +// names must meet the following requirements: +// +// * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores +// (_), or dashes (-) +// +// * Start with a letter or number, and end with a letter or number +// +// * Be between 3 and 128 characters +// +// * Have no adjacent periods, underscores or dashes. Names like my-_namespace +// and my--namespace are invalid. +// +// * Not be in IP address format (for example, 192.168.5.4) +type InvalidTrailNameException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidTrailNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTrailNameException) GoString() string { + return s.String() +} + +func newErrorInvalidTrailNameException(v protocol.ResponseMetadata) error { + return &InvalidTrailNameException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *InvalidTrailNameException) Code() string { + return "InvalidTrailNameException" +} + +// Message returns the exception's message. +func (s *InvalidTrailNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *InvalidTrailNameException) OrigErr() error { + return nil +} + +func (s *InvalidTrailNameException) 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 *InvalidTrailNameException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *InvalidTrailNameException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when there is an issue with the specified KMS key +// and the trail can’t be updated. +type KmsException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KmsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KmsException) GoString() string { + return s.String() +} + +func newErrorKmsException(v protocol.ResponseMetadata) error { + return &KmsException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *KmsException) Code() string { + return "KmsException" +} + +// Message returns the exception's message. +func (s *KmsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *KmsException) OrigErr() error { + return nil +} + +func (s *KmsException) 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 *KmsException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *KmsException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is no longer in use. +// +// Deprecated: KmsKeyDisabledException has been deprecated +type KmsKeyDisabledException struct { + _ struct{} `deprecated:"true" type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KmsKeyDisabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KmsKeyDisabledException) GoString() string { + return s.String() +} + +func newErrorKmsKeyDisabledException(v protocol.ResponseMetadata) error { + return &KmsKeyDisabledException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *KmsKeyDisabledException) Code() string { + return "KmsKeyDisabledException" +} + +// Message returns the exception's message. +func (s *KmsKeyDisabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *KmsKeyDisabledException) OrigErr() error { + return nil +} + +func (s *KmsKeyDisabledException) 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 *KmsKeyDisabledException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *KmsKeyDisabledException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the KMS key does not exist, or when the S3 +// bucket and the KMS key are not in the same region. +type KmsKeyNotFoundException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KmsKeyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KmsKeyNotFoundException) GoString() string { + return s.String() +} + +func newErrorKmsKeyNotFoundException(v protocol.ResponseMetadata) error { + return &KmsKeyNotFoundException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *KmsKeyNotFoundException) Code() string { + return "KmsKeyNotFoundException" +} + +// Message returns the exception's message. +func (s *KmsKeyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *KmsKeyNotFoundException) OrigErr() error { + return nil +} + +func (s *KmsKeyNotFoundException) 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 *KmsKeyNotFoundException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *KmsKeyNotFoundException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Requests the public keys for a specified time range. +type ListPublicKeysInput struct { + _ struct{} `type:"structure"` + + // Optionally specifies, in UTC, the end of the time range to look up public + // keys for CloudTrail digest files. If not specified, the current time is used. + EndTime *time.Time `type:"timestamp"` + + // Reserved for future use. + NextToken *string `type:"string"` + + // Optionally specifies, in UTC, the start of the time range to look up public + // keys for CloudTrail digest files. If not specified, the current time is used, + // and the current public key is returned. + StartTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s ListPublicKeysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPublicKeysInput) GoString() string { + return s.String() +} + +// SetEndTime sets the EndTime field's value. +func (s *ListPublicKeysInput) SetEndTime(v time.Time) *ListPublicKeysInput { + s.EndTime = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPublicKeysInput) SetNextToken(v string) *ListPublicKeysInput { + s.NextToken = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ListPublicKeysInput) SetStartTime(v time.Time) *ListPublicKeysInput { + s.StartTime = &v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type ListPublicKeysOutput struct { + _ struct{} `type:"structure"` + + // Reserved for future use. + NextToken *string `type:"string"` + + // Contains an array of PublicKey objects. + // + // The returned public keys may have validity time ranges that overlap. + PublicKeyList []*PublicKey `type:"list"` +} + +// String returns the string representation +func (s ListPublicKeysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPublicKeysOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPublicKeysOutput) SetNextToken(v string) *ListPublicKeysOutput { + s.NextToken = &v + return s +} + +// SetPublicKeyList sets the PublicKeyList field's value. +func (s *ListPublicKeysOutput) SetPublicKeyList(v []*PublicKey) *ListPublicKeysOutput { + s.PublicKeyList = v + return s +} + +// Specifies a list of trail tags to return. +type ListTagsInput struct { + _ struct{} `type:"structure"` + + // Reserved for future use. + NextToken *string `type:"string"` + + // Specifies a list of trail ARNs whose tags will be listed. The list has a + // limit of 20 ARNs. The format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // ResourceIdList is a required field + ResourceIdList []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"} + if s.ResourceIdList == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceIdList")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput { + s.NextToken = &v + return s +} + +// SetResourceIdList sets the ResourceIdList field's value. +func (s *ListTagsInput) SetResourceIdList(v []*string) *ListTagsInput { + s.ResourceIdList = v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type ListTagsOutput struct { + _ struct{} `type:"structure"` + + // Reserved for future use. + NextToken *string `type:"string"` + + // A list of resource tags. + ResourceTagList []*ResourceTag `type:"list"` +} + +// String returns the string representation +func (s ListTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTagsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput { + s.NextToken = &v + return s +} + +// SetResourceTagList sets the ResourceTagList field's value. +func (s *ListTagsOutput) SetResourceTagList(v []*ResourceTag) *ListTagsOutput { + s.ResourceTagList = v + return s +} + +type ListTrailsInput struct { + _ struct{} `type:"structure"` + + // The token to use to get the next page of results after a previous API call. + // This token must be passed in with the same parameters that were specified + // in the the original call. For example, if the original call specified an + // AttributeKey of 'Username' with a value of 'root', the call with NextToken + // should include those same parameters. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListTrailsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrailsInput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTrailsInput) SetNextToken(v string) *ListTrailsInput { + s.NextToken = &v + return s +} + +type ListTrailsOutput struct { + _ struct{} `type:"structure"` + + // The token to use to get the next page of results after a previous API call. + // If the token does not appear, there are no more results to return. The token + // must be passed in with the same parameters as the previous call. For example, + // if the original call specified an AttributeKey of 'Username' with a value + // of 'root', the call with NextToken should include those same parameters. + NextToken *string `type:"string"` + + // Returns the name, ARN, and home region of trails in the current account. + Trails []*TrailInfo `type:"list"` +} + +// String returns the string representation +func (s ListTrailsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrailsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTrailsOutput) SetNextToken(v string) *ListTrailsOutput { + s.NextToken = &v + return s +} + +// SetTrails sets the Trails field's value. +func (s *ListTrailsOutput) SetTrails(v []*TrailInfo) *ListTrailsOutput { + s.Trails = v + return s +} + +// Specifies an attribute and value that filter the events returned. +type LookupAttribute struct { + _ struct{} `type:"structure"` + + // Specifies an attribute on which to filter the events returned. + // + // AttributeKey is a required field + AttributeKey *string `type:"string" required:"true" enum:"LookupAttributeKey"` + + // Specifies a value for the specified AttributeKey. + // + // AttributeValue is a required field + AttributeValue *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s LookupAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LookupAttribute) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LookupAttribute) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LookupAttribute"} + if s.AttributeKey == nil { + invalidParams.Add(request.NewErrParamRequired("AttributeKey")) + } + if s.AttributeValue == nil { + invalidParams.Add(request.NewErrParamRequired("AttributeValue")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAttributeKey sets the AttributeKey field's value. +func (s *LookupAttribute) SetAttributeKey(v string) *LookupAttribute { + s.AttributeKey = &v + return s +} + +// SetAttributeValue sets the AttributeValue field's value. +func (s *LookupAttribute) SetAttributeValue(v string) *LookupAttribute { + s.AttributeValue = &v + return s +} + +// Contains a request for LookupEvents. +type LookupEventsInput struct { + _ struct{} `type:"structure"` + + // Specifies that only events that occur before or at the specified time are + // returned. If the specified end time is before the specified start time, an + // error is returned. + EndTime *time.Time `type:"timestamp"` + + // Specifies the event category. If you do not specify an event category, events + // of the category are not returned in the response. For example, if you do + // not specify insight as the value of EventCategory, no Insights events are + // returned. + EventCategory *string `type:"string" enum:"EventCategory"` + + // Contains a list of lookup attributes. Currently the list can contain only + // one item. + LookupAttributes []*LookupAttribute `type:"list"` + + // The number of events to return. Possible values are 1 through 50. The default + // is 50. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to get the next page of results after a previous API call. + // This token must be passed in with the same parameters that were specified + // in the the original call. For example, if the original call specified an + // AttributeKey of 'Username' with a value of 'root', the call with NextToken + // should include those same parameters. + NextToken *string `type:"string"` + + // Specifies that only events that occur after or at the specified time are + // returned. If the specified start time is after the specified end time, an + // error is returned. + StartTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s LookupEventsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LookupEventsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LookupEventsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LookupEventsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.LookupAttributes != nil { + for i, v := range s.LookupAttributes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LookupAttributes", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndTime sets the EndTime field's value. +func (s *LookupEventsInput) SetEndTime(v time.Time) *LookupEventsInput { + s.EndTime = &v + return s +} + +// SetEventCategory sets the EventCategory field's value. +func (s *LookupEventsInput) SetEventCategory(v string) *LookupEventsInput { + s.EventCategory = &v + return s +} + +// SetLookupAttributes sets the LookupAttributes field's value. +func (s *LookupEventsInput) SetLookupAttributes(v []*LookupAttribute) *LookupEventsInput { + s.LookupAttributes = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *LookupEventsInput) SetMaxResults(v int64) *LookupEventsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *LookupEventsInput) SetNextToken(v string) *LookupEventsInput { + s.NextToken = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *LookupEventsInput) SetStartTime(v time.Time) *LookupEventsInput { + s.StartTime = &v + return s +} + +// Contains a response to a LookupEvents action. +type LookupEventsOutput struct { + _ struct{} `type:"structure"` + + // A list of events returned based on the lookup attributes specified and the + // CloudTrail event. The events list is sorted by time. The most recent event + // is listed first. + Events []*Event `type:"list"` + + // The token to use to get the next page of results after a previous API call. + // If the token does not appear, there are no more results to return. The token + // must be passed in with the same parameters as the previous call. For example, + // if the original call specified an AttributeKey of 'Username' with a value + // of 'root', the call with NextToken should include those same parameters. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s LookupEventsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LookupEventsOutput) GoString() string { + return s.String() +} + +// SetEvents sets the Events field's value. +func (s *LookupEventsOutput) SetEvents(v []*Event) *LookupEventsOutput { + s.Events = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *LookupEventsOutput) SetNextToken(v string) *LookupEventsOutput { + s.NextToken = &v + return s +} + +// This exception is thrown when the maximum number of trails is reached. +type MaximumNumberOfTrailsExceededException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MaximumNumberOfTrailsExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MaximumNumberOfTrailsExceededException) GoString() string { + return s.String() +} + +func newErrorMaximumNumberOfTrailsExceededException(v protocol.ResponseMetadata) error { + return &MaximumNumberOfTrailsExceededException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *MaximumNumberOfTrailsExceededException) Code() string { + return "MaximumNumberOfTrailsExceededException" +} + +// Message returns the exception's message. +func (s *MaximumNumberOfTrailsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *MaximumNumberOfTrailsExceededException) OrigErr() error { + return nil +} + +func (s *MaximumNumberOfTrailsExceededException) 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 *MaximumNumberOfTrailsExceededException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *MaximumNumberOfTrailsExceededException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +type NotOrganizationMasterAccountException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotOrganizationMasterAccountException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotOrganizationMasterAccountException) GoString() string { + return s.String() +} + +func newErrorNotOrganizationMasterAccountException(v protocol.ResponseMetadata) error { + return &NotOrganizationMasterAccountException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *NotOrganizationMasterAccountException) Code() string { + return "NotOrganizationMasterAccountException" +} + +// Message returns the exception's message. +func (s *NotOrganizationMasterAccountException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *NotOrganizationMasterAccountException) OrigErr() error { + return nil +} + +func (s *NotOrganizationMasterAccountException) 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 *NotOrganizationMasterAccountException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *NotOrganizationMasterAccountException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the requested operation is not permitted. +type OperationNotPermittedException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OperationNotPermittedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationNotPermittedException) GoString() string { + return s.String() +} + +func newErrorOperationNotPermittedException(v protocol.ResponseMetadata) error { + return &OperationNotPermittedException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *OperationNotPermittedException) Code() string { + return "OperationNotPermittedException" +} + +// Message returns the exception's message. +func (s *OperationNotPermittedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *OperationNotPermittedException) OrigErr() error { + return nil +} + +func (s *OperationNotPermittedException) 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 *OperationNotPermittedException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *OperationNotPermittedException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when AWS Organizations is not configured to support +// all features. All features must be enabled in AWS Organization to support +// creating an organization trail. For more information, see Prepare For Creating +// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +type OrganizationNotInAllFeaturesModeException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OrganizationNotInAllFeaturesModeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationNotInAllFeaturesModeException) GoString() string { + return s.String() +} + +func newErrorOrganizationNotInAllFeaturesModeException(v protocol.ResponseMetadata) error { + return &OrganizationNotInAllFeaturesModeException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *OrganizationNotInAllFeaturesModeException) Code() string { + return "OrganizationNotInAllFeaturesModeException" +} + +// Message returns the exception's message. +func (s *OrganizationNotInAllFeaturesModeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *OrganizationNotInAllFeaturesModeException) OrigErr() error { + return nil +} + +func (s *OrganizationNotInAllFeaturesModeException) 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 *OrganizationNotInAllFeaturesModeException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *OrganizationNotInAllFeaturesModeException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the request is made from an AWS account that +// is not a member of an organization. To make this request, sign in using the +// credentials of an account that belongs to an organization. +type OrganizationsNotInUseException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OrganizationsNotInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationsNotInUseException) GoString() string { + return s.String() +} + +func newErrorOrganizationsNotInUseException(v protocol.ResponseMetadata) error { + return &OrganizationsNotInUseException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *OrganizationsNotInUseException) Code() string { + return "OrganizationsNotInUseException" +} + +// Message returns the exception's message. +func (s *OrganizationsNotInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *OrganizationsNotInUseException) OrigErr() error { + return nil +} + +func (s *OrganizationsNotInUseException) 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 *OrganizationsNotInUseException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *OrganizationsNotInUseException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Contains information about a returned public key. +type PublicKey struct { + _ struct{} `type:"structure"` + + // The fingerprint of the public key. + Fingerprint *string `type:"string"` + + // The ending time of validity of the public key. + ValidityEndTime *time.Time `type:"timestamp"` + + // The starting time of validity of the public key. + ValidityStartTime *time.Time `type:"timestamp"` + + // The DER encoded public key value in PKCS#1 format. + // + // Value is automatically base64 encoded/decoded by the SDK. + Value []byte `type:"blob"` +} + +// String returns the string representation +func (s PublicKey) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PublicKey) GoString() string { + return s.String() +} + +// SetFingerprint sets the Fingerprint field's value. +func (s *PublicKey) SetFingerprint(v string) *PublicKey { + s.Fingerprint = &v + return s +} + +// SetValidityEndTime sets the ValidityEndTime field's value. +func (s *PublicKey) SetValidityEndTime(v time.Time) *PublicKey { + s.ValidityEndTime = &v + return s +} + +// SetValidityStartTime sets the ValidityStartTime field's value. +func (s *PublicKey) SetValidityStartTime(v time.Time) *PublicKey { + s.ValidityStartTime = &v + return s +} + +// SetValue sets the Value field's value. +func (s *PublicKey) SetValue(v []byte) *PublicKey { + s.Value = v + return s +} + +type PutEventSelectorsInput struct { + _ struct{} `type:"structure"` + + // Specifies the settings for your event selectors. You can configure up to + // five event selectors for a trail. + // + // EventSelectors is a required field + EventSelectors []*EventSelector `type:"list" required:"true"` + + // Specifies the name of the trail or trail ARN. If you specify a trail name, + // the string must meet the following requirements: + // + // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores + // (_), or dashes (-) + // + // * Start with a letter or number, and end with a letter or number + // + // * Be between 3 and 128 characters + // + // * Have no adjacent periods, underscores or dashes. Names like my-_namespace + // and my--namespace are invalid. + // + // * Not be in IP address format (for example, 192.168.5.4) + // + // If you specify a trail ARN, it must be in the format: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s PutEventSelectorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutEventSelectorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutEventSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutEventSelectorsInput"} + if s.EventSelectors == nil { + invalidParams.Add(request.NewErrParamRequired("EventSelectors")) + } + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventSelectors sets the EventSelectors field's value. +func (s *PutEventSelectorsInput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsInput { + s.EventSelectors = v + return s +} + +// SetTrailName sets the TrailName field's value. +func (s *PutEventSelectorsInput) SetTrailName(v string) *PutEventSelectorsInput { + s.TrailName = &v + return s +} + +type PutEventSelectorsOutput struct { + _ struct{} `type:"structure"` + + // Specifies the event selectors configured for your trail. + EventSelectors []*EventSelector `type:"list"` + + // Specifies the ARN of the trail that was updated with event selectors. The + // format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s PutEventSelectorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutEventSelectorsOutput) GoString() string { + return s.String() +} + +// SetEventSelectors sets the EventSelectors field's value. +func (s *PutEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsOutput { + s.EventSelectors = v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *PutEventSelectorsOutput) SetTrailARN(v string) *PutEventSelectorsOutput { + s.TrailARN = &v + return s +} + +type PutInsightSelectorsInput struct { + _ struct{} `type:"structure"` + + // A JSON string that contains the insight types you want to log on a trail. + // In this release, only ApiCallRateInsight is supported as an insight type. + // + // InsightSelectors is a required field + InsightSelectors []*InsightSelector `type:"list" required:"true"` + + // The name of the CloudTrail trail for which you want to change or add Insights + // selectors. + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s PutInsightSelectorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutInsightSelectorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutInsightSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutInsightSelectorsInput"} + if s.InsightSelectors == nil { + invalidParams.Add(request.NewErrParamRequired("InsightSelectors")) + } + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInsightSelectors sets the InsightSelectors field's value. +func (s *PutInsightSelectorsInput) SetInsightSelectors(v []*InsightSelector) *PutInsightSelectorsInput { + s.InsightSelectors = v + return s +} + +// SetTrailName sets the TrailName field's value. +func (s *PutInsightSelectorsInput) SetTrailName(v string) *PutInsightSelectorsInput { + s.TrailName = &v + return s +} + +type PutInsightSelectorsOutput struct { + _ struct{} `type:"structure"` + + // A JSON string that contains the insight types you want to log on a trail. + // In this release, only ApiCallRateInsight is supported as an insight type. + InsightSelectors []*InsightSelector `type:"list"` + + // The Amazon Resource Name (ARN) of a trail for which you want to change or + // add Insights selectors. + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s PutInsightSelectorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutInsightSelectorsOutput) GoString() string { + return s.String() +} + +// SetInsightSelectors sets the InsightSelectors field's value. +func (s *PutInsightSelectorsOutput) SetInsightSelectors(v []*InsightSelector) *PutInsightSelectorsOutput { + s.InsightSelectors = v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *PutInsightSelectorsOutput) SetTrailARN(v string) *PutInsightSelectorsOutput { + s.TrailARN = &v + return s +} + +// Specifies the tags to remove from a trail. +type RemoveTagsInput struct { + _ struct{} `type:"structure"` + + // Specifies the ARN of the trail from which tags should be removed. The format + // of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // ResourceId is a required field + ResourceId *string `type:"string" required:"true"` + + // Specifies a list of tags to be removed. + TagsList []*Tag `type:"list"` +} + +// String returns the string representation +func (s RemoveTagsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTagsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RemoveTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + if s.TagsList != nil { + for i, v := range s.TagsList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceId sets the ResourceId field's value. +func (s *RemoveTagsInput) SetResourceId(v string) *RemoveTagsInput { + s.ResourceId = &v + return s +} + +// SetTagsList sets the TagsList field's value. +func (s *RemoveTagsInput) SetTagsList(v []*Tag) *RemoveTagsInput { + s.TagsList = v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type RemoveTagsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RemoveTagsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemoveTagsOutput) GoString() string { + return s.String() +} + +// Specifies the type and name of a resource referenced by an event. +type Resource struct { + _ struct{} `type:"structure"` + + // The name of the resource referenced by the event returned. These are user-created + // names whose values will depend on the environment. For example, the resource + // name might be "auto-scaling-test-group" for an Auto Scaling Group or "i-1234567" + // for an EC2 Instance. + ResourceName *string `type:"string"` + + // The type of a resource referenced by the event returned. When the resource + // type cannot be determined, null is returned. Some examples of resource types + // are: Instance for EC2, Trail for CloudTrail, DBInstance for RDS, and AccessKey + // for IAM. To learn more about how to look up and filter events by the resource + // types supported for a service, see Filtering CloudTrail Events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-console.html#filtering-cloudtrail-events). + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s Resource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Resource) GoString() string { + return s.String() +} + +// SetResourceName sets the ResourceName field's value. +func (s *Resource) SetResourceName(v string) *Resource { + s.ResourceName = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *Resource) SetResourceType(v string) *Resource { + s.ResourceType = &v + return s +} + +// This exception is thrown when the specified resource is not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +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 +} + +// A resource tag. +type ResourceTag struct { + _ struct{} `type:"structure"` + + // Specifies the ARN of the resource. + ResourceId *string `type:"string"` + + // A list of tags. + TagsList []*Tag `type:"list"` +} + +// String returns the string representation +func (s ResourceTag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceTag) GoString() string { + return s.String() +} + +// SetResourceId sets the ResourceId field's value. +func (s *ResourceTag) SetResourceId(v string) *ResourceTag { + s.ResourceId = &v + return s +} + +// SetTagsList sets the TagsList field's value. +func (s *ResourceTag) SetTagsList(v []*Tag) *ResourceTag { + s.TagsList = v + return s +} + +// This exception is thrown when the specified resource type is not supported +// by CloudTrail. +type ResourceTypeNotSupportedException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceTypeNotSupportedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceTypeNotSupportedException) GoString() string { + return s.String() +} + +func newErrorResourceTypeNotSupportedException(v protocol.ResponseMetadata) error { + return &ResourceTypeNotSupportedException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *ResourceTypeNotSupportedException) Code() string { + return "ResourceTypeNotSupportedException" +} + +// Message returns the exception's message. +func (s *ResourceTypeNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *ResourceTypeNotSupportedException) OrigErr() error { + return nil +} + +func (s *ResourceTypeNotSupportedException) 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 *ResourceTypeNotSupportedException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *ResourceTypeNotSupportedException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the specified S3 bucket does not exist. +type S3BucketDoesNotExistException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s S3BucketDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3BucketDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorS3BucketDoesNotExistException(v protocol.ResponseMetadata) error { + return &S3BucketDoesNotExistException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *S3BucketDoesNotExistException) Code() string { + return "S3BucketDoesNotExistException" +} + +// Message returns the exception's message. +func (s *S3BucketDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *S3BucketDoesNotExistException) OrigErr() error { + return nil +} + +func (s *S3BucketDoesNotExistException) 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 *S3BucketDoesNotExistException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *S3BucketDoesNotExistException) RequestID() string { + return s.RespMetadata.RequestID +} + +// The request to CloudTrail to start logging AWS API calls for an account. +type StartLoggingInput struct { + _ struct{} `type:"structure"` + + // Specifies the name or the CloudTrail ARN of the trail for which CloudTrail + // logs AWS API calls. The format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // Name is a required field + Name *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StartLoggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartLoggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartLoggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartLoggingInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *StartLoggingInput) SetName(v string) *StartLoggingInput { + s.Name = &v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type StartLoggingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s StartLoggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartLoggingOutput) GoString() string { + return s.String() +} + +// Passes the request to CloudTrail to stop logging AWS API calls for the specified +// account. +type StopLoggingInput struct { + _ struct{} `type:"structure"` + + // Specifies the name or the CloudTrail ARN of the trail for which CloudTrail + // will stop logging AWS API calls. The format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // Name is a required field + Name *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StopLoggingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopLoggingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopLoggingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopLoggingInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *StopLoggingInput) SetName(v string) *StopLoggingInput { + s.Name = &v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type StopLoggingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s StopLoggingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopLoggingOutput) GoString() string { + return s.String() +} + +// A custom key-value pair associated with a resource such as a CloudTrail trail. +type Tag struct { + _ struct{} `type:"structure"` + + // The key in a key-value pair. The key must be must be no longer than 128 Unicode + // characters. The key must be unique for the resource to which it applies. + // + // Key is a required field + Key *string `type:"string" required:"true"` + + // The value in a key-value pair of a tag. The value must be no longer than + // 256 Unicode characters. + Value *string `type:"string"` +} + +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v + return s +} + +// The number of tags per trail has exceeded the permitted amount. Currently, +// the limit is 50. +type TagsLimitExceededException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagsLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagsLimitExceededException) GoString() string { + return s.String() +} + +func newErrorTagsLimitExceededException(v protocol.ResponseMetadata) error { + return &TagsLimitExceededException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *TagsLimitExceededException) Code() string { + return "TagsLimitExceededException" +} + +// Message returns the exception's message. +func (s *TagsLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *TagsLimitExceededException) OrigErr() error { + return nil +} + +func (s *TagsLimitExceededException) 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 *TagsLimitExceededException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *TagsLimitExceededException) RequestID() string { + return s.RespMetadata.RequestID +} + +// The settings for a trail. +type Trail struct { + _ struct{} `type:"structure"` + + // Specifies an Amazon Resource Name (ARN), a unique identifier that represents + // the log group to which CloudTrail logs will be delivered. + CloudWatchLogsLogGroupArn *string `type:"string"` + + // Specifies the role for the CloudWatch Logs endpoint to assume to write to + // a user's log group. + CloudWatchLogsRoleArn *string `type:"string"` + + // Specifies if the trail has custom event selectors. + HasCustomEventSelectors *bool `type:"boolean"` + + // Specifies whether a trail has insight types specified in an InsightSelector + // list. + HasInsightSelectors *bool `type:"boolean"` + + // The region in which the trail was created. + HomeRegion *string `type:"string"` + + // Set to True to include AWS API calls from AWS global services such as IAM. + // Otherwise, False. + IncludeGlobalServiceEvents *bool `type:"boolean"` + + // Specifies whether the trail exists only in one region or exists in all regions. + IsMultiRegionTrail *bool `type:"boolean"` + + // Specifies whether the trail is an organization trail. + IsOrganizationTrail *bool `type:"boolean"` + + // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. + // The value is a fully specified ARN to a KMS key in the format: + // + // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 + KmsKeyId *string `type:"string"` + + // Specifies whether log file validation is enabled. + LogFileValidationEnabled *bool `type:"boolean"` + + // Name of the trail set by calling CreateTrail. The maximum length is 128 characters. + Name *string `type:"string"` + + // Name of the Amazon S3 bucket into which CloudTrail delivers your trail files. + // See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). + S3BucketName *string `type:"string"` + + // Specifies the Amazon S3 key prefix that comes after the name of the bucket + // you have designated for log file delivery. For more information, see Finding + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).The + // maximum length is 200 characters. + S3KeyPrefix *string `type:"string"` + + // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications + // when log files are delivered. The format of a topic ARN is: + // + // arn:aws:sns:us-east-2:123456789012:MyTopic + SnsTopicARN *string `type:"string"` + + // This field is no longer in use. Use SnsTopicARN. + // + // Deprecated: SnsTopicName has been deprecated + SnsTopicName *string `deprecated:"true" type:"string"` + + // Specifies the ARN of the trail. The format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s Trail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Trail) GoString() string { + return s.String() +} + +// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. +func (s *Trail) SetCloudWatchLogsLogGroupArn(v string) *Trail { + s.CloudWatchLogsLogGroupArn = &v + return s +} + +// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. +func (s *Trail) SetCloudWatchLogsRoleArn(v string) *Trail { + s.CloudWatchLogsRoleArn = &v + return s +} + +// SetHasCustomEventSelectors sets the HasCustomEventSelectors field's value. +func (s *Trail) SetHasCustomEventSelectors(v bool) *Trail { + s.HasCustomEventSelectors = &v + return s +} + +// SetHasInsightSelectors sets the HasInsightSelectors field's value. +func (s *Trail) SetHasInsightSelectors(v bool) *Trail { + s.HasInsightSelectors = &v + return s +} + +// SetHomeRegion sets the HomeRegion field's value. +func (s *Trail) SetHomeRegion(v string) *Trail { + s.HomeRegion = &v + return s +} + +// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. +func (s *Trail) SetIncludeGlobalServiceEvents(v bool) *Trail { + s.IncludeGlobalServiceEvents = &v + return s +} + +// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. +func (s *Trail) SetIsMultiRegionTrail(v bool) *Trail { + s.IsMultiRegionTrail = &v + return s +} + +// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. +func (s *Trail) SetIsOrganizationTrail(v bool) *Trail { + s.IsOrganizationTrail = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *Trail) SetKmsKeyId(v string) *Trail { + s.KmsKeyId = &v + return s +} + +// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. +func (s *Trail) SetLogFileValidationEnabled(v bool) *Trail { + s.LogFileValidationEnabled = &v + return s +} + +// SetName sets the Name field's value. +func (s *Trail) SetName(v string) *Trail { + s.Name = &v + return s +} + +// SetS3BucketName sets the S3BucketName field's value. +func (s *Trail) SetS3BucketName(v string) *Trail { + s.S3BucketName = &v + return s +} + +// SetS3KeyPrefix sets the S3KeyPrefix field's value. +func (s *Trail) SetS3KeyPrefix(v string) *Trail { + s.S3KeyPrefix = &v + return s +} + +// SetSnsTopicARN sets the SnsTopicARN field's value. +func (s *Trail) SetSnsTopicARN(v string) *Trail { + s.SnsTopicARN = &v + return s +} + +// SetSnsTopicName sets the SnsTopicName field's value. +func (s *Trail) SetSnsTopicName(v string) *Trail { + s.SnsTopicName = &v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *Trail) SetTrailARN(v string) *Trail { + s.TrailARN = &v + return s +} + +// This exception is thrown when the specified trail already exists. +type TrailAlreadyExistsException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TrailAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrailAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorTrailAlreadyExistsException(v protocol.ResponseMetadata) error { + return &TrailAlreadyExistsException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *TrailAlreadyExistsException) Code() string { + return "TrailAlreadyExistsException" +} + +// Message returns the exception's message. +func (s *TrailAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *TrailAlreadyExistsException) OrigErr() error { + return nil +} + +func (s *TrailAlreadyExistsException) 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 *TrailAlreadyExistsException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *TrailAlreadyExistsException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Information about a CloudTrail trail, including the trail's name, home region, +// and Amazon Resource Name (ARN). +type TrailInfo struct { + _ struct{} `type:"structure"` + + // The AWS region in which a trail was created. + HomeRegion *string `type:"string"` + + // The name of a trail. + Name *string `type:"string"` + + // The ARN of a trail. + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s TrailInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrailInfo) GoString() string { + return s.String() +} + +// SetHomeRegion sets the HomeRegion field's value. +func (s *TrailInfo) SetHomeRegion(v string) *TrailInfo { + s.HomeRegion = &v + return s +} + +// SetName sets the Name field's value. +func (s *TrailInfo) SetName(v string) *TrailInfo { + s.Name = &v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *TrailInfo) SetTrailARN(v string) *TrailInfo { + s.TrailARN = &v + return s +} + +// This exception is thrown when the trail with the given name is not found. +type TrailNotFoundException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TrailNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrailNotFoundException) GoString() string { + return s.String() +} + +func newErrorTrailNotFoundException(v protocol.ResponseMetadata) error { + return &TrailNotFoundException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *TrailNotFoundException) Code() string { + return "TrailNotFoundException" +} + +// Message returns the exception's message. +func (s *TrailNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *TrailNotFoundException) OrigErr() error { + return nil +} + +func (s *TrailNotFoundException) 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 *TrailNotFoundException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *TrailNotFoundException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is no longer in use. +type TrailNotProvidedException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TrailNotProvidedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrailNotProvidedException) GoString() string { + return s.String() +} + +func newErrorTrailNotProvidedException(v protocol.ResponseMetadata) error { + return &TrailNotProvidedException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *TrailNotProvidedException) Code() string { + return "TrailNotProvidedException" +} + +// Message returns the exception's message. +func (s *TrailNotProvidedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *TrailNotProvidedException) OrigErr() error { + return nil +} + +func (s *TrailNotProvidedException) 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 *TrailNotProvidedException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *TrailNotProvidedException) RequestID() string { + return s.RespMetadata.RequestID +} + +// This exception is thrown when the requested operation is not supported. +type UnsupportedOperationException struct { + _ struct{} `type:"structure"` + RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { + return &UnsupportedOperationException{ + RespMetadata: v, + } +} + +// Code returns the exception type name. +func (s *UnsupportedOperationException) Code() string { + return "UnsupportedOperationException" +} + +// Message returns the exception's message. +func (s *UnsupportedOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s *UnsupportedOperationException) OrigErr() error { + return nil +} + +func (s *UnsupportedOperationException) 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 *UnsupportedOperationException) StatusCode() int { + return s.RespMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s *UnsupportedOperationException) RequestID() string { + return s.RespMetadata.RequestID +} + +// Specifies settings to update for the trail. +type UpdateTrailInput struct { + _ struct{} `type:"structure"` + + // Specifies a log group name using an Amazon Resource Name (ARN), a unique + // identifier that represents the log group to which CloudTrail logs will be + // delivered. Not required unless you specify CloudWatchLogsRoleArn. + CloudWatchLogsLogGroupArn *string `type:"string"` + + // Specifies the role for the CloudWatch Logs endpoint to assume to write to + // a user's log group. + CloudWatchLogsRoleArn *string `type:"string"` + + // Specifies whether log file validation is enabled. The default is false. + // + // When you disable log file integrity validation, the chain of digest files + // is broken after one hour. CloudTrail will not create digest files for log + // files that were delivered during a period in which log file integrity validation + // was disabled. For example, if you enable log file integrity validation at + // noon on January 1, disable it at noon on January 2, and re-enable it at noon + // on January 10, digest files will not be created for the log files delivered + // from noon on January 2 to noon on January 10. The same applies whenever you + // stop CloudTrail logging or delete a trail. + EnableLogFileValidation *bool `type:"boolean"` + + // Specifies whether the trail is publishing events from global services such + // as IAM to the log files. + IncludeGlobalServiceEvents *bool `type:"boolean"` + + // Specifies whether the trail applies only to the current region or to all + // regions. The default is false. If the trail exists only in the current region + // and this value is set to true, shadow trails (replications of the trail) + // will be created in the other regions. If the trail exists in all regions + // and this value is set to false, the trail will remain in the region where + // it was created, and its shadow trails in other regions will be deleted. As + // a best practice, consider using trails that log events in all regions. + IsMultiRegionTrail *bool `type:"boolean"` + + // Specifies whether the trail is applied to all accounts in an organization + // in AWS Organizations, or only for the current AWS account. The default is + // false, and cannot be true unless the call is made on behalf of an AWS account + // that is the master account for an organization in AWS Organizations. If the + // trail is not an organization trail and this is set to true, the trail will + // be created in all AWS accounts that belong to the organization. If the trail + // is an organization trail and this is set to false, the trail will remain + // in the current AWS account but be deleted from all member accounts in the + // organization. + IsOrganizationTrail *bool `type:"boolean"` + + // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. + // The value can be an alias name prefixed by "alias/", a fully specified ARN + // to an alias, a fully specified ARN to a key, or a globally unique identifier. + // + // Examples: + // + // * alias/MyAliasName + // + // * arn:aws:kms:us-east-2:123456789012:alias/MyAliasName + // + // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 + // + // * 12345678-1234-1234-1234-123456789012 + KmsKeyId *string `type:"string"` + + // Specifies the name of the trail or trail ARN. If Name is a trail name, the + // string must meet the following requirements: + // + // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores + // (_), or dashes (-) + // + // * Start with a letter or number, and end with a letter or number + // + // * Be between 3 and 128 characters + // + // * Have no adjacent periods, underscores or dashes. Names like my-_namespace + // and my--namespace are invalid. + // + // * Not be in IP address format (for example, 192.168.5.4) + // + // If Name is a trail ARN, it must be in the format: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // Specifies the name of the Amazon S3 bucket designated for publishing log + // files. See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). + S3BucketName *string `type:"string"` + + // Specifies the Amazon S3 key prefix that comes after the name of the bucket + // you have designated for log file delivery. For more information, see Finding + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + // The maximum length is 200 characters. + S3KeyPrefix *string `type:"string"` + + // Specifies the name of the Amazon SNS topic defined for notification of log + // file delivery. The maximum length is 256 characters. + SnsTopicName *string `type:"string"` +} + +// String returns the string representation +func (s UpdateTrailInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrailInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTrailInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTrailInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. +func (s *UpdateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *UpdateTrailInput { + s.CloudWatchLogsLogGroupArn = &v + return s +} + +// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. +func (s *UpdateTrailInput) SetCloudWatchLogsRoleArn(v string) *UpdateTrailInput { + s.CloudWatchLogsRoleArn = &v + return s +} + +// SetEnableLogFileValidation sets the EnableLogFileValidation field's value. +func (s *UpdateTrailInput) SetEnableLogFileValidation(v bool) *UpdateTrailInput { + s.EnableLogFileValidation = &v + return s +} + +// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. +func (s *UpdateTrailInput) SetIncludeGlobalServiceEvents(v bool) *UpdateTrailInput { + s.IncludeGlobalServiceEvents = &v + return s +} + +// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. +func (s *UpdateTrailInput) SetIsMultiRegionTrail(v bool) *UpdateTrailInput { + s.IsMultiRegionTrail = &v + return s +} + +// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. +func (s *UpdateTrailInput) SetIsOrganizationTrail(v bool) *UpdateTrailInput { + s.IsOrganizationTrail = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *UpdateTrailInput) SetKmsKeyId(v string) *UpdateTrailInput { + s.KmsKeyId = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateTrailInput) SetName(v string) *UpdateTrailInput { + s.Name = &v + return s +} + +// SetS3BucketName sets the S3BucketName field's value. +func (s *UpdateTrailInput) SetS3BucketName(v string) *UpdateTrailInput { + s.S3BucketName = &v + return s +} + +// SetS3KeyPrefix sets the S3KeyPrefix field's value. +func (s *UpdateTrailInput) SetS3KeyPrefix(v string) *UpdateTrailInput { + s.S3KeyPrefix = &v + return s +} + +// SetSnsTopicName sets the SnsTopicName field's value. +func (s *UpdateTrailInput) SetSnsTopicName(v string) *UpdateTrailInput { + s.SnsTopicName = &v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +type UpdateTrailOutput struct { + _ struct{} `type:"structure"` + + // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail + // logs will be delivered. + CloudWatchLogsLogGroupArn *string `type:"string"` + + // Specifies the role for the CloudWatch Logs endpoint to assume to write to + // a user's log group. + CloudWatchLogsRoleArn *string `type:"string"` + + // Specifies whether the trail is publishing events from global services such + // as IAM to the log files. + IncludeGlobalServiceEvents *bool `type:"boolean"` + + // Specifies whether the trail exists in one region or in all regions. + IsMultiRegionTrail *bool `type:"boolean"` + + // Specifies whether the trail is an organization trail. + IsOrganizationTrail *bool `type:"boolean"` + + // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. + // The value is a fully specified ARN to a KMS key in the format: + // + // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 + KmsKeyId *string `type:"string"` + + // Specifies whether log file integrity validation is enabled. + LogFileValidationEnabled *bool `type:"boolean"` + + // Specifies the name of the trail. + Name *string `type:"string"` + + // Specifies the name of the Amazon S3 bucket designated for publishing log + // files. + S3BucketName *string `type:"string"` + + // Specifies the Amazon S3 key prefix that comes after the name of the bucket + // you have designated for log file delivery. For more information, see Finding + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). + S3KeyPrefix *string `type:"string"` + + // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications + // when log files are delivered. The format of a topic ARN is: + // + // arn:aws:sns:us-east-2:123456789012:MyTopic + SnsTopicARN *string `type:"string"` + + // This field is no longer in use. Use SnsTopicARN. + // + // Deprecated: SnsTopicName has been deprecated + SnsTopicName *string `deprecated:"true" type:"string"` + + // Specifies the ARN of the trail that was updated. The format of a trail ARN + // is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s UpdateTrailOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrailOutput) GoString() string { + return s.String() +} + +// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. +func (s *UpdateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *UpdateTrailOutput { + s.CloudWatchLogsLogGroupArn = &v + return s +} + +// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. +func (s *UpdateTrailOutput) SetCloudWatchLogsRoleArn(v string) *UpdateTrailOutput { + s.CloudWatchLogsRoleArn = &v + return s +} + +// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. +func (s *UpdateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *UpdateTrailOutput { + s.IncludeGlobalServiceEvents = &v + return s +} + +// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. +func (s *UpdateTrailOutput) SetIsMultiRegionTrail(v bool) *UpdateTrailOutput { + s.IsMultiRegionTrail = &v + return s +} + +// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. +func (s *UpdateTrailOutput) SetIsOrganizationTrail(v bool) *UpdateTrailOutput { + s.IsOrganizationTrail = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *UpdateTrailOutput) SetKmsKeyId(v string) *UpdateTrailOutput { + s.KmsKeyId = &v + return s +} + +// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. +func (s *UpdateTrailOutput) SetLogFileValidationEnabled(v bool) *UpdateTrailOutput { + s.LogFileValidationEnabled = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateTrailOutput) SetName(v string) *UpdateTrailOutput { + s.Name = &v + return s +} + +// SetS3BucketName sets the S3BucketName field's value. +func (s *UpdateTrailOutput) SetS3BucketName(v string) *UpdateTrailOutput { + s.S3BucketName = &v + return s +} + +// SetS3KeyPrefix sets the S3KeyPrefix field's value. +func (s *UpdateTrailOutput) SetS3KeyPrefix(v string) *UpdateTrailOutput { + s.S3KeyPrefix = &v + return s +} + +// SetSnsTopicARN sets the SnsTopicARN field's value. +func (s *UpdateTrailOutput) SetSnsTopicARN(v string) *UpdateTrailOutput { + s.SnsTopicARN = &v + return s +} + +// SetSnsTopicName sets the SnsTopicName field's value. +func (s *UpdateTrailOutput) SetSnsTopicName(v string) *UpdateTrailOutput { + s.SnsTopicName = &v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *UpdateTrailOutput) SetTrailARN(v string) *UpdateTrailOutput { + s.TrailARN = &v + return s +} + +const ( + // EventCategoryInsight is a EventCategory enum value + EventCategoryInsight = "insight" +) + +const ( + // InsightTypeApiCallRateInsight is a InsightType enum value + InsightTypeApiCallRateInsight = "ApiCallRateInsight" +) + +const ( + // LookupAttributeKeyEventId is a LookupAttributeKey enum value + LookupAttributeKeyEventId = "EventId" + + // LookupAttributeKeyEventName is a LookupAttributeKey enum value + LookupAttributeKeyEventName = "EventName" + + // LookupAttributeKeyReadOnly is a LookupAttributeKey enum value + LookupAttributeKeyReadOnly = "ReadOnly" + + // LookupAttributeKeyUsername is a LookupAttributeKey enum value + LookupAttributeKeyUsername = "Username" + + // LookupAttributeKeyResourceType is a LookupAttributeKey enum value + LookupAttributeKeyResourceType = "ResourceType" + + // LookupAttributeKeyResourceName is a LookupAttributeKey enum value + LookupAttributeKeyResourceName = "ResourceName" + + // LookupAttributeKeyEventSource is a LookupAttributeKey enum value + LookupAttributeKeyEventSource = "EventSource" + + // LookupAttributeKeyAccessKeyId is a LookupAttributeKey enum value + LookupAttributeKeyAccessKeyId = "AccessKeyId" +) + +const ( + // ReadWriteTypeReadOnly is a ReadWriteType enum value + ReadWriteTypeReadOnly = "ReadOnly" + + // ReadWriteTypeWriteOnly is a ReadWriteType enum value + ReadWriteTypeWriteOnly = "WriteOnly" + + // ReadWriteTypeAll is a ReadWriteType enum value + ReadWriteTypeAll = "All" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go new file mode 100644 index 0000000000..d2b23643d3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go @@ -0,0 +1,48 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package cloudtrail provides the client and types for making API +// requests to AWS CloudTrail. +// +// This is the CloudTrail API Reference. It provides descriptions of actions, +// data types, common parameters, and common errors for CloudTrail. +// +// CloudTrail is a web service that records AWS API calls for your AWS account +// and delivers log files to an Amazon S3 bucket. The recorded information includes +// the identity of the user, the start time of the AWS API call, the source +// IP address, the request parameters, and the response elements returned by +// the service. +// +// As an alternative to the API, you can use one of the AWS SDKs, which consist +// of libraries and sample code for various programming languages and platforms +// (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way +// to create programmatic access to AWSCloudTrail. For example, the SDKs take +// care of cryptographically signing requests, managing errors, and retrying +// requests automatically. For information about the AWS SDKs, including how +// to download and install them, see the Tools for Amazon Web Services page +// (http://aws.amazon.com/tools/). +// +// See the AWS CloudTrail User Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html) +// for information about the data that is included with each AWS API call listed +// in the log files. +// +// See https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01 for more information on this service. +// +// See cloudtrail package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudtrail/ +// +// Using the Client +// +// To contact AWS CloudTrail with the SDK use the New function to create +// a new service client. With that client you can make API requests to the service. +// These clients are safe to use concurrently. +// +// See the SDK's documentation for more information on how to use the SDK. +// https://docs.aws.amazon.com/sdk-for-go/api/ +// +// See aws.Config documentation for more information on configuring SDK clients. +// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config +// +// See the AWS CloudTrail client CloudTrail for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudtrail/#New +package cloudtrail diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go new file mode 100644 index 0000000000..5feef21ae6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go @@ -0,0 +1,369 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package cloudtrail + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeARNInvalidException for service response error code + // "CloudTrailARNInvalidException". + // + // This exception is thrown when an operation is called with an invalid trail + // ARN. The format of a trail ARN is: + // + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + ErrCodeARNInvalidException = "CloudTrailARNInvalidException" + + // ErrCodeAccessNotEnabledException for service response error code + // "CloudTrailAccessNotEnabledException". + // + // This exception is thrown when trusted access has not been enabled between + // AWS CloudTrail and AWS Organizations. For more information, see Enabling + // Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) + // and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). + ErrCodeAccessNotEnabledException = "CloudTrailAccessNotEnabledException" + + // ErrCodeCloudWatchLogsDeliveryUnavailableException for service response error code + // "CloudWatchLogsDeliveryUnavailableException". + // + // Cannot set a CloudWatch Logs delivery for this region. + ErrCodeCloudWatchLogsDeliveryUnavailableException = "CloudWatchLogsDeliveryUnavailableException" + + // ErrCodeInsightNotEnabledException for service response error code + // "InsightNotEnabledException". + // + // If you run GetInsightSelectors on a trail that does not have Insights events + // enabled, the operation throws the exception InsightNotEnabledException. + ErrCodeInsightNotEnabledException = "InsightNotEnabledException" + + // ErrCodeInsufficientDependencyServiceAccessPermissionException for service response error code + // "InsufficientDependencyServiceAccessPermissionException". + // + // This exception is thrown when the IAM user or role that is used to create + // the organization trail is lacking one or more required permissions for creating + // an organization trail in a required service. For more information, see Prepare + // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). + ErrCodeInsufficientDependencyServiceAccessPermissionException = "InsufficientDependencyServiceAccessPermissionException" + + // ErrCodeInsufficientEncryptionPolicyException for service response error code + // "InsufficientEncryptionPolicyException". + // + // This exception is thrown when the policy on the S3 bucket or KMS key is not + // sufficient. + ErrCodeInsufficientEncryptionPolicyException = "InsufficientEncryptionPolicyException" + + // ErrCodeInsufficientS3BucketPolicyException for service response error code + // "InsufficientS3BucketPolicyException". + // + // This exception is thrown when the policy on the S3 bucket is not sufficient. + ErrCodeInsufficientS3BucketPolicyException = "InsufficientS3BucketPolicyException" + + // ErrCodeInsufficientSnsTopicPolicyException for service response error code + // "InsufficientSnsTopicPolicyException". + // + // This exception is thrown when the policy on the SNS topic is not sufficient. + ErrCodeInsufficientSnsTopicPolicyException = "InsufficientSnsTopicPolicyException" + + // ErrCodeInvalidCloudWatchLogsLogGroupArnException for service response error code + // "InvalidCloudWatchLogsLogGroupArnException". + // + // This exception is thrown when the provided CloudWatch log group is not valid. + ErrCodeInvalidCloudWatchLogsLogGroupArnException = "InvalidCloudWatchLogsLogGroupArnException" + + // ErrCodeInvalidCloudWatchLogsRoleArnException for service response error code + // "InvalidCloudWatchLogsRoleArnException". + // + // This exception is thrown when the provided role is not valid. + ErrCodeInvalidCloudWatchLogsRoleArnException = "InvalidCloudWatchLogsRoleArnException" + + // ErrCodeInvalidEventCategoryException for service response error code + // "InvalidEventCategoryException". + // + // Occurs if an event category that is not valid is specified as a value of + // EventCategory. + ErrCodeInvalidEventCategoryException = "InvalidEventCategoryException" + + // ErrCodeInvalidEventSelectorsException for service response error code + // "InvalidEventSelectorsException". + // + // This exception is thrown when the PutEventSelectors operation is called with + // a number of event selectors or data resources that is not valid. The combination + // of event selectors and data resources is not valid. A trail can have up to + // 5 event selectors. A trail is limited to 250 data resources. These data resources + // can be distributed across event selectors, but the overall total cannot exceed + // 250. + // + // You can: + // + // * Specify a valid number of event selectors (1 to 5) for a trail. + // + // * Specify a valid number of data resources (1 to 250) for an event selector. + // The limit of number of resources on an individual event selector is configurable + // up to 250. However, this upper limit is allowed only if the total number + // of data resources does not exceed 250 across all event selectors for a + // trail. + // + // * Specify a valid value for a parameter. For example, specifying the ReadWriteType + // parameter with a value of read-only is invalid. + ErrCodeInvalidEventSelectorsException = "InvalidEventSelectorsException" + + // ErrCodeInvalidHomeRegionException for service response error code + // "InvalidHomeRegionException". + // + // This exception is thrown when an operation is called on a trail from a region + // other than the region in which the trail was created. + ErrCodeInvalidHomeRegionException = "InvalidHomeRegionException" + + // ErrCodeInvalidInsightSelectorsException for service response error code + // "InvalidInsightSelectorsException". + // + // The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors + // or GetInsightSelectors request is not valid, or the specified insight type + // in the InsightSelectors statement is not a valid insight type. + ErrCodeInvalidInsightSelectorsException = "InvalidInsightSelectorsException" + + // ErrCodeInvalidKmsKeyIdException for service response error code + // "InvalidKmsKeyIdException". + // + // This exception is thrown when the KMS key ARN is invalid. + ErrCodeInvalidKmsKeyIdException = "InvalidKmsKeyIdException" + + // ErrCodeInvalidLookupAttributesException for service response error code + // "InvalidLookupAttributesException". + // + // Occurs when an invalid lookup attribute is specified. + ErrCodeInvalidLookupAttributesException = "InvalidLookupAttributesException" + + // ErrCodeInvalidMaxResultsException for service response error code + // "InvalidMaxResultsException". + // + // This exception is thrown if the limit specified is invalid. + ErrCodeInvalidMaxResultsException = "InvalidMaxResultsException" + + // ErrCodeInvalidNextTokenException for service response error code + // "InvalidNextTokenException". + // + // Invalid token or token that was previously used in a request with different + // parameters. This exception is thrown if the token is invalid. + ErrCodeInvalidNextTokenException = "InvalidNextTokenException" + + // ErrCodeInvalidParameterCombinationException for service response error code + // "InvalidParameterCombinationException". + // + // This exception is thrown when the combination of parameters provided is not + // valid. + ErrCodeInvalidParameterCombinationException = "InvalidParameterCombinationException" + + // ErrCodeInvalidS3BucketNameException for service response error code + // "InvalidS3BucketNameException". + // + // This exception is thrown when the provided S3 bucket name is not valid. + ErrCodeInvalidS3BucketNameException = "InvalidS3BucketNameException" + + // ErrCodeInvalidS3PrefixException for service response error code + // "InvalidS3PrefixException". + // + // This exception is thrown when the provided S3 prefix is not valid. + ErrCodeInvalidS3PrefixException = "InvalidS3PrefixException" + + // ErrCodeInvalidSnsTopicNameException for service response error code + // "InvalidSnsTopicNameException". + // + // This exception is thrown when the provided SNS topic name is not valid. + ErrCodeInvalidSnsTopicNameException = "InvalidSnsTopicNameException" + + // ErrCodeInvalidTagParameterException for service response error code + // "InvalidTagParameterException". + // + // This exception is thrown when the specified tag key or values are not valid. + // It can also occur if there are duplicate tags or too many tags on the resource. + ErrCodeInvalidTagParameterException = "InvalidTagParameterException" + + // ErrCodeInvalidTimeRangeException for service response error code + // "InvalidTimeRangeException". + // + // Occurs if the timestamp values are invalid. Either the start time occurs + // after the end time or the time range is outside the range of possible values. + ErrCodeInvalidTimeRangeException = "InvalidTimeRangeException" + + // ErrCodeInvalidTokenException for service response error code + // "InvalidTokenException". + // + // Reserved for future use. + ErrCodeInvalidTokenException = "InvalidTokenException" + + // ErrCodeInvalidTrailNameException for service response error code + // "InvalidTrailNameException". + // + // This exception is thrown when the provided trail name is not valid. Trail + // names must meet the following requirements: + // + // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores + // (_), or dashes (-) + // + // * Start with a letter or number, and end with a letter or number + // + // * Be between 3 and 128 characters + // + // * Have no adjacent periods, underscores or dashes. Names like my-_namespace + // and my--namespace are invalid. + // + // * Not be in IP address format (for example, 192.168.5.4) + ErrCodeInvalidTrailNameException = "InvalidTrailNameException" + + // ErrCodeKmsException for service response error code + // "KmsException". + // + // This exception is thrown when there is an issue with the specified KMS key + // and the trail can’t be updated. + ErrCodeKmsException = "KmsException" + + // ErrCodeKmsKeyDisabledException for service response error code + // "KmsKeyDisabledException". + // + // This exception is no longer in use. + ErrCodeKmsKeyDisabledException = "KmsKeyDisabledException" + + // ErrCodeKmsKeyNotFoundException for service response error code + // "KmsKeyNotFoundException". + // + // This exception is thrown when the KMS key does not exist, or when the S3 + // bucket and the KMS key are not in the same region. + ErrCodeKmsKeyNotFoundException = "KmsKeyNotFoundException" + + // ErrCodeMaximumNumberOfTrailsExceededException for service response error code + // "MaximumNumberOfTrailsExceededException". + // + // This exception is thrown when the maximum number of trails is reached. + ErrCodeMaximumNumberOfTrailsExceededException = "MaximumNumberOfTrailsExceededException" + + // ErrCodeNotOrganizationMasterAccountException for service response error code + // "NotOrganizationMasterAccountException". + // + // This exception is thrown when the AWS account making the request to create + // or update an organization trail is not the master account for an organization + // in AWS Organizations. For more information, see Prepare For Creating a Trail + // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). + ErrCodeNotOrganizationMasterAccountException = "NotOrganizationMasterAccountException" + + // ErrCodeOperationNotPermittedException for service response error code + // "OperationNotPermittedException". + // + // This exception is thrown when the requested operation is not permitted. + ErrCodeOperationNotPermittedException = "OperationNotPermittedException" + + // ErrCodeOrganizationNotInAllFeaturesModeException for service response error code + // "OrganizationNotInAllFeaturesModeException". + // + // This exception is thrown when AWS Organizations is not configured to support + // all features. All features must be enabled in AWS Organization to support + // creating an organization trail. For more information, see Prepare For Creating + // a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). + ErrCodeOrganizationNotInAllFeaturesModeException = "OrganizationNotInAllFeaturesModeException" + + // ErrCodeOrganizationsNotInUseException for service response error code + // "OrganizationsNotInUseException". + // + // This exception is thrown when the request is made from an AWS account that + // is not a member of an organization. To make this request, sign in using the + // credentials of an account that belongs to an organization. + ErrCodeOrganizationsNotInUseException = "OrganizationsNotInUseException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // This exception is thrown when the specified resource is not found. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" + + // ErrCodeResourceTypeNotSupportedException for service response error code + // "ResourceTypeNotSupportedException". + // + // This exception is thrown when the specified resource type is not supported + // by CloudTrail. + ErrCodeResourceTypeNotSupportedException = "ResourceTypeNotSupportedException" + + // ErrCodeS3BucketDoesNotExistException for service response error code + // "S3BucketDoesNotExistException". + // + // This exception is thrown when the specified S3 bucket does not exist. + ErrCodeS3BucketDoesNotExistException = "S3BucketDoesNotExistException" + + // ErrCodeTagsLimitExceededException for service response error code + // "TagsLimitExceededException". + // + // The number of tags per trail has exceeded the permitted amount. Currently, + // the limit is 50. + ErrCodeTagsLimitExceededException = "TagsLimitExceededException" + + // ErrCodeTrailAlreadyExistsException for service response error code + // "TrailAlreadyExistsException". + // + // This exception is thrown when the specified trail already exists. + ErrCodeTrailAlreadyExistsException = "TrailAlreadyExistsException" + + // ErrCodeTrailNotFoundException for service response error code + // "TrailNotFoundException". + // + // This exception is thrown when the trail with the given name is not found. + ErrCodeTrailNotFoundException = "TrailNotFoundException" + + // ErrCodeTrailNotProvidedException for service response error code + // "TrailNotProvidedException". + // + // This exception is no longer in use. + ErrCodeTrailNotProvidedException = "TrailNotProvidedException" + + // ErrCodeUnsupportedOperationException for service response error code + // "UnsupportedOperationException". + // + // This exception is thrown when the requested operation is not supported. + ErrCodeUnsupportedOperationException = "UnsupportedOperationException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CloudTrailARNInvalidException": newErrorARNInvalidException, + "CloudTrailAccessNotEnabledException": newErrorAccessNotEnabledException, + "CloudWatchLogsDeliveryUnavailableException": newErrorCloudWatchLogsDeliveryUnavailableException, + "InsightNotEnabledException": newErrorInsightNotEnabledException, + "InsufficientDependencyServiceAccessPermissionException": newErrorInsufficientDependencyServiceAccessPermissionException, + "InsufficientEncryptionPolicyException": newErrorInsufficientEncryptionPolicyException, + "InsufficientS3BucketPolicyException": newErrorInsufficientS3BucketPolicyException, + "InsufficientSnsTopicPolicyException": newErrorInsufficientSnsTopicPolicyException, + "InvalidCloudWatchLogsLogGroupArnException": newErrorInvalidCloudWatchLogsLogGroupArnException, + "InvalidCloudWatchLogsRoleArnException": newErrorInvalidCloudWatchLogsRoleArnException, + "InvalidEventCategoryException": newErrorInvalidEventCategoryException, + "InvalidEventSelectorsException": newErrorInvalidEventSelectorsException, + "InvalidHomeRegionException": newErrorInvalidHomeRegionException, + "InvalidInsightSelectorsException": newErrorInvalidInsightSelectorsException, + "InvalidKmsKeyIdException": newErrorInvalidKmsKeyIdException, + "InvalidLookupAttributesException": newErrorInvalidLookupAttributesException, + "InvalidMaxResultsException": newErrorInvalidMaxResultsException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterCombinationException": newErrorInvalidParameterCombinationException, + "InvalidS3BucketNameException": newErrorInvalidS3BucketNameException, + "InvalidS3PrefixException": newErrorInvalidS3PrefixException, + "InvalidSnsTopicNameException": newErrorInvalidSnsTopicNameException, + "InvalidTagParameterException": newErrorInvalidTagParameterException, + "InvalidTimeRangeException": newErrorInvalidTimeRangeException, + "InvalidTokenException": newErrorInvalidTokenException, + "InvalidTrailNameException": newErrorInvalidTrailNameException, + "KmsException": newErrorKmsException, + "KmsKeyDisabledException": newErrorKmsKeyDisabledException, + "KmsKeyNotFoundException": newErrorKmsKeyNotFoundException, + "MaximumNumberOfTrailsExceededException": newErrorMaximumNumberOfTrailsExceededException, + "NotOrganizationMasterAccountException": newErrorNotOrganizationMasterAccountException, + "OperationNotPermittedException": newErrorOperationNotPermittedException, + "OrganizationNotInAllFeaturesModeException": newErrorOrganizationNotInAllFeaturesModeException, + "OrganizationsNotInUseException": newErrorOrganizationsNotInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceTypeNotSupportedException": newErrorResourceTypeNotSupportedException, + "S3BucketDoesNotExistException": newErrorS3BucketDoesNotExistException, + "TagsLimitExceededException": newErrorTagsLimitExceededException, + "TrailAlreadyExistsException": newErrorTrailAlreadyExistsException, + "TrailNotFoundException": newErrorTrailNotFoundException, + "TrailNotProvidedException": newErrorTrailNotProvidedException, + "UnsupportedOperationException": newErrorUnsupportedOperationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go new file mode 100644 index 0000000000..fece8a618a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go @@ -0,0 +1,103 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package cloudtrail + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/client" + "github.com/aws/aws-sdk-go/aws/client/metadata" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" +) + +// CloudTrail provides the API operation methods for making requests to +// AWS CloudTrail. See this package's package overview docs +// for details on the service. +// +// CloudTrail methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type CloudTrail struct { + *client.Client +} + +// Used for custom client initialization logic +var initClient func(*client.Client) + +// Used for custom request initialization logic +var initRequest func(*request.Request) + +// Service information constants +const ( + ServiceName = "cloudtrail" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "CloudTrail" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the CloudTrail client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a CloudTrail client from just a session. +// svc := cloudtrail.New(mySession) +// +// // Create a CloudTrail client with additional configuration +// svc := cloudtrail.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudTrail { + c := p.ClientConfig(EndpointsID, cfgs...) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudTrail { + svc := &CloudTrail{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2013-11-01", + JSONVersion: "1.1", + TargetPrefix: "com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101", + }, + handlers, + ), + } + + // Handlers + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) + svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) + svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) + svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a CloudTrail operation and runs any +// custom request initialization. +func (c *CloudTrail) newRequest(op *request.Operation, params, data interface{}) *request.Request { + req := c.NewRequest(op, params, data) + + // Run custom request initialization if present + if initRequest != nil { + initRequest(req) + } + + return req +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 95ade2a227..1888e1c9ff 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -162,6 +162,7 @@ github.com/aws/aws-sdk-go/private/protocol/rest github.com/aws/aws-sdk-go/private/protocol/restxml github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil github.com/aws/aws-sdk-go/service/acm +github.com/aws/aws-sdk-go/service/cloudtrail github.com/aws/aws-sdk-go/service/cloudwatch github.com/aws/aws-sdk-go/service/ec2 github.com/aws/aws-sdk-go/service/elbv2 @@ -1105,7 +1106,7 @@ k8s.io/utils/integer sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.2.0 sigs.k8s.io/yaml -# yunion.io/x/executor v0.0.0-20201201131200-44fa553abd9e +# yunion.io/x/executor v0.0.0-20201231064744-df32f32165a9 yunion.io/x/executor/apis yunion.io/x/executor/client yunion.io/x/executor/server @@ -1118,7 +1119,7 @@ yunion.io/x/log/hooks yunion.io/x/ovsdb/cli_util yunion.io/x/ovsdb/schema/ovn_nb yunion.io/x/ovsdb/types -# yunion.io/x/pkg v0.0.0-20201123083159-ca3aea986ff2 +# yunion.io/x/pkg v0.0.0-20210109071527-7e72daf56747 yunion.io/x/pkg/errors yunion.io/x/pkg/gotypes yunion.io/x/pkg/prettytable diff --git a/vendor/yunion.io/x/pkg/util/compare/compare.go b/vendor/yunion.io/x/pkg/util/compare/compare.go index 4c3d62b1f6..fb64a78af8 100644 --- a/vendor/yunion.io/x/pkg/util/compare/compare.go +++ b/vendor/yunion.io/x/pkg/util/compare/compare.go @@ -19,6 +19,8 @@ import ( "reflect" "sort" "strings" + + "yunion.io/x/pkg/errors" ) type valueElement struct { @@ -79,6 +81,19 @@ func CompareSets(dbSet interface{}, extSet interface{}, removed interface{}, com sort.Sort(valueSet(dbSetArray)) sort.Sort(valueSet(extSetArray)) + dupCheck := map[string][]reflect.Value{} + for i := range extSetArray { + _, ok := dupCheck[extSetArray[i].key] + if !ok { + dupCheck[extSetArray[i].key] = []reflect.Value{} + } + dupCheck[extSetArray[i].key] = append(dupCheck[extSetArray[i].key], extSetArray[i].value) + + if len(dupCheck[extSetArray[i].key]) > 1 { + return errors.Wrapf(errors.ErrDuplicateId, "duplicated id: %s", extSetArray[i].key) + } + } + removedValue := reflect.Indirect(reflect.ValueOf(removed)) commonDBValue := reflect.Indirect(reflect.ValueOf(commonDB)) commonExtValue := reflect.Indirect(reflect.ValueOf(commonExt))