Share via


TwinState Class

Definition

Representation of a single Twin initial state for the Device Provisioning Service.

public class TwinState
type TwinState = class
Public Class TwinState
Inheritance
TwinState

Examples

For instance, the following is a valid TwinState, represented as initialTwin in the rest API.

{
    "initialTwin": {
        "tags":{
            "SpeedUnity":"MPH",
            "$metadata":{
                "$lastUpdated":"2017-09-21T02:07:44.238Z",
                "$lastUpdatedVersion":4,
                "SpeedUnity":{
                    "$lastUpdated":"2017-09-21T02:07:44.238Z",
                    "$lastUpdatedVersion":4
                }
            },
            "$version":4
        }
        "properties":{
            "desired": {
                "MaxSpeed":{
                    "Value":500,
                    "NewValue":300
                },
                "$metadata":{
                    "$lastUpdated":"2017-09-21T02:07:44.238Z",
                    "$lastUpdatedVersion":4,
                    "MaxSpeed":{
                        "$lastUpdated":"2017-09-21T02:07:44.238Z",
                        "$lastUpdatedVersion":4,
                        "Value":{
                            "$lastUpdated":"2017-09-21T02:07:44.238Z",
                            "$lastUpdatedVersion":4
                        },
                        "NewValue":{
                            "$lastUpdated":"2017-09-21T02:07:44.238Z",
                            "$lastUpdatedVersion":4
                        }
                    }
                },
                "$version":4
            }
        }
    }
}

Remarks

The TwinState can contain one Microsoft.Azure.Devices.Provisioning.Service.TwinCollection of Tags, and one Microsoft.Azure.Devices.Provisioning.Service.TwinCollection of properties.desired.

Each entity in the collections can contain a associated Microsoft.Azure.Devices.Provisioning.Service.Metadata.

These metadata are provided by the Service and contains information about the last updated date time, and version.

Constructors

TwinState(TwinCollection, TwinCollection)

CONSTRUCTOR

Properties

DesiredProperties

Getter and setter the desired properties.

Tags

Getter and setter the for tags.

Methods

ToString()

Convert this object in a pretty print format.

Applies to