diff --git a/provisioning/service/src/Config/IndividualEnrollment.cs b/provisioning/service/src/Config/IndividualEnrollment.cs index a45455a655..3c3961405c 100644 --- a/provisioning/service/src/Config/IndividualEnrollment.cs +++ b/provisioning/service/src/Config/IndividualEnrollment.cs @@ -212,6 +212,12 @@ public override string ToString() [JsonProperty(PropertyName = "registrationState", DefaultValueHandling = DefaultValueHandling.Ignore)] public DeviceRegistrationState RegistrationState { get; private set; } + /// + /// Optional Device Information. + /// + [JsonProperty(PropertyName = "optionalDeviceInformation")] + public TwinCollection OptionalDeviceInformation { get; set; } + /// /// Attestation Mechanism /// diff --git a/provisioning/service/tests/Config/IndividualEnrollmentTests.cs b/provisioning/service/tests/Config/IndividualEnrollmentTests.cs index f4cf62b3dc..2e157180e3 100644 --- a/provisioning/service/tests/Config/IndividualEnrollmentTests.cs +++ b/provisioning/service/tests/Config/IndividualEnrollmentTests.cs @@ -67,6 +67,10 @@ public class IndividualEnrollmentTests " }\n" + " }\n" + " },\n" + + " \"optionalDeviceInformation\":{\n" + + " \"tag1\":\"val1\",\n" + + " \"tag2\":\"val2\"\n" + + " },\n" + " \"iotHubHostName\":\"" + SampleIotHubHostName + "\",\n" + " \"deviceId\":\"" + SampleDeviceId + "\",\n" + " \"initialTwin\":{\n" + @@ -266,6 +270,7 @@ public void IndividualEnrollmentConstructorWithoutCapabilitiesJSONSucceed() Assert.IsTrue(individualEnrollment.Attestation is X509Attestation); Assert.AreEqual(SampleDeviceId, individualEnrollment.DeviceId); Assert.AreEqual(SampleIotHubHostName, individualEnrollment.IotHubHostName); + Assert.IsNotNull(individualEnrollment.OptionalDeviceInformation); Assert.IsNotNull(individualEnrollment.InitialTwinState); Assert.AreEqual(SampleProvisioningStatus, individualEnrollment.ProvisioningStatus); Assert.AreEqual(SampleCreateDateTimeUTC, individualEnrollment.CreatedDateTimeUtc); @@ -286,6 +291,7 @@ public void IndividualEnrollmentConstructorWithCapabilitiesTrueJSONSucceed() Assert.IsTrue(individualEnrollment.Attestation is X509Attestation); Assert.AreEqual(SampleDeviceId, individualEnrollment.DeviceId); Assert.AreEqual(SampleIotHubHostName, individualEnrollment.IotHubHostName); + Assert.IsNotNull(individualEnrollment.OptionalDeviceInformation); Assert.IsNotNull(individualEnrollment.InitialTwinState); Assert.AreEqual(SampleProvisioningStatus, individualEnrollment.ProvisioningStatus); Assert.AreEqual(SampleCreateDateTimeUTC, individualEnrollment.CreatedDateTimeUtc); @@ -306,6 +312,7 @@ public void IndividualEnrollmentConstructorWithCapabilitiesFalseJSONSucceed() Assert.IsTrue(individualEnrollment.Attestation is X509Attestation); Assert.AreEqual(SampleDeviceId, individualEnrollment.DeviceId); Assert.AreEqual(SampleIotHubHostName, individualEnrollment.IotHubHostName); + Assert.IsNotNull(individualEnrollment.OptionalDeviceInformation); Assert.IsNotNull(individualEnrollment.InitialTwinState); Assert.AreEqual(SampleProvisioningStatus, individualEnrollment.ProvisioningStatus); Assert.AreEqual(SampleCreateDateTimeUTC, individualEnrollment.CreatedDateTimeUtc);