Class PolicyAssignmentProperties
java.lang.Object
com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentProperties
- All Implemented Interfaces:
com.azure.json.JsonSerializable<PolicyAssignmentProperties>
public final class PolicyAssignmentProperties
extends Object
implements com.azure.json.JsonSerializable<PolicyAssignmentProperties>
The policy assignment properties.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of PolicyAssignmentProperties class. -
Method Summary
Modifier and TypeMethodDescriptionGet the definitionVersion property: The version of the policy definition to use.Get the description property: This message will be part of response in case of policy violation.Get the displayName property: The display name of the policy assignment.Get the effectiveDefinitionVersion property: The effective version of the policy definition in use.Get the enforcementMode property: The policy assignment enforcement mode.static PolicyAssignmentPropertiesfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of PolicyAssignmentProperties from the JsonReader.Get the latestDefinitionVersion property: The latest version of the policy definition available.metadata()Get the metadata property: The policy assignment metadata.Get the nonComplianceMessages property: The messages that describe why a resource is non-compliant with the policy.Get the notScopes property: The policy's excluded scopes.Get the overrides property: The policy property value override.Get the parameters property: The parameter values for the assigned policy rule.Get the policyDefinitionId property: The ID of the policy definition or policy set definition being assigned.Get the resourceSelectors property: The resource selector list to filter policies by resource properties.scope()Get the scope property: The scope for the policy assignment.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withDefinitionVersion(String definitionVersion) Set the definitionVersion property: The version of the policy definition to use.withDescription(String description) Set the description property: This message will be part of response in case of policy violation.withDisplayName(String displayName) Set the displayName property: The display name of the policy assignment.withEnforcementMode(EnforcementMode enforcementMode) Set the enforcementMode property: The policy assignment enforcement mode.withMetadata(Object metadata) Set the metadata property: The policy assignment metadata.withNonComplianceMessages(List<NonComplianceMessage> nonComplianceMessages) Set the nonComplianceMessages property: The messages that describe why a resource is non-compliant with the policy.withNotScopes(List<String> notScopes) Set the notScopes property: The policy's excluded scopes.withOverrides(List<OverrideModel> overrides) Set the overrides property: The policy property value override.withParameters(Map<String, ParameterValuesValue> parameters) Set the parameters property: The parameter values for the assigned policy rule.withPolicyDefinitionId(String policyDefinitionId) Set the policyDefinitionId property: The ID of the policy definition or policy set definition being assigned.withResourceSelectors(List<ResourceSelector> resourceSelectors) Set the resourceSelectors property: The resource selector list to filter policies by resource properties.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
-
PolicyAssignmentProperties
public PolicyAssignmentProperties()Creates an instance of PolicyAssignmentProperties class.
-
-
Method Details
-
displayName
Get the displayName property: The display name of the policy assignment.- Returns:
- the displayName value.
-
withDisplayName
Set the displayName property: The display name of the policy assignment.- Parameters:
displayName- the displayName value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
policyDefinitionId
Get the policyDefinitionId property: The ID of the policy definition or policy set definition being assigned.- Returns:
- the policyDefinitionId value.
-
withPolicyDefinitionId
Set the policyDefinitionId property: The ID of the policy definition or policy set definition being assigned.- Parameters:
policyDefinitionId- the policyDefinitionId value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
definitionVersion
Get the definitionVersion property: The version of the policy definition to use.- Returns:
- the definitionVersion value.
-
withDefinitionVersion
Set the definitionVersion property: The version of the policy definition to use.- Parameters:
definitionVersion- the definitionVersion value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
latestDefinitionVersion
Get the latestDefinitionVersion property: The latest version of the policy definition available. This is only present if requested via the $expand query parameter.- Returns:
- the latestDefinitionVersion value.
-
effectiveDefinitionVersion
Get the effectiveDefinitionVersion property: The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.- Returns:
- the effectiveDefinitionVersion value.
-
scope
Get the scope property: The scope for the policy assignment.- Returns:
- the scope value.
-
notScopes
Get the notScopes property: The policy's excluded scopes.- Returns:
- the notScopes value.
-
withNotScopes
Set the notScopes property: The policy's excluded scopes.- Parameters:
notScopes- the notScopes value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
parameters
Get the parameters property: The parameter values for the assigned policy rule. The keys are the parameter names.- Returns:
- the parameters value.
-
withParameters
Set the parameters property: The parameter values for the assigned policy rule. The keys are the parameter names.- Parameters:
parameters- the parameters value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
description
Get the description property: This message will be part of response in case of policy violation.- Returns:
- the description value.
-
withDescription
Set the description property: This message will be part of response in case of policy violation.- Parameters:
description- the description value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
metadata
Get the metadata property: The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.- Returns:
- the metadata value.
-
withMetadata
Set the metadata property: The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.- Parameters:
metadata- the metadata value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
enforcementMode
Get the enforcementMode property: The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.- Returns:
- the enforcementMode value.
-
withEnforcementMode
Set the enforcementMode property: The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.- Parameters:
enforcementMode- the enforcementMode value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
nonComplianceMessages
Get the nonComplianceMessages property: The messages that describe why a resource is non-compliant with the policy.- Returns:
- the nonComplianceMessages value.
-
withNonComplianceMessages
public PolicyAssignmentProperties withNonComplianceMessages(List<NonComplianceMessage> nonComplianceMessages) Set the nonComplianceMessages property: The messages that describe why a resource is non-compliant with the policy.- Parameters:
nonComplianceMessages- the nonComplianceMessages value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
resourceSelectors
Get the resourceSelectors property: The resource selector list to filter policies by resource properties.- Returns:
- the resourceSelectors value.
-
withResourceSelectors
Set the resourceSelectors property: The resource selector list to filter policies by resource properties.- Parameters:
resourceSelectors- the resourceSelectors value to set.- Returns:
- the PolicyAssignmentProperties object itself.
-
overrides
Get the overrides property: The policy property value override.- Returns:
- the overrides value.
-
withOverrides
Set the overrides property: The policy property value override.- Parameters:
overrides- the overrides value to set.- Returns:
- the PolicyAssignmentProperties 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<PolicyAssignmentProperties>- Throws:
IOException
-
fromJson
public static PolicyAssignmentProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of PolicyAssignmentProperties from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of PolicyAssignmentProperties if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the PolicyAssignmentProperties.
-