QueryResult Class

Definition

Representation of a single Device Provisioning Service query response with a JSON deserializer.

public class QueryResult
type QueryResult = class
Public Class QueryResult
Inheritance
QueryResult

Remarks

It is the result of any query for the provisioning service. This class will parse the result and return it in a best format possible. For the known formats in QueryResultType, you can just cast the items. In case of unknown type, the items will contain a list of string and you shall parse it by your own.

The provisioning service query result is composed by 2 system properties and a body. This class exposes it with 3 getters, Type, Items, and ContinuationToken.

The system properties are:

And the body is a JSON list of the specific type. For instance, if the system property type is IndividualEnrollment, the body will look like:

[
    {
        "registrationId":"validRegistrationId-1",
        "deviceId":"ContosoDevice-1",
        "attestation":{
            "type":"tpm",
            "tpm":{
                "endorsementKey":"validEndorsementKey"
            }
        },
        "iotHubHostName":"ContosoIoTHub.azure-devices.net",
        "provisioningStatus":"enabled"
    },
    {
        "registrationId":"validRegistrationId-2",
        "deviceId":"ContosoDevice-2",
        "attestation":{
            "type":"tpm",
           "tpm":{
                "endorsementKey":"validEndorsementKey"
            }
        },
        "iotHubHostName":"ContosoIoTHub.azure-devices.net",
        "provisioningStatus":"enabled"
    }
]

Properties

ContinuationToken

Getter for the query result continuationToken.

Items

Getter for the list of query result Items.

Type

Getter for the query result Type.

Methods

ToString()

Convert this object in a pretty print format.

Applies to