AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.IotData.AmazonIotDataClient

Namespace: Amazon.IotData
Assembly: AWSSDK.IotData.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonIotDataClient : AmazonServiceClient
         IAmazonIotData, IAmazonService, IDisposable

The AmazonIotDataClient type exposes the following members

Constructors

NameDescription
Public Method AmazonIotDataClient(string)

Constructs AmazonIotDataClient 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 Method AmazonIotDataClient(AmazonIotDataConfig)

Constructs AmazonIotDataClient 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 Method AmazonIotDataClient(string, AWSCredentials)

Constructs AmazonIotDataClient with AWS Credentials

Public Method AmazonIotDataClient(AWSCredentials, AmazonIotDataConfig)

Constructs AmazonIotDataClient with AWS Credentials and an AmazonIotDataClient Configuration object.

Public Method AmazonIotDataClient(string, string, string)

Constructs AmazonIotDataClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonIotDataClient(string, string, AmazonIotDataConfig)

Constructs AmazonIotDataClient with AWS Access Key ID, AWS Secret Key and an AmazonIotDataClient Configuration object.

Public Method AmazonIotDataClient(string, string, string, string)

Constructs AmazonIotDataClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonIotDataClient(string, string, string, AmazonIotDataConfig)

Constructs AmazonIotDataClient with AWS Access Key ID, AWS Secret Key and an AmazonIotDataClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.
Public Property Paginators Amazon.IotData.Model.IIotDataPaginatorFactory

Paginators for the service

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method DeleteThingShadow(DeleteThingShadowRequest)

Deletes the shadow for the specified thing.

Requires permission to access the DeleteThingShadow action.

For more information, see DeleteThingShadow in the IoT Developer Guide.

Public Method DeleteThingShadowAsync(DeleteThingShadowRequest, CancellationToken)

Deletes the shadow for the specified thing.

Requires permission to access the DeleteThingShadow action.

For more information, see DeleteThingShadow in the IoT Developer Guide.

Public Method DetermineServiceOperationEndpoint(AmazonWebServiceRequest)

Returns the endpoint that will be used for a particular request.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method GetRetainedMessage(GetRetainedMessageRequest)

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.

Public Method GetRetainedMessageAsync(GetRetainedMessageRequest, CancellationToken)

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.

Public Method GetThingShadow(GetThingShadowRequest)

Gets the shadow for the specified thing.

Requires permission to access the GetThingShadow action.

For more information, see GetThingShadow in the IoT Developer Guide.

Public Method GetThingShadowAsync(GetThingShadowRequest, CancellationToken)

Gets the shadow for the specified thing.

Requires permission to access the GetThingShadow action.

For more information, see GetThingShadow in the IoT Developer Guide.

Public Method ListNamedShadowsForThing(ListNamedShadowsForThingRequest)

Lists the shadows for the specified thing.

Requires permission to access the ListNamedShadowsForThing action.

Public Method ListNamedShadowsForThingAsync(ListNamedShadowsForThingRequest, CancellationToken)

Lists the shadows for the specified thing.

Requires permission to access the ListNamedShadowsForThing action.

Public Method ListRetainedMessages(ListRetainedMessagesRequest)

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.

Public Method ListRetainedMessagesAsync(ListRetainedMessagesRequest, CancellationToken)

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.

Public Method Publish(PublishRequest)

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.

Public Method PublishAsync(PublishRequest, CancellationToken)

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.

Public Method UpdateThingShadow(UpdateThingShadowRequest)

Updates the shadow for the specified thing.

Requires permission to access the UpdateThingShadow action.

For more information, see UpdateThingShadow in the IoT Developer Guide.

Public Method UpdateThingShadowAsync(UpdateThingShadowRequest, CancellationToken)

Updates the shadow for the specified thing.

Requires permission to access the UpdateThingShadow action.

For more information, see UpdateThingShadow in the IoT Developer Guide.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer, 3.5