
software.amazon.awssdk.services.fsx.model.OntapFileSystemConfiguration Maven / Gradle / Ivy
/*
* 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;
/**
*
* Configuration for the FSx for NetApp ONTAP file system.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OntapFileSystemConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField AUTOMATIC_BACKUP_RETENTION_DAYS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("AutomaticBackupRetentionDays")
.getter(getter(OntapFileSystemConfiguration::automaticBackupRetentionDays))
.setter(setter(Builder::automaticBackupRetentionDays))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutomaticBackupRetentionDays")
.build()).build();
private static final SdkField DAILY_AUTOMATIC_BACKUP_START_TIME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DailyAutomaticBackupStartTime")
.getter(getter(OntapFileSystemConfiguration::dailyAutomaticBackupStartTime))
.setter(setter(Builder::dailyAutomaticBackupStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DailyAutomaticBackupStartTime")
.build()).build();
private static final SdkField DEPLOYMENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeploymentType").getter(getter(OntapFileSystemConfiguration::deploymentTypeAsString))
.setter(setter(Builder::deploymentType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeploymentType").build()).build();
private static final SdkField ENDPOINT_IP_ADDRESS_RANGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EndpointIpAddressRange").getter(getter(OntapFileSystemConfiguration::endpointIpAddressRange))
.setter(setter(Builder::endpointIpAddressRange))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndpointIpAddressRange").build())
.build();
private static final SdkField ENDPOINTS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Endpoints")
.getter(getter(OntapFileSystemConfiguration::endpoints)).setter(setter(Builder::endpoints))
.constructor(FileSystemEndpoints::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Endpoints").build()).build();
private static final SdkField DISK_IOPS_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DiskIopsConfiguration")
.getter(getter(OntapFileSystemConfiguration::diskIopsConfiguration)).setter(setter(Builder::diskIopsConfiguration))
.constructor(DiskIopsConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DiskIopsConfiguration").build())
.build();
private static final SdkField PREFERRED_SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PreferredSubnetId").getter(getter(OntapFileSystemConfiguration::preferredSubnetId))
.setter(setter(Builder::preferredSubnetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PreferredSubnetId").build()).build();
private static final SdkField> ROUTE_TABLE_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("RouteTableIds")
.getter(getter(OntapFileSystemConfiguration::routeTableIds))
.setter(setter(Builder::routeTableIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RouteTableIds").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 THROUGHPUT_CAPACITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ThroughputCapacity").getter(getter(OntapFileSystemConfiguration::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(OntapFileSystemConfiguration::weeklyMaintenanceStartTime))
.setter(setter(Builder::weeklyMaintenanceStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WeeklyMaintenanceStartTime").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
AUTOMATIC_BACKUP_RETENTION_DAYS_FIELD, DAILY_AUTOMATIC_BACKUP_START_TIME_FIELD, DEPLOYMENT_TYPE_FIELD,
ENDPOINT_IP_ADDRESS_RANGE_FIELD, ENDPOINTS_FIELD, DISK_IOPS_CONFIGURATION_FIELD, PREFERRED_SUBNET_ID_FIELD,
ROUTE_TABLE_IDS_FIELD, THROUGHPUT_CAPACITY_FIELD, WEEKLY_MAINTENANCE_START_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final Integer automaticBackupRetentionDays;
private final String dailyAutomaticBackupStartTime;
private final String deploymentType;
private final String endpointIpAddressRange;
private final FileSystemEndpoints endpoints;
private final DiskIopsConfiguration diskIopsConfiguration;
private final String preferredSubnetId;
private final List routeTableIds;
private final Integer throughputCapacity;
private final String weeklyMaintenanceStartTime;
private OntapFileSystemConfiguration(BuilderImpl builder) {
this.automaticBackupRetentionDays = builder.automaticBackupRetentionDays;
this.dailyAutomaticBackupStartTime = builder.dailyAutomaticBackupStartTime;
this.deploymentType = builder.deploymentType;
this.endpointIpAddressRange = builder.endpointIpAddressRange;
this.endpoints = builder.endpoints;
this.diskIopsConfiguration = builder.diskIopsConfiguration;
this.preferredSubnetId = builder.preferredSubnetId;
this.routeTableIds = builder.routeTableIds;
this.throughputCapacity = builder.throughputCapacity;
this.weeklyMaintenanceStartTime = builder.weeklyMaintenanceStartTime;
}
/**
* 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;
}
/**
* 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;
}
/**
*
* Specifies the FSx for ONTAP file system deployment type in use in the file system.
*
*
* -
*
* MULTI_AZ_1
- (Default) A high availability file system configured for Multi-AZ redundancy to
* tolerate temporary Availability Zone (AZ) unavailability.
*
*
* -
*
* SINGLE_AZ_1
- A file system configured for Single-AZ redundancy.
*
*
*
*
* For information about the use cases for Multi-AZ and Single-AZ deployments, refer to Choosing Multi-AZ or
* Single-AZ file system deployment.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentType}
* will return {@link OntapDeploymentType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #deploymentTypeAsString}.
*
*
* @return Specifies the FSx for ONTAP file system deployment type in use in the file system.
*
* -
*
* MULTI_AZ_1
- (Default) A high availability file system configured for Multi-AZ redundancy to
* tolerate temporary Availability Zone (AZ) unavailability.
*
*
* -
*
* SINGLE_AZ_1
- A file system configured for Single-AZ redundancy.
*
*
*
*
* For information about the use cases for Multi-AZ and Single-AZ deployments, refer to Choosing Multi-AZ
* or Single-AZ file system deployment.
* @see OntapDeploymentType
*/
public final OntapDeploymentType deploymentType() {
return OntapDeploymentType.fromValue(deploymentType);
}
/**
*
* Specifies the FSx for ONTAP file system deployment type in use in the file system.
*
*
* -
*
* MULTI_AZ_1
- (Default) A high availability file system configured for Multi-AZ redundancy to
* tolerate temporary Availability Zone (AZ) unavailability.
*
*
* -
*
* SINGLE_AZ_1
- A file system configured for Single-AZ redundancy.
*
*
*
*
* For information about the use cases for Multi-AZ and Single-AZ deployments, refer to Choosing Multi-AZ or
* Single-AZ file system deployment.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentType}
* will return {@link OntapDeploymentType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #deploymentTypeAsString}.
*
*
* @return Specifies the FSx for ONTAP file system deployment type in use in the file system.
*
* -
*
* MULTI_AZ_1
- (Default) A high availability file system configured for Multi-AZ redundancy to
* tolerate temporary Availability Zone (AZ) unavailability.
*
*
* -
*
* SINGLE_AZ_1
- A file system configured for Single-AZ redundancy.
*
*
*
*
* For information about the use cases for Multi-AZ and Single-AZ deployments, refer to Choosing Multi-AZ
* or Single-AZ file system deployment.
* @see OntapDeploymentType
*/
public final String deploymentTypeAsString() {
return deploymentType;
}
/**
*
* (Multi-AZ only) The IP address range in which the endpoints to access your file system are created.
*
*
*
* The Endpoint IP address range you select for your file system must exist outside the VPC's CIDR range and must be
* at least /30 or larger. If you do not specify this optional parameter, Amazon FSx will automatically select a
* CIDR block for you.
*
*
*
* @return (Multi-AZ only) The IP address range in which the endpoints to access your file system are created.
*
*
* The Endpoint IP address range you select for your file system must exist outside the VPC's CIDR range and
* must be at least /30 or larger. If you do not specify this optional parameter, Amazon FSx will
* automatically select a CIDR block for you.
*
*/
public final String endpointIpAddressRange() {
return endpointIpAddressRange;
}
/**
*
* The Management
and Intercluster
endpoints that are used to access data or to manage the
* file system using the NetApp ONTAP CLI, REST API, or NetApp SnapMirror.
*
*
* @return The Management
and Intercluster
endpoints that are used to access data or to
* manage the file system using the NetApp ONTAP CLI, REST API, or NetApp SnapMirror.
*/
public final FileSystemEndpoints endpoints() {
return endpoints;
}
/**
*
* The SSD IOPS configuration for the ONTAP file system, specifying the number of provisioned IOPS and the provision
* mode.
*
*
* @return The SSD IOPS configuration for the ONTAP file system, specifying the number of provisioned IOPS and the
* provision mode.
*/
public final DiskIopsConfiguration diskIopsConfiguration() {
return diskIopsConfiguration;
}
/**
* Returns the value of the PreferredSubnetId property for this object.
*
* @return The value of the PreferredSubnetId property for this object.
*/
public final String preferredSubnetId() {
return preferredSubnetId;
}
/**
* For responses, this returns true if the service returned a value for the RouteTableIds 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 hasRouteTableIds() {
return routeTableIds != null && !(routeTableIds instanceof SdkAutoConstructList);
}
/**
*
* (Multi-AZ only) The VPC route tables in which your file system's endpoints are created.
*
*
* 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 #hasRouteTableIds} method.
*
*
* @return (Multi-AZ only) The VPC route tables in which your file system's endpoints are created.
*/
public final List routeTableIds() {
return routeTableIds;
}
/**
* Returns the value of the ThroughputCapacity property for this object.
*
* @return The value of the ThroughputCapacity property for this object.
*/
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;
}
@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(dailyAutomaticBackupStartTime());
hashCode = 31 * hashCode + Objects.hashCode(deploymentTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(endpointIpAddressRange());
hashCode = 31 * hashCode + Objects.hashCode(endpoints());
hashCode = 31 * hashCode + Objects.hashCode(diskIopsConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(preferredSubnetId());
hashCode = 31 * hashCode + Objects.hashCode(hasRouteTableIds() ? routeTableIds() : null);
hashCode = 31 * hashCode + Objects.hashCode(throughputCapacity());
hashCode = 31 * hashCode + Objects.hashCode(weeklyMaintenanceStartTime());
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 OntapFileSystemConfiguration)) {
return false;
}
OntapFileSystemConfiguration other = (OntapFileSystemConfiguration) obj;
return Objects.equals(automaticBackupRetentionDays(), other.automaticBackupRetentionDays())
&& Objects.equals(dailyAutomaticBackupStartTime(), other.dailyAutomaticBackupStartTime())
&& Objects.equals(deploymentTypeAsString(), other.deploymentTypeAsString())
&& Objects.equals(endpointIpAddressRange(), other.endpointIpAddressRange())
&& Objects.equals(endpoints(), other.endpoints())
&& Objects.equals(diskIopsConfiguration(), other.diskIopsConfiguration())
&& Objects.equals(preferredSubnetId(), other.preferredSubnetId())
&& hasRouteTableIds() == other.hasRouteTableIds() && Objects.equals(routeTableIds(), other.routeTableIds())
&& Objects.equals(throughputCapacity(), other.throughputCapacity())
&& Objects.equals(weeklyMaintenanceStartTime(), other.weeklyMaintenanceStartTime());
}
/**
* 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("OntapFileSystemConfiguration")
.add("AutomaticBackupRetentionDays", automaticBackupRetentionDays())
.add("DailyAutomaticBackupStartTime", dailyAutomaticBackupStartTime())
.add("DeploymentType", deploymentTypeAsString()).add("EndpointIpAddressRange", endpointIpAddressRange())
.add("Endpoints", endpoints()).add("DiskIopsConfiguration", diskIopsConfiguration())
.add("PreferredSubnetId", preferredSubnetId()).add("RouteTableIds", hasRouteTableIds() ? routeTableIds() : null)
.add("ThroughputCapacity", throughputCapacity()).add("WeeklyMaintenanceStartTime", weeklyMaintenanceStartTime())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AutomaticBackupRetentionDays":
return Optional.ofNullable(clazz.cast(automaticBackupRetentionDays()));
case "DailyAutomaticBackupStartTime":
return Optional.ofNullable(clazz.cast(dailyAutomaticBackupStartTime()));
case "DeploymentType":
return Optional.ofNullable(clazz.cast(deploymentTypeAsString()));
case "EndpointIpAddressRange":
return Optional.ofNullable(clazz.cast(endpointIpAddressRange()));
case "Endpoints":
return Optional.ofNullable(clazz.cast(endpoints()));
case "DiskIopsConfiguration":
return Optional.ofNullable(clazz.cast(diskIopsConfiguration()));
case "PreferredSubnetId":
return Optional.ofNullable(clazz.cast(preferredSubnetId()));
case "RouteTableIds":
return Optional.ofNullable(clazz.cast(routeTableIds()));
case "ThroughputCapacity":
return Optional.ofNullable(clazz.cast(throughputCapacity()));
case "WeeklyMaintenanceStartTime":
return Optional.ofNullable(clazz.cast(weeklyMaintenanceStartTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function