
com.azure.resourcemanager.netapp.fluent.models.BackupPolicyInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-netapp Show documentation
Show all versions of azure-resourcemanager-netapp Show documentation
This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-preview-2024-07-01-preview.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.netapp.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.netapp.models.VolumeBackups;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* Backup policy information.
*/
@Fluent
public final class BackupPolicyInner extends Resource {
/*
* A unique read-only string that changes whenever the resource is updated.
*/
private String etag;
/*
* Backup policy Properties
*/
private BackupPolicyProperties innerProperties = new BackupPolicyProperties();
/*
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*/
private SystemData systemData;
/*
* The type of the resource.
*/
private String type;
/*
* The name of the resource.
*/
private String name;
/*
* Fully qualified resource Id for the resource.
*/
private String id;
/**
* Creates an instance of BackupPolicyInner class.
*/
public BackupPolicyInner() {
}
/**
* Get the etag property: A unique read-only string that changes whenever the resource is updated.
*
* @return the etag value.
*/
public String etag() {
return this.etag;
}
/**
* Get the innerProperties property: Backup policy Properties.
*
* @return the innerProperties value.
*/
private BackupPolicyProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
* @return the systemData value.
*/
public SystemData systemData() {
return this.systemData;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the id property: Fully qualified resource Id for the resource.
*
* @return the id value.
*/
@Override
public String id() {
return this.id;
}
/**
* {@inheritDoc}
*/
@Override
public BackupPolicyInner withLocation(String location) {
super.withLocation(location);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public BackupPolicyInner withTags(Map tags) {
super.withTags(tags);
return this;
}
/**
* Get the backupPolicyId property: Backup Policy Resource ID.
*
* @return the backupPolicyId value.
*/
public String backupPolicyId() {
return this.innerProperties() == null ? null : this.innerProperties().backupPolicyId();
}
/**
* Get the provisioningState property: Azure lifecycle management.
*
* @return the provisioningState value.
*/
public String provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}
/**
* Get the dailyBackupsToKeep property: Daily backups count to keep.
*
* @return the dailyBackupsToKeep value.
*/
public Integer dailyBackupsToKeep() {
return this.innerProperties() == null ? null : this.innerProperties().dailyBackupsToKeep();
}
/**
* Set the dailyBackupsToKeep property: Daily backups count to keep.
*
* @param dailyBackupsToKeep the dailyBackupsToKeep value to set.
* @return the BackupPolicyInner object itself.
*/
public BackupPolicyInner withDailyBackupsToKeep(Integer dailyBackupsToKeep) {
if (this.innerProperties() == null) {
this.innerProperties = new BackupPolicyProperties();
}
this.innerProperties().withDailyBackupsToKeep(dailyBackupsToKeep);
return this;
}
/**
* Get the weeklyBackupsToKeep property: Weekly backups count to keep.
*
* @return the weeklyBackupsToKeep value.
*/
public Integer weeklyBackupsToKeep() {
return this.innerProperties() == null ? null : this.innerProperties().weeklyBackupsToKeep();
}
/**
* Set the weeklyBackupsToKeep property: Weekly backups count to keep.
*
* @param weeklyBackupsToKeep the weeklyBackupsToKeep value to set.
* @return the BackupPolicyInner object itself.
*/
public BackupPolicyInner withWeeklyBackupsToKeep(Integer weeklyBackupsToKeep) {
if (this.innerProperties() == null) {
this.innerProperties = new BackupPolicyProperties();
}
this.innerProperties().withWeeklyBackupsToKeep(weeklyBackupsToKeep);
return this;
}
/**
* Get the monthlyBackupsToKeep property: Monthly backups count to keep.
*
* @return the monthlyBackupsToKeep value.
*/
public Integer monthlyBackupsToKeep() {
return this.innerProperties() == null ? null : this.innerProperties().monthlyBackupsToKeep();
}
/**
* Set the monthlyBackupsToKeep property: Monthly backups count to keep.
*
* @param monthlyBackupsToKeep the monthlyBackupsToKeep value to set.
* @return the BackupPolicyInner object itself.
*/
public BackupPolicyInner withMonthlyBackupsToKeep(Integer monthlyBackupsToKeep) {
if (this.innerProperties() == null) {
this.innerProperties = new BackupPolicyProperties();
}
this.innerProperties().withMonthlyBackupsToKeep(monthlyBackupsToKeep);
return this;
}
/**
* Get the volumesAssigned property: Volumes using current backup policy.
*
* @return the volumesAssigned value.
*/
public Integer volumesAssigned() {
return this.innerProperties() == null ? null : this.innerProperties().volumesAssigned();
}
/**
* Get the enabled property: The property to decide policy is enabled or not.
*
* @return the enabled value.
*/
public Boolean enabled() {
return this.innerProperties() == null ? null : this.innerProperties().enabled();
}
/**
* Set the enabled property: The property to decide policy is enabled or not.
*
* @param enabled the enabled value to set.
* @return the BackupPolicyInner object itself.
*/
public BackupPolicyInner withEnabled(Boolean enabled) {
if (this.innerProperties() == null) {
this.innerProperties = new BackupPolicyProperties();
}
this.innerProperties().withEnabled(enabled);
return this;
}
/**
* Get the volumeBackups property: A list of volumes assigned to this policy.
*
* @return the volumeBackups value.
*/
public List volumeBackups() {
return this.innerProperties() == null ? null : this.innerProperties().volumeBackups();
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property innerProperties in model BackupPolicyInner"));
} else {
innerProperties().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(BackupPolicyInner.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("location", location());
jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of BackupPolicyInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of BackupPolicyInner 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.
* @throws IOException If an error occurs while reading the BackupPolicyInner.
*/
public static BackupPolicyInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
BackupPolicyInner deserializedBackupPolicyInner = new BackupPolicyInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedBackupPolicyInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedBackupPolicyInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedBackupPolicyInner.type = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedBackupPolicyInner.withLocation(reader.getString());
} else if ("tags".equals(fieldName)) {
Map tags = reader.readMap(reader1 -> reader1.getString());
deserializedBackupPolicyInner.withTags(tags);
} else if ("properties".equals(fieldName)) {
deserializedBackupPolicyInner.innerProperties = BackupPolicyProperties.fromJson(reader);
} else if ("etag".equals(fieldName)) {
deserializedBackupPolicyInner.etag = reader.getString();
} else if ("systemData".equals(fieldName)) {
deserializedBackupPolicyInner.systemData = SystemData.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedBackupPolicyInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy