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 Details

    • PolicyAssignmentProperties

      public PolicyAssignmentProperties()
      Creates an instance of PolicyAssignmentProperties class.
  • Method Details

    • displayName

      public String displayName()
      Get the displayName property: The display name of the policy assignment.
      Returns:
      the displayName value.
    • withDisplayName

      public PolicyAssignmentProperties withDisplayName(String displayName)
      Set the displayName property: The display name of the policy assignment.
      Parameters:
      displayName - the displayName value to set.
      Returns:
      the PolicyAssignmentProperties object itself.
    • policyDefinitionId

      public String policyDefinitionId()
      Get the policyDefinitionId property: The ID of the policy definition or policy set definition being assigned.
      Returns:
      the policyDefinitionId value.
    • withPolicyDefinitionId

      public PolicyAssignmentProperties withPolicyDefinitionId(String policyDefinitionId)
      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.
    • scope

      public String scope()
      Get the scope property: The scope for the policy assignment.
      Returns:
      the scope value.
    • notScopes

      public List<String> notScopes()
      Get the notScopes property: The policy's excluded scopes.
      Returns:
      the notScopes value.
    • withNotScopes

      public PolicyAssignmentProperties withNotScopes(List<String> notScopes)
      Set the notScopes property: The policy's excluded scopes.
      Parameters:
      notScopes - the notScopes value to set.
      Returns:
      the PolicyAssignmentProperties object itself.
    • parameters

      public Map<String,ParameterValuesValue> parameters()
      Get the parameters property: The parameter values for the assigned policy rule. The keys are the parameter names.
      Returns:
      the parameters value.
    • withParameters

      public PolicyAssignmentProperties withParameters(Map<String,ParameterValuesValue> parameters)
      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

      public String description()
      Get the description property: This message will be part of response in case of policy violation.
      Returns:
      the description value.
    • withDescription

      public PolicyAssignmentProperties withDescription(String description)
      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

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

      public PolicyAssignmentProperties withMetadata(Object metadata)
      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

      public EnforcementMode enforcementMode()
      Get the enforcementMode property: The policy assignment enforcement mode. Possible values are Default and DoNotEnforce.
      Returns:
      the enforcementMode value.
    • withEnforcementMode

      public PolicyAssignmentProperties withEnforcementMode(EnforcementMode enforcementMode)
      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

      public List<NonComplianceMessage> 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

      public List<ResourceSelector> resourceSelectors()
      Get the resourceSelectors property: The resource selector list to filter policies by resource properties.
      Returns:
      the resourceSelectors value.
    • withResourceSelectors

      public PolicyAssignmentProperties withResourceSelectors(List<ResourceSelector> resourceSelectors)
      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

      public List<OverrideModel> overrides()
      Get the overrides property: The policy property value override.
      Returns:
      the overrides value.
    • withOverrides

      public PolicyAssignmentProperties withOverrides(List<OverrideModel> overrides)
      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

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