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

software.amazon.awssdk.services.transfer.model.UpdateAccessRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Transfer module holds the client classes that are used for communicating with Transfer.

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.transfer.model;

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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateAccessRequest extends TransferRequest implements
        ToCopyableBuilder {
    private static final SdkField HOME_DIRECTORY_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("HomeDirectory").getter(getter(UpdateAccessRequest::homeDirectory))
            .setter(setter(Builder::homeDirectory))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HomeDirectory").build()).build();

    private static final SdkField HOME_DIRECTORY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("HomeDirectoryType").getter(getter(UpdateAccessRequest::homeDirectoryTypeAsString))
            .setter(setter(Builder::homeDirectoryType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HomeDirectoryType").build()).build();

    private static final SdkField> HOME_DIRECTORY_MAPPINGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("HomeDirectoryMappings")
            .getter(getter(UpdateAccessRequest::homeDirectoryMappings))
            .setter(setter(Builder::homeDirectoryMappings))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HomeDirectoryMappings").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(HomeDirectoryMapEntry::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField POLICY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Policy")
            .getter(getter(UpdateAccessRequest::policy)).setter(setter(Builder::policy))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Policy").build()).build();

    private static final SdkField POSIX_PROFILE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("PosixProfile").getter(getter(UpdateAccessRequest::posixProfile)).setter(setter(Builder::posixProfile))
            .constructor(PosixProfile::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PosixProfile").build()).build();

    private static final SdkField ROLE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Role")
            .getter(getter(UpdateAccessRequest::role)).setter(setter(Builder::role))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Role").build()).build();

    private static final SdkField SERVER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ServerId").getter(getter(UpdateAccessRequest::serverId)).setter(setter(Builder::serverId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerId").build()).build();

    private static final SdkField EXTERNAL_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ExternalId").getter(getter(UpdateAccessRequest::externalId)).setter(setter(Builder::externalId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExternalId").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(HOME_DIRECTORY_FIELD,
            HOME_DIRECTORY_TYPE_FIELD, HOME_DIRECTORY_MAPPINGS_FIELD, POLICY_FIELD, POSIX_PROFILE_FIELD, ROLE_FIELD,
            SERVER_ID_FIELD, EXTERNAL_ID_FIELD));

    private final String homeDirectory;

    private final String homeDirectoryType;

    private final List homeDirectoryMappings;

    private final String policy;

    private final PosixProfile posixProfile;

    private final String role;

    private final String serverId;

    private final String externalId;

    private UpdateAccessRequest(BuilderImpl builder) {
        super(builder);
        this.homeDirectory = builder.homeDirectory;
        this.homeDirectoryType = builder.homeDirectoryType;
        this.homeDirectoryMappings = builder.homeDirectoryMappings;
        this.policy = builder.policy;
        this.posixProfile = builder.posixProfile;
        this.role = builder.role;
        this.serverId = builder.serverId;
        this.externalId = builder.externalId;
    }

    /**
     * 

* The landing directory (folder) for a user when they log in to the server using the client. *

*

* A HomeDirectory example is /bucket_name/home/mydirectory. *

* * @return The landing directory (folder) for a user when they log in to the server using the client.

*

* A HomeDirectory example is /bucket_name/home/mydirectory. */ public final String homeDirectory() { return homeDirectory; } /** *

* The type of landing directory (folder) you want your users' home directory to be when they log into the server. * If you set it to PATH, the user will see the absolute Amazon S3 bucket or EFS paths as is in their * file transfer protocol clients. If you set it LOGICAL, you will need to provide mappings in the * HomeDirectoryMappings for how you want to make Amazon S3 or EFS paths visible to your users. *

*

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

* * @return The type of landing directory (folder) you want your users' home directory to be when they log into the * server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or EFS paths * as is in their file transfer protocol clients. If you set it LOGICAL, you will need to * provide mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or EFS * paths visible to your users. * @see HomeDirectoryType */ public final HomeDirectoryType homeDirectoryType() { return HomeDirectoryType.fromValue(homeDirectoryType); } /** *

* The type of landing directory (folder) you want your users' home directory to be when they log into the server. * If you set it to PATH, the user will see the absolute Amazon S3 bucket or EFS paths as is in their * file transfer protocol clients. If you set it LOGICAL, you will need to provide mappings in the * HomeDirectoryMappings for how you want to make Amazon S3 or EFS paths visible to your users. *

*

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

* * @return The type of landing directory (folder) you want your users' home directory to be when they log into the * server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or EFS paths * as is in their file transfer protocol clients. If you set it LOGICAL, you will need to * provide mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or EFS * paths visible to your users. * @see HomeDirectoryType */ public final String homeDirectoryTypeAsString() { return homeDirectoryType; } /** * Returns true if the HomeDirectoryMappings property was specified by the sender (it may be empty), or false if the * sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS * service. */ public final boolean hasHomeDirectoryMappings() { return homeDirectoryMappings != null && !(homeDirectoryMappings instanceof SdkAutoConstructList); } /** *

* Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your * user and how you want to make them visible. You must specify the Entry and Target pair, * where Entry shows how the path is made visible and Target is the actual Amazon S3 or * Amazon EFS path. If you only specify a target, it will be displayed as is. You also must ensure that your AWS * Identity and Access Management (IAM) role provides access to paths in Target. This value can only be * set when HomeDirectoryType is set to LOGICAL. *

*

* The following is an Entry and Target pair example. *

*

* [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] *

*

* In most cases, you can use this value instead of the scope-down policy to lock down your user to the designated * home directory ("chroot"). To do this, you can set Entry to / and set * Target to the HomeDirectory parameter value. *

*

* The following is an Entry and Target pair example for chroot. *

*

* [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ] *

* *

* If the target of a logical directory entry does not exist in Amazon S3 or Amazon EFS, the entry will be ignored. * As a workaround, you can use the Amazon S3 API or EFS API to create 0-byte objects as place holders for your * directory. If using the AWS CLI, use the s3api or efsapi call instead of * s3 or efs so you can use the put-object operation. For example, you can * use the following. *

*

* aws s3api put-object --bucket bucketname --key path/to/folder/ *

*

* The end of the key name must end in a / for it to be considered a folder. *

*
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasHomeDirectoryMappings()} to see if a value was sent in this field. *

* * @return Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to * your user and how you want to make them visible. You must specify the Entry and * Target pair, where Entry shows how the path is made visible and * Target is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it will be * displayed as is. You also must ensure that your AWS Identity and Access Management (IAM) role provides * access to paths in Target. This value can only be set when HomeDirectoryType is * set to LOGICAL.

*

* The following is an Entry and Target pair example. *

*

* [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] *

*

* In most cases, you can use this value instead of the scope-down policy to lock down your user to the * designated home directory ("chroot"). To do this, you can set Entry to * / and set Target to the HomeDirectory parameter value. *

*

* The following is an Entry and Target pair example for chroot. *

*

* [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ] *

* *

* If the target of a logical directory entry does not exist in Amazon S3 or Amazon EFS, the entry will be * ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0-byte objects as place * holders for your directory. If using the AWS CLI, use the s3api or efsapi call * instead of s3 or efs so you can use the put-object operation. For * example, you can use the following. *

*

* aws s3api put-object --bucket bucketname --key path/to/folder/ *

*

* The end of the key name must end in a / for it to be considered a folder. *

*/ public final List homeDirectoryMappings() { return homeDirectoryMappings; } /** *

* A scope-down policy for your user so that you can use the same IAM role across multiple users. This policy scopes * down user access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include * ${Transfer:UserName}, ${Transfer:HomeDirectory}, and * ${Transfer:HomeBucket}. *

* *

* This only applies when domain of ServerId is S3. Amazon EFS does not use scope down policy. *

*

* For scope-down policies, AWS Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource * Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the Policy argument. *

*

* For an example of a scope-down policy, see Example scope-down * policy. *

*

* For more information, see AssumeRole in the AWS * Security Token Service API Reference. *

*
* * @return A scope-down policy for your user so that you can use the same IAM role across multiple users. This * policy scopes down user access to portions of their Amazon S3 bucket. Variables that you can use inside * this policy include ${Transfer:UserName}, ${Transfer:HomeDirectory}, and * ${Transfer:HomeBucket}.

*

* This only applies when domain of ServerId is S3. Amazon EFS does not use scope down policy. *

*

* For scope-down policies, AWS Transfer Family stores the policy as a JSON blob, instead of the Amazon * Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the * Policy argument. *

*

* For an example of a scope-down policy, see Example scope-down * policy. *

*

* For more information, see AssumeRole in the * AWS Security Token Service API Reference. *

*/ public final String policy() { return policy; } /** * Returns the value of the PosixProfile property for this object. * * @return The value of the PosixProfile property for this object. */ public final PosixProfile posixProfile() { return posixProfile; } /** *

* Specifies the Amazon Resource Name (ARN) of the IAM role that controls your users' access to your Amazon S3 * bucket or EFS file system. The policies attached to this role determine the level of access that you want to * provide your users when transferring files into and out of your Amazon S3 bucket or EFS file system. The IAM role * should also contain a trust relationship that allows the server to access your resources when servicing your * users' transfer requests. *

* * @return Specifies the Amazon Resource Name (ARN) of the IAM role that controls your users' access to your Amazon * S3 bucket or EFS file system. The policies attached to this role determine the level of access that you * want to provide your users when transferring files into and out of your Amazon S3 bucket or EFS file * system. The IAM role should also contain a trust relationship that allows the server to access your * resources when servicing your users' transfer requests. */ public final String role() { return role; } /** *

* A system-assigned unique identifier for a server instance. This is the specific server that you added your user * to. *

* * @return A system-assigned unique identifier for a server instance. This is the specific server that you added * your user to. */ public final String serverId() { return serverId; } /** *

* A unique identifier that is required to identify specific groups within your directory. The users of the group * that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled protocols using AWS * Transfer Family. If you know the group name, you can view the SID values by running the following command using * Windows PowerShell. *

*

* Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid *

*

* In that command, replace YourGroupName with the name of your Active Directory group. *

*

* The regex used to validate this parameter is a string of characters consisting of uppercase and lowercase * alphanumeric characters with no spaces. You can also include underscores or any of the following characters: * =,.@:/- *

* * @return A unique identifier that is required to identify specific groups within your directory. The users of the * group that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled protocols * using AWS Transfer Family. If you know the group name, you can view the SID values by running the * following command using Windows PowerShell.

*

* Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid *

*

* In that command, replace YourGroupName with the name of your Active Directory group. *

*

* The regex used to validate this parameter is a string of characters consisting of uppercase and lowercase * alphanumeric characters with no spaces. You can also include underscores or any of the following * characters: =,.@:/- */ public final String externalId() { return externalId; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(homeDirectory()); hashCode = 31 * hashCode + Objects.hashCode(homeDirectoryTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasHomeDirectoryMappings() ? homeDirectoryMappings() : null); hashCode = 31 * hashCode + Objects.hashCode(policy()); hashCode = 31 * hashCode + Objects.hashCode(posixProfile()); hashCode = 31 * hashCode + Objects.hashCode(role()); hashCode = 31 * hashCode + Objects.hashCode(serverId()); hashCode = 31 * hashCode + Objects.hashCode(externalId()); 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 UpdateAccessRequest)) { return false; } UpdateAccessRequest other = (UpdateAccessRequest) obj; return Objects.equals(homeDirectory(), other.homeDirectory()) && Objects.equals(homeDirectoryTypeAsString(), other.homeDirectoryTypeAsString()) && hasHomeDirectoryMappings() == other.hasHomeDirectoryMappings() && Objects.equals(homeDirectoryMappings(), other.homeDirectoryMappings()) && Objects.equals(policy(), other.policy()) && Objects.equals(posixProfile(), other.posixProfile()) && Objects.equals(role(), other.role()) && Objects.equals(serverId(), other.serverId()) && Objects.equals(externalId(), other.externalId()); } /** * 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("UpdateAccessRequest").add("HomeDirectory", homeDirectory()) .add("HomeDirectoryType", homeDirectoryTypeAsString()) .add("HomeDirectoryMappings", hasHomeDirectoryMappings() ? homeDirectoryMappings() : null) .add("Policy", policy()).add("PosixProfile", posixProfile()).add("Role", role()).add("ServerId", serverId()) .add("ExternalId", externalId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "HomeDirectory": return Optional.ofNullable(clazz.cast(homeDirectory())); case "HomeDirectoryType": return Optional.ofNullable(clazz.cast(homeDirectoryTypeAsString())); case "HomeDirectoryMappings": return Optional.ofNullable(clazz.cast(homeDirectoryMappings())); case "Policy": return Optional.ofNullable(clazz.cast(policy())); case "PosixProfile": return Optional.ofNullable(clazz.cast(posixProfile())); case "Role": return Optional.ofNullable(clazz.cast(role())); case "ServerId": return Optional.ofNullable(clazz.cast(serverId())); case "ExternalId": return Optional.ofNullable(clazz.cast(externalId())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateAccessRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends TransferRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The landing directory (folder) for a user when they log in to the server using the client. *

*

* A HomeDirectory example is /bucket_name/home/mydirectory. *

* * @param homeDirectory * The landing directory (folder) for a user when they log in to the server using the client.

*

* A HomeDirectory example is /bucket_name/home/mydirectory. * @return Returns a reference to this object so that method calls can be chained together. */ Builder homeDirectory(String homeDirectory); /** *

* The type of landing directory (folder) you want your users' home directory to be when they log into the * server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or EFS paths as * is in their file transfer protocol clients. If you set it LOGICAL, you will need to provide * mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or EFS paths visible to * your users. *

* * @param homeDirectoryType * The type of landing directory (folder) you want your users' home directory to be when they log into * the server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or EFS * paths as is in their file transfer protocol clients. If you set it LOGICAL, you will need * to provide mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or * EFS paths visible to your users. * @see HomeDirectoryType * @return Returns a reference to this object so that method calls can be chained together. * @see HomeDirectoryType */ Builder homeDirectoryType(String homeDirectoryType); /** *

* The type of landing directory (folder) you want your users' home directory to be when they log into the * server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or EFS paths as * is in their file transfer protocol clients. If you set it LOGICAL, you will need to provide * mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or EFS paths visible to * your users. *

* * @param homeDirectoryType * The type of landing directory (folder) you want your users' home directory to be when they log into * the server. If you set it to PATH, the user will see the absolute Amazon S3 bucket or EFS * paths as is in their file transfer protocol clients. If you set it LOGICAL, you will need * to provide mappings in the HomeDirectoryMappings for how you want to make Amazon S3 or * EFS paths visible to your users. * @see HomeDirectoryType * @return Returns a reference to this object so that method calls can be chained together. * @see HomeDirectoryType */ Builder homeDirectoryType(HomeDirectoryType homeDirectoryType); /** *

* Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your * user and how you want to make them visible. You must specify the Entry and Target * pair, where Entry shows how the path is made visible and Target is the actual * Amazon S3 or Amazon EFS path. If you only specify a target, it will be displayed as is. You also must ensure * that your AWS Identity and Access Management (IAM) role provides access to paths in Target. This * value can only be set when HomeDirectoryType is set to LOGICAL. *

*

* The following is an Entry and Target pair example. *

*

* [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] *

*

* In most cases, you can use this value instead of the scope-down policy to lock down your user to the * designated home directory ("chroot"). To do this, you can set Entry to * / and set Target to the HomeDirectory parameter value. *

*

* The following is an Entry and Target pair example for chroot. *

*

* [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ] *

* *

* If the target of a logical directory entry does not exist in Amazon S3 or Amazon EFS, the entry will be * ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0-byte objects as place holders * for your directory. If using the AWS CLI, use the s3api or efsapi call instead of * s3 or efs so you can use the put-object operation. For example, you * can use the following. *

*

* aws s3api put-object --bucket bucketname --key path/to/folder/ *

*

* The end of the key name must end in a / for it to be considered a folder. *

*
* * @param homeDirectoryMappings * Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible * to your user and how you want to make them visible. You must specify the Entry and * Target pair, where Entry shows how the path is made visible and * Target is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it will * be displayed as is. You also must ensure that your AWS Identity and Access Management (IAM) role * provides access to paths in Target. This value can only be set when * HomeDirectoryType is set to LOGICAL.

*

* The following is an Entry and Target pair example. *

*

* [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] *

*

* In most cases, you can use this value instead of the scope-down policy to lock down your user to the * designated home directory ("chroot"). To do this, you can set Entry to * / and set Target to the HomeDirectory parameter value. *

*

* The following is an Entry and Target pair example for chroot. *

*

* [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ] *

* *

* If the target of a logical directory entry does not exist in Amazon S3 or Amazon EFS, the entry will * be ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0-byte objects as * place holders for your directory. If using the AWS CLI, use the s3api or * efsapi call instead of s3 or efs so you can use the * put-object operation. For example, you can use the following. *

*

* aws s3api put-object --bucket bucketname --key path/to/folder/ *

*

* The end of the key name must end in a / for it to be considered a folder. *

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

* Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your * user and how you want to make them visible. You must specify the Entry and Target * pair, where Entry shows how the path is made visible and Target is the actual * Amazon S3 or Amazon EFS path. If you only specify a target, it will be displayed as is. You also must ensure * that your AWS Identity and Access Management (IAM) role provides access to paths in Target. This * value can only be set when HomeDirectoryType is set to LOGICAL. *

*

* The following is an Entry and Target pair example. *

*

* [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] *

*

* In most cases, you can use this value instead of the scope-down policy to lock down your user to the * designated home directory ("chroot"). To do this, you can set Entry to * / and set Target to the HomeDirectory parameter value. *

*

* The following is an Entry and Target pair example for chroot. *

*

* [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ] *

* *

* If the target of a logical directory entry does not exist in Amazon S3 or Amazon EFS, the entry will be * ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0-byte objects as place holders * for your directory. If using the AWS CLI, use the s3api or efsapi call instead of * s3 or efs so you can use the put-object operation. For example, you * can use the following. *

*

* aws s3api put-object --bucket bucketname --key path/to/folder/ *

*

* The end of the key name must end in a / for it to be considered a folder. *

*
* * @param homeDirectoryMappings * Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible * to your user and how you want to make them visible. You must specify the Entry and * Target pair, where Entry shows how the path is made visible and * Target is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it will * be displayed as is. You also must ensure that your AWS Identity and Access Management (IAM) role * provides access to paths in Target. This value can only be set when * HomeDirectoryType is set to LOGICAL.

*

* The following is an Entry and Target pair example. *

*

* [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] *

*

* In most cases, you can use this value instead of the scope-down policy to lock down your user to the * designated home directory ("chroot"). To do this, you can set Entry to * / and set Target to the HomeDirectory parameter value. *

*

* The following is an Entry and Target pair example for chroot. *

*

* [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ] *

* *

* If the target of a logical directory entry does not exist in Amazon S3 or Amazon EFS, the entry will * be ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0-byte objects as * place holders for your directory. If using the AWS CLI, use the s3api or * efsapi call instead of s3 or efs so you can use the * put-object operation. For example, you can use the following. *

*

* aws s3api put-object --bucket bucketname --key path/to/folder/ *

*

* The end of the key name must end in a / for it to be considered a folder. *

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

* Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your * user and how you want to make them visible. You must specify the Entry and Target * pair, where Entry shows how the path is made visible and Target is the actual * Amazon S3 or Amazon EFS path. If you only specify a target, it will be displayed as is. You also must ensure * that your AWS Identity and Access Management (IAM) role provides access to paths in Target. This * value can only be set when HomeDirectoryType is set to LOGICAL. *

*

* The following is an Entry and Target pair example. *

*

* [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ] *

*

* In most cases, you can use this value instead of the scope-down policy to lock down your user to the * designated home directory ("chroot"). To do this, you can set Entry to * / and set Target to the HomeDirectory parameter value. *

*

* The following is an Entry and Target pair example for chroot. *

*

* [ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ] *

* *

* If the target of a logical directory entry does not exist in Amazon S3 or Amazon EFS, the entry will be * ignored. As a workaround, you can use the Amazon S3 API or EFS API to create 0-byte objects as place holders * for your directory. If using the AWS CLI, use the s3api or efsapi call instead of * s3 or efs so you can use the put-object operation. For example, you * can use the following. *

*

* aws s3api put-object --bucket bucketname --key path/to/folder/ *

*

* The end of the key name must end in a / for it to be considered a folder. *

*
This is a convenience that creates an instance of the {@link List.Builder} * avoiding the need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called * immediately and its result is passed to {@link #homeDirectoryMappings(List)}. * * @param homeDirectoryMappings * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #homeDirectoryMappings(List) */ Builder homeDirectoryMappings(Consumer... homeDirectoryMappings); /** *

* A scope-down policy for your user so that you can use the same IAM role across multiple users. This policy * scopes down user access to portions of their Amazon S3 bucket. Variables that you can use inside this policy * include ${Transfer:UserName}, ${Transfer:HomeDirectory}, and * ${Transfer:HomeBucket}. *

* *

* This only applies when domain of ServerId is S3. Amazon EFS does not use scope down policy. *

*

* For scope-down policies, AWS Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource * Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the Policy argument. *

*

* For an example of a scope-down policy, see Example scope-down * policy. *

*

* For more information, see AssumeRole in the AWS * Security Token Service API Reference. *

*
* * @param policy * A scope-down policy for your user so that you can use the same IAM role across multiple users. This * policy scopes down user access to portions of their Amazon S3 bucket. Variables that you can use * inside this policy include ${Transfer:UserName}, ${Transfer:HomeDirectory}, * and ${Transfer:HomeBucket}.

*

* This only applies when domain of ServerId is S3. Amazon EFS does not use scope down * policy. *

*

* For scope-down policies, AWS Transfer Family stores the policy as a JSON blob, instead of the Amazon * Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the * Policy argument. *

*

* For an example of a scope-down policy, see Example scope-down * policy. *

*

* For more information, see AssumeRole in the * AWS Security Token Service API Reference. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder policy(String policy); /** * Sets the value of the PosixProfile property for this object. * * @param posixProfile * The new value for the PosixProfile property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder posixProfile(PosixProfile posixProfile); /** * Sets the value of the PosixProfile property for this object. * * This is a convenience that creates an instance of the {@link PosixProfile.Builder} avoiding the need to * create one manually via {@link PosixProfile#builder()}. * * When the {@link Consumer} completes, {@link PosixProfile.Builder#build()} is called immediately and its * result is passed to {@link #posixProfile(PosixProfile)}. * * @param posixProfile * a consumer that will call methods on {@link PosixProfile.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #posixProfile(PosixProfile) */ default Builder posixProfile(Consumer posixProfile) { return posixProfile(PosixProfile.builder().applyMutation(posixProfile).build()); } /** *

* Specifies the Amazon Resource Name (ARN) of the IAM role that controls your users' access to your Amazon S3 * bucket or EFS file system. The policies attached to this role determine the level of access that you want to * provide your users when transferring files into and out of your Amazon S3 bucket or EFS file system. The IAM * role should also contain a trust relationship that allows the server to access your resources when servicing * your users' transfer requests. *

* * @param role * Specifies the Amazon Resource Name (ARN) of the IAM role that controls your users' access to your * Amazon S3 bucket or EFS file system. The policies attached to this role determine the level of access * that you want to provide your users when transferring files into and out of your Amazon S3 bucket or * EFS file system. The IAM role should also contain a trust relationship that allows the server to * access your resources when servicing your users' transfer requests. * @return Returns a reference to this object so that method calls can be chained together. */ Builder role(String role); /** *

* A system-assigned unique identifier for a server instance. This is the specific server that you added your * user to. *

* * @param serverId * A system-assigned unique identifier for a server instance. This is the specific server that you added * your user to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverId(String serverId); /** *

* A unique identifier that is required to identify specific groups within your directory. The users of the * group that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled protocols * using AWS Transfer Family. If you know the group name, you can view the SID values by running the following * command using Windows PowerShell. *

*

* Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid *

*

* In that command, replace YourGroupName with the name of your Active Directory group. *

*

* The regex used to validate this parameter is a string of characters consisting of uppercase and lowercase * alphanumeric characters with no spaces. You can also include underscores or any of the following characters: * =,.@:/- *

* * @param externalId * A unique identifier that is required to identify specific groups within your directory. The users of * the group that you associate have access to your Amazon S3 or Amazon EFS resources over the enabled * protocols using AWS Transfer Family. If you know the group name, you can view the SID values by * running the following command using Windows PowerShell.

*

* Get-ADGroup -Filter {samAccountName -like "YourGroupName*"} -Properties * | Select SamAccountName,ObjectSid *

*

* In that command, replace YourGroupName with the name of your Active Directory group. *

*

* The regex used to validate this parameter is a string of characters consisting of uppercase and * lowercase alphanumeric characters with no spaces. You can also include underscores or any of the * following characters: =,.@:/- * @return Returns a reference to this object so that method calls can be chained together. */ Builder externalId(String externalId); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends TransferRequest.BuilderImpl implements Builder { private String homeDirectory; private String homeDirectoryType; private List homeDirectoryMappings = DefaultSdkAutoConstructList.getInstance(); private String policy; private PosixProfile posixProfile; private String role; private String serverId; private String externalId; private BuilderImpl() { } private BuilderImpl(UpdateAccessRequest model) { super(model); homeDirectory(model.homeDirectory); homeDirectoryType(model.homeDirectoryType); homeDirectoryMappings(model.homeDirectoryMappings); policy(model.policy); posixProfile(model.posixProfile); role(model.role); serverId(model.serverId); externalId(model.externalId); } public final String getHomeDirectory() { return homeDirectory; } @Override public final Builder homeDirectory(String homeDirectory) { this.homeDirectory = homeDirectory; return this; } public final void setHomeDirectory(String homeDirectory) { this.homeDirectory = homeDirectory; } public final String getHomeDirectoryType() { return homeDirectoryType; } @Override public final Builder homeDirectoryType(String homeDirectoryType) { this.homeDirectoryType = homeDirectoryType; return this; } @Override public final Builder homeDirectoryType(HomeDirectoryType homeDirectoryType) { this.homeDirectoryType(homeDirectoryType == null ? null : homeDirectoryType.toString()); return this; } public final void setHomeDirectoryType(String homeDirectoryType) { this.homeDirectoryType = homeDirectoryType; } public final List getHomeDirectoryMappings() { List result = HomeDirectoryMappingsCopier.copyToBuilder(this.homeDirectoryMappings); if (result instanceof SdkAutoConstructList) { return null; } return result; } @Override public final Builder homeDirectoryMappings(Collection homeDirectoryMappings) { this.homeDirectoryMappings = HomeDirectoryMappingsCopier.copy(homeDirectoryMappings); return this; } @Override @SafeVarargs public final Builder homeDirectoryMappings(HomeDirectoryMapEntry... homeDirectoryMappings) { homeDirectoryMappings(Arrays.asList(homeDirectoryMappings)); return this; } @Override @SafeVarargs public final Builder homeDirectoryMappings(Consumer... homeDirectoryMappings) { homeDirectoryMappings(Stream.of(homeDirectoryMappings) .map(c -> HomeDirectoryMapEntry.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setHomeDirectoryMappings(Collection homeDirectoryMappings) { this.homeDirectoryMappings = HomeDirectoryMappingsCopier.copyFromBuilder(homeDirectoryMappings); } public final String getPolicy() { return policy; } @Override public final Builder policy(String policy) { this.policy = policy; return this; } public final void setPolicy(String policy) { this.policy = policy; } public final PosixProfile.Builder getPosixProfile() { return posixProfile != null ? posixProfile.toBuilder() : null; } @Override public final Builder posixProfile(PosixProfile posixProfile) { this.posixProfile = posixProfile; return this; } public final void setPosixProfile(PosixProfile.BuilderImpl posixProfile) { this.posixProfile = posixProfile != null ? posixProfile.build() : null; } public final String getRole() { return role; } @Override public final Builder role(String role) { this.role = role; return this; } public final void setRole(String role) { this.role = role; } public final String getServerId() { return serverId; } @Override public final Builder serverId(String serverId) { this.serverId = serverId; return this; } public final void setServerId(String serverId) { this.serverId = serverId; } public final String getExternalId() { return externalId; } @Override public final Builder externalId(String externalId) { this.externalId = externalId; return this; } public final void setExternalId(String externalId) { this.externalId = externalId; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateAccessRequest build() { return new UpdateAccessRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy