
software.amazon.awssdk.services.efs.model.UpdateFileSystemRequest 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.efs.model;
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.awscore.AwsRequestOverrideConfiguration;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateFileSystemRequest extends EfsRequest implements
ToCopyableBuilder {
private static final SdkField FILE_SYSTEM_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FileSystemId").getter(getter(UpdateFileSystemRequest::fileSystemId))
.setter(setter(Builder::fileSystemId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("FileSystemId").build()).build();
private static final SdkField THROUGHPUT_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ThroughputMode").getter(getter(UpdateFileSystemRequest::throughputModeAsString))
.setter(setter(Builder::throughputMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ThroughputMode").build()).build();
private static final SdkField PROVISIONED_THROUGHPUT_IN_MIBPS_FIELD = SdkField
. builder(MarshallingType.DOUBLE)
.memberName("ProvisionedThroughputInMibps")
.getter(getter(UpdateFileSystemRequest::provisionedThroughputInMibps))
.setter(setter(Builder::provisionedThroughputInMibps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProvisionedThroughputInMibps")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FILE_SYSTEM_ID_FIELD,
THROUGHPUT_MODE_FIELD, PROVISIONED_THROUGHPUT_IN_MIBPS_FIELD));
private final String fileSystemId;
private final String throughputMode;
private final Double provisionedThroughputInMibps;
private UpdateFileSystemRequest(BuilderImpl builder) {
super(builder);
this.fileSystemId = builder.fileSystemId;
this.throughputMode = builder.throughputMode;
this.provisionedThroughputInMibps = builder.provisionedThroughputInMibps;
}
/**
*
* The ID of the file system that you want to update.
*
*
* @return The ID of the file system that you want to update.
*/
public final String fileSystemId() {
return fileSystemId;
}
/**
*
* (Optional) Updates the file system's throughput mode. If you're not updating your throughput mode, you don't need
* to provide this value in your request. If you are changing the ThroughputMode
to
* provisioned
, you must also set a value for ProvisionedThroughputInMibps
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #throughputMode}
* will return {@link ThroughputMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #throughputModeAsString}.
*
*
* @return (Optional) Updates the file system's throughput mode. If you're not updating your throughput mode, you
* don't need to provide this value in your request. If you are changing the ThroughputMode
to
* provisioned
, you must also set a value for ProvisionedThroughputInMibps
.
* @see ThroughputMode
*/
public final ThroughputMode throughputMode() {
return ThroughputMode.fromValue(throughputMode);
}
/**
*
* (Optional) Updates the file system's throughput mode. If you're not updating your throughput mode, you don't need
* to provide this value in your request. If you are changing the ThroughputMode
to
* provisioned
, you must also set a value for ProvisionedThroughputInMibps
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #throughputMode}
* will return {@link ThroughputMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #throughputModeAsString}.
*
*
* @return (Optional) Updates the file system's throughput mode. If you're not updating your throughput mode, you
* don't need to provide this value in your request. If you are changing the ThroughputMode
to
* provisioned
, you must also set a value for ProvisionedThroughputInMibps
.
* @see ThroughputMode
*/
public final String throughputModeAsString() {
return throughputMode;
}
/**
*
* (Optional) Sets the amount of provisioned throughput, in MiB/s, for the file system. Valid values are 1-1024. If
* you are changing the throughput mode to provisioned, you must also provide the amount of provisioned throughput.
* Required if ThroughputMode
is changed to provisioned
on update.
*
*
* @return (Optional) Sets the amount of provisioned throughput, in MiB/s, for the file system. Valid values are
* 1-1024. If you are changing the throughput mode to provisioned, you must also provide the amount of
* provisioned throughput. Required if ThroughputMode
is changed to provisioned
on
* update.
*/
public final Double provisionedThroughputInMibps() {
return provisionedThroughputInMibps;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(fileSystemId());
hashCode = 31 * hashCode + Objects.hashCode(throughputModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(provisionedThroughputInMibps());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateFileSystemRequest)) {
return false;
}
UpdateFileSystemRequest other = (UpdateFileSystemRequest) obj;
return Objects.equals(fileSystemId(), other.fileSystemId())
&& Objects.equals(throughputModeAsString(), other.throughputModeAsString())
&& Objects.equals(provisionedThroughputInMibps(), other.provisionedThroughputInMibps());
}
/**
* 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("UpdateFileSystemRequest").add("FileSystemId", fileSystemId())
.add("ThroughputMode", throughputModeAsString())
.add("ProvisionedThroughputInMibps", provisionedThroughputInMibps()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FileSystemId":
return Optional.ofNullable(clazz.cast(fileSystemId()));
case "ThroughputMode":
return Optional.ofNullable(clazz.cast(throughputModeAsString()));
case "ProvisionedThroughputInMibps":
return Optional.ofNullable(clazz.cast(provisionedThroughputInMibps()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function