
com.oracle.bmc.mysql.model.CreateBackupDetails Maven / Gradle / Ivy
/**
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
*/
package com.oracle.bmc.mysql.model;
/**
* Complete information for a Backup.
*
* Note: Objects should always be created or deserialized using the {@link Builder}. This model distinguishes fields
* that are {@code null} because they are unset from fields that are explicitly set to {@code null}. This is done in
* the setter methods of the {@link Builder}, which maintain a set of all explicitly set fields called
* {@link #__explicitlySet__}. The {@link #hashCode()} and {@link #equals(Object)} methods are implemented to take
* {@link #__explicitlySet__} into account. The constructor, on the other hand, does not set {@link #__explicitlySet__}
* (since the constructor cannot distinguish explicit {@code null} from unset {@code null}).
**/
@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20190415")
@lombok.AllArgsConstructor(onConstructor = @__({@Deprecated}))
@lombok.Value
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(
builder = CreateBackupDetails.Builder.class
)
@com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.internal.ExplicitlySetFilter.NAME)
@lombok.Builder(builderClassName = "Builder", toBuilder = true)
public class CreateBackupDetails {
@com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder(withPrefix = "")
@lombok.experimental.Accessors(fluent = true)
public static class Builder {
@com.fasterxml.jackson.annotation.JsonProperty("displayName")
private String displayName;
public Builder displayName(String displayName) {
this.displayName = displayName;
this.__explicitlySet__.add("displayName");
return this;
}
@com.fasterxml.jackson.annotation.JsonProperty("description")
private String description;
public Builder description(String description) {
this.description = description;
this.__explicitlySet__.add("description");
return this;
}
@com.fasterxml.jackson.annotation.JsonProperty("backupType")
private BackupType backupType;
public Builder backupType(BackupType backupType) {
this.backupType = backupType;
this.__explicitlySet__.add("backupType");
return this;
}
@com.fasterxml.jackson.annotation.JsonProperty("dbSystemId")
private String dbSystemId;
public Builder dbSystemId(String dbSystemId) {
this.dbSystemId = dbSystemId;
this.__explicitlySet__.add("dbSystemId");
return this;
}
@com.fasterxml.jackson.annotation.JsonProperty("retentionInDays")
private Integer retentionInDays;
public Builder retentionInDays(Integer retentionInDays) {
this.retentionInDays = retentionInDays;
this.__explicitlySet__.add("retentionInDays");
return this;
}
@com.fasterxml.jackson.annotation.JsonProperty("freeformTags")
private java.util.Map freeformTags;
public Builder freeformTags(java.util.Map freeformTags) {
this.freeformTags = freeformTags;
this.__explicitlySet__.add("freeformTags");
return this;
}
@com.fasterxml.jackson.annotation.JsonProperty("definedTags")
private java.util.Map> definedTags;
public Builder definedTags(
java.util.Map> definedTags) {
this.definedTags = definedTags;
this.__explicitlySet__.add("definedTags");
return this;
}
@com.fasterxml.jackson.annotation.JsonIgnore
private final java.util.Set __explicitlySet__ = new java.util.HashSet();
public CreateBackupDetails build() {
CreateBackupDetails __instance__ =
new CreateBackupDetails(
displayName,
description,
backupType,
dbSystemId,
retentionInDays,
freeformTags,
definedTags);
__instance__.__explicitlySet__.addAll(__explicitlySet__);
return __instance__;
}
@com.fasterxml.jackson.annotation.JsonIgnore
public Builder copy(CreateBackupDetails o) {
Builder copiedBuilder =
displayName(o.getDisplayName())
.description(o.getDescription())
.backupType(o.getBackupType())
.dbSystemId(o.getDbSystemId())
.retentionInDays(o.getRetentionInDays())
.freeformTags(o.getFreeformTags())
.definedTags(o.getDefinedTags());
copiedBuilder.__explicitlySet__.retainAll(o.__explicitlySet__);
return copiedBuilder;
}
}
/**
* Create a new builder.
*/
public static Builder builder() {
return new Builder();
}
/**
* A user-supplied display name for the backup.
**/
@com.fasterxml.jackson.annotation.JsonProperty("displayName")
String displayName;
/**
* A user-supplied description for the backup.
**/
@com.fasterxml.jackson.annotation.JsonProperty("description")
String description;
/**
* The type of backup.
**/
public enum BackupType {
Full("FULL"),
Incremental("INCREMENTAL"),
;
private final String value;
private static java.util.Map map;
static {
map = new java.util.HashMap<>();
for (BackupType v : BackupType.values()) {
map.put(v.getValue(), v);
}
}
BackupType(String value) {
this.value = value;
}
@com.fasterxml.jackson.annotation.JsonValue
public String getValue() {
return value;
}
@com.fasterxml.jackson.annotation.JsonCreator
public static BackupType create(String key) {
if (map.containsKey(key)) {
return map.get(key);
}
throw new IllegalArgumentException("Invalid BackupType: " + key);
}
};
/**
* The type of backup.
**/
@com.fasterxml.jackson.annotation.JsonProperty("backupType")
BackupType backupType;
/**
* The OCID of the DB System the Backup is associated with.
**/
@com.fasterxml.jackson.annotation.JsonProperty("dbSystemId")
String dbSystemId;
/**
* Number of days to retain this backup.
**/
@com.fasterxml.jackson.annotation.JsonProperty("retentionInDays")
Integer retentionInDays;
/**
* Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
* Example: `{\"bar-key\": \"value\"}`
*
**/
@com.fasterxml.jackson.annotation.JsonProperty("freeformTags")
java.util.Map freeformTags;
/**
* Defined tags for this resource. Each key is predefined and scoped to a namespace.
* Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`
*
**/
@com.fasterxml.jackson.annotation.JsonProperty("definedTags")
java.util.Map> definedTags;
@com.fasterxml.jackson.annotation.JsonIgnore
private final java.util.Set __explicitlySet__ = new java.util.HashSet();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy