Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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 IoT Core pricing - Messaging.
Synopsis
- data Publish = Publish' {}
- newPublish :: Text -> Publish
- publish_retain :: Lens' Publish (Maybe Bool)
- publish_payload :: Lens' Publish (Maybe ByteString)
- publish_qos :: Lens' Publish (Maybe Natural)
- publish_topic :: Lens' Publish Text
- data PublishResponse = PublishResponse' {
- newPublishResponse :: PublishResponse
Creating a Request
The input for the Publish operation.
See: newPublish
smart constructor.
Publish' | |
|
Instances
Create a value of Publish
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:retain:Publish'
, publish_retain
- A Boolean value that determines whether to set the RETAIN flag when the
message is published.
Setting the RETAIN flag causes the message to be retained and sent to new subscribers to the topic.
Valid values: true
| false
Default value: false
$sel:payload:Publish'
, publish_payload
- The message body. MQTT accepts text, binary, and empty (null) message
payloads.
Publishing an empty (null) payload with retain = true
deletes the
retained message identified by topic from IoT Core.
$sel:qos:Publish'
, publish_qos
- The Quality of Service (QoS) level.
$sel:topic:Publish'
, publish_topic
- The name of the MQTT topic.
Request Lenses
publish_retain :: Lens' Publish (Maybe Bool) Source #
A Boolean value that determines whether to set the RETAIN flag when the message is published.
Setting the RETAIN flag causes the message to be retained and sent to new subscribers to the topic.
Valid values: true
| false
Default value: false
publish_payload :: Lens' Publish (Maybe ByteString) Source #
The message body. MQTT accepts text, binary, and empty (null) message payloads.
Publishing an empty (null) payload with retain = true
deletes the
retained message identified by topic from IoT Core.
Destructuring the Response
data PublishResponse Source #
See: newPublishResponse
smart constructor.
Instances
Eq PublishResponse Source # | |
Defined in Amazonka.IoTData.Publish (==) :: PublishResponse -> PublishResponse -> Bool # (/=) :: PublishResponse -> PublishResponse -> Bool # | |
Read PublishResponse Source # | |
Defined in Amazonka.IoTData.Publish | |
Show PublishResponse Source # | |
Defined in Amazonka.IoTData.Publish showsPrec :: Int -> PublishResponse -> ShowS # show :: PublishResponse -> String # showList :: [PublishResponse] -> ShowS # | |
Generic PublishResponse Source # | |
Defined in Amazonka.IoTData.Publish type Rep PublishResponse :: Type -> Type # from :: PublishResponse -> Rep PublishResponse x # to :: Rep PublishResponse x -> PublishResponse # | |
NFData PublishResponse Source # | |
Defined in Amazonka.IoTData.Publish rnf :: PublishResponse -> () # | |
type Rep PublishResponse Source # | |
newPublishResponse :: PublishResponse Source #
Create a value of PublishResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.