/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the cloudtrail-data-2021-08-11.normal.json service model.
*/
using System;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Net;
using Amazon.CloudTrailData.Model;
using Amazon.CloudTrailData.Model.Internal.MarshallTransformations;
using Amazon.CloudTrailData.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.CloudTrailData
{
///
/// Implementation for accessing CloudTrailData
///
/// The CloudTrail Data Service lets you ingest events into CloudTrail from any source
/// in your hybrid environments, such as in-house or SaaS applications hosted on-premises
/// or in the cloud, virtual machines, or containers. You can store, access, analyze,
/// troubleshoot and take action on this data without maintaining multiple log aggregators
/// and reporting tools. After you run PutAuditEvents
to ingest your application
/// activity into CloudTrail, you can use CloudTrail Lake to search, query, and analyze
/// the data that is logged from your applications.
///
public partial class AmazonCloudTrailDataClient : AmazonServiceClient, IAmazonCloudTrailData
{
private static IServiceMetadata serviceMetadata = new AmazonCloudTrailDataMetadata();
#region Constructors
///
/// Constructs AmazonCloudTrailDataClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
public AmazonCloudTrailDataClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonCloudTrailDataConfig()) { }
///
/// Constructs AmazonCloudTrailDataClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
/// The region to connect.
public AmazonCloudTrailDataClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonCloudTrailDataConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonCloudTrailDataClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
/// The AmazonCloudTrailDataClient Configuration Object
public AmazonCloudTrailDataClient(AmazonCloudTrailDataConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonCloudTrailDataClient with AWS Credentials
///
/// AWS Credentials
public AmazonCloudTrailDataClient(AWSCredentials credentials)
: this(credentials, new AmazonCloudTrailDataConfig())
{
}
///
/// Constructs AmazonCloudTrailDataClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonCloudTrailDataClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonCloudTrailDataConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonCloudTrailDataClient with AWS Credentials and an
/// AmazonCloudTrailDataClient Configuration object.
///
/// AWS Credentials
/// The AmazonCloudTrailDataClient Configuration Object
public AmazonCloudTrailDataClient(AWSCredentials credentials, AmazonCloudTrailDataConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonCloudTrailDataClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonCloudTrailDataClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonCloudTrailDataConfig())
{
}
///
/// Constructs AmazonCloudTrailDataClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonCloudTrailDataClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonCloudTrailDataConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonCloudTrailDataClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonCloudTrailDataClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonCloudTrailDataClient Configuration Object
public AmazonCloudTrailDataClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonCloudTrailDataConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonCloudTrailDataClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonCloudTrailDataClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCloudTrailDataConfig())
{
}
///
/// Constructs AmazonCloudTrailDataClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The region to connect.
public AmazonCloudTrailDataClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCloudTrailDataConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonCloudTrailDataClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonCloudTrailDataClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonCloudTrailDataClient Configuration Object
public AmazonCloudTrailDataClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCloudTrailDataConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#region Overrides
///
/// Creates the signer for the service.
///
protected override AbstractAWSSigner CreateSigner()
{
return new AWS4Signer();
}
///
/// Customize the pipeline
///
///
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.RemoveHandler();
pipeline.AddHandlerAfter(new AmazonCloudTrailDataEndpointResolver());
}
///
/// Capture metadata for the service.
///
protected override IServiceMetadata ServiceMetadata
{
get
{
return serviceMetadata;
}
}
#endregion
#region Dispose
///
/// Disposes the service client.
///
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#endregion
#region PutAuditEvents
///
/// Ingests your application events into CloudTrail Lake. A required parameter, auditEvents
,
/// accepts the JSON records (also called payload) of events that you want CloudTrail
/// to ingest. You can add up to 100 of these events (or up to 1 MB) per PutAuditEvents
/// request.
///
/// Container for the necessary parameters to execute the PutAuditEvents service method.
///
/// The response from the PutAuditEvents service method, as returned by CloudTrailData.
///
/// The caller's account ID must be the same as the channel owner's account ID.
///
///
/// The channel could not be found.
///
///
/// The schema type of the event is not supported.
///
///
/// Two or more entries in the request have the same event ID.
///
///
/// The specified channel ARN is not a valid channel ARN.
///
///
/// The operation requested is not supported in this region or account.
///
/// REST API Reference for PutAuditEvents Operation
public virtual PutAuditEventsResponse PutAuditEvents(PutAuditEventsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PutAuditEventsRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutAuditEventsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Ingests your application events into CloudTrail Lake. A required parameter, auditEvents
,
/// accepts the JSON records (also called payload) of events that you want CloudTrail
/// to ingest. You can add up to 100 of these events (or up to 1 MB) per PutAuditEvents
/// request.
///
/// Container for the necessary parameters to execute the PutAuditEvents service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PutAuditEvents service method, as returned by CloudTrailData.
///
/// The caller's account ID must be the same as the channel owner's account ID.
///
///
/// The channel could not be found.
///
///
/// The schema type of the event is not supported.
///
///
/// Two or more entries in the request have the same event ID.
///
///
/// The specified channel ARN is not a valid channel ARN.
///
///
/// The operation requested is not supported in this region or account.
///
/// REST API Reference for PutAuditEvents Operation
public virtual Task PutAuditEventsAsync(PutAuditEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = PutAuditEventsRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutAuditEventsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}