IoTDataPlane
Service object for interacting with AWS IoTDataPlane service.
public struct IoTDataPlane: AWSService
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
AWSService
Initializers
init(client:region:partition:endpoint:timeout:byteBufferAllocator:options:)
Initialize the IoTDataPlane client
public init(
client: AWSClient,
region: SotoCore.Region? = nil,
partition: AWSPartition = .aws,
endpoint: String? = nil,
timeout: TimeAmount? = nil,
byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
options: AWSServiceConfig.Options = []
)
Parameters
- client: AWSClient used to process requests
- region: Region of server you want to communicate with. This will override the partition parameter.
- partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
- endpoint: Custom endpoint URL to use instead of standard AWS servers
- timeout: Timeout value for HTTP requests
init(from:patch:)
Initializer required by AWSService.with(middlewares:timeout:byteBufferAllocator:options)
. You are not able to use this initializer directly as there are no public initializers for AWSServiceConfig.Patch
. Please use AWSService.with(middlewares:timeout:byteBufferAllocator:options)
instead.
public init(from: IoTDataPlane, patch: AWSServiceConfig.Patch)
Properties
client
Client used for communication with AWS
public let client: AWSClient
config
Service configuration
public let config: AWSServiceConfig
Methods
deleteThingShadow(_:logger:on:)
public func deleteThingShadow(_ input: DeleteThingShadowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<DeleteThingShadowResponse>
Deletes the shadow for the specified thing.
Requires permission to access the DeleteThingShadow action.
For more information, see DeleteThingShadow in the IoT Developer Guide.
getRetainedMessage(_:logger:on:)
public func getRetainedMessage(_ input: GetRetainedMessageRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<GetRetainedMessageResponse>
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.
getThingShadow(_:logger:on:)
public func getThingShadow(_ input: GetThingShadowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<GetThingShadowResponse>
Gets the shadow for the specified thing.
Requires permission to access the GetThingShadow action.
For more information, see GetThingShadow in the IoT Developer Guide.
listNamedShadowsForThing(_:logger:on:)
public func listNamedShadowsForThing(_ input: ListNamedShadowsForThingRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListNamedShadowsForThingResponse>
Lists the shadows for the specified thing.
Requires permission to access the ListNamedShadowsForThing action.
listRetainedMessages(_:logger:on:)
public func listRetainedMessages(_ input: ListRetainedMessagesRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<ListRetainedMessagesResponse>
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.
publish(_:logger:on:)
@discardableResult public func publish(_ input: PublishRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<Void>
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.
updateThingShadow(_:logger:on:)
public func updateThingShadow(_ input: UpdateThingShadowRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) -> EventLoopFuture<UpdateThingShadowResponse>
Updates the shadow for the specified thing.
Requires permission to access the UpdateThingShadow action.
For more information, see UpdateThingShadow in the IoT Developer Guide.
listRetainedMessagesPaginator(_:logger:on:)
compiler(>=5.5.2) && canImport(_Concurrency)
public func listRetainedMessagesPaginator( _ input: ListRetainedMessagesRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil ) -> AWSClient.PaginatorSequence<ListRetainedMessagesRequest, ListRetainedMessagesResponse>
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.
Return PaginatorSequence for operation. - Parameters: - input: Input for request - logger: Logger used flot logging - eventLoop: EventLoop to run this process on
listRetainedMessagesPaginator(_:_:logger:on:onPage:)
Provide paginated results to closure onPage
for it to combine them into one result. This works in a similar manner to Array.reduce<Result>(_:_:) -> Result
.
public func listRetainedMessagesPaginator<Result>(
_ input: ListRetainedMessagesRequest,
_ initialValue: Result,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (Result, ListRetainedMessagesResponse, EventLoop) -> EventLoopFuture<(Bool, Result)>
) -> EventLoopFuture<Result>
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.
Parameters:
- input: Input for request
- initialValue: The value to use as the initial accumulating value.
initialValue
is passed toonPage
the first time it is called.
- logger: Logger used flot logging
- eventLoop: EventLoop to run this process on
- onPage: closure called with each paginated response. It combines an accumulating result with the contents of response. This combined result is then returned along with a boolean indicating if the paginate operation should continue.
listRetainedMessagesPaginator(_:logger:on:onPage:)
Provide paginated results to closure onPage
.
public func listRetainedMessagesPaginator(
_ input: ListRetainedMessagesRequest,
logger: Logger = AWSClient.loggingDisabled,
on eventLoop: EventLoop? = nil,
onPage: @escaping (ListRetainedMessagesResponse, EventLoop) -> EventLoopFuture<Bool>
) -> EventLoopFuture<Void>
Parameters
- input: Input for request
- logger: Logger used flot logging
- eventLoop: EventLoop to run this process on
- onPage: closure called with each block of entries. Returns boolean indicating whether we should continue.