updateComplianceProfile method
Future<UpdateComplianceProfileResponseDto>
updateComplianceProfile(
- String apiKey, {
- required String complianceId,
- required UpdateComplianceProfileRequestDto updateComplianceProfileRequestDto,
Implementation
Future<UpdateComplianceProfileResponseDto> updateComplianceProfile(
String apiKey, {
required String complianceId,
required UpdateComplianceProfileRequestDto
updateComplianceProfileRequestDto,
}) async {
final String url = '$channel/api/v1/mdm/compliance/$complianceId';
// need to remove null values from the request
final requestDto = updateComplianceProfileRequestDto.toJson();
requestDto.removeWhere((key, value) => value == null);
final response = await http.put(
Uri.parse(url),
headers: {
'Authorization': 'Zoho-oauthtoken $apiKey',
'Content-Type': 'application/json;charset=UTF-8',
},
);
if (!response.statusCode.isSuccessful) {
throw MdmEngineException(
method: response.request?.method,
url: url,
statusCode: response.statusCode,
error: response.body,
);
}
return UpdateComplianceProfileResponseDto.fromJson(
jsonDecode(response.body) as Map<String, dynamic>,
);
}