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

software.amazon.awssdk.services.emr.model.CreateStudioRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EMR module holds the client classes that are used for communicating with Amazon Elastic MapReduce Service

There is a newer version: 2.28.3
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.emr.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 CreateStudioRequest extends EmrRequest implements
        ToCopyableBuilder {
    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
            .getter(getter(CreateStudioRequest::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(CreateStudioRequest::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

    private static final SdkField AUTH_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("AuthMode").getter(getter(CreateStudioRequest::authModeAsString)).setter(setter(Builder::authMode))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AuthMode").build()).build();

    private static final SdkField VPC_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("VpcId")
            .getter(getter(CreateStudioRequest::vpcId)).setter(setter(Builder::vpcId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcId").build()).build();

    private static final SdkField> SUBNET_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("SubnetIds")
            .getter(getter(CreateStudioRequest::subnetIds))
            .setter(setter(Builder::subnetIds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetIds").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 SERVICE_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ServiceRole").getter(getter(CreateStudioRequest::serviceRole)).setter(setter(Builder::serviceRole))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceRole").build()).build();

    private static final SdkField USER_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("UserRole").getter(getter(CreateStudioRequest::userRole)).setter(setter(Builder::userRole))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserRole").build()).build();

    private static final SdkField WORKSPACE_SECURITY_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("WorkspaceSecurityGroupId").getter(getter(CreateStudioRequest::workspaceSecurityGroupId))
            .setter(setter(Builder::workspaceSecurityGroupId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WorkspaceSecurityGroupId").build())
            .build();

    private static final SdkField ENGINE_SECURITY_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EngineSecurityGroupId").getter(getter(CreateStudioRequest::engineSecurityGroupId))
            .setter(setter(Builder::engineSecurityGroupId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineSecurityGroupId").build())
            .build();

    private static final SdkField DEFAULT_S3_LOCATION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DefaultS3Location").getter(getter(CreateStudioRequest::defaultS3Location))
            .setter(setter(Builder::defaultS3Location))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultS3Location").build()).build();

    private static final SdkField IDP_AUTH_URL_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("IdpAuthUrl").getter(getter(CreateStudioRequest::idpAuthUrl)).setter(setter(Builder::idpAuthUrl))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdpAuthUrl").build()).build();

    private static final SdkField IDP_RELAY_STATE_PARAMETER_NAME_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("IdpRelayStateParameterName")
            .getter(getter(CreateStudioRequest::idpRelayStateParameterName))
            .setter(setter(Builder::idpRelayStateParameterName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdpRelayStateParameterName").build())
            .build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Tags")
            .getter(getter(CreateStudioRequest::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Tag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField TRUSTED_IDENTITY_PROPAGATION_ENABLED_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("TrustedIdentityPropagationEnabled")
            .getter(getter(CreateStudioRequest::trustedIdentityPropagationEnabled))
            .setter(setter(Builder::trustedIdentityPropagationEnabled))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrustedIdentityPropagationEnabled")
                    .build()).build();

    private static final SdkField IDC_USER_ASSIGNMENT_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("IdcUserAssignment").getter(getter(CreateStudioRequest::idcUserAssignmentAsString))
            .setter(setter(Builder::idcUserAssignment))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdcUserAssignment").build()).build();

    private static final SdkField IDC_INSTANCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("IdcInstanceArn").getter(getter(CreateStudioRequest::idcInstanceArn))
            .setter(setter(Builder::idcInstanceArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdcInstanceArn").build()).build();

    private static final SdkField ENCRYPTION_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EncryptionKeyArn").getter(getter(CreateStudioRequest::encryptionKeyArn))
            .setter(setter(Builder::encryptionKeyArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EncryptionKeyArn").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, DESCRIPTION_FIELD,
            AUTH_MODE_FIELD, VPC_ID_FIELD, SUBNET_IDS_FIELD, SERVICE_ROLE_FIELD, USER_ROLE_FIELD,
            WORKSPACE_SECURITY_GROUP_ID_FIELD, ENGINE_SECURITY_GROUP_ID_FIELD, DEFAULT_S3_LOCATION_FIELD, IDP_AUTH_URL_FIELD,
            IDP_RELAY_STATE_PARAMETER_NAME_FIELD, TAGS_FIELD, TRUSTED_IDENTITY_PROPAGATION_ENABLED_FIELD,
            IDC_USER_ASSIGNMENT_FIELD, IDC_INSTANCE_ARN_FIELD, ENCRYPTION_KEY_ARN_FIELD));

    private final String name;

    private final String description;

    private final String authMode;

    private final String vpcId;

    private final List subnetIds;

    private final String serviceRole;

    private final String userRole;

    private final String workspaceSecurityGroupId;

    private final String engineSecurityGroupId;

    private final String defaultS3Location;

    private final String idpAuthUrl;

    private final String idpRelayStateParameterName;

    private final List tags;

    private final Boolean trustedIdentityPropagationEnabled;

    private final String idcUserAssignment;

    private final String idcInstanceArn;

    private final String encryptionKeyArn;

    private CreateStudioRequest(BuilderImpl builder) {
        super(builder);
        this.name = builder.name;
        this.description = builder.description;
        this.authMode = builder.authMode;
        this.vpcId = builder.vpcId;
        this.subnetIds = builder.subnetIds;
        this.serviceRole = builder.serviceRole;
        this.userRole = builder.userRole;
        this.workspaceSecurityGroupId = builder.workspaceSecurityGroupId;
        this.engineSecurityGroupId = builder.engineSecurityGroupId;
        this.defaultS3Location = builder.defaultS3Location;
        this.idpAuthUrl = builder.idpAuthUrl;
        this.idpRelayStateParameterName = builder.idpRelayStateParameterName;
        this.tags = builder.tags;
        this.trustedIdentityPropagationEnabled = builder.trustedIdentityPropagationEnabled;
        this.idcUserAssignment = builder.idcUserAssignment;
        this.idcInstanceArn = builder.idcInstanceArn;
        this.encryptionKeyArn = builder.encryptionKeyArn;
    }

    /**
     * 

* A descriptive name for the Amazon EMR Studio. *

* * @return A descriptive name for the Amazon EMR Studio. */ public final String name() { return name; } /** *

* A detailed description of the Amazon EMR Studio. *

* * @return A detailed description of the Amazon EMR Studio. */ public final String description() { return description; } /** *

* Specifies whether the Studio authenticates users using IAM or IAM Identity Center. *

*

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

* * @return Specifies whether the Studio authenticates users using IAM or IAM Identity Center. * @see AuthMode */ public final AuthMode authMode() { return AuthMode.fromValue(authMode); } /** *

* Specifies whether the Studio authenticates users using IAM or IAM Identity Center. *

*

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

* * @return Specifies whether the Studio authenticates users using IAM or IAM Identity Center. * @see AuthMode */ public final String authModeAsString() { return authMode; } /** *

* The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio. *

* * @return The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio. */ public final String vpcId() { return vpcId; } /** * For responses, this returns true if the service returned a value for the SubnetIds 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 hasSubnetIds() { return subnetIds != null && !(subnetIds instanceof SdkAutoConstructList); } /** *

* A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The * subnets must belong to the VPC specified by VpcId. Studio users can create a Workspace in any of the * specified subnets. *

*

* 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 #hasSubnetIds} method. *

* * @return A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. * The subnets must belong to the VPC specified by VpcId. Studio users can create a Workspace * in any of the specified subnets. */ public final List subnetIds() { return subnetIds; } /** *

* The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to * interoperate with other Amazon Web Services services. *

* * @return The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to * interoperate with other Amazon Web Services services. */ public final String serviceRole() { return serviceRole; } /** *

* The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a * UserRole when you use IAM Identity Center authentication. The permissions attached to the * UserRole can be scoped down for each user or group using session policies. *

* * @return The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a * UserRole when you use IAM Identity Center authentication. The permissions attached to the * UserRole can be scoped down for each user or group using session policies. */ public final String userRole() { return userRole; } /** *

* The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network * traffic to resources in the Engine security group, and it must be in the same VPC specified by VpcId * . *

* * @return The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound * network traffic to resources in the Engine security group, and it must be in the same VPC specified by * VpcId. */ public final String workspaceSecurityGroupId() { return workspaceSecurityGroupId; } /** *

* The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic * from the Workspace security group, and it must be in the same VPC specified by VpcId. *

* * @return The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network * traffic from the Workspace security group, and it must be in the same VPC specified by VpcId * . */ public final String engineSecurityGroupId() { return engineSecurityGroupId; } /** *

* The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files. *

* * @return The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files. */ public final String defaultS3Location() { return defaultS3Location; } /** *

* The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM authentication * and want to let federated users log in to a Studio with the Studio URL and credentials from your IdP. Amazon EMR * Studio redirects users to this endpoint to enter credentials. *

* * @return The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM * authentication and want to let federated users log in to a Studio with the Studio URL and credentials * from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials. */ public final String idpAuthUrl() { return idpAuthUrl; } /** *

* The name that your identity provider (IdP) uses for its RelayState parameter. For example, * RelayState or TargetSource. Specify this value when you use IAM authentication and want * to let federated users log in to a Studio using the Studio URL. The RelayState parameter differs by * IdP. *

* * @return The name that your identity provider (IdP) uses for its RelayState parameter. For example, * RelayState or TargetSource. Specify this value when you use IAM authentication * and want to let federated users log in to a Studio using the Studio URL. The RelayState * parameter differs by IdP. */ public final String idpRelayStateParameterName() { return idpRelayStateParameterName; } /** * For responses, this returns true if the service returned a value for the Tags 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 hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that consist of a * required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 * characters. *

*

* 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 #hasTags} method. *

* * @return A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that * consist of a required key string with a maximum of 128 characters, and an optional value string with a * maximum of 256 characters. */ public final List tags() { return tags; } /** *

* A Boolean indicating whether to enable Trusted identity propagation for the Studio. The default value is * false. *

* * @return A Boolean indicating whether to enable Trusted identity propagation for the Studio. The default value is * false. */ public final Boolean trustedIdentityPropagationEnabled() { return trustedIdentityPropagationEnabled; } /** *

* Specifies whether IAM Identity Center user assignment is REQUIRED or OPTIONAL. If the * value is set to REQUIRED, users must be explicitly assigned to the Studio application to access the * Studio. *

*

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

* * @return Specifies whether IAM Identity Center user assignment is REQUIRED or OPTIONAL. * If the value is set to REQUIRED, users must be explicitly assigned to the Studio application * to access the Studio. * @see IdcUserAssignment */ public final IdcUserAssignment idcUserAssignment() { return IdcUserAssignment.fromValue(idcUserAssignment); } /** *

* Specifies whether IAM Identity Center user assignment is REQUIRED or OPTIONAL. If the * value is set to REQUIRED, users must be explicitly assigned to the Studio application to access the * Studio. *

*

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

* * @return Specifies whether IAM Identity Center user assignment is REQUIRED or OPTIONAL. * If the value is set to REQUIRED, users must be explicitly assigned to the Studio application * to access the Studio. * @see IdcUserAssignment */ public final String idcUserAssignmentAsString() { return idcUserAssignment; } /** *

* The ARN of the IAM Identity Center instance to create the Studio application. *

* * @return The ARN of the IAM Identity Center instance to create the Studio application. */ public final String idcInstanceArn() { return idcInstanceArn; } /** *

* The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and notebook files when backed up to * Amazon S3. *

* * @return The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and notebook files when backed * up to Amazon S3. */ public final String encryptionKeyArn() { return encryptionKeyArn; } @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(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(authModeAsString()); hashCode = 31 * hashCode + Objects.hashCode(vpcId()); hashCode = 31 * hashCode + Objects.hashCode(hasSubnetIds() ? subnetIds() : null); hashCode = 31 * hashCode + Objects.hashCode(serviceRole()); hashCode = 31 * hashCode + Objects.hashCode(userRole()); hashCode = 31 * hashCode + Objects.hashCode(workspaceSecurityGroupId()); hashCode = 31 * hashCode + Objects.hashCode(engineSecurityGroupId()); hashCode = 31 * hashCode + Objects.hashCode(defaultS3Location()); hashCode = 31 * hashCode + Objects.hashCode(idpAuthUrl()); hashCode = 31 * hashCode + Objects.hashCode(idpRelayStateParameterName()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(trustedIdentityPropagationEnabled()); hashCode = 31 * hashCode + Objects.hashCode(idcUserAssignmentAsString()); hashCode = 31 * hashCode + Objects.hashCode(idcInstanceArn()); hashCode = 31 * hashCode + Objects.hashCode(encryptionKeyArn()); 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 CreateStudioRequest)) { return false; } CreateStudioRequest other = (CreateStudioRequest) obj; return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(authModeAsString(), other.authModeAsString()) && Objects.equals(vpcId(), other.vpcId()) && hasSubnetIds() == other.hasSubnetIds() && Objects.equals(subnetIds(), other.subnetIds()) && Objects.equals(serviceRole(), other.serviceRole()) && Objects.equals(userRole(), other.userRole()) && Objects.equals(workspaceSecurityGroupId(), other.workspaceSecurityGroupId()) && Objects.equals(engineSecurityGroupId(), other.engineSecurityGroupId()) && Objects.equals(defaultS3Location(), other.defaultS3Location()) && Objects.equals(idpAuthUrl(), other.idpAuthUrl()) && Objects.equals(idpRelayStateParameterName(), other.idpRelayStateParameterName()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(trustedIdentityPropagationEnabled(), other.trustedIdentityPropagationEnabled()) && Objects.equals(idcUserAssignmentAsString(), other.idcUserAssignmentAsString()) && Objects.equals(idcInstanceArn(), other.idcInstanceArn()) && Objects.equals(encryptionKeyArn(), other.encryptionKeyArn()); } /** * 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("CreateStudioRequest").add("Name", name()).add("Description", description()) .add("AuthMode", authModeAsString()).add("VpcId", vpcId()).add("SubnetIds", hasSubnetIds() ? subnetIds() : null) .add("ServiceRole", serviceRole()).add("UserRole", userRole()) .add("WorkspaceSecurityGroupId", workspaceSecurityGroupId()) .add("EngineSecurityGroupId", engineSecurityGroupId()).add("DefaultS3Location", defaultS3Location()) .add("IdpAuthUrl", idpAuthUrl()).add("IdpRelayStateParameterName", idpRelayStateParameterName()) .add("Tags", hasTags() ? tags() : null) .add("TrustedIdentityPropagationEnabled", trustedIdentityPropagationEnabled()) .add("IdcUserAssignment", idcUserAssignmentAsString()).add("IdcInstanceArn", idcInstanceArn()) .add("EncryptionKeyArn", encryptionKeyArn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "AuthMode": return Optional.ofNullable(clazz.cast(authModeAsString())); case "VpcId": return Optional.ofNullable(clazz.cast(vpcId())); case "SubnetIds": return Optional.ofNullable(clazz.cast(subnetIds())); case "ServiceRole": return Optional.ofNullable(clazz.cast(serviceRole())); case "UserRole": return Optional.ofNullable(clazz.cast(userRole())); case "WorkspaceSecurityGroupId": return Optional.ofNullable(clazz.cast(workspaceSecurityGroupId())); case "EngineSecurityGroupId": return Optional.ofNullable(clazz.cast(engineSecurityGroupId())); case "DefaultS3Location": return Optional.ofNullable(clazz.cast(defaultS3Location())); case "IdpAuthUrl": return Optional.ofNullable(clazz.cast(idpAuthUrl())); case "IdpRelayStateParameterName": return Optional.ofNullable(clazz.cast(idpRelayStateParameterName())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "TrustedIdentityPropagationEnabled": return Optional.ofNullable(clazz.cast(trustedIdentityPropagationEnabled())); case "IdcUserAssignment": return Optional.ofNullable(clazz.cast(idcUserAssignmentAsString())); case "IdcInstanceArn": return Optional.ofNullable(clazz.cast(idcInstanceArn())); case "EncryptionKeyArn": return Optional.ofNullable(clazz.cast(encryptionKeyArn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateStudioRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends EmrRequest.Builder, SdkPojo, CopyableBuilder { /** *

* A descriptive name for the Amazon EMR Studio. *

* * @param name * A descriptive name for the Amazon EMR Studio. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* A detailed description of the Amazon EMR Studio. *

* * @param description * A detailed description of the Amazon EMR Studio. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* Specifies whether the Studio authenticates users using IAM or IAM Identity Center. *

* * @param authMode * Specifies whether the Studio authenticates users using IAM or IAM Identity Center. * @see AuthMode * @return Returns a reference to this object so that method calls can be chained together. * @see AuthMode */ Builder authMode(String authMode); /** *

* Specifies whether the Studio authenticates users using IAM or IAM Identity Center. *

* * @param authMode * Specifies whether the Studio authenticates users using IAM or IAM Identity Center. * @see AuthMode * @return Returns a reference to this object so that method calls can be chained together. * @see AuthMode */ Builder authMode(AuthMode authMode); /** *

* The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio. *

* * @param vpcId * The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcId(String vpcId); /** *

* A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The * subnets must belong to the VPC specified by VpcId. Studio users can create a Workspace in any of * the specified subnets. *

* * @param subnetIds * A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 * subnets. The subnets must belong to the VPC specified by VpcId. Studio users can create a * Workspace in any of the specified subnets. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subnetIds(Collection subnetIds); /** *

* A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The * subnets must belong to the VPC specified by VpcId. Studio users can create a Workspace in any of * the specified subnets. *

* * @param subnetIds * A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 * subnets. The subnets must belong to the VPC specified by VpcId. Studio users can create a * Workspace in any of the specified subnets. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subnetIds(String... subnetIds); /** *

* The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to * interoperate with other Amazon Web Services services. *

* * @param serviceRole * The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio * to interoperate with other Amazon Web Services services. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceRole(String serviceRole); /** *

* The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a * UserRole when you use IAM Identity Center authentication. The permissions attached to the * UserRole can be scoped down for each user or group using session policies. *

* * @param userRole * The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a * UserRole when you use IAM Identity Center authentication. The permissions attached to the * UserRole can be scoped down for each user or group using session policies. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userRole(String userRole); /** *

* The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound * network traffic to resources in the Engine security group, and it must be in the same VPC specified by * VpcId. *

* * @param workspaceSecurityGroupId * The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound * network traffic to resources in the Engine security group, and it must be in the same VPC specified by * VpcId. * @return Returns a reference to this object so that method calls can be chained together. */ Builder workspaceSecurityGroupId(String workspaceSecurityGroupId); /** *

* The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network * traffic from the Workspace security group, and it must be in the same VPC specified by VpcId. *

* * @param engineSecurityGroupId * The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound * network traffic from the Workspace security group, and it must be in the same VPC specified by * VpcId. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engineSecurityGroupId(String engineSecurityGroupId); /** *

* The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files. *

* * @param defaultS3Location * The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultS3Location(String defaultS3Location); /** *

* The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM * authentication and want to let federated users log in to a Studio with the Studio URL and credentials from * your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials. *

* * @param idpAuthUrl * The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM * authentication and want to let federated users log in to a Studio with the Studio URL and credentials * from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials. * @return Returns a reference to this object so that method calls can be chained together. */ Builder idpAuthUrl(String idpAuthUrl); /** *

* The name that your identity provider (IdP) uses for its RelayState parameter. For example, * RelayState or TargetSource. Specify this value when you use IAM authentication and * want to let federated users log in to a Studio using the Studio URL. The RelayState parameter * differs by IdP. *

* * @param idpRelayStateParameterName * The name that your identity provider (IdP) uses for its RelayState parameter. For * example, RelayState or TargetSource. Specify this value when you use IAM * authentication and want to let federated users log in to a Studio using the Studio URL. The * RelayState parameter differs by IdP. * @return Returns a reference to this object so that method calls can be chained together. */ Builder idpRelayStateParameterName(String idpRelayStateParameterName); /** *

* A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that consist of * a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 * characters. *

* * @param tags * A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that * consist of a required key string with a maximum of 128 characters, and an optional value string with a * maximum of 256 characters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that consist of * a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 * characters. *

* * @param tags * A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that * consist of a required key string with a maximum of 128 characters, and an optional value string with a * maximum of 256 characters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

* A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that consist of * a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 * characters. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.emr.model.Tag.Builder} avoiding the need to create one manually via * {@link software.amazon.awssdk.services.emr.model.Tag#builder()}. * *

* When the {@link Consumer} completes, {@link software.amazon.awssdk.services.emr.model.Tag.Builder#build()} is * called immediately and its result is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link software.amazon.awssdk.services.emr.model.Tag.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(java.util.Collection) */ Builder tags(Consumer... tags); /** *

* A Boolean indicating whether to enable Trusted identity propagation for the Studio. The default value is * false. *

* * @param trustedIdentityPropagationEnabled * A Boolean indicating whether to enable Trusted identity propagation for the Studio. The default value * is false. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trustedIdentityPropagationEnabled(Boolean trustedIdentityPropagationEnabled); /** *

* Specifies whether IAM Identity Center user assignment is REQUIRED or OPTIONAL. If * the value is set to REQUIRED, users must be explicitly assigned to the Studio application to * access the Studio. *

* * @param idcUserAssignment * Specifies whether IAM Identity Center user assignment is REQUIRED or * OPTIONAL. If the value is set to REQUIRED, users must be explicitly assigned * to the Studio application to access the Studio. * @see IdcUserAssignment * @return Returns a reference to this object so that method calls can be chained together. * @see IdcUserAssignment */ Builder idcUserAssignment(String idcUserAssignment); /** *

* Specifies whether IAM Identity Center user assignment is REQUIRED or OPTIONAL. If * the value is set to REQUIRED, users must be explicitly assigned to the Studio application to * access the Studio. *

* * @param idcUserAssignment * Specifies whether IAM Identity Center user assignment is REQUIRED or * OPTIONAL. If the value is set to REQUIRED, users must be explicitly assigned * to the Studio application to access the Studio. * @see IdcUserAssignment * @return Returns a reference to this object so that method calls can be chained together. * @see IdcUserAssignment */ Builder idcUserAssignment(IdcUserAssignment idcUserAssignment); /** *

* The ARN of the IAM Identity Center instance to create the Studio application. *

* * @param idcInstanceArn * The ARN of the IAM Identity Center instance to create the Studio application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder idcInstanceArn(String idcInstanceArn); /** *

* The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and notebook files when backed up to * Amazon S3. *

* * @param encryptionKeyArn * The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and notebook files when * backed up to Amazon S3. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryptionKeyArn(String encryptionKeyArn); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends EmrRequest.BuilderImpl implements Builder { private String name; private String description; private String authMode; private String vpcId; private List subnetIds = DefaultSdkAutoConstructList.getInstance(); private String serviceRole; private String userRole; private String workspaceSecurityGroupId; private String engineSecurityGroupId; private String defaultS3Location; private String idpAuthUrl; private String idpRelayStateParameterName; private List tags = DefaultSdkAutoConstructList.getInstance(); private Boolean trustedIdentityPropagationEnabled; private String idcUserAssignment; private String idcInstanceArn; private String encryptionKeyArn; private BuilderImpl() { } private BuilderImpl(CreateStudioRequest model) { super(model); name(model.name); description(model.description); authMode(model.authMode); vpcId(model.vpcId); subnetIds(model.subnetIds); serviceRole(model.serviceRole); userRole(model.userRole); workspaceSecurityGroupId(model.workspaceSecurityGroupId); engineSecurityGroupId(model.engineSecurityGroupId); defaultS3Location(model.defaultS3Location); idpAuthUrl(model.idpAuthUrl); idpRelayStateParameterName(model.idpRelayStateParameterName); tags(model.tags); trustedIdentityPropagationEnabled(model.trustedIdentityPropagationEnabled); idcUserAssignment(model.idcUserAssignment); idcInstanceArn(model.idcInstanceArn); encryptionKeyArn(model.encryptionKeyArn); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getAuthMode() { return authMode; } public final void setAuthMode(String authMode) { this.authMode = authMode; } @Override public final Builder authMode(String authMode) { this.authMode = authMode; return this; } @Override public final Builder authMode(AuthMode authMode) { this.authMode(authMode == null ? null : authMode.toString()); return this; } public final String getVpcId() { return vpcId; } public final void setVpcId(String vpcId) { this.vpcId = vpcId; } @Override public final Builder vpcId(String vpcId) { this.vpcId = vpcId; return this; } public final Collection getSubnetIds() { if (subnetIds instanceof SdkAutoConstructList) { return null; } return subnetIds; } public final void setSubnetIds(Collection subnetIds) { this.subnetIds = SubnetIdListCopier.copy(subnetIds); } @Override public final Builder subnetIds(Collection subnetIds) { this.subnetIds = SubnetIdListCopier.copy(subnetIds); return this; } @Override @SafeVarargs public final Builder subnetIds(String... subnetIds) { subnetIds(Arrays.asList(subnetIds)); return this; } public final String getServiceRole() { return serviceRole; } public final void setServiceRole(String serviceRole) { this.serviceRole = serviceRole; } @Override public final Builder serviceRole(String serviceRole) { this.serviceRole = serviceRole; return this; } public final String getUserRole() { return userRole; } public final void setUserRole(String userRole) { this.userRole = userRole; } @Override public final Builder userRole(String userRole) { this.userRole = userRole; return this; } public final String getWorkspaceSecurityGroupId() { return workspaceSecurityGroupId; } public final void setWorkspaceSecurityGroupId(String workspaceSecurityGroupId) { this.workspaceSecurityGroupId = workspaceSecurityGroupId; } @Override public final Builder workspaceSecurityGroupId(String workspaceSecurityGroupId) { this.workspaceSecurityGroupId = workspaceSecurityGroupId; return this; } public final String getEngineSecurityGroupId() { return engineSecurityGroupId; } public final void setEngineSecurityGroupId(String engineSecurityGroupId) { this.engineSecurityGroupId = engineSecurityGroupId; } @Override public final Builder engineSecurityGroupId(String engineSecurityGroupId) { this.engineSecurityGroupId = engineSecurityGroupId; return this; } public final String getDefaultS3Location() { return defaultS3Location; } public final void setDefaultS3Location(String defaultS3Location) { this.defaultS3Location = defaultS3Location; } @Override public final Builder defaultS3Location(String defaultS3Location) { this.defaultS3Location = defaultS3Location; return this; } public final String getIdpAuthUrl() { return idpAuthUrl; } public final void setIdpAuthUrl(String idpAuthUrl) { this.idpAuthUrl = idpAuthUrl; } @Override public final Builder idpAuthUrl(String idpAuthUrl) { this.idpAuthUrl = idpAuthUrl; return this; } public final String getIdpRelayStateParameterName() { return idpRelayStateParameterName; } public final void setIdpRelayStateParameterName(String idpRelayStateParameterName) { this.idpRelayStateParameterName = idpRelayStateParameterName; } @Override public final Builder idpRelayStateParameterName(String idpRelayStateParameterName) { this.idpRelayStateParameterName = idpRelayStateParameterName; return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Boolean getTrustedIdentityPropagationEnabled() { return trustedIdentityPropagationEnabled; } public final void setTrustedIdentityPropagationEnabled(Boolean trustedIdentityPropagationEnabled) { this.trustedIdentityPropagationEnabled = trustedIdentityPropagationEnabled; } @Override public final Builder trustedIdentityPropagationEnabled(Boolean trustedIdentityPropagationEnabled) { this.trustedIdentityPropagationEnabled = trustedIdentityPropagationEnabled; return this; } public final String getIdcUserAssignment() { return idcUserAssignment; } public final void setIdcUserAssignment(String idcUserAssignment) { this.idcUserAssignment = idcUserAssignment; } @Override public final Builder idcUserAssignment(String idcUserAssignment) { this.idcUserAssignment = idcUserAssignment; return this; } @Override public final Builder idcUserAssignment(IdcUserAssignment idcUserAssignment) { this.idcUserAssignment(idcUserAssignment == null ? null : idcUserAssignment.toString()); return this; } public final String getIdcInstanceArn() { return idcInstanceArn; } public final void setIdcInstanceArn(String idcInstanceArn) { this.idcInstanceArn = idcInstanceArn; } @Override public final Builder idcInstanceArn(String idcInstanceArn) { this.idcInstanceArn = idcInstanceArn; return this; } public final String getEncryptionKeyArn() { return encryptionKeyArn; } public final void setEncryptionKeyArn(String encryptionKeyArn) { this.encryptionKeyArn = encryptionKeyArn; } @Override public final Builder encryptionKeyArn(String encryptionKeyArn) { this.encryptionKeyArn = encryptionKeyArn; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateStudioRequest build() { return new CreateStudioRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy