awsiot.iotshadow

class awsiot.iotshadow.IotShadowClient(mqtt_connection)

Bases: MqttServiceClient

The AWS IoT Device Shadow service adds shadows to AWS IoT thing objects. Shadows are a simple data store for device properties and state. Shadows can make a device’s state available to apps and other services whether the device is connected to AWS IoT or not.

AWS Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html

Parameters:

mqtt_connection (Connection) –

publish_delete_named_shadow(request, qos)

Deletes a named shadow for an AWS IoT thing.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-pub-sub-topic

Parameters:
  • request (DeleteNamedShadowRequest) – DeleteNamedShadowRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

Returns:

A Future whose result will be None if the request is successfully published. The Future’s result will be an exception if the request cannot be published.

Return type:

Future

publish_delete_shadow(request, qos)

Deletes the (classic) shadow for an AWS IoT thing.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-pub-sub-topic

Parameters:
  • request (DeleteShadowRequest) – DeleteShadowRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

Returns:

A Future whose result will be None if the request is successfully published. The Future’s result will be an exception if the request cannot be published.

Return type:

Future

publish_get_named_shadow(request, qos)

Gets a named shadow for an AWS IoT thing.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-pub-sub-topic

Parameters:
  • request (GetNamedShadowRequest) – GetNamedShadowRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

Returns:

A Future whose result will be None if the request is successfully published. The Future’s result will be an exception if the request cannot be published.

Return type:

Future

publish_get_shadow(request, qos)

Gets the (classic) shadow for an AWS IoT thing.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-pub-sub-topic

Parameters:
  • request (GetShadowRequest) – GetShadowRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

Returns:

A Future whose result will be None if the request is successfully published. The Future’s result will be an exception if the request cannot be published.

Return type:

Future

publish_update_named_shadow(request, qos)

Update a named shadow for a device.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-pub-sub-topic

Parameters:
  • request (UpdateNamedShadowRequest) – UpdateNamedShadowRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

Returns:

A Future whose result will be None if the request is successfully published. The Future’s result will be an exception if the request cannot be published.

Return type:

Future

publish_update_shadow(request, qos)

Update a device’s (classic) shadow.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-pub-sub-topic

Parameters:
  • request (UpdateShadowRequest) – UpdateShadowRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

Returns:

A Future whose result will be None if the request is successfully published. The Future’s result will be an exception if the request cannot be published.

Return type:

Future

subscribe_to_delete_named_shadow_accepted(request, qos, callback)

Subscribes to the accepted topic for the DeleteNamedShadow operation.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-accepted-pub-sub-topic

Parameters:
  • request (DeleteNamedShadowSubscriptionRequest) – DeleteNamedShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[DeleteShadowResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type DeleteShadowResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_delete_named_shadow_rejected(request, qos, callback)

Subscribes to the rejected topic for the DeleteNamedShadow operation.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-rejected-pub-sub-topic

Parameters:
  • request (DeleteNamedShadowSubscriptionRequest) – DeleteNamedShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ErrorResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ErrorResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_delete_shadow_accepted(request, qos, callback)

Subscribes to the accepted topic for the DeleteShadow operation

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-accepted-pub-sub-topic

Parameters:
  • request (DeleteShadowSubscriptionRequest) – DeleteShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[DeleteShadowResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type DeleteShadowResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_delete_shadow_rejected(request, qos, callback)

Subscribes to the rejected topic for the DeleteShadow operation

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#delete-rejected-pub-sub-topic

Parameters:
  • request (DeleteShadowSubscriptionRequest) – DeleteShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ErrorResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ErrorResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_get_named_shadow_accepted(request, qos, callback)

Subscribes to the accepted topic for the GetNamedShadow operation.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-accepted-pub-sub-topic

Parameters:
  • request (GetNamedShadowSubscriptionRequest) – GetNamedShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[GetShadowResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type GetShadowResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_get_named_shadow_rejected(request, qos, callback)

Subscribes to the rejected topic for the GetNamedShadow operation.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-rejected-pub-sub-topic

Parameters:
  • request (GetNamedShadowSubscriptionRequest) – GetNamedShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ErrorResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ErrorResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_get_shadow_accepted(request, qos, callback)

Subscribes to the accepted topic for the GetShadow operation.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-accepted-pub-sub-topic

Parameters:
  • request (GetShadowSubscriptionRequest) – GetShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[GetShadowResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type GetShadowResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_get_shadow_rejected(request, qos, callback)

Subscribes to the rejected topic for the GetShadow operation.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#get-rejected-pub-sub-topic

Parameters:
  • request (GetShadowSubscriptionRequest) – GetShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ErrorResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ErrorResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_named_shadow_delta_updated_events(request, qos, callback)

Subscribe to NamedShadowDelta events for a named shadow of an AWS IoT thing.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-delta-pub-sub-topic

Parameters:
  • request (NamedShadowDeltaUpdatedSubscriptionRequest) – NamedShadowDeltaUpdatedSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ShadowDeltaUpdatedEvent], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ShadowDeltaUpdatedEvent. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_named_shadow_updated_events(request, qos, callback)

Subscribe to ShadowUpdated events for a named shadow of an AWS IoT thing.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-documents-pub-sub-topic

Parameters:
  • request (NamedShadowUpdatedSubscriptionRequest) – NamedShadowUpdatedSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ShadowUpdatedEvent], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ShadowUpdatedEvent. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_shadow_delta_updated_events(request, qos, callback)

Subscribe to ShadowDelta events for the (classic) shadow of an AWS IoT thing.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-delta-pub-sub-topic

Parameters:
  • request (ShadowDeltaUpdatedSubscriptionRequest) – ShadowDeltaUpdatedSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ShadowDeltaUpdatedEvent], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ShadowDeltaUpdatedEvent. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_shadow_updated_events(request, qos, callback)

Subscribe to ShadowUpdated events for the (classic) shadow of an AWS IoT thing.

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-documents-pub-sub-topic

Parameters:
  • request (ShadowUpdatedSubscriptionRequest) – ShadowUpdatedSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ShadowUpdatedEvent], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ShadowUpdatedEvent. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_update_named_shadow_accepted(request, qos, callback)

