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
    Constructor
    Description
    Creates an instance of NonComplianceMessage class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of NonComplianceMessage from the JsonReader.
    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.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    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, wait

    Methods 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

      public String 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

      public NonComplianceMessage withMessage(String message)
      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

      public String 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

      public NonComplianceMessage withPolicyDefinitionReferenceId(String policyDefinitionReferenceId)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.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.