Class PolicyAssignmentInner
java.lang.Object
com.azure.core.management.ProxyResource
com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner
- All Implemented Interfaces:
com.azure.json.JsonSerializable<com.azure.core.management.ProxyResource>
public final class PolicyAssignmentInner
extends com.azure.core.management.ProxyResource
The policy assignment.
-
Constructor Summary
Constructors -
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 PolicyAssignmentInnerfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of PolicyAssignmentInner from the JsonReader.id()Get the id property: Fully qualified resource Id for the resource.identity()Get the identity property: The managed identity associated with the policy assignment.Get the latestDefinitionVersion property: The latest version of the policy definition available.location()Get the location property: The location of the policy assignment.metadata()Get the metadata property: The policy assignment metadata.name()Get the name property: The name of the resource.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.core.management.SystemDataGet the systemData property: The system metadata relating to this resource.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) type()Get the type property: The type of the resource.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.withIdentity(Identity identity) Set the identity property: The managed identity associated with the policy assignment.withLocation(String location) Set the location property: The location of the policy assignment.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
-
PolicyAssignmentInner
public PolicyAssignmentInner()Creates an instance of PolicyAssignmentInner class.
-
-
Method Details
-
location
Get the location property: The location of the policy assignment. Only required when utilizing managed identity.- Returns:
- the location value.
-
withLocation
Set the location property: The location of the policy assignment. Only required when utilizing managed identity.- Parameters:
location- the location value to set.- Returns:
- the PolicyAssignmentInner object itself.
-
identity
Get the identity property: The managed identity associated with the policy assignment.- Returns:
- the identity value.
-
withIdentity
Set the identity property: The managed identity associated with the policy assignment.- Parameters:
identity- the identity value to set.- Returns:
- the PolicyAssignmentInner object itself.
-
systemData
public com.azure.core.management.SystemData systemData()Get the systemData property: The system metadata relating to this resource.- Returns:
- the systemData value.
-
type
Get the type property: The type of the resource.- Overrides:
typein classcom.azure.core.management.ProxyResource- Returns:
- the type value.
-
name
Get the name property: The name of the resource.- Overrides:
namein classcom.azure.core.management.ProxyResource- Returns:
- the name value.
-
id
Get the id property: Fully qualified resource Id for the resource.- Overrides:
idin classcom.azure.core.management.ProxyResource- Returns:
- the id value.
-
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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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 PolicyAssignmentInner 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<com.azure.core.management.ProxyResource>- Overrides:
toJsonin classcom.azure.core.management.ProxyResource- Throws:
IOException
-
fromJson
public static PolicyAssignmentInner fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of PolicyAssignmentInner from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of PolicyAssignmentInner 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 PolicyAssignmentInner.
-