Class ManagementPolicyRule
java.lang.Object
com.azure.resourcemanager.storage.models.ManagementPolicyRule
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ManagementPolicyRule>
public final class ManagementPolicyRule
extends Object
implements com.azure.json.JsonSerializable<ManagementPolicyRule>
An object that wraps the Lifecycle rule. Each rule is uniquely defined by name.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the definition property: An object that defines the Lifecycle rule.enabled()Get the enabled property: Rule is enabled if set to true.static ManagementPolicyRulefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ManagementPolicyRule from the JsonReader.name()Get the name property: A rule name can contain any combination of alpha numeric characters.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) type()Get the type property: The valid value is Lifecycle.voidvalidate()Validates the instance.withDefinition(ManagementPolicyDefinition definition) Set the definition property: An object that defines the Lifecycle rule.withEnabled(Boolean enabled) Set the enabled property: Rule is enabled if set to true.Set the name property: A rule name can contain any combination of alpha numeric characters.Set the type property: The valid value is Lifecycle.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
-
ManagementPolicyRule
public ManagementPolicyRule()Creates an instance of ManagementPolicyRule class.
-
-
Method Details
-
enabled
Get the enabled property: Rule is enabled if set to true.- Returns:
- the enabled value.
-
withEnabled
Set the enabled property: Rule is enabled if set to true.- Parameters:
enabled- the enabled value to set.- Returns:
- the ManagementPolicyRule object itself.
-
name
Get the name property: A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.- Returns:
- the name value.
-
withName
Set the name property: A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.- Parameters:
name- the name value to set.- Returns:
- the ManagementPolicyRule object itself.
-
type
Get the type property: The valid value is Lifecycle.- Returns:
- the type value.
-
withType
Set the type property: The valid value is Lifecycle.- Parameters:
type- the type value to set.- Returns:
- the ManagementPolicyRule object itself.
-
definition
Get the definition property: An object that defines the Lifecycle rule.- Returns:
- the definition value.
-
withDefinition
Set the definition property: An object that defines the Lifecycle rule.- Parameters:
definition- the definition value to set.- Returns:
- the ManagementPolicyRule 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<ManagementPolicyRule>- Throws:
IOException
-
fromJson
public static ManagementPolicyRule fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of ManagementPolicyRule from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ManagementPolicyRule 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 ManagementPolicyRule.
-