libZSservicesZSamazonka-iot-dataplaneZSamazonka-iot-dataplane
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.IoTData.Publish

Description

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

Creating a Request

data Publish Source #

The input for the Publish operation.

See: newPublish smart constructor.

Constructors

Publish' 

Fields

  • retain :: Maybe Bool

    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

  • payload :: Maybe ByteString

    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.

  • qos :: Maybe Natural

    The Quality of Service (QoS) level.

  • topic :: Text

    The name of the MQTT topic.

Instances

Instances details
Eq Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Methods

(==) :: Publish -> Publish -> Bool #

(/=) :: Publish -> Publish -> Bool #

Read Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Show Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Generic Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Associated Types

type Rep Publish :: Type -> Type #

Methods

from :: Publish -> Rep Publish x #

to :: Rep Publish x -> Publish #

NFData Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Methods

rnf :: Publish -> () #

Hashable Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Methods

hashWithSalt :: Int -> Publish -> Int #

hash :: Publish -> Int #

AWSRequest Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Associated Types

type AWSResponse Publish #

ToBody Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

ToHeaders Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Methods

toHeaders :: Publish -> [Header] #

ToPath Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Methods

toPath :: Publish -> ByteString #

ToQuery Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

type Rep Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

type Rep Publish = D1 ('MetaData "Publish" "Amazonka.IoTData.Publish" "libZSservicesZSamazonka-iot-dataplaneZSamazonka-iot-dataplane" 'False) (C1 ('MetaCons "Publish'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "retain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "payload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ByteString))) :*: (S1 ('MetaSel ('Just "qos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "topic") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))
type AWSResponse Publish Source # 
Instance details

Defined in Amazonka.IoTData.Publish

newPublish Source #

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.

publish_qos :: Lens' Publish (Maybe Natural) Source #

The Quality of Service (QoS) level.

publish_topic :: Lens' Publish Text Source #

The name of the MQTT topic.

Destructuring the Response

data PublishResponse Source #

See: newPublishResponse smart constructor.

Constructors

PublishResponse' 

Instances

Instances details
Eq PublishResponse Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Read PublishResponse Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Show PublishResponse Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Generic PublishResponse Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Associated Types

type Rep PublishResponse :: Type -> Type #

NFData PublishResponse Source # 
Instance details

Defined in Amazonka.IoTData.Publish

Methods

rnf :: PublishResponse -> () #

type Rep PublishResponse Source # 
Instance details

Defined in Amazonka.IoTData.Publish

type Rep PublishResponse = D1 ('MetaData "PublishResponse" "Amazonka.IoTData.Publish" "libZSservicesZSamazonka-iot-dataplaneZSamazonka-iot-dataplane" 'False) (C1 ('MetaCons "PublishResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newPublishResponse :: PublishResponse Source #

Create a value of PublishResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.