use of com.microsoft.azure.sdk.iot.provisioning.service.configs.AttestationMechanism in project azure-iot-sdk-java by Azure.
the class EnrollmentGroupManager method getAttestationMechanism.
AttestationMechanism getAttestationMechanism(String enrollmentGroupId) throws ProvisioningServiceClientException {
if (Tools.isNullOrEmpty(enrollmentGroupId)) {
throw new IllegalArgumentException("enrollmentGroupId cannot be null or empty.");
}
String enrollmentAttestationMechanismPath = getEnrollmentGroupAttestationMechanismPath(enrollmentGroupId);
String payload = "{}";
HttpResponse httpResponse = contractApiHttp.request(HttpMethod.POST, enrollmentAttestationMechanismPath, null, payload);
byte[] body = httpResponse.getBody();
if (body == null) {
throw new ProvisioningServiceClientServiceException("Unexpected empty body received from service");
}
return new AttestationMechanism(new String(body, StandardCharsets.UTF_8));
}
Aggregations