/*
* 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 backupstorage-2018-04-10.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.BackupStorage.Model;
using Amazon.BackupStorage.Model.Internal.MarshallTransformations;
using Amazon.BackupStorage.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.BackupStorage
{
///
/// Implementation for accessing BackupStorage
///
/// The frontend service for Cryo Storage.
///
public partial class AmazonBackupStorageClient : AmazonServiceClient, IAmazonBackupStorage
{
private static IServiceMetadata serviceMetadata = new AmazonBackupStorageMetadata();
#region Constructors
///
/// Constructs AmazonBackupStorageClient 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 AmazonBackupStorageClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonBackupStorageConfig()) { }
///
/// Constructs AmazonBackupStorageClient 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 AmazonBackupStorageClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonBackupStorageConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonBackupStorageClient 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 AmazonBackupStorageClient Configuration Object
public AmazonBackupStorageClient(AmazonBackupStorageConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonBackupStorageClient with AWS Credentials
///
/// AWS Credentials
public AmazonBackupStorageClient(AWSCredentials credentials)
: this(credentials, new AmazonBackupStorageConfig())
{
}
///
/// Constructs AmazonBackupStorageClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonBackupStorageClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonBackupStorageConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonBackupStorageClient with AWS Credentials and an
/// AmazonBackupStorageClient Configuration object.
///
/// AWS Credentials
/// The AmazonBackupStorageClient Configuration Object
public AmazonBackupStorageClient(AWSCredentials credentials, AmazonBackupStorageConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonBackupStorageClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonBackupStorageClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonBackupStorageConfig())
{
}
///
/// Constructs AmazonBackupStorageClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonBackupStorageClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonBackupStorageConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonBackupStorageClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonBackupStorageClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonBackupStorageClient Configuration Object
public AmazonBackupStorageClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonBackupStorageConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonBackupStorageClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonBackupStorageClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonBackupStorageConfig())
{
}
///
/// Constructs AmazonBackupStorageClient 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 AmazonBackupStorageClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonBackupStorageConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonBackupStorageClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonBackupStorageClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonBackupStorageClient Configuration Object
public AmazonBackupStorageClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonBackupStorageConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#if AWS_ASYNC_ENUMERABLES_API
private IBackupStoragePaginatorFactory _paginators;
///
/// Paginators for the service
///
public IBackupStoragePaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new BackupStoragePaginatorFactory(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 AmazonBackupStorageEndpointResolver());
}
///
/// 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 DeleteObject
internal virtual DeleteObjectResponse DeleteObject(DeleteObjectRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteObjectRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteObjectResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Delete Object from the incremental base Backup.
///
/// Container for the necessary parameters to execute the DeleteObject service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteObject service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Attempted to make an operation on non-existing or expired
/// resource.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Retryable exception, indicates internal server error.
///
///
/// Increased rate over throttling limits. Can be retried with exponential backoff.
///
/// REST API Reference for DeleteObject Operation
public virtual Task DeleteObjectAsync(DeleteObjectRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteObjectRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteObjectResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetChunk
internal virtual GetChunkResponse GetChunk(GetChunkRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetChunkRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetChunkResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Gets the specified object's chunk.
///
/// Container for the necessary parameters to execute the GetChunk service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetChunk service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message
/// for details.
///
///
/// Non-retryable exception. Attempted to make an operation on non-existing or expired
/// resource.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Increased rate over throttling limits. Can be retried with exponential backoff.
///
/// REST API Reference for GetChunk Operation
public virtual Task GetChunkAsync(GetChunkRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetChunkRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetChunkResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetObjectMetadata
internal virtual GetObjectMetadataResponse GetObjectMetadata(GetObjectMetadataRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetObjectMetadataRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetObjectMetadataResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Get metadata associated with an Object.
///
/// Container for the necessary parameters to execute the GetObjectMetadata service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetObjectMetadata service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message
/// for details.
///
///
/// Non-retryable exception. Attempted to make an operation on non-existing or expired
/// resource.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Retryable exception, indicates internal server error.
///
///
/// Increased rate over throttling limits. Can be retried with exponential backoff.
///
/// REST API Reference for GetObjectMetadata Operation
public virtual Task GetObjectMetadataAsync(GetObjectMetadataRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetObjectMetadataRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetObjectMetadataResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListChunks
internal virtual ListChunksResponse ListChunks(ListChunksRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListChunksRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListChunksResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// List chunks in a given Object
///
/// Container for the necessary parameters to execute the ListChunks service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListChunks service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Attempted to make an operation on non-existing or expired
/// resource.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Retryable exception, indicates internal server error.
///
/// REST API Reference for ListChunks Operation
public virtual Task ListChunksAsync(ListChunksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListChunksRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListChunksResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListObjects
internal virtual ListObjectsResponse ListObjects(ListObjectsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListObjectsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListObjectsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// List all Objects in a given Backup.
///
/// Container for the necessary parameters to execute the ListObjects service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListObjects service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message
/// for details.
///
///
/// Non-retryable exception. Attempted to make an operation on non-existing or expired
/// resource.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Retryable exception, indicates internal server error.
///
///
/// Increased rate over throttling limits. Can be retried with exponential backoff.
///
/// REST API Reference for ListObjects Operation
public virtual Task ListObjectsAsync(ListObjectsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListObjectsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListObjectsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region NotifyObjectComplete
internal virtual NotifyObjectCompleteResponse NotifyObjectComplete(NotifyObjectCompleteRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = NotifyObjectCompleteRequestMarshaller.Instance;
options.ResponseUnmarshaller = NotifyObjectCompleteResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Complete upload
///
/// Container for the necessary parameters to execute the NotifyObjectComplete service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the NotifyObjectComplete service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message
/// for details.
///
///
/// Retryalble exception. Indicated issues while reading an input stream due to the networking
/// issues or connection drop on the client side.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Retryable exception, indicates internal server error.
///
///
/// Increased rate over throttling limits. Can be retried with exponential backoff.
///
/// REST API Reference for NotifyObjectComplete Operation
public virtual Task NotifyObjectCompleteAsync(NotifyObjectCompleteRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = NotifyObjectCompleteRequestMarshaller.Instance;
options.ResponseUnmarshaller = NotifyObjectCompleteResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region PutChunk
internal virtual PutChunkResponse PutChunk(PutChunkRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PutChunkRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutChunkResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Upload chunk.
///
/// Container for the necessary parameters to execute the PutChunk service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PutChunk service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message
/// for details.
///
///
/// Retryalble exception. Indicated issues while reading an input stream due to the networking
/// issues or connection drop on the client side.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Retryable exception, indicates internal server error.
///
///
/// Increased rate over throttling limits. Can be retried with exponential backoff.
///
/// REST API Reference for PutChunk Operation
public virtual Task PutChunkAsync(PutChunkRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = PutChunkRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutChunkResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region PutObject
internal virtual PutObjectResponse PutObject(PutObjectRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PutObjectRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutObjectResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Upload object that can store object metadata String and data blob in single API call
/// using inline chunk field.
///
/// Container for the necessary parameters to execute the PutObject service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PutObject service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message
/// for details.
///
///
/// Retryalble exception. Indicated issues while reading an input stream due to the networking
/// issues or connection drop on the client side.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Retryable exception, indicates internal server error.
///
///
/// Increased rate over throttling limits. Can be retried with exponential backoff.
///
/// REST API Reference for PutObject Operation
public virtual Task PutObjectAsync(PutObjectRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = PutObjectRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutObjectResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region StartObject
internal virtual StartObjectResponse StartObject(StartObjectRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartObjectRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartObjectResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Start upload containing one or many chunks.
///
/// Container for the necessary parameters to execute the StartObject service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the StartObject service method, as returned by BackupStorage.
///
///
///
///
/// Non-retryable exception. Attempted to create already existing object or chunk. This
/// message contains a checksum of already presented data.
///
///
/// Non-retryable exception, indicates client error (wrong argument passed to API). See
/// exception message for details.
///
///
/// Non-retryable exception. Attempted to make an operation on non-existing or expired
/// resource.
///
///
/// Retryable exception. In general indicates internal failure that can be fixed by retry.
///
///
/// Deprecated. To be removed from the model.
///
///
/// Retryable exception, indicates internal server error.
///
///
/// Increased rate over throttling limits. Can be retried with exponential backoff.
///
/// REST API Reference for StartObject Operation
public virtual Task StartObjectAsync(StartObjectRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = StartObjectRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartObjectResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}