All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.ecs.model.EFSVolumeConfiguration Maven / Gradle / Ivy

Go to download

The AWS Java SDK for the Amazon EC2 Container Service holds the client classes that are used for communicating with the Amazon EC2 Container Service

There is a newer version: 2.29.39
Show newest version
/*
 * 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.ecs.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;

/**
 * 

* This parameter is specified when you're using an Amazon Elastic File System file system for task storage. For more * information, see Amazon EFS * volumes in the Amazon Elastic Container Service Developer Guide. *

*/ @Generated("software.amazon.awssdk:codegen") public final class EFSVolumeConfiguration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField FILE_SYSTEM_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("fileSystemId").getter(getter(EFSVolumeConfiguration::fileSystemId)) .setter(setter(Builder::fileSystemId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fileSystemId").build()).build(); private static final SdkField ROOT_DIRECTORY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("rootDirectory").getter(getter(EFSVolumeConfiguration::rootDirectory)) .setter(setter(Builder::rootDirectory)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("rootDirectory").build()).build(); private static final SdkField TRANSIT_ENCRYPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("transitEncryption").getter(getter(EFSVolumeConfiguration::transitEncryptionAsString)) .setter(setter(Builder::transitEncryption)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("transitEncryption").build()).build(); private static final SdkField TRANSIT_ENCRYPTION_PORT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("transitEncryptionPort").getter(getter(EFSVolumeConfiguration::transitEncryptionPort)) .setter(setter(Builder::transitEncryptionPort)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("transitEncryptionPort").build()) .build(); private static final SdkField AUTHORIZATION_CONFIG_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("authorizationConfig") .getter(getter(EFSVolumeConfiguration::authorizationConfig)).setter(setter(Builder::authorizationConfig)) .constructor(EFSAuthorizationConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("authorizationConfig").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FILE_SYSTEM_ID_FIELD, ROOT_DIRECTORY_FIELD, TRANSIT_ENCRYPTION_FIELD, TRANSIT_ENCRYPTION_PORT_FIELD, AUTHORIZATION_CONFIG_FIELD)); private static final long serialVersionUID = 1L; private final String fileSystemId; private final String rootDirectory; private final String transitEncryption; private final Integer transitEncryptionPort; private final EFSAuthorizationConfig authorizationConfig; private EFSVolumeConfiguration(BuilderImpl builder) { this.fileSystemId = builder.fileSystemId; this.rootDirectory = builder.rootDirectory; this.transitEncryption = builder.transitEncryption; this.transitEncryptionPort = builder.transitEncryptionPort; this.authorizationConfig = builder.authorizationConfig; } /** *

* The Amazon EFS file system ID to use. *

* * @return The Amazon EFS file system ID to use. */ public final String fileSystemId() { return fileSystemId; } /** *

* The directory within the Amazon EFS file system to mount as the root directory inside the host. If this parameter * is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the same effect * as omitting this parameter. *

* *

* If an EFS access point is specified in the authorizationConfig, the root directory parameter must * either be omitted or set to / which will enforce the path set on the EFS access point. *

*
* * @return The directory within the Amazon EFS file system to mount as the root directory inside the host. If this * parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have * the same effect as omitting this parameter.

*

* If an EFS access point is specified in the authorizationConfig, the root directory parameter * must either be omitted or set to / which will enforce the path set on the EFS access point. *

*/ public final String rootDirectory() { return rootDirectory; } /** *

* Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon * EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. If this parameter is * omitted, the default value of DISABLED is used. For more information, see Encrypting data in transit in the * Amazon Elastic File System User Guide. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #transitEncryption} * will return {@link EFSTransitEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #transitEncryptionAsString}. *

* * @return Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and the * Amazon EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. If this * parameter is omitted, the default value of DISABLED is used. For more information, see Encrypting data in * transit in the Amazon Elastic File System User Guide. * @see EFSTransitEncryption */ public final EFSTransitEncryption transitEncryption() { return EFSTransitEncryption.fromValue(transitEncryption); } /** *

* Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and the Amazon * EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. If this parameter is * omitted, the default value of DISABLED is used. For more information, see Encrypting data in transit in the * Amazon Elastic File System User Guide. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #transitEncryption} * will return {@link EFSTransitEncryption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #transitEncryptionAsString}. *

* * @return Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and the * Amazon EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. If this * parameter is omitted, the default value of DISABLED is used. For more information, see Encrypting data in * transit in the Amazon Elastic File System User Guide. * @see EFSTransitEncryption */ public final String transitEncryptionAsString() { return transitEncryption; } /** *

* The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. If you do not * specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount helper uses. * For more information, see EFS mount * helper in the Amazon Elastic File System User Guide. *

* * @return The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. If you * do not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS * mount helper uses. For more information, see EFS mount helper in the * Amazon Elastic File System User Guide. */ public final Integer transitEncryptionPort() { return transitEncryptionPort; } /** *

* The authorization configuration details for the Amazon EFS file system. *

* * @return The authorization configuration details for the Amazon EFS file system. */ public final EFSAuthorizationConfig authorizationConfig() { return authorizationConfig; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(fileSystemId()); hashCode = 31 * hashCode + Objects.hashCode(rootDirectory()); hashCode = 31 * hashCode + Objects.hashCode(transitEncryptionAsString()); hashCode = 31 * hashCode + Objects.hashCode(transitEncryptionPort()); hashCode = 31 * hashCode + Objects.hashCode(authorizationConfig()); 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 EFSVolumeConfiguration)) { return false; } EFSVolumeConfiguration other = (EFSVolumeConfiguration) obj; return Objects.equals(fileSystemId(), other.fileSystemId()) && Objects.equals(rootDirectory(), other.rootDirectory()) && Objects.equals(transitEncryptionAsString(), other.transitEncryptionAsString()) && Objects.equals(transitEncryptionPort(), other.transitEncryptionPort()) && Objects.equals(authorizationConfig(), other.authorizationConfig()); } /** * 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("EFSVolumeConfiguration").add("FileSystemId", fileSystemId()) .add("RootDirectory", rootDirectory()).add("TransitEncryption", transitEncryptionAsString()) .add("TransitEncryptionPort", transitEncryptionPort()).add("AuthorizationConfig", authorizationConfig()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "fileSystemId": return Optional.ofNullable(clazz.cast(fileSystemId())); case "rootDirectory": return Optional.ofNullable(clazz.cast(rootDirectory())); case "transitEncryption": return Optional.ofNullable(clazz.cast(transitEncryptionAsString())); case "transitEncryptionPort": return Optional.ofNullable(clazz.cast(transitEncryptionPort())); case "authorizationConfig": return Optional.ofNullable(clazz.cast(authorizationConfig())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((EFSVolumeConfiguration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon EFS file system ID to use. *

* * @param fileSystemId * The Amazon EFS file system ID to use. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fileSystemId(String fileSystemId); /** *

* The directory within the Amazon EFS file system to mount as the root directory inside the host. If this * parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / will have the * same effect as omitting this parameter. *

* *

* If an EFS access point is specified in the authorizationConfig, the root directory parameter * must either be omitted or set to / which will enforce the path set on the EFS access point. *

*
* * @param rootDirectory * The directory within the Amazon EFS file system to mount as the root directory inside the host. If * this parameter is omitted, the root of the Amazon EFS volume will be used. Specifying / * will have the same effect as omitting this parameter.

*

* If an EFS access point is specified in the authorizationConfig, the root directory * parameter must either be omitted or set to / which will enforce the path set on the EFS * access point. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder rootDirectory(String rootDirectory); /** *

* Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and the * Amazon EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. If this * parameter is omitted, the default value of DISABLED is used. For more information, see Encrypting data in transit in * the Amazon Elastic File System User Guide. *

* * @param transitEncryption * Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and * the Amazon EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. * If this parameter is omitted, the default value of DISABLED is used. For more * information, see Encrypting data in * transit in the Amazon Elastic File System User Guide. * @see EFSTransitEncryption * @return Returns a reference to this object so that method calls can be chained together. * @see EFSTransitEncryption */ Builder transitEncryption(String transitEncryption); /** *

* Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and the * Amazon EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. If this * parameter is omitted, the default value of DISABLED is used. For more information, see Encrypting data in transit in * the Amazon Elastic File System User Guide. *

* * @param transitEncryption * Determines whether to use encryption for Amazon EFS data in transit between the Amazon ECS host and * the Amazon EFS server. Transit encryption must be turned on if Amazon EFS IAM authorization is used. * If this parameter is omitted, the default value of DISABLED is used. For more * information, see Encrypting data in * transit in the Amazon Elastic File System User Guide. * @see EFSTransitEncryption * @return Returns a reference to this object so that method calls can be chained together. * @see EFSTransitEncryption */ Builder transitEncryption(EFSTransitEncryption transitEncryption); /** *

* The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. If you do * not specify a transit encryption port, it will use the port selection strategy that the Amazon EFS mount * helper uses. For more information, see EFS mount helper in the Amazon * Elastic File System User Guide. *

* * @param transitEncryptionPort * The port to use when sending encrypted data between the Amazon ECS host and the Amazon EFS server. If * you do not specify a transit encryption port, it will use the port selection strategy that the Amazon * EFS mount helper uses. For more information, see EFS mount helper in the * Amazon Elastic File System User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder transitEncryptionPort(Integer transitEncryptionPort); /** *

* The authorization configuration details for the Amazon EFS file system. *

* * @param authorizationConfig * The authorization configuration details for the Amazon EFS file system. * @return Returns a reference to this object so that method calls can be chained together. */ Builder authorizationConfig(EFSAuthorizationConfig authorizationConfig); /** *

* The authorization configuration details for the Amazon EFS file system. *

* This is a convenience method that creates an instance of the {@link EFSAuthorizationConfig.Builder} avoiding * the need to create one manually via {@link EFSAuthorizationConfig#builder()}. * *

* When the {@link Consumer} completes, {@link EFSAuthorizationConfig.Builder#build()} is called immediately and * its result is passed to {@link #authorizationConfig(EFSAuthorizationConfig)}. * * @param authorizationConfig * a consumer that will call methods on {@link EFSAuthorizationConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #authorizationConfig(EFSAuthorizationConfig) */ default Builder authorizationConfig(Consumer authorizationConfig) { return authorizationConfig(EFSAuthorizationConfig.builder().applyMutation(authorizationConfig).build()); } } static final class BuilderImpl implements Builder { private String fileSystemId; private String rootDirectory; private String transitEncryption; private Integer transitEncryptionPort; private EFSAuthorizationConfig authorizationConfig; private BuilderImpl() { } private BuilderImpl(EFSVolumeConfiguration model) { fileSystemId(model.fileSystemId); rootDirectory(model.rootDirectory); transitEncryption(model.transitEncryption); transitEncryptionPort(model.transitEncryptionPort); authorizationConfig(model.authorizationConfig); } public final String getFileSystemId() { return fileSystemId; } public final void setFileSystemId(String fileSystemId) { this.fileSystemId = fileSystemId; } @Override public final Builder fileSystemId(String fileSystemId) { this.fileSystemId = fileSystemId; return this; } public final String getRootDirectory() { return rootDirectory; } public final void setRootDirectory(String rootDirectory) { this.rootDirectory = rootDirectory; } @Override public final Builder rootDirectory(String rootDirectory) { this.rootDirectory = rootDirectory; return this; } public final String getTransitEncryption() { return transitEncryption; } public final void setTransitEncryption(String transitEncryption) { this.transitEncryption = transitEncryption; } @Override public final Builder transitEncryption(String transitEncryption) { this.transitEncryption = transitEncryption; return this; } @Override public final Builder transitEncryption(EFSTransitEncryption transitEncryption) { this.transitEncryption(transitEncryption == null ? null : transitEncryption.toString()); return this; } public final Integer getTransitEncryptionPort() { return transitEncryptionPort; } public final void setTransitEncryptionPort(Integer transitEncryptionPort) { this.transitEncryptionPort = transitEncryptionPort; } @Override public final Builder transitEncryptionPort(Integer transitEncryptionPort) { this.transitEncryptionPort = transitEncryptionPort; return this; } public final EFSAuthorizationConfig.Builder getAuthorizationConfig() { return authorizationConfig != null ? authorizationConfig.toBuilder() : null; } public final void setAuthorizationConfig(EFSAuthorizationConfig.BuilderImpl authorizationConfig) { this.authorizationConfig = authorizationConfig != null ? authorizationConfig.build() : null; } @Override public final Builder authorizationConfig(EFSAuthorizationConfig authorizationConfig) { this.authorizationConfig = authorizationConfig; return this; } @Override public EFSVolumeConfiguration build() { return new EFSVolumeConfiguration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy