/*
* 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 cur-2017-01-06.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.CostAndUsageReport.Model;
using Amazon.CostAndUsageReport.Model.Internal.MarshallTransformations;
using Amazon.CostAndUsageReport.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.CostAndUsageReport
{
///
/// Implementation for accessing CostAndUsageReport
///
/// The AWS Cost and Usage Report API enables you to programmatically create, query, and
/// delete AWS Cost and Usage report definitions.
///
///
///
/// AWS Cost and Usage reports track the monthly AWS costs and usage associated with your
/// AWS account. The report contains line items for each unique combination of AWS product,
/// usage type, and operation that your AWS account uses. You can configure the AWS Cost
/// and Usage report to show only the data that you want, using the AWS Cost and Usage
/// API.
///
///
///
/// Service Endpoint
///
///
///
/// The AWS Cost and Usage Report API provides the following endpoint:
///
/// -
///
/// cur.us-east-1.amazonaws.com
///
///
///
public partial class AmazonCostAndUsageReportClient : AmazonServiceClient, IAmazonCostAndUsageReport
{
private static IServiceMetadata serviceMetadata = new AmazonCostAndUsageReportMetadata();
#region Constructors
///
/// Constructs AmazonCostAndUsageReportClient 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 AmazonCostAndUsageReportClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonCostAndUsageReportConfig()) { }
///
/// Constructs AmazonCostAndUsageReportClient 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 AmazonCostAndUsageReportClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonCostAndUsageReportConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonCostAndUsageReportClient 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 AmazonCostAndUsageReportClient Configuration Object
public AmazonCostAndUsageReportClient(AmazonCostAndUsageReportConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonCostAndUsageReportClient with AWS Credentials
///
/// AWS Credentials
public AmazonCostAndUsageReportClient(AWSCredentials credentials)
: this(credentials, new AmazonCostAndUsageReportConfig())
{
}
///
/// Constructs AmazonCostAndUsageReportClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonCostAndUsageReportClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonCostAndUsageReportConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonCostAndUsageReportClient with AWS Credentials and an
/// AmazonCostAndUsageReportClient Configuration object.
///
/// AWS Credentials
/// The AmazonCostAndUsageReportClient Configuration Object
public AmazonCostAndUsageReportClient(AWSCredentials credentials, AmazonCostAndUsageReportConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonCostAndUsageReportClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonCostAndUsageReportClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonCostAndUsageReportConfig())
{
}
///
/// Constructs AmazonCostAndUsageReportClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonCostAndUsageReportClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonCostAndUsageReportConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonCostAndUsageReportClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonCostAndUsageReportClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonCostAndUsageReportClient Configuration Object
public AmazonCostAndUsageReportClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonCostAndUsageReportConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonCostAndUsageReportClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonCostAndUsageReportClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCostAndUsageReportConfig())
{
}
///
/// Constructs AmazonCostAndUsageReportClient 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 AmazonCostAndUsageReportClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCostAndUsageReportConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonCostAndUsageReportClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonCostAndUsageReportClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonCostAndUsageReportClient Configuration Object
public AmazonCostAndUsageReportClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCostAndUsageReportConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#if AWS_ASYNC_ENUMERABLES_API
private ICostAndUsageReportPaginatorFactory _paginators;
///
/// Paginators for the service
///
public ICostAndUsageReportPaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new CostAndUsageReportPaginatorFactory(this);
}
return this._paginators;
}
}
#endif
#region Overrides
///
/// Creates the signer for the service.
///
protected override AbstractAWSSigner CreateSigner()
{
return new AWS4Signer();
}
///
/// Customizes the runtime pipeline.
///
/// Runtime pipeline for the current client.
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.RemoveHandler();
pipeline.AddHandlerAfter(new AmazonCostAndUsageReportEndpointResolver());
}
///
/// 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 DeleteReportDefinition
internal virtual DeleteReportDefinitionResponse DeleteReportDefinition(DeleteReportDefinitionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteReportDefinitionRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteReportDefinitionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Deletes the specified report.
///
/// Container for the necessary parameters to execute the DeleteReportDefinition service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteReportDefinition service method, as returned by CostAndUsageReport.
///
/// An error on the server occurred during the processing of your request. Try again later.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for DeleteReportDefinition Operation
public virtual Task DeleteReportDefinitionAsync(DeleteReportDefinitionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteReportDefinitionRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteReportDefinitionResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region DescribeReportDefinitions
internal virtual DescribeReportDefinitionsResponse DescribeReportDefinitions(DescribeReportDefinitionsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeReportDefinitionsRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeReportDefinitionsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Lists the AWS Cost and Usage reports available to this account.
///
/// Container for the necessary parameters to execute the DescribeReportDefinitions service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DescribeReportDefinitions service method, as returned by CostAndUsageReport.
///
/// An error on the server occurred during the processing of your request. Try again later.
///
/// REST API Reference for DescribeReportDefinitions Operation
public virtual Task DescribeReportDefinitionsAsync(DescribeReportDefinitionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeReportDefinitionsRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeReportDefinitionsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ModifyReportDefinition
internal virtual ModifyReportDefinitionResponse ModifyReportDefinition(ModifyReportDefinitionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ModifyReportDefinitionRequestMarshaller.Instance;
options.ResponseUnmarshaller = ModifyReportDefinitionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Allows you to programatically update your report preferences.
///
/// Container for the necessary parameters to execute the ModifyReportDefinition service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ModifyReportDefinition service method, as returned by CostAndUsageReport.
///
/// An error on the server occurred during the processing of your request. Try again later.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for ModifyReportDefinition Operation
public virtual Task ModifyReportDefinitionAsync(ModifyReportDefinitionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ModifyReportDefinitionRequestMarshaller.Instance;
options.ResponseUnmarshaller = ModifyReportDefinitionResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region PutReportDefinition
internal virtual PutReportDefinitionResponse PutReportDefinition(PutReportDefinitionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PutReportDefinitionRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutReportDefinitionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Creates a new report using the description that you provide.
///
/// Container for the necessary parameters to execute the PutReportDefinition service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PutReportDefinition service method, as returned by CostAndUsageReport.
///
/// A report with the specified name already exists in the account. Specify a different
/// report name.
///
///
/// An error on the server occurred during the processing of your request. Try again later.
///
///
/// This account already has five reports defined. To define a new report, you must delete
/// an existing report.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for PutReportDefinition Operation
public virtual Task PutReportDefinitionAsync(PutReportDefinitionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = PutReportDefinitionRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutReportDefinitionResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}