public final class BulkEnrollmentOperation extends Object
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"
}
]
}
| Constructor and Description |
|---|
BulkEnrollmentOperation() |
| Modifier and Type | Method and Description |
|---|---|
static String |
toJson(BulkOperationMode mode,
Collection<IndividualEnrollment> individualEnrollments)
Serializer
|
static com.google.gson.JsonElement |
toJsonElement(BulkOperationMode mode,
Collection<IndividualEnrollment> individualEnrollments)
Serializer
|
static String |
toString(BulkOperationMode mode,
Collection<IndividualEnrollment> individualEnrollments)
Convert the class in a pretty print string.
|
public static String toJson(BulkOperationMode mode, Collection<IndividualEnrollment> individualEnrollments)
Creates a String, whose content represents the mode and the collection of
individualEnrollments in a JSON format.
mode - the BulkOperationMode that defines the single operation to do over the individualEnrollments.individualEnrollments - the collection of IndividualEnrollment that contains the description of each individualEnrollment.String with the content of this class.IllegalArgumentException - if one of the parameters is invalid.public static String toString(BulkOperationMode mode, Collection<IndividualEnrollment> individualEnrollments)
Creates a String, whose content represents the mode and the collection of
individualEnrollments in a pretty print JSON format.
mode - the BulkOperationMode that defines the single operation to do over the individualEnrollments.individualEnrollments - the collection of IndividualEnrollment that contains the description of each individualEnrollment.String with the content of this class.IllegalArgumentException - if one of the parameters is invalid.public static com.google.gson.JsonElement toJsonElement(BulkOperationMode mode, Collection<IndividualEnrollment> individualEnrollments)
Creates a JsonElement, whose content represents the mode and the collection of
individualEnrollments in a JSON format.
This is useful if the caller will integrate this JSON with JSON from other classes to generate a consolidated JSON.
mode - the BulkOperationMode that defines the single operation to do over the individualEnrollments.individualEnrollments - the collection of IndividualEnrollment that contains the description of each individualEnrollment.JsonElement with the content of this class.IllegalArgumentException - if one of the parameters is invalid.Copyright © 2021. All rights reserved.