com.azure.resourcemanager.storage.fluent.models.ManagementPolicyProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-storage Show documentation
Show all versions of azure-resourcemanager-storage Show documentation
This package contains Microsoft Azure Storage Management SDK.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.storage.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.storage.models.ManagementPolicySchema;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
/**
* The Storage Account ManagementPolicy properties.
*/
@Fluent
public final class ManagementPolicyProperties {
/*
* Returns the date and time the ManagementPolicies was last modified.
*/
@JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime lastModifiedTime;
/*
* The Storage Account ManagementPolicy, in JSON format. See more details in:
* https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
*/
@JsonProperty(value = "policy", required = true)
private ManagementPolicySchema policy;
/**
* Creates an instance of ManagementPolicyProperties class.
*/
public ManagementPolicyProperties() {
}
/**
* Get the lastModifiedTime property: Returns the date and time the ManagementPolicies was last modified.
*
* @return the lastModifiedTime value.
*/
public OffsetDateTime lastModifiedTime() {
return this.lastModifiedTime;
}
/**
* Get the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in:
* https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
*
* @return the policy value.
*/
public ManagementPolicySchema policy() {
return this.policy;
}
/**
* Set the policy property: The Storage Account ManagementPolicy, in JSON format. See more details in:
* https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
*
* @param policy the policy value to set.
* @return the ManagementPolicyProperties object itself.
*/
public ManagementPolicyProperties withPolicy(ManagementPolicySchema policy) {
this.policy = policy;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (policy() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property policy in model ManagementPolicyProperties"));
} else {
policy().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(ManagementPolicyProperties.class);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy