software.amazon.awssdk.services.fsx.model.CreateFileCacheLustreConfiguration 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.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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The Amazon File Cache configuration for the cache that you are creating.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateFileCacheLustreConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField PER_UNIT_STORAGE_THROUGHPUT_FIELD = SdkField
. builder(MarshallingType.INTEGER).memberName("PerUnitStorageThroughput")
.getter(getter(CreateFileCacheLustreConfiguration::perUnitStorageThroughput))
.setter(setter(Builder::perUnitStorageThroughput))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PerUnitStorageThroughput").build())
.build();
private static final SdkField DEPLOYMENT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DeploymentType").getter(getter(CreateFileCacheLustreConfiguration::deploymentTypeAsString))
.setter(setter(Builder::deploymentType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeploymentType").build()).build();
private static final SdkField WEEKLY_MAINTENANCE_START_TIME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("WeeklyMaintenanceStartTime")
.getter(getter(CreateFileCacheLustreConfiguration::weeklyMaintenanceStartTime))
.setter(setter(Builder::weeklyMaintenanceStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WeeklyMaintenanceStartTime").build())
.build();
private static final SdkField METADATA_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("MetadataConfiguration")
.getter(getter(CreateFileCacheLustreConfiguration::metadataConfiguration))
.setter(setter(Builder::metadataConfiguration)).constructor(FileCacheLustreMetadataConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetadataConfiguration").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
PER_UNIT_STORAGE_THROUGHPUT_FIELD, DEPLOYMENT_TYPE_FIELD, WEEKLY_MAINTENANCE_START_TIME_FIELD,
METADATA_CONFIGURATION_FIELD));
private static final long serialVersionUID = 1L;
private final Integer perUnitStorageThroughput;
private final String deploymentType;
private final String weeklyMaintenanceStartTime;
private final FileCacheLustreMetadataConfiguration metadataConfiguration;
private CreateFileCacheLustreConfiguration(BuilderImpl builder) {
this.perUnitStorageThroughput = builder.perUnitStorageThroughput;
this.deploymentType = builder.deploymentType;
this.weeklyMaintenanceStartTime = builder.weeklyMaintenanceStartTime;
this.metadataConfiguration = builder.metadataConfiguration;
}
/**
*
* Provisions the amount of read and write throughput for each 1 tebibyte (TiB) of cache storage capacity, in
* MB/s/TiB. The only supported value is 1000
.
*
*
* @return Provisions the amount of read and write throughput for each 1 tebibyte (TiB) of cache storage capacity,
* in MB/s/TiB. The only supported value is 1000
.
*/
public final Integer perUnitStorageThroughput() {
return perUnitStorageThroughput;
}
/**
*
* Specifies the cache deployment type, which must be CACHE_1
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentType}
* will return {@link FileCacheLustreDeploymentType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service
* is available from {@link #deploymentTypeAsString}.
*
*
* @return Specifies the cache deployment type, which must be CACHE_1
.
* @see FileCacheLustreDeploymentType
*/
public final FileCacheLustreDeploymentType deploymentType() {
return FileCacheLustreDeploymentType.fromValue(deploymentType);
}
/**
*
* Specifies the cache deployment type, which must be CACHE_1
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #deploymentType}
* will return {@link FileCacheLustreDeploymentType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service
* is available from {@link #deploymentTypeAsString}.
*
*
* @return Specifies the cache deployment type, which must be CACHE_1
.
* @see FileCacheLustreDeploymentType
*/
public final String deploymentTypeAsString() {
return deploymentType;
}
/**
* 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;
}
/**
*
* The configuration for a Lustre MDT (Metadata Target) storage volume.
*
*
* @return The configuration for a Lustre MDT (Metadata Target) storage volume.
*/
public final FileCacheLustreMetadataConfiguration metadataConfiguration() {
return metadataConfiguration;
}
@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(perUnitStorageThroughput());
hashCode = 31 * hashCode + Objects.hashCode(deploymentTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(weeklyMaintenanceStartTime());
hashCode = 31 * hashCode + Objects.hashCode(metadataConfiguration());
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 CreateFileCacheLustreConfiguration)) {
return false;
}
CreateFileCacheLustreConfiguration other = (CreateFileCacheLustreConfiguration) obj;
return Objects.equals(perUnitStorageThroughput(), other.perUnitStorageThroughput())
&& Objects.equals(deploymentTypeAsString(), other.deploymentTypeAsString())
&& Objects.equals(weeklyMaintenanceStartTime(), other.weeklyMaintenanceStartTime())
&& Objects.equals(metadataConfiguration(), other.metadataConfiguration());
}
/**
* 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("CreateFileCacheLustreConfiguration").add("PerUnitStorageThroughput", perUnitStorageThroughput())
.add("DeploymentType", deploymentTypeAsString()).add("WeeklyMaintenanceStartTime", weeklyMaintenanceStartTime())
.add("MetadataConfiguration", metadataConfiguration()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "PerUnitStorageThroughput":
return Optional.ofNullable(clazz.cast(perUnitStorageThroughput()));
case "DeploymentType":
return Optional.ofNullable(clazz.cast(deploymentTypeAsString()));
case "WeeklyMaintenanceStartTime":
return Optional.ofNullable(clazz.cast(weeklyMaintenanceStartTime()));
case "MetadataConfiguration":
return Optional.ofNullable(clazz.cast(metadataConfiguration()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function