Class NonComplianceMessage
java.lang.Object
com.azure.resourcemanager.resources.models.NonComplianceMessage
- All Implemented Interfaces:
com.azure.json.JsonSerializable<NonComplianceMessage>
public final class NonComplianceMessage
extends Object
implements com.azure.json.JsonSerializable<NonComplianceMessage>
A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and
on resource's non-compliant compliance results.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NonComplianceMessagefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of NonComplianceMessage from the JsonReader.message()Get the message property: A message that describes why a resource is non-compliant with the policy.Get the policyDefinitionReferenceId property: The policy definition reference ID within a policy set definition the message is intended for.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withMessage(String message) Set the message property: A message that describes why a resource is non-compliant with the policy.withPolicyDefinitionReferenceId(String policyDefinitionReferenceId) Set the policyDefinitionReferenceId property: The policy definition reference ID within a policy set definition the message is intended for.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
NonComplianceMessage
public NonComplianceMessage()Creates an instance of NonComplianceMessage class.
-
-
Method Details
-
message
Get the message property: A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.- Returns:
- the message value.
-
withMessage
Set the message property: A message that describes why a resource is non-compliant with the policy. This is shown in 'deny' error messages and on resource's non-compliant compliance results.- Parameters:
message- the message value to set.- Returns:
- the NonComplianceMessage object itself.
-
policyDefinitionReferenceId
Get the policyDefinitionReferenceId property: The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.- Returns:
- the policyDefinitionReferenceId value.
-
withPolicyDefinitionReferenceId
Set the policyDefinitionReferenceId property: The policy definition reference ID within a policy set definition the message is intended for. This is only applicable if the policy assignment assigns a policy set definition. If this is not provided the message applies to all policies assigned by this policy assignment.- Parameters:
policyDefinitionReferenceId- the policyDefinitionReferenceId value to set.- Returns:
- the NonComplianceMessage object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<NonComplianceMessage>- Throws:
IOException
-
fromJson
public static NonComplianceMessage fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of NonComplianceMessage from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of NonComplianceMessage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the NonComplianceMessage.
-