/*
* 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 sagemaker-a2i-runtime-2019-11-07.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Net;
using Amazon.AugmentedAIRuntime.Model;
using Amazon.AugmentedAIRuntime.Model.Internal.MarshallTransformations;
using Amazon.AugmentedAIRuntime.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.AugmentedAIRuntime
{
///
/// Implementation for accessing AugmentedAIRuntime
///
/// Amazon Augmented AI (Amazon A2I) adds the benefit of human judgment to any machine
/// learning application. When an AI application can't evaluate data with a high degree
/// of confidence, human reviewers can take over. This human review is called a human
/// review workflow. To create and start a human review workflow, you need three resources:
/// a worker task template, a flow definition, and a human loop.
///
///
///
/// For information about these resources and prerequisites for using Amazon A2I, see
/// Get
/// Started with Amazon Augmented AI in the Amazon SageMaker Developer Guide.
///
///
///
/// This API reference includes information about API actions and data types that you
/// can use to interact with Amazon A2I programmatically. Use this guide to:
///
/// -
///
/// Start a human loop with the
StartHumanLoop
operation when using Amazon
/// A2I with a custom task type. To learn more about the difference between custom
/// and built-in task types, see Use
/// Task Types . To learn how to start a human loop using this API, see Create
/// and Start a Human Loop for a Custom Task Type in the Amazon SageMaker Developer
/// Guide.
///
/// -
///
/// Manage your human loops. You can list all human loops that you have created, describe
/// individual human loops, and stop and delete human loops. To learn more, see Monitor
/// and Manage Your Human Loop in the Amazon SageMaker Developer Guide.
///
///
///
/// Amazon A2I integrates APIs from various AWS services to create and start human review
/// workflows for those services. To learn how Amazon A2I uses these APIs, see Use
/// APIs in Amazon A2I in the Amazon SageMaker Developer Guide.
///
///
public partial class AmazonAugmentedAIRuntimeClient : AmazonServiceClient, IAmazonAugmentedAIRuntime
{
private static IServiceMetadata serviceMetadata = new AmazonAugmentedAIRuntimeMetadata();
#if BCL45 || AWS_ASYNC_ENUMERABLES_API
private IAugmentedAIRuntimePaginatorFactory _paginators;
///
/// Paginators for the service
///
public IAugmentedAIRuntimePaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new AugmentedAIRuntimePaginatorFactory(this);
}
return this._paginators;
}
}
#endif
#region Constructors
///
/// Constructs AmazonAugmentedAIRuntimeClient 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 AmazonAugmentedAIRuntimeClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonAugmentedAIRuntimeConfig()) { }
///
/// Constructs AmazonAugmentedAIRuntimeClient 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 AmazonAugmentedAIRuntimeClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonAugmentedAIRuntimeConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonAugmentedAIRuntimeClient 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 AmazonAugmentedAIRuntimeClient Configuration Object
public AmazonAugmentedAIRuntimeClient(AmazonAugmentedAIRuntimeConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonAugmentedAIRuntimeClient with AWS Credentials
///
/// AWS Credentials
public AmazonAugmentedAIRuntimeClient(AWSCredentials credentials)
: this(credentials, new AmazonAugmentedAIRuntimeConfig())
{
}
///
/// Constructs AmazonAugmentedAIRuntimeClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonAugmentedAIRuntimeClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonAugmentedAIRuntimeConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonAugmentedAIRuntimeClient with AWS Credentials and an
/// AmazonAugmentedAIRuntimeClient Configuration object.
///
/// AWS Credentials
/// The AmazonAugmentedAIRuntimeClient Configuration Object
public AmazonAugmentedAIRuntimeClient(AWSCredentials credentials, AmazonAugmentedAIRuntimeConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonAugmentedAIRuntimeClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonAugmentedAIRuntimeClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonAugmentedAIRuntimeConfig())
{
}
///
/// Constructs AmazonAugmentedAIRuntimeClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonAugmentedAIRuntimeClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonAugmentedAIRuntimeConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonAugmentedAIRuntimeClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonAugmentedAIRuntimeClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonAugmentedAIRuntimeClient Configuration Object
public AmazonAugmentedAIRuntimeClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonAugmentedAIRuntimeConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonAugmentedAIRuntimeClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonAugmentedAIRuntimeClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonAugmentedAIRuntimeConfig())
{
}
///
/// Constructs AmazonAugmentedAIRuntimeClient 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 AmazonAugmentedAIRuntimeClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonAugmentedAIRuntimeConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonAugmentedAIRuntimeClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonAugmentedAIRuntimeClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonAugmentedAIRuntimeClient Configuration Object
public AmazonAugmentedAIRuntimeClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonAugmentedAIRuntimeConfig 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 AmazonAugmentedAIRuntimeEndpointResolver());
}
///
/// 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 DeleteHumanLoop
///
/// Deletes the specified human loop for a flow definition.
///
///
///
/// If the human loop was deleted, this operation will return a ResourceNotFoundException
.
///
///
///
/// Container for the necessary parameters to execute the DeleteHumanLoop service method.
///
/// The response from the DeleteHumanLoop service method, as returned by AugmentedAIRuntime.
///
/// We couldn't process your request because of an issue with the server. Try again later.
///
///
/// We couldn't find the requested resource. Check that your resources exists and were
/// created in the same AWS Region as your request, and try your request again.
///
///
/// You exceeded the maximum number of requests.
///
///
/// The request isn't valid. Check the syntax and try again.
///
/// REST API Reference for DeleteHumanLoop Operation
public virtual DeleteHumanLoopResponse DeleteHumanLoop(DeleteHumanLoopRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteHumanLoopRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteHumanLoopResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the DeleteHumanLoop operation.
///
///
/// Container for the necessary parameters to execute the DeleteHumanLoop operation on AmazonAugmentedAIRuntimeClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteHumanLoop
/// operation.
/// REST API Reference for DeleteHumanLoop Operation
public virtual IAsyncResult BeginDeleteHumanLoop(DeleteHumanLoopRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteHumanLoopRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteHumanLoopResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the DeleteHumanLoop operation.
///
///
/// The IAsyncResult returned by the call to BeginDeleteHumanLoop.
///
/// Returns a DeleteHumanLoopResult from AugmentedAIRuntime.
/// REST API Reference for DeleteHumanLoop Operation
public virtual DeleteHumanLoopResponse EndDeleteHumanLoop(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region DescribeHumanLoop
///
/// Returns information about the specified human loop. If the human loop was deleted,
/// this operation will return a ResourceNotFoundException
error.
///
/// Container for the necessary parameters to execute the DescribeHumanLoop service method.
///
/// The response from the DescribeHumanLoop service method, as returned by AugmentedAIRuntime.
///
/// We couldn't process your request because of an issue with the server. Try again later.
///
///
/// We couldn't find the requested resource. Check that your resources exists and were
/// created in the same AWS Region as your request, and try your request again.
///
///
/// You exceeded the maximum number of requests.
///
///
/// The request isn't valid. Check the syntax and try again.
///
/// REST API Reference for DescribeHumanLoop Operation
public virtual DescribeHumanLoopResponse DescribeHumanLoop(DescribeHumanLoopRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeHumanLoopRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeHumanLoopResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the DescribeHumanLoop operation.
///
///
/// Container for the necessary parameters to execute the DescribeHumanLoop operation on AmazonAugmentedAIRuntimeClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeHumanLoop
/// operation.
/// REST API Reference for DescribeHumanLoop Operation
public virtual IAsyncResult BeginDescribeHumanLoop(DescribeHumanLoopRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeHumanLoopRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeHumanLoopResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the DescribeHumanLoop operation.
///
///
/// The IAsyncResult returned by the call to BeginDescribeHumanLoop.
///
/// Returns a DescribeHumanLoopResult from AugmentedAIRuntime.
/// REST API Reference for DescribeHumanLoop Operation
public virtual DescribeHumanLoopResponse EndDescribeHumanLoop(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region ListHumanLoops
///
/// Returns information about human loops, given the specified parameters. If a human
/// loop was deleted, it will not be included.
///
/// Container for the necessary parameters to execute the ListHumanLoops service method.
///
/// The response from the ListHumanLoops service method, as returned by AugmentedAIRuntime.
///
/// We couldn't process your request because of an issue with the server. Try again later.
///
///
/// We couldn't find the requested resource. Check that your resources exists and were
/// created in the same AWS Region as your request, and try your request again.
///
///
/// You exceeded the maximum number of requests.
///
///
/// The request isn't valid. Check the syntax and try again.
///
/// REST API Reference for ListHumanLoops Operation
public virtual ListHumanLoopsResponse ListHumanLoops(ListHumanLoopsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListHumanLoopsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListHumanLoopsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the ListHumanLoops operation.
///
///
/// Container for the necessary parameters to execute the ListHumanLoops operation on AmazonAugmentedAIRuntimeClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListHumanLoops
/// operation.
/// REST API Reference for ListHumanLoops Operation
public virtual IAsyncResult BeginListHumanLoops(ListHumanLoopsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListHumanLoopsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListHumanLoopsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the ListHumanLoops operation.
///
///
/// The IAsyncResult returned by the call to BeginListHumanLoops.
///
/// Returns a ListHumanLoopsResult from AugmentedAIRuntime.
/// REST API Reference for ListHumanLoops Operation
public virtual ListHumanLoopsResponse EndListHumanLoops(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region StartHumanLoop
///
/// Starts a human loop, provided that at least one activation condition is met.
///
/// Container for the necessary parameters to execute the StartHumanLoop service method.
///
/// The response from the StartHumanLoop service method, as returned by AugmentedAIRuntime.
///
/// Your request has the same name as another active human loop but has different input
/// data. You cannot start two human loops with the same name and different input data.
///
///
/// We couldn't process your request because of an issue with the server. Try again later.
///
///
/// You exceeded your service quota. Service quotas, also referred to as limits, are the
/// maximum number of service resources or operations for your AWS account. For a list
/// of Amazon A2I service quotes, see Amazon
/// Augmented AI Service Quotes. Delete some resources or request an increase in your
/// service quota. You can request a quota increase using Service Quotas or the AWS Support
/// Center. To request an increase, see AWS
/// Service Quotas in the AWS General Reference.
///
///
/// You exceeded the maximum number of requests.
///
///
/// The request isn't valid. Check the syntax and try again.
///
/// REST API Reference for StartHumanLoop Operation
public virtual StartHumanLoopResponse StartHumanLoop(StartHumanLoopRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartHumanLoopRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartHumanLoopResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the StartHumanLoop operation.
///
///
/// Container for the necessary parameters to execute the StartHumanLoop operation on AmazonAugmentedAIRuntimeClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartHumanLoop
/// operation.
/// REST API Reference for StartHumanLoop Operation
public virtual IAsyncResult BeginStartHumanLoop(StartHumanLoopRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartHumanLoopRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartHumanLoopResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the StartHumanLoop operation.
///
///
/// The IAsyncResult returned by the call to BeginStartHumanLoop.
///
/// Returns a StartHumanLoopResult from AugmentedAIRuntime.
/// REST API Reference for StartHumanLoop Operation
public virtual StartHumanLoopResponse EndStartHumanLoop(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region StopHumanLoop
///
/// Stops the specified human loop.
///
/// Container for the necessary parameters to execute the StopHumanLoop service method.
///
/// The response from the StopHumanLoop service method, as returned by AugmentedAIRuntime.
///
/// We couldn't process your request because of an issue with the server. Try again later.
///
///
/// We couldn't find the requested resource. Check that your resources exists and were
/// created in the same AWS Region as your request, and try your request again.
///
///
/// You exceeded the maximum number of requests.
///
///
/// The request isn't valid. Check the syntax and try again.
///
/// REST API Reference for StopHumanLoop Operation
public virtual StopHumanLoopResponse StopHumanLoop(StopHumanLoopRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = StopHumanLoopRequestMarshaller.Instance;
options.ResponseUnmarshaller = StopHumanLoopResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the StopHumanLoop operation.
///
///
/// Container for the necessary parameters to execute the StopHumanLoop operation on AmazonAugmentedAIRuntimeClient.
/// An AsyncCallback delegate that is invoked when the operation completes.
/// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.
///
/// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopHumanLoop
/// operation.
/// REST API Reference for StopHumanLoop Operation
public virtual IAsyncResult BeginStopHumanLoop(StopHumanLoopRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = StopHumanLoopRequestMarshaller.Instance;
options.ResponseUnmarshaller = StopHumanLoopResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the StopHumanLoop operation.
///
///
/// The IAsyncResult returned by the call to BeginStopHumanLoop.
///
/// Returns a StopHumanLoopResult from AugmentedAIRuntime.
/// REST API Reference for StopHumanLoop Operation
public virtual StopHumanLoopResponse EndStopHumanLoop(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
}
}