software.amazon.awssdk.services.fsx.model.UpdateFileSystemOpenZFSConfiguration Maven / Gradle / Ivy
Show all versions of fsx Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.fsx.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The configuration updates for an Amazon FSx for OpenZFS file system.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateFileSystemOpenZFSConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField AUTOMATIC_BACKUP_RETENTION_DAYS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("AutomaticBackupRetentionDays")
.getter(getter(UpdateFileSystemOpenZFSConfiguration::automaticBackupRetentionDays))
.setter(setter(Builder::automaticBackupRetentionDays))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutomaticBackupRetentionDays")
.build()).build();
private static final SdkField COPY_TAGS_TO_BACKUPS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CopyTagsToBackups").getter(getter(UpdateFileSystemOpenZFSConfiguration::copyTagsToBackups))
.setter(setter(Builder::copyTagsToBackups))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CopyTagsToBackups").build()).build();
private static final SdkField COPY_TAGS_TO_VOLUMES_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CopyTagsToVolumes").getter(getter(UpdateFileSystemOpenZFSConfiguration::copyTagsToVolumes))
.setter(setter(Builder::copyTagsToVolumes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CopyTagsToVolumes").build()).build();
private static final SdkField DAILY_AUTOMATIC_BACKUP_START_TIME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DailyAutomaticBackupStartTime")
.getter(getter(UpdateFileSystemOpenZFSConfiguration::dailyAutomaticBackupStartTime))
.setter(setter(Builder::dailyAutomaticBackupStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DailyAutomaticBackupStartTime")
.build()).build();
private static final SdkField THROUGHPUT_CAPACITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ThroughputCapacity").getter(getter(UpdateFileSystemOpenZFSConfiguration::throughputCapacity))
.setter(setter(Builder::throughputCapacity))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ThroughputCapacity").build())
.build();
private static final SdkField WEEKLY_MAINTENANCE_START_TIME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("WeeklyMaintenanceStartTime")
.getter(getter(UpdateFileSystemOpenZFSConfiguration::weeklyMaintenanceStartTime))
.setter(setter(Builder::weeklyMaintenanceStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WeeklyMaintenanceStartTime").build())
.build();
private static final SdkField DISK_IOPS_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DiskIopsConfiguration")
.getter(getter(UpdateFileSystemOpenZFSConfiguration::diskIopsConfiguration))
.setter(setter(Builder::diskIopsConfiguration)).constructor(DiskIopsConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DiskIopsConfiguration").build())
.build();
private static final SdkField> ADD_ROUTE_TABLE_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AddRouteTableIds")
.getter(getter(UpdateFileSystemOpenZFSConfiguration::addRouteTableIds))
.setter(setter(Builder::addRouteTableIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AddRouteTableIds").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> REMOVE_ROUTE_TABLE_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("RemoveRouteTableIds")
.getter(getter(UpdateFileSystemOpenZFSConfiguration::removeRouteTableIds))
.setter(setter(Builder::removeRouteTableIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RemoveRouteTableIds").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
AUTOMATIC_BACKUP_RETENTION_DAYS_FIELD, COPY_TAGS_TO_BACKUPS_FIELD, COPY_TAGS_TO_VOLUMES_FIELD,
DAILY_AUTOMATIC_BACKUP_START_TIME_FIELD, THROUGHPUT_CAPACITY_FIELD, WEEKLY_MAINTENANCE_START_TIME_FIELD,
DISK_IOPS_CONFIGURATION_FIELD, ADD_ROUTE_TABLE_IDS_FIELD, REMOVE_ROUTE_TABLE_IDS_FIELD));
private static final long serialVersionUID = 1L;
private final Integer automaticBackupRetentionDays;
private final Boolean copyTagsToBackups;
private final Boolean copyTagsToVolumes;
private final String dailyAutomaticBackupStartTime;
private final Integer throughputCapacity;
private final String weeklyMaintenanceStartTime;
private final DiskIopsConfiguration diskIopsConfiguration;
private final List addRouteTableIds;
private final List removeRouteTableIds;
private UpdateFileSystemOpenZFSConfiguration(BuilderImpl builder) {
this.automaticBackupRetentionDays = builder.automaticBackupRetentionDays;
this.copyTagsToBackups = builder.copyTagsToBackups;
this.copyTagsToVolumes = builder.copyTagsToVolumes;
this.dailyAutomaticBackupStartTime = builder.dailyAutomaticBackupStartTime;
this.throughputCapacity = builder.throughputCapacity;
this.weeklyMaintenanceStartTime = builder.weeklyMaintenanceStartTime;
this.diskIopsConfiguration = builder.diskIopsConfiguration;
this.addRouteTableIds = builder.addRouteTableIds;
this.removeRouteTableIds = builder.removeRouteTableIds;
}
/**
* Returns the value of the AutomaticBackupRetentionDays property for this object.
*
* @return The value of the AutomaticBackupRetentionDays property for this object.
*/
public final Integer automaticBackupRetentionDays() {
return automaticBackupRetentionDays;
}
/**
*
* A Boolean value indicating whether tags for the file system should be copied to backups. This value defaults to
* false
. If it's set to true
, all tags for the file system are copied to all automatic
* and user-initiated backups where the user doesn't specify tags. If this value is true
and you
* specify one or more tags, only the specified tags are copied to backups. If you specify one or more tags when
* creating a user-initiated backup, no tags are copied from the file system, regardless of this value.
*
*
* @return A Boolean value indicating whether tags for the file system should be copied to backups. This value
* defaults to false
. If it's set to true
, all tags for the file system are copied
* to all automatic and user-initiated backups where the user doesn't specify tags. If this value is
* true
and you specify one or more tags, only the specified tags are copied to backups. If you
* specify one or more tags when creating a user-initiated backup, no tags are copied from the file system,
* regardless of this value.
*/
public final Boolean copyTagsToBackups() {
return copyTagsToBackups;
}
/**
*
* A Boolean value indicating whether tags for the volume should be copied to snapshots. This value defaults to
* false
. If it's set to true
, all tags for the volume are copied to snapshots where the
* user doesn't specify tags. If this value is true
and you specify one or more tags, only the
* specified tags are copied to snapshots. If you specify one or more tags when creating the snapshot, no tags are
* copied from the volume, regardless of this value.
*
*
* @return A Boolean value indicating whether tags for the volume should be copied to snapshots. This value defaults
* to false
. If it's set to true
, all tags for the volume are copied to snapshots
* where the user doesn't specify tags. If this value is true
and you specify one or more tags,
* only the specified tags are copied to snapshots. If you specify one or more tags when creating the
* snapshot, no tags are copied from the volume, regardless of this value.
*/
public final Boolean copyTagsToVolumes() {
return copyTagsToVolumes;
}
/**
* Returns the value of the DailyAutomaticBackupStartTime property for this object.
*
* @return The value of the DailyAutomaticBackupStartTime property for this object.
*/
public final String dailyAutomaticBackupStartTime() {
return dailyAutomaticBackupStartTime;
}
/**
*
* The throughput of an Amazon FSx for OpenZFS file system, measured in megabytes per second
(MB/s). Valid
* values depend on the DeploymentType you choose, as follows:
*
*
* -
*
* For MULTI_AZ_1
and SINGLE_AZ_2
, valid values are 160, 320, 640, 1280, 2560, 3840, 5120,
* 7680, or 10240 MB/s.
*
*
* -
*
* For SINGLE_AZ_1
, valid values are 64, 128, 256, 512, 1024, 2048, 3072, or 4096 MB/s.
*
*
*
*
* @return The throughput of an Amazon FSx for OpenZFS file system, measured in megabytes per second
(MB/s).
* Valid values depend on the DeploymentType you choose, as follows:
*
* -
*
* For MULTI_AZ_1
and SINGLE_AZ_2
, valid values are 160, 320, 640, 1280, 2560,
* 3840, 5120, 7680, or 10240 MB/s.
*
*
* -
*
* For SINGLE_AZ_1
, valid values are 64, 128, 256, 512, 1024, 2048, 3072, or 4096 MB/s.
*
*
*/
public final Integer throughputCapacity() {
return throughputCapacity;
}
/**
* Returns the value of the WeeklyMaintenanceStartTime property for this object.
*
* @return The value of the WeeklyMaintenanceStartTime property for this object.
*/
public final String weeklyMaintenanceStartTime() {
return weeklyMaintenanceStartTime;
}
/**
* Returns the value of the DiskIopsConfiguration property for this object.
*
* @return The value of the DiskIopsConfiguration property for this object.
*/
public final DiskIopsConfiguration diskIopsConfiguration() {
return diskIopsConfiguration;
}
/**
* For responses, this returns true if the service returned a value for the AddRouteTableIds property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasAddRouteTableIds() {
return addRouteTableIds != null && !(addRouteTableIds instanceof SdkAutoConstructList);
}
/**
*
* (Multi-AZ only) A list of IDs of new virtual private cloud (VPC) route tables to associate (add) with your Amazon
* FSx for OpenZFS file system.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasAddRouteTableIds} method.
*
*
* @return (Multi-AZ only) A list of IDs of new virtual private cloud (VPC) route tables to associate (add) with
* your Amazon FSx for OpenZFS file system.
*/
public final List addRouteTableIds() {
return addRouteTableIds;
}
/**
* For responses, this returns true if the service returned a value for the RemoveRouteTableIds property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasRemoveRouteTableIds() {
return removeRouteTableIds != null && !(removeRouteTableIds instanceof SdkAutoConstructList);
}
/**
*
* (Multi-AZ only) A list of IDs of existing virtual private cloud (VPC) route tables to disassociate (remove) from
* your Amazon FSx for OpenZFS file system. You can use the API operation to retrieve the list of VPC route table
* IDs for a file system.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasRemoveRouteTableIds} method.
*
*
* @return (Multi-AZ only) A list of IDs of existing virtual private cloud (VPC) route tables to disassociate
* (remove) from your Amazon FSx for OpenZFS file system. You can use the API operation to retrieve the list
* of VPC route table IDs for a file system.
*/
public final List removeRouteTableIds() {
return removeRouteTableIds;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(automaticBackupRetentionDays());
hashCode = 31 * hashCode + Objects.hashCode(copyTagsToBackups());
hashCode = 31 * hashCode + Objects.hashCode(copyTagsToVolumes());
hashCode = 31 * hashCode + Objects.hashCode(dailyAutomaticBackupStartTime());
hashCode = 31 * hashCode + Objects.hashCode(throughputCapacity());
hashCode = 31 * hashCode + Objects.hashCode(weeklyMaintenanceStartTime());
hashCode = 31 * hashCode + Objects.hashCode(diskIopsConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(hasAddRouteTableIds() ? addRouteTableIds() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasRemoveRouteTableIds() ? removeRouteTableIds() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateFileSystemOpenZFSConfiguration)) {
return false;
}
UpdateFileSystemOpenZFSConfiguration other = (UpdateFileSystemOpenZFSConfiguration) obj;
return Objects.equals(automaticBackupRetentionDays(), other.automaticBackupRetentionDays())
&& Objects.equals(copyTagsToBackups(), other.copyTagsToBackups())
&& Objects.equals(copyTagsToVolumes(), other.copyTagsToVolumes())
&& Objects.equals(dailyAutomaticBackupStartTime(), other.dailyAutomaticBackupStartTime())
&& Objects.equals(throughputCapacity(), other.throughputCapacity())
&& Objects.equals(weeklyMaintenanceStartTime(), other.weeklyMaintenanceStartTime())
&& Objects.equals(diskIopsConfiguration(), other.diskIopsConfiguration())
&& hasAddRouteTableIds() == other.hasAddRouteTableIds()
&& Objects.equals(addRouteTableIds(), other.addRouteTableIds())
&& hasRemoveRouteTableIds() == other.hasRemoveRouteTableIds()
&& Objects.equals(removeRouteTableIds(), other.removeRouteTableIds());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("UpdateFileSystemOpenZFSConfiguration")
.add("AutomaticBackupRetentionDays", automaticBackupRetentionDays())
.add("CopyTagsToBackups", copyTagsToBackups()).add("CopyTagsToVolumes", copyTagsToVolumes())
.add("DailyAutomaticBackupStartTime", dailyAutomaticBackupStartTime())
.add("ThroughputCapacity", throughputCapacity()).add("WeeklyMaintenanceStartTime", weeklyMaintenanceStartTime())
.add("DiskIopsConfiguration", diskIopsConfiguration())
.add("AddRouteTableIds", hasAddRouteTableIds() ? addRouteTableIds() : null)
.add("RemoveRouteTableIds", hasRemoveRouteTableIds() ? removeRouteTableIds() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AutomaticBackupRetentionDays":
return Optional.ofNullable(clazz.cast(automaticBackupRetentionDays()));
case "CopyTagsToBackups":
return Optional.ofNullable(clazz.cast(copyTagsToBackups()));
case "CopyTagsToVolumes":
return Optional.ofNullable(clazz.cast(copyTagsToVolumes()));
case "DailyAutomaticBackupStartTime":
return Optional.ofNullable(clazz.cast(dailyAutomaticBackupStartTime()));
case "ThroughputCapacity":
return Optional.ofNullable(clazz.cast(throughputCapacity()));
case "WeeklyMaintenanceStartTime":
return Optional.ofNullable(clazz.cast(weeklyMaintenanceStartTime()));
case "DiskIopsConfiguration":
return Optional.ofNullable(clazz.cast(diskIopsConfiguration()));
case "AddRouteTableIds":
return Optional.ofNullable(clazz.cast(addRouteTableIds()));
case "RemoveRouteTableIds":
return Optional.ofNullable(clazz.cast(removeRouteTableIds()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function