/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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 com.amazonaws.services.cloudtrail; import javax.annotation.Generated; import com.amazonaws.*; import com.amazonaws.regions.*; import com.amazonaws.services.cloudtrail.model.*; /** * Interface for accessing CloudTrail. *

* Note: Do not directly implement this interface, new methods are added to it regularly. Extend from * {@link com.amazonaws.services.cloudtrail.AbstractAWSCloudTrail} instead. *

*

* 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 Amazon Web Services API calls for your Amazon Web Services account and * delivers log files to an Amazon S3 bucket. The recorded information includes the identity of the user, the start time * of the Amazon Web Services 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 Amazon Web Services SDKs, which consist of libraries and sample * code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide * programmatic access to CloudTrail. For example, the SDKs handle cryptographically signing requests, managing errors, * and retrying requests automatically. For more information about the Amazon Web Services SDKs, including how to * download and install them, see Tools to Build on Amazon Web Services. *

*
*

* See the CloudTrail * User Guide for information about the data that is included with each Amazon Web Services API call listed in the * log files. *

*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public interface AWSCloudTrail { /** * The region metadata service name for computing region endpoints. You can use this value to retrieve metadata * (such as supported regions) of the service. * * @see RegionUtils#getRegionsForService(String) */ String ENDPOINT_PREFIX = "cloudtrail"; /** * Overrides the default endpoint for this client ("cloudtrail.us-east-1.amazonaws.com"). Callers can use this * method to control which AWS region they want to work with. *

* Callers can pass in just the endpoint (ex: "cloudtrail.us-east-1.amazonaws.com") or a full URL, including the * protocol (ex: "cloudtrail.us-east-1.amazonaws.com"). If the protocol is not specified here, the default protocol * from this client's {@link ClientConfiguration} will be used, which by default is HTTPS. *

* For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available * endpoints for all AWS services, see: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-region-selection.html#region-selection- * choose-endpoint *

* This method is not threadsafe. An endpoint should be configured when the client is created and before any * service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in * transit or retrying. * * @param endpoint * The endpoint (ex: "cloudtrail.us-east-1.amazonaws.com") or a full URL, including the protocol (ex: * "cloudtrail.us-east-1.amazonaws.com") of the region specific AWS endpoint this client will communicate * with. * @deprecated use {@link AwsClientBuilder#setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)} for * example: * {@code builder.setEndpointConfiguration(new EndpointConfiguration(endpoint, signingRegion));} */ @Deprecated void setEndpoint(String endpoint); /** * An alternative to {@link AWSCloudTrail#setEndpoint(String)}, sets the regional endpoint for this client's service * calls. Callers can use this method to control which AWS region they want to work with. *

* By default, all service endpoints in all regions use the https protocol. To use http instead, specify it in the * {@link ClientConfiguration} supplied at construction. *

* This method is not threadsafe. A region should be configured when the client is created and before any service * requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit * or retrying. * * @param region * The region this client will communicate with. See {@link Region#getRegion(com.amazonaws.regions.Regions)} * for accessing a given region. Must not be null and must be a region where the service is available. * * @see Region#getRegion(com.amazonaws.regions.Regions) * @see Region#createClient(Class, com.amazonaws.auth.AWSCredentialsProvider, ClientConfiguration) * @see Region#isServiceSupported(String) * @deprecated use {@link AwsClientBuilder#setRegion(String)} */ @Deprecated void setRegion(Region region); /** *

* Adds one or more tags to a trail, event data store, or channel, 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; 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 or event data store that applies to all Amazon Web * Services Regions only from the Region in which the trail or event data store was created (also known as its home * Region). *

* * @param addTagsRequest * Specifies the tags to add to a trail, event data store, or channel. * @return Result of the AddTags operation returned by the service. * @throws ResourceNotFoundException * This exception is thrown when the specified resource is not found. * @throws CloudTrailARNInvalidException * This exception is thrown when an operation is called with a trail ARN that is not valid. The following is * the format of a trail ARN.

*

* arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail *

*

* This exception is also thrown when you call AddTags or RemoveTags on a trail, * event data store, or channel with a resource ARN that is not valid. *

*

* The following is the format of an event data store ARN: * arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE *

*

* The following is the format of a channel ARN: * arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 * @throws EventDataStoreARNInvalidException * The specified event data store ARN is not valid or does not map to an event data store in your account. * @throws ChannelARNInvalidException * This exception is thrown when the specified value of ChannelARN is not valid. * @throws ResourceTypeNotSupportedException * This exception is thrown when the specified resource type is not supported by CloudTrail. * @throws TagsLimitExceededException * The number of tags per trail, event data store, or channel has exceeded the permitted amount. Currently, * the limit is 50. * @throws InvalidTrailNameException * This exception is thrown when the provided trail name is not valid. Trail names must meet the following * requirements: *

*