Subscribes to the accepted topic for the UpdateNamedShadow operation

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-accepted-pub-sub-topic

Parameters:
  • request (UpdateNamedShadowSubscriptionRequest) – UpdateNamedShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[UpdateShadowResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type UpdateShadowResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_update_named_shadow_rejected(request, qos, callback)

Subscribes to the rejected topic for the UpdateNamedShadow operation

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-rejected-pub-sub-topic

Parameters:
  • request (UpdateNamedShadowSubscriptionRequest) – UpdateNamedShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ErrorResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ErrorResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_update_shadow_accepted(request, qos, callback)

Subscribes to the accepted topic for the UpdateShadow operation

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-accepted-pub-sub-topic

Parameters:
  • request (UpdateShadowSubscriptionRequest) – UpdateShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[UpdateShadowResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type UpdateShadowResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

subscribe_to_update_shadow_rejected(request, qos, callback)

Subscribes to the rejected topic for the UpdateShadow operation

API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-mqtt.html#update-rejected-pub-sub-topic

Parameters:
  • request (UpdateShadowSubscriptionRequest) – UpdateShadowSubscriptionRequest instance.

  • qos (int) – The Quality of Service guarantee of this message

  • callback (Callable[[ErrorResponse], None]) – Callback to invoke each time the event is received. The callback should take 1 argument of type ErrorResponse. The callback is not expected to return anything.

Returns:

Tuple with two values. The first is a Future whose result will be the awscrt.mqtt.QoS granted by the server, or an exception if the subscription fails. The second value is a topic which may be passed to unsubscribe() to stop receiving messages. Note that messages may arrive before the subscription is acknowledged.

Return type:

Tuple[Future, str]

class awsiot.iotshadow.DeleteNamedShadowRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to make a DeleteNamedShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

  • shadow_name (str) – Name of the shadow to delete.

  • thing_name (str) – AWS IoT thing to delete a named shadow from.

client_token

Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

Type:

str

shadow_name

Name of the shadow to delete.

Type:

str

thing_name

AWS IoT thing to delete a named shadow from.

Type:

str

class awsiot.iotshadow.DeleteNamedShadowSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to DeleteNamedShadow responses for an AWS IoT thing.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • shadow_name (str) – Name of the shadow to subscribe to DeleteNamedShadow operations for.

  • thing_name (str) – AWS IoT thing to subscribe to DeleteNamedShadow operations for.

shadow_name

Name of the shadow to subscribe to DeleteNamedShadow operations for.

Type:

str

thing_name

AWS IoT thing to subscribe to DeleteNamedShadow operations for.

Type:

str

class awsiot.iotshadow.DeleteShadowRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to make a DeleteShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

  • thing_name (str) – AWS IoT thing to delete the (classic) shadow of.

client_token

Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

Type:

str

thing_name

AWS IoT thing to delete the (classic) shadow of.

Type:

str

class awsiot.iotshadow.DeleteShadowResponse(*args, **kwargs)

Bases: ModeledClass

Response payload to a DeleteShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – A client token used to correlate requests and responses.

  • timestamp (datetime.datetime) – The time the response was generated by AWS IoT.

  • version (int) – The current version of the document for the device’s shadow.

client_token

A client token used to correlate requests and responses.

Type:

str

timestamp

The time the response was generated by AWS IoT.

Type:

datetime.datetime

version

The current version of the document for the device’s shadow.

Type:

int

class awsiot.iotshadow.DeleteShadowSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to DeleteShadow responses for an AWS IoT thing.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:

thing_name (str) – AWS IoT thing to subscribe to DeleteShadow operations for.

thing_name

AWS IoT thing to subscribe to DeleteShadow operations for.

Type:

str

class awsiot.iotshadow.ErrorResponse(*args, **kwargs)

Bases: ModeledClass

Response document containing details about a failed request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – Opaque request-response correlation data. Present only if a client token was used in the request.

  • code (int) – An HTTP response code that indicates the type of error.

  • message (str) – A text message that provides additional information.

  • timestamp (datetime.datetime) – The date and time the response was generated by AWS IoT. This property is not present in all error response documents.

client_token

Opaque request-response correlation data. Present only if a client token was used in the request.

Type:

str

code

An HTTP response code that indicates the type of error.

Type:

int

message

A text message that provides additional information.

Type:

str

timestamp

The date and time the response was generated by AWS IoT. This property is not present in all error response documents.

Type:

datetime.datetime

class awsiot.iotshadow.GetNamedShadowRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to make a GetNamedShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

  • shadow_name (str) – Name of the shadow to get.

  • thing_name (str) – AWS IoT thing to get the named shadow for.

client_token

Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

Type:

str

shadow_name

Name of the shadow to get.

Type:

str

thing_name

AWS IoT thing to get the named shadow for.

Type:

str

class awsiot.iotshadow.GetNamedShadowSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to GetNamedShadow responses.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • shadow_name (str) – Name of the shadow to subscribe to GetNamedShadow responses for.

  • thing_name (str) – AWS IoT thing subscribe to GetNamedShadow responses for.

shadow_name

Name of the shadow to subscribe to GetNamedShadow responses for.

Type:

str

thing_name

AWS IoT thing subscribe to GetNamedShadow responses for.

Type:

str

class awsiot.iotshadow.GetShadowRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to make a GetShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

  • thing_name (str) – AWS IoT thing to get the (classic) shadow for.

client_token

Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

Type:

str

thing_name

AWS IoT thing to get the (classic) shadow for.

Type:

str

class awsiot.iotshadow.GetShadowResponse(*args, **kwargs)

Bases: ModeledClass

Response payload to a GetShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – An opaque token used to correlate requests and responses.

  • metadata (ShadowMetadata) – Contains the timestamps for each attribute in the desired and reported sections of the state.

  • state (ShadowStateWithDelta) – The (classic) shadow state of the AWS IoT thing.

  • timestamp (datetime.datetime) – The time the response was generated by AWS IoT.

  • version (int) – The current version of the document for the device’s shadow shared in AWS IoT. It is increased by one over the previous version of the document.

client_token

An opaque token used to correlate requests and responses.

Type:

str

metadata

Contains the timestamps for each attribute in the desired and reported sections of the state.

Type:

ShadowMetadata

state

The (classic) shadow state of the AWS IoT thing.

Type:

ShadowStateWithDelta

timestamp

The time the response was generated by AWS IoT.

Type:

datetime.datetime

version

The current version of the document for the device’s shadow shared in AWS IoT. It is increased by one over the previous version of the document.

Type:

int

class awsiot.iotshadow.GetShadowSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to GetShadow responses.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:

thing_name (str) – AWS IoT thing subscribe to GetShadow responses for.

thing_name

AWS IoT thing subscribe to GetShadow responses for.

Type:

str

class awsiot.iotshadow.NamedShadowDeltaUpdatedSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to a device’s NamedShadowDelta events.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • shadow_name (str) – Name of the shadow to get ShadowDelta events for.

  • thing_name (str) – Name of the AWS IoT thing to get NamedShadowDelta events for.

shadow_name

Name of the shadow to get ShadowDelta events for.

Type:

str

thing_name

Name of the AWS IoT thing to get NamedShadowDelta events for.

Type:

str

class awsiot.iotshadow.NamedShadowUpdatedSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to a device’s NamedShadowUpdated events.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • shadow_name (str) – Name of the shadow to get NamedShadowUpdated events for.

  • thing_name (str) – Name of the AWS IoT thing to get NamedShadowUpdated events for.

shadow_name

Name of the shadow to get NamedShadowUpdated events for.

Type:

str

thing_name

Name of the AWS IoT thing to get NamedShadowUpdated events for.

Type:

str

class awsiot.iotshadow.ShadowDeltaUpdatedEvent(*args, **kwargs)

Bases: ModeledClass

An event generated when a shadow document was updated by a request to AWS IoT. The event payload contains only the changes requested.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – An opaque token used to correlate requests and responses. Present only if a client token was used in the request.

  • metadata (Dict[str, Any]) – Timestamps for the shadow properties that were updated.

  • state (Dict[str, Any]) – Shadow properties that were updated.

  • timestamp (datetime.datetime) – The time the event was generated by AWS IoT.

  • version (int) – The current version of the document for the device’s shadow.

client_token

An opaque token used to correlate requests and responses. Present only if a client token was used in the request.

Type:

str

metadata

Timestamps for the shadow properties that were updated.

Type:

Dict[str, Any]

state

Shadow properties that were updated.

Type:

Dict[str, Any]

timestamp

The time the event was generated by AWS IoT.

Type:

datetime.datetime

version

The current version of the document for the device’s shadow.

Type:

int

class awsiot.iotshadow.ShadowDeltaUpdatedSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to a device’s ShadowDelta events.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:

thing_name (str) – Name of the AWS IoT thing to get ShadowDelta events for.

thing_name

Name of the AWS IoT thing to get ShadowDelta events for.

Type:

str

class awsiot.iotshadow.ShadowMetadata(*args, **kwargs)

Bases: ModeledClass

Contains the last-updated timestamps for each attribute in the desired and reported sections of the shadow state.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • desired (Dict[str, Any]) – Contains the timestamps for each attribute in the desired section of a shadow’s state.

  • reported (Dict[str, Any]) – Contains the timestamps for each attribute in the reported section of a shadow’s state.

desired

Contains the timestamps for each attribute in the desired section of a shadow’s state.

Type:

Dict[str, Any]

reported

Contains the timestamps for each attribute in the reported section of a shadow’s state.

Type:

Dict[str, Any]

class awsiot.iotshadow.ShadowState(*args, **kwargs)

Bases: ModeledClass

(Potentially partial) state of an AWS IoT thing’s shadow.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • desired (Dict[str, Any]) – The desired shadow state (from external services and devices).

  • reported (Dict[str, Any]) – The (last) reported shadow state from the device.

desired

The desired shadow state (from external services and devices).

Type:

Dict[str, Any]

desired_is_nullable

Set to true to allow ‘desired’ to be None, clearing the data if sent.

Type:

bool

reported

The (last) reported shadow state from the device.

Type:

Dict[str, Any]

reported_is_nullable

Set to true to allow ‘reported’ to be None, clearing the data if sent.

Type:

bool

class awsiot.iotshadow.ShadowStateWithDelta(*args, **kwargs)

Bases: ModeledClass

(Potentially partial) state of an AWS IoT thing’s shadow. Includes the delta between the reported and desired states.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • delta (Dict[str, Any]) – The delta between the reported and desired states.

  • desired (Dict[str, Any]) – The desired shadow state (from external services and devices).

  • reported (Dict[str, Any]) – The (last) reported shadow state from the device.

delta

The delta between the reported and desired states.

Type:

Dict[str, Any]

desired

The desired shadow state (from external services and devices).

Type:

Dict[str, Any]

reported

The (last) reported shadow state from the device.

Type:

Dict[str, Any]

class awsiot.iotshadow.ShadowUpdatedEvent(*args, **kwargs)

Bases: ModeledClass

A description of the before and after states of a device shadow.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
current

Contains the state of the object after the update.

Type:

ShadowUpdatedSnapshot

previous

Contains the state of the object before the update.

Type:

ShadowUpdatedSnapshot

timestamp

The time the event was generated by AWS IoT.

Type:

datetime.datetime

class awsiot.iotshadow.ShadowUpdatedSnapshot(*args, **kwargs)

Bases: ModeledClass

Complete state of the (classic) shadow of an AWS IoT Thing.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • metadata (ShadowMetadata) – Contains the timestamps for each attribute in the desired and reported sections of the state.

  • state (ShadowState) – Current shadow state.

  • version (int) – The current version of the document for the device’s shadow.

metadata

Contains the timestamps for each attribute in the desired and reported sections of the state.

Type:

ShadowMetadata

state

Current shadow state.

Type:

ShadowState

version

The current version of the document for the device’s shadow.

Type:

int

class awsiot.iotshadow.ShadowUpdatedSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to a device’s ShadowUpdated events.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:

thing_name (str) – Name of the AWS IoT thing to get ShadowUpdated events for.

thing_name

Name of the AWS IoT thing to get ShadowUpdated events for.

Type:

str

class awsiot.iotshadow.UpdateNamedShadowRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to make an UpdateNamedShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

  • shadow_name (str) – Name of the shadow to update.

  • state (ShadowState) – Requested changes to shadow state. Updates affect only the fields specified.

  • thing_name (str) – Aws IoT thing to update a named shadow of.

  • version (int) – (Optional) The Device Shadow service applies the update only if the specified version matches the latest version.

client_token

Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

Type:

str

shadow_name

Name of the shadow to update.

Type:

str

state

Requested changes to shadow state. Updates affect only the fields specified.

Type:

ShadowState

thing_name

Aws IoT thing to update a named shadow of.

Type:

str

version

(Optional) The Device Shadow service applies the update only if the specified version matches the latest version.

Type:

int

class awsiot.iotshadow.UpdateNamedShadowSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to UpdateNamedShadow responses.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • shadow_name (str) – Name of the shadow to listen to UpdateNamedShadow responses for.

  • thing_name (str) – Name of the AWS IoT thing to listen to UpdateNamedShadow responses for.

shadow_name

Name of the shadow to listen to UpdateNamedShadow responses for.

Type:

str

thing_name

Name of the AWS IoT thing to listen to UpdateNamedShadow responses for.

Type:

str

class awsiot.iotshadow.UpdateShadowRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to make an UpdateShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

  • state (ShadowState) – Requested changes to the shadow state. Updates affect only the fields specified.

  • thing_name (str) – Aws IoT thing to update the (classic) shadow of.

  • version (int) – (Optional) The Device Shadow service processes the update only if the specified version matches the latest version.

client_token

Optional. A client token used to correlate requests and responses. Enter an arbitrary value here and it is reflected in the response.

Type:

str

state

Requested changes to the shadow state. Updates affect only the fields specified.

Type:

ShadowState

thing_name

Aws IoT thing to update the (classic) shadow of.

Type:

str

version

(Optional) The Device Shadow service processes the update only if the specified version matches the latest version.

Type:

int

class awsiot.iotshadow.UpdateShadowResponse(*args, **kwargs)

Bases: ModeledClass

Response payload to an UpdateShadow request.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:
  • client_token (str) – An opaque token used to correlate requests and responses. Present only if a client token was used in the request.

  • metadata (ShadowMetadata) – Contains the timestamps for each attribute in the desired and reported sections so that you can determine when the state was updated.

  • state (ShadowState) – Updated device shadow state.

  • timestamp (datetime.datetime) – The time the response was generated by AWS IoT.

  • version (int) – The current version of the document for the device’s shadow shared in AWS IoT. It is increased by one over the previous version of the document.

client_token

An opaque token used to correlate requests and responses. Present only if a client token was used in the request.

Type:

str

metadata

Contains the timestamps for each attribute in the desired and reported sections so that you can determine when the state was updated.

Type:

ShadowMetadata

state

Updated device shadow state.

Type:

ShadowState

timestamp

The time the response was generated by AWS IoT.

Type:

datetime.datetime

version

The current version of the document for the device’s shadow shared in AWS IoT. It is increased by one over the previous version of the document.

Type:

int

class awsiot.iotshadow.UpdateShadowSubscriptionRequest(*args, **kwargs)

Bases: ModeledClass

Data needed to subscribe to UpdateShadow responses.

All attributes are None by default, and may be set by keyword in the constructor.

Keyword Arguments:

thing_name (str) – Name of the AWS IoT thing to listen to UpdateShadow responses for.

thing_name

Name of the AWS IoT thing to listen to UpdateShadow responses for.

Type:

str