TwinOperations Class

TwinOperations operations.

Inheritance
builtins.object
TwinOperations

Constructor

TwinOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

api_version

The API version to use for the request. Constant value: "2020-05-31-preview".

Methods

get_device_twin

Gets a device twin.

Gets a device twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

get_module_twin

Gets a module twin.

Gets a module twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

replace_device_twin

Replaces tags and desired properties of a device twin.

Replaces a device twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

replace_module_twin

Replaces tags and desired properties of a module twin.

Replaces a module twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

update_device_twin

Updates tags and desired properties of a device twin.

Updates a device twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

update_module_twin

Updates tags and desired properties of a module twin.

Updates a module twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

get_device_twin

Gets a device twin.

Gets a device twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

get_device_twin(id, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Twin or ClientRawResponse if raw=true

Return type

Twin,

Exceptions

get_module_twin

Gets a module twin.

Gets a module twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

get_module_twin(id, mid, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

mid
str
Required

Module ID.

custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Twin or ClientRawResponse if raw=true

Return type

Twin,

Exceptions

replace_device_twin

Replaces tags and desired properties of a device twin.

Replaces a device twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

replace_device_twin(id, device_twin_info, if_match=None, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

device_twin_info
Twin
Required

Device twin info

if_match
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Twin or ClientRawResponse if raw=true

Return type

Twin,

Exceptions

replace_module_twin

Replaces tags and desired properties of a module twin.

Replaces a module twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

replace_module_twin(id, mid, device_twin_info, if_match=None, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

mid
str
Required

Module ID.

device_twin_info
Twin
Required

Device twin info

if_match
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Twin or ClientRawResponse if raw=true

Return type

Twin,

Exceptions

update_device_twin

Updates tags and desired properties of a device twin.

Updates a device twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

update_device_twin(id, device_twin_info, if_match=None, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

device_twin_info
Twin
Required

Device twin info

if_match
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Twin or ClientRawResponse if raw=true

Return type

Twin,

Exceptions

update_module_twin

Updates tags and desired properties of a module twin.

Updates a module twin. See https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-device-twins for more information.

update_module_twin(id, mid, device_twin_info, if_match=None, custom_headers=None, raw=False, **operation_config)

Parameters

id
str
Required

Device ID.

mid
str
Required

Module ID.

device_twin_info
Twin
Required

Device twin information

if_match
str
default value: None
custom_headers
dict
default value: None

headers that will be added to the request

raw
bool
default value: False

returns the direct response alongside the deserialized response

operation_config
Required

Operation configuration overrides.

Returns

Twin or ClientRawResponse if raw=true

Return type

Twin,

Exceptions

Attributes

models

models = <module 'azure.iot.hub.protocol.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\iot\\hub\\protocol\\models\\__init__.py'>