BulkEnrollmentOperation 类

定义

Representation of a single Device Provisioning Service bulk operation with a JSON serializer.

It is an internal class that creates a JSON for the bulk operations over the IndividualEnrollment. To use bulk operations, please use the external API ProvisioningServiceClient#runBulkEnrollmentOperation(BulkOperationMode, Collection).

The following JSON is an example of the result of this serializer.

**{
     "mode":"update",

     "enrollments":

     [

         {

             "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"

         }

     ]

*}

</code></pre></p>

public class BulkEnrollmentOperation
继承
java.lang.Object
BulkEnrollmentOperation

方法

toJson(BulkOperationMode mode, Collection<IndividualEnrollment> individualEnrollments)

Serializer

Creates aString 

</code> , whose content represents the mode and the collection of individualEnrollments in a JSON format.</p>

toJsonElement(BulkOperationMode mode, Collection<IndividualEnrollment> individualEnrollments)

Serializer

Creates aJsonElement 

</code> , whose content represents the mode and the collection of individualEnrollments in a JSON format.</p>

This is useful if the caller will integrate this JSON with JSON from other classes to generate a consolidated JSON.

toString(BulkOperationMode mode, Collection<IndividualEnrollment> individualEnrollments)

Convert the class in a pretty print string.

Creates aString 

</code> , whose content represents the mode and the collection of individualEnrollments in a pretty print JSON format.</p>

适用于