/*
* 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 dlm-2018-01-12.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.DLM.Model;
using Amazon.DLM.Model.Internal.MarshallTransformations;
using Amazon.DLM.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.DLM
{
///
/// Implementation for accessing DLM
///
/// Amazon Data Lifecycle Manager
///
/// With Amazon Data Lifecycle Manager, you can manage the lifecycle of your Amazon Web
/// Services resources. You create lifecycle policies, which are used to automate operations
/// on the specified resources.
///
///
///
/// Amazon Data Lifecycle Manager supports Amazon EBS volumes and snapshots. For information
/// about using Amazon Data Lifecycle Manager with Amazon EBS, see
/// Amazon Data Lifecycle Manager in the Amazon EC2 User Guide.
///
///
public partial class AmazonDLMClient : AmazonServiceClient, IAmazonDLM
{
private static IServiceMetadata serviceMetadata = new AmazonDLMMetadata();
#region Constructors
///
/// Constructs AmazonDLMClient 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 AmazonDLMClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonDLMConfig()) { }
///
/// Constructs AmazonDLMClient 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 AmazonDLMClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonDLMConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonDLMClient 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 AmazonDLMClient Configuration Object
public AmazonDLMClient(AmazonDLMConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonDLMClient with AWS Credentials
///
/// AWS Credentials
public AmazonDLMClient(AWSCredentials credentials)
: this(credentials, new AmazonDLMConfig())
{
}
///
/// Constructs AmazonDLMClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonDLMClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonDLMConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonDLMClient with AWS Credentials and an
/// AmazonDLMClient Configuration object.
///
/// AWS Credentials
/// The AmazonDLMClient Configuration Object
public AmazonDLMClient(AWSCredentials credentials, AmazonDLMConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonDLMClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonDLMClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonDLMConfig())
{
}
///
/// Constructs AmazonDLMClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonDLMClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonDLMConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonDLMClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonDLMClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonDLMClient Configuration Object
public AmazonDLMClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonDLMConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonDLMClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonDLMClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonDLMConfig())
{
}
///
/// Constructs AmazonDLMClient 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 AmazonDLMClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonDLMConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonDLMClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonDLMClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonDLMClient Configuration Object
public AmazonDLMClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonDLMConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#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 AmazonDLMEndpointResolver());
}
///
/// 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 CreateLifecyclePolicy
internal virtual CreateLifecyclePolicyResponse CreateLifecyclePolicy(CreateLifecyclePolicyRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateLifecyclePolicyRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateLifecyclePolicyResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Creates a policy to manage the lifecycle of the specified Amazon Web Services resources.
/// You can create up to 100 lifecycle policies.
///
/// Container for the necessary parameters to execute the CreateLifecyclePolicy service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the CreateLifecyclePolicy service method, as returned by DLM.
///
/// The service failed in an unexpected way.
///
///
/// Bad request. The request is missing required parameters or has invalid parameters.
///
///
/// The request failed because a limit was exceeded.
///
/// REST API Reference for CreateLifecyclePolicy Operation
public virtual Task CreateLifecyclePolicyAsync(CreateLifecyclePolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateLifecyclePolicyRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateLifecyclePolicyResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region DeleteLifecyclePolicy
internal virtual DeleteLifecyclePolicyResponse DeleteLifecyclePolicy(DeleteLifecyclePolicyRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteLifecyclePolicyRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteLifecyclePolicyResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Deletes the specified lifecycle policy and halts the automated operations that the
/// policy specified.
///
///
///
/// For more information about deleting a policy, see Delete
/// lifecycle policies.
///
///
/// Container for the necessary parameters to execute the DeleteLifecyclePolicy service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteLifecyclePolicy service method, as returned by DLM.
///
/// The service failed in an unexpected way.
///
///
/// The request failed because a limit was exceeded.
///
///
/// A requested resource was not found.
///
/// REST API Reference for DeleteLifecyclePolicy Operation
public virtual Task DeleteLifecyclePolicyAsync(DeleteLifecyclePolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteLifecyclePolicyRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteLifecyclePolicyResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetLifecyclePolicies
internal virtual GetLifecyclePoliciesResponse GetLifecyclePolicies(GetLifecyclePoliciesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetLifecyclePoliciesRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetLifecyclePoliciesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Gets summary information about all or the specified data lifecycle policies.
///
///
///
/// To get complete information about a policy, use GetLifecyclePolicy.
///
///
/// Container for the necessary parameters to execute the GetLifecyclePolicies service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetLifecyclePolicies service method, as returned by DLM.
///
/// The service failed in an unexpected way.
///
///
/// Bad request. The request is missing required parameters or has invalid parameters.
///
///
/// The request failed because a limit was exceeded.
///
///
/// A requested resource was not found.
///
/// REST API Reference for GetLifecyclePolicies Operation
public virtual Task GetLifecyclePoliciesAsync(GetLifecyclePoliciesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetLifecyclePoliciesRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetLifecyclePoliciesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetLifecyclePolicy
internal virtual GetLifecyclePolicyResponse GetLifecyclePolicy(GetLifecyclePolicyRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetLifecyclePolicyRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetLifecyclePolicyResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Gets detailed information about the specified lifecycle policy.
///
/// Container for the necessary parameters to execute the GetLifecyclePolicy service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetLifecyclePolicy service method, as returned by DLM.
///
/// The service failed in an unexpected way.
///
///
/// The request failed because a limit was exceeded.
///
///
/// A requested resource was not found.
///
/// REST API Reference for GetLifecyclePolicy Operation
public virtual Task GetLifecyclePolicyAsync(GetLifecyclePolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetLifecyclePolicyRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetLifecyclePolicyResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListTagsForResource
internal virtual ListTagsForResourceResponse ListTagsForResource(ListTagsForResourceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Lists the tags for the specified resource.
///
/// Container for the necessary parameters to execute the ListTagsForResource service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListTagsForResource service method, as returned by DLM.
///
/// The service failed in an unexpected way.
///
///
/// Bad request. The request is missing required parameters or has invalid parameters.
///
///
/// A requested resource was not found.
///
/// REST API Reference for ListTagsForResource Operation
public virtual Task ListTagsForResourceAsync(ListTagsForResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region TagResource
internal virtual TagResourceResponse TagResource(TagResourceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = TagResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Adds the specified tags to the specified resource.
///
/// Container for the necessary parameters to execute the TagResource service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the TagResource service method, as returned by DLM.
///
/// The service failed in an unexpected way.
///
///
/// Bad request. The request is missing required parameters or has invalid parameters.
///
///
/// A requested resource was not found.
///
/// REST API Reference for TagResource Operation
public virtual Task TagResourceAsync(TagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = TagResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region UntagResource
internal virtual UntagResourceResponse UntagResource(UntagResourceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UntagResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Removes the specified tags from the specified resource.
///
/// Container for the necessary parameters to execute the UntagResource service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the UntagResource service method, as returned by DLM.
///
/// The service failed in an unexpected way.
///
///
/// Bad request. The request is missing required parameters or has invalid parameters.
///
///
/// A requested resource was not found.
///
/// REST API Reference for UntagResource Operation
public virtual Task UntagResourceAsync(UntagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = UntagResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region UpdateLifecyclePolicy
internal virtual UpdateLifecyclePolicyResponse UpdateLifecyclePolicy(UpdateLifecyclePolicyRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateLifecyclePolicyRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateLifecyclePolicyResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Updates the specified lifecycle policy.
///
///
///
/// For more information about updating a policy, see Modify
/// lifecycle policies.
///
///
/// Container for the necessary parameters to execute the UpdateLifecyclePolicy service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the UpdateLifecyclePolicy service method, as returned by DLM.
///
/// The service failed in an unexpected way.
///
///
/// Bad request. The request is missing required parameters or has invalid parameters.
///
///
/// The request failed because a limit was exceeded.
///
///
/// A requested resource was not found.
///
/// REST API Reference for UpdateLifecyclePolicy Operation
public virtual Task UpdateLifecyclePolicyAsync(UpdateLifecyclePolicyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateLifecyclePolicyRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateLifecyclePolicyResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}