/*
* 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-edge-2020-09-23.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Net;
using Amazon.SagemakerEdgeManager.Model;
using Amazon.SagemakerEdgeManager.Model.Internal.MarshallTransformations;
using Amazon.SagemakerEdgeManager.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.SagemakerEdgeManager
{
///
/// Implementation for accessing SagemakerEdgeManager
///
/// SageMaker Edge Manager dataplane service for communicating with active agents.
///
public partial class AmazonSagemakerEdgeManagerClient : AmazonServiceClient, IAmazonSagemakerEdgeManager
{
private static IServiceMetadata serviceMetadata = new AmazonSagemakerEdgeManagerMetadata();
#region Constructors
///
/// Constructs AmazonSagemakerEdgeManagerClient 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 AmazonSagemakerEdgeManagerClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonSagemakerEdgeManagerConfig()) { }
///
/// Constructs AmazonSagemakerEdgeManagerClient 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 AmazonSagemakerEdgeManagerClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonSagemakerEdgeManagerConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonSagemakerEdgeManagerClient 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 AmazonSagemakerEdgeManagerClient Configuration Object
public AmazonSagemakerEdgeManagerClient(AmazonSagemakerEdgeManagerConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonSagemakerEdgeManagerClient with AWS Credentials
///
/// AWS Credentials
public AmazonSagemakerEdgeManagerClient(AWSCredentials credentials)
: this(credentials, new AmazonSagemakerEdgeManagerConfig())
{
}
///
/// Constructs AmazonSagemakerEdgeManagerClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonSagemakerEdgeManagerClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonSagemakerEdgeManagerConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonSagemakerEdgeManagerClient with AWS Credentials and an
/// AmazonSagemakerEdgeManagerClient Configuration object.
///
/// AWS Credentials
/// The AmazonSagemakerEdgeManagerClient Configuration Object
public AmazonSagemakerEdgeManagerClient(AWSCredentials credentials, AmazonSagemakerEdgeManagerConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonSagemakerEdgeManagerClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonSagemakerEdgeManagerClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonSagemakerEdgeManagerConfig())
{
}
///
/// Constructs AmazonSagemakerEdgeManagerClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonSagemakerEdgeManagerClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonSagemakerEdgeManagerConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonSagemakerEdgeManagerClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonSagemakerEdgeManagerClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonSagemakerEdgeManagerClient Configuration Object
public AmazonSagemakerEdgeManagerClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonSagemakerEdgeManagerConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonSagemakerEdgeManagerClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonSagemakerEdgeManagerClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonSagemakerEdgeManagerConfig())
{
}
///
/// Constructs AmazonSagemakerEdgeManagerClient 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 AmazonSagemakerEdgeManagerClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonSagemakerEdgeManagerConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonSagemakerEdgeManagerClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonSagemakerEdgeManagerClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonSagemakerEdgeManagerClient Configuration Object
public AmazonSagemakerEdgeManagerClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonSagemakerEdgeManagerConfig 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 AmazonSagemakerEdgeManagerEndpointResolver());
}
///
/// 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 GetDeployments
///
/// Use to get the active deployments from a device.
///
/// Container for the necessary parameters to execute the GetDeployments service method.
///
/// The response from the GetDeployments service method, as returned by SagemakerEdgeManager.
///
/// An internal failure occurred. Try your request again. If the problem persists, contact
/// Amazon Web Services customer support.
///
/// REST API Reference for GetDeployments Operation
public virtual GetDeploymentsResponse GetDeployments(GetDeploymentsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetDeploymentsRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetDeploymentsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the GetDeployments operation.
///
///
/// Container for the necessary parameters to execute the GetDeployments operation on AmazonSagemakerEdgeManagerClient.
/// 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 EndGetDeployments
/// operation.
/// REST API Reference for GetDeployments Operation
public virtual IAsyncResult BeginGetDeployments(GetDeploymentsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetDeploymentsRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetDeploymentsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the GetDeployments operation.
///
///
/// The IAsyncResult returned by the call to BeginGetDeployments.
///
/// Returns a GetDeploymentsResult from SagemakerEdgeManager.
/// REST API Reference for GetDeployments Operation
public virtual GetDeploymentsResponse EndGetDeployments(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region GetDeviceRegistration
///
/// Use to check if a device is registered with SageMaker Edge Manager.
///
/// Container for the necessary parameters to execute the GetDeviceRegistration service method.
///
/// The response from the GetDeviceRegistration service method, as returned by SagemakerEdgeManager.
///
/// An internal failure occurred. Try your request again. If the problem persists, contact
/// Amazon Web Services customer support.
///
/// REST API Reference for GetDeviceRegistration Operation
public virtual GetDeviceRegistrationResponse GetDeviceRegistration(GetDeviceRegistrationRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetDeviceRegistrationRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetDeviceRegistrationResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the GetDeviceRegistration operation.
///
///
/// Container for the necessary parameters to execute the GetDeviceRegistration operation on AmazonSagemakerEdgeManagerClient.
/// 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 EndGetDeviceRegistration
/// operation.
/// REST API Reference for GetDeviceRegistration Operation
public virtual IAsyncResult BeginGetDeviceRegistration(GetDeviceRegistrationRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetDeviceRegistrationRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetDeviceRegistrationResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the GetDeviceRegistration operation.
///
///
/// The IAsyncResult returned by the call to BeginGetDeviceRegistration.
///
/// Returns a GetDeviceRegistrationResult from SagemakerEdgeManager.
/// REST API Reference for GetDeviceRegistration Operation
public virtual GetDeviceRegistrationResponse EndGetDeviceRegistration(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region SendHeartbeat
///
/// Use to get the current status of devices registered on SageMaker Edge Manager.
///
/// Container for the necessary parameters to execute the SendHeartbeat service method.
///
/// The response from the SendHeartbeat service method, as returned by SagemakerEdgeManager.
///
/// An internal failure occurred. Try your request again. If the problem persists, contact
/// Amazon Web Services customer support.
///
/// REST API Reference for SendHeartbeat Operation
public virtual SendHeartbeatResponse SendHeartbeat(SendHeartbeatRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SendHeartbeatRequestMarshaller.Instance;
options.ResponseUnmarshaller = SendHeartbeatResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the SendHeartbeat operation.
///
///
/// Container for the necessary parameters to execute the SendHeartbeat operation on AmazonSagemakerEdgeManagerClient.
/// 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 EndSendHeartbeat
/// operation.
/// REST API Reference for SendHeartbeat Operation
public virtual IAsyncResult BeginSendHeartbeat(SendHeartbeatRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = SendHeartbeatRequestMarshaller.Instance;
options.ResponseUnmarshaller = SendHeartbeatResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the SendHeartbeat operation.
///
///
/// The IAsyncResult returned by the call to BeginSendHeartbeat.
///
/// Returns a SendHeartbeatResult from SagemakerEdgeManager.
/// REST API Reference for SendHeartbeat Operation
public virtual SendHeartbeatResponse EndSendHeartbeat(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
}
}