NonComplianceMessage Class

  • java.lang.Object
    • com.azure.resourcemanager.resources.models.NonComplianceMessage

Implements

public final class NonComplianceMessage
implements 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

Constructor Description
NonComplianceMessage()

Creates an instance of NonComplianceMessage class.

Method Summary

Modifier and Type Method and Description
static NonComplianceMessage fromJson(JsonReader jsonReader)

Reads an instance of NonComplianceMessage from the JsonReader.

String message()

Get the message property: A message that describes why a resource is non-compliant with the policy.

String policyDefinitionReferenceId()

Get the policyDefinitionReferenceId property: The policy definition reference ID within a policy set definition the message is intended for.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

NonComplianceMessage withMessage(String message)

Set the message property: A message that describes why a resource is non-compliant with the policy.

NonComplianceMessage 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 java.lang.Object

Constructor Details

NonComplianceMessage

public NonComplianceMessage()

Creates an instance of NonComplianceMessage class.

Method Details

fromJson

public static NonComplianceMessage fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

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.

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

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.

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.

Applies to