/*
* 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 iot-data-2015-05-28.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Net;
using Amazon.IotData.Model;
using Amazon.IotData.Model.Internal.MarshallTransformations;
using Amazon.IotData.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.IotData
{
///
/// Implementation for accessing IotData
///
/// IoT data
///
/// IoT data enables secure, bi-directional communication between Internet-connected things
/// (such as sensors, actuators, embedded devices, or smart appliances) and the Amazon
/// Web Services cloud. It implements a broker for applications and things to publish
/// messages over HTTP (Publish) and retrieve, update, and delete shadows. A shadow is
/// a persistent representation of your things and their state in the Amazon Web Services
/// cloud.
///
///
///
/// Find the endpoint address for actions in IoT data by running this CLI command:
///
///
///
/// aws iot describe-endpoint --endpoint-type iot:Data-ATS
///
///
///
/// The service name used by Amazon
/// Web ServicesSignature Version 4 to sign requests is: iotdevicegateway.
///
///
public partial class AmazonIotDataClient : AmazonServiceClient, IAmazonIotData
{
private static IServiceMetadata serviceMetadata = new AmazonIotDataMetadata();
#if BCL45 || AWS_ASYNC_ENUMERABLES_API
private IIotDataPaginatorFactory _paginators;
///
/// Paginators for the service
///
public IIotDataPaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new IotDataPaginatorFactory(this);
}
return this._paginators;
}
}
#endif
#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 AmazonIotDataEndpointResolver());
}
///
/// 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 DeleteThingShadow
///
/// Deletes the shadow for the specified thing.
///
///
///
/// Requires permission to access the DeleteThingShadow
/// action.
///
///
///
/// For more information, see DeleteThingShadow
/// in the IoT Developer Guide.
///
///
/// Container for the necessary parameters to execute the DeleteThingShadow service method.
///
/// The response from the DeleteThingShadow service method, as returned by IotData.
///
/// An unexpected error has occurred.
///
///
/// The request is not valid.
///
///
/// The specified combination of HTTP verb and URI is not supported.
///
///
/// The specified resource does not exist.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
///
/// You are not authorized to perform this operation.
///
///
/// The document encoding is not supported.
///
/// REST API Reference for DeleteThingShadow Operation
public virtual DeleteThingShadowResponse DeleteThingShadow(DeleteThingShadowRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteThingShadowRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteThingShadowResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the DeleteThingShadow operation.
///
///
/// Container for the necessary parameters to execute the DeleteThingShadow operation on AmazonIotDataClient.
/// 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 EndDeleteThingShadow
/// operation.
/// REST API Reference for DeleteThingShadow Operation
public virtual IAsyncResult BeginDeleteThingShadow(DeleteThingShadowRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteThingShadowRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteThingShadowResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the DeleteThingShadow operation.
///
///
/// The IAsyncResult returned by the call to BeginDeleteThingShadow.
///
/// Returns a DeleteThingShadowResult from IotData.
/// REST API Reference for DeleteThingShadow Operation
public virtual DeleteThingShadowResponse EndDeleteThingShadow(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region GetRetainedMessage
///
/// Gets the details of a single retained message for the specified topic.
///
///
///
/// This action returns the message payload of the retained message, which can incur messaging
/// costs. To list only the topic names of the retained messages, call ListRetainedMessages.
///
///
///
/// Requires permission to access the GetRetainedMessage
/// action.
///
///
///
/// For more information about messaging costs, see Amazon
/// Web Services IoT Core pricing - Messaging.
///
///
/// Container for the necessary parameters to execute the GetRetainedMessage service method.
///
/// The response from the GetRetainedMessage service method, as returned by IotData.
///
/// An unexpected error has occurred.
///
///
/// The request is not valid.
///
///
/// The specified combination of HTTP verb and URI is not supported.
///
///
/// The specified resource does not exist.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
///
/// You are not authorized to perform this operation.
///
/// REST API Reference for GetRetainedMessage Operation
public virtual GetRetainedMessageResponse GetRetainedMessage(GetRetainedMessageRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetRetainedMessageRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetRetainedMessageResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the GetRetainedMessage operation.
///
///
/// Container for the necessary parameters to execute the GetRetainedMessage operation on AmazonIotDataClient.
/// 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 EndGetRetainedMessage
/// operation.
/// REST API Reference for GetRetainedMessage Operation
public virtual IAsyncResult BeginGetRetainedMessage(GetRetainedMessageRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetRetainedMessageRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetRetainedMessageResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the GetRetainedMessage operation.
///
///
/// The IAsyncResult returned by the call to BeginGetRetainedMessage.
///
/// Returns a GetRetainedMessageResult from IotData.
/// REST API Reference for GetRetainedMessage Operation
public virtual GetRetainedMessageResponse EndGetRetainedMessage(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region GetThingShadow
///
/// Gets the shadow for the specified thing.
///
///
///
/// Requires permission to access the GetThingShadow
/// action.
///
///
///
/// For more information, see GetThingShadow
/// in the IoT Developer Guide.
///
///
/// Container for the necessary parameters to execute the GetThingShadow service method.
///
/// The response from the GetThingShadow service method, as returned by IotData.
///
/// An unexpected error has occurred.
///
///
/// The request is not valid.
///
///
/// The specified combination of HTTP verb and URI is not supported.
///
///
/// The specified resource does not exist.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
///
/// You are not authorized to perform this operation.
///
///
/// The document encoding is not supported.
///
/// REST API Reference for GetThingShadow Operation
public virtual GetThingShadowResponse GetThingShadow(GetThingShadowRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetThingShadowRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetThingShadowResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the GetThingShadow operation.
///
///
/// Container for the necessary parameters to execute the GetThingShadow operation on AmazonIotDataClient.
/// 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 EndGetThingShadow
/// operation.
/// REST API Reference for GetThingShadow Operation
public virtual IAsyncResult BeginGetThingShadow(GetThingShadowRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetThingShadowRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetThingShadowResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the GetThingShadow operation.
///
///
/// The IAsyncResult returned by the call to BeginGetThingShadow.
///
/// Returns a GetThingShadowResult from IotData.
/// REST API Reference for GetThingShadow Operation
public virtual GetThingShadowResponse EndGetThingShadow(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region ListNamedShadowsForThing
///
/// Lists the shadows for the specified thing.
///
///
///
/// Requires permission to access the ListNamedShadowsForThing
/// action.
///
///
/// Container for the necessary parameters to execute the ListNamedShadowsForThing service method.
///
/// The response from the ListNamedShadowsForThing service method, as returned by IotData.
///
/// An unexpected error has occurred.
///
///
/// The request is not valid.
///
///
/// The specified combination of HTTP verb and URI is not supported.
///
///
/// The specified resource does not exist.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
///
/// You are not authorized to perform this operation.
///
/// REST API Reference for ListNamedShadowsForThing Operation
public virtual ListNamedShadowsForThingResponse ListNamedShadowsForThing(ListNamedShadowsForThingRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListNamedShadowsForThingRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListNamedShadowsForThingResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the ListNamedShadowsForThing operation.
///
///
/// Container for the necessary parameters to execute the ListNamedShadowsForThing operation on AmazonIotDataClient.
/// 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 EndListNamedShadowsForThing
/// operation.
/// REST API Reference for ListNamedShadowsForThing Operation
public virtual IAsyncResult BeginListNamedShadowsForThing(ListNamedShadowsForThingRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListNamedShadowsForThingRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListNamedShadowsForThingResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the ListNamedShadowsForThing operation.
///
///
/// The IAsyncResult returned by the call to BeginListNamedShadowsForThing.
///
/// Returns a ListNamedShadowsForThingResult from IotData.
/// REST API Reference for ListNamedShadowsForThing Operation
public virtual ListNamedShadowsForThingResponse EndListNamedShadowsForThing(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region ListRetainedMessages
///
/// Lists summary information about the retained messages stored for the account.
///
///
///
/// This action returns only the topic names of the retained messages. It doesn't return
/// any message payloads. Although this action doesn't return a message payload, it can
/// still incur messaging costs.
///
///
///
/// To get the message payload of a retained message, call GetRetainedMessage
/// with the topic name of the retained message.
///
///
///
/// Requires permission to access the ListRetainedMessages
/// action.
///
///
///
/// For more information about messaging costs, see Amazon
/// Web Services IoT Core pricing - Messaging.
///
///
/// Container for the necessary parameters to execute the ListRetainedMessages service method.
///
/// The response from the ListRetainedMessages service method, as returned by IotData.
///
/// An unexpected error has occurred.
///
///
/// The request is not valid.
///
///
/// The specified combination of HTTP verb and URI is not supported.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
///
/// You are not authorized to perform this operation.
///
/// REST API Reference for ListRetainedMessages Operation
public virtual ListRetainedMessagesResponse ListRetainedMessages(ListRetainedMessagesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListRetainedMessagesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListRetainedMessagesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the ListRetainedMessages operation.
///
///
/// Container for the necessary parameters to execute the ListRetainedMessages operation on AmazonIotDataClient.
/// 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 EndListRetainedMessages
/// operation.
/// REST API Reference for ListRetainedMessages Operation
public virtual IAsyncResult BeginListRetainedMessages(ListRetainedMessagesRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListRetainedMessagesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListRetainedMessagesResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the ListRetainedMessages operation.
///
///
/// The IAsyncResult returned by the call to BeginListRetainedMessages.
///
/// Returns a ListRetainedMessagesResult from IotData.
/// REST API Reference for ListRetainedMessages Operation
public virtual ListRetainedMessagesResponse EndListRetainedMessages(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region Publish
///
/// Publishes an MQTT message.
///
///
///
/// Requires permission to access the Publish
/// action.
///
///
///
/// For more information about MQTT messages, see MQTT
/// Protocol in the IoT Developer Guide.
///
///
///
/// For more information about messaging costs, see Amazon
/// Web Services IoT Core pricing - Messaging.
///
///
/// Container for the necessary parameters to execute the Publish service method.
///
/// The response from the Publish service method, as returned by IotData.
///
/// An unexpected error has occurred.
///
///
/// The request is not valid.
///
///
/// The specified combination of HTTP verb and URI is not supported.
///
///
/// The rate exceeds the limit.
///
///
/// You are not authorized to perform this operation.
///
/// REST API Reference for Publish Operation
public virtual PublishResponse Publish(PublishRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PublishRequestMarshaller.Instance;
options.ResponseUnmarshaller = PublishResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the Publish operation.
///
///
/// Container for the necessary parameters to execute the Publish operation on AmazonIotDataClient.
/// 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 EndPublish
/// operation.
/// REST API Reference for Publish Operation
public virtual IAsyncResult BeginPublish(PublishRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = PublishRequestMarshaller.Instance;
options.ResponseUnmarshaller = PublishResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the Publish operation.
///
///
/// The IAsyncResult returned by the call to BeginPublish.
///
/// Returns a PublishResult from IotData.
/// REST API Reference for Publish Operation
public virtual PublishResponse EndPublish(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
#region UpdateThingShadow
///
/// Updates the shadow for the specified thing.
///
///
///
/// Requires permission to access the UpdateThingShadow
/// action.
///
///
///
/// For more information, see UpdateThingShadow
/// in the IoT Developer Guide.
///
///
/// Container for the necessary parameters to execute the UpdateThingShadow service method.
///
/// The response from the UpdateThingShadow service method, as returned by IotData.
///
/// The specified version does not match the version of the document.
///
///
/// An unexpected error has occurred.
///
///
/// The request is not valid.
///
///
/// The specified combination of HTTP verb and URI is not supported.
///
///
/// The payload exceeds the maximum size allowed.
///
///
/// The service is temporarily unavailable.
///
///
/// The rate exceeds the limit.
///
///
/// You are not authorized to perform this operation.
///
///
/// The document encoding is not supported.
///
/// REST API Reference for UpdateThingShadow Operation
public virtual UpdateThingShadowResponse UpdateThingShadow(UpdateThingShadowRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateThingShadowRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateThingShadowResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Initiates the asynchronous execution of the UpdateThingShadow operation.
///
///
/// Container for the necessary parameters to execute the UpdateThingShadow operation on AmazonIotDataClient.
/// 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 EndUpdateThingShadow
/// operation.
/// REST API Reference for UpdateThingShadow Operation
public virtual IAsyncResult BeginUpdateThingShadow(UpdateThingShadowRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateThingShadowRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateThingShadowResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
///
/// Finishes the asynchronous execution of the UpdateThingShadow operation.
///
///
/// The IAsyncResult returned by the call to BeginUpdateThingShadow.
///
/// Returns a UpdateThingShadowResult from IotData.
/// REST API Reference for UpdateThingShadow Operation
public virtual UpdateThingShadowResponse EndUpdateThingShadow(IAsyncResult asyncResult)
{
return EndInvoke(asyncResult);
}
#endregion
}
}