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

software.amazon.awssdk.services.emr.model.StartNotebookExecutionRequest 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.Map;
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.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 StartNotebookExecutionRequest extends EmrRequest implements
        ToCopyableBuilder {
    private static final SdkField EDITOR_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("EditorId").getter(getter(StartNotebookExecutionRequest::editorId)).setter(setter(Builder::editorId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EditorId").build()).build();

    private static final SdkField RELATIVE_PATH_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("RelativePath").getter(getter(StartNotebookExecutionRequest::relativePath))
            .setter(setter(Builder::relativePath))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RelativePath").build()).build();

    private static final SdkField NOTEBOOK_EXECUTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("NotebookExecutionName").getter(getter(StartNotebookExecutionRequest::notebookExecutionName))
            .setter(setter(Builder::notebookExecutionName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotebookExecutionName").build())
            .build();

    private static final SdkField NOTEBOOK_PARAMS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("NotebookParams").getter(getter(StartNotebookExecutionRequest::notebookParams))
            .setter(setter(Builder::notebookParams))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotebookParams").build()).build();

    private static final SdkField EXECUTION_ENGINE_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("ExecutionEngine")
            .getter(getter(StartNotebookExecutionRequest::executionEngine)).setter(setter(Builder::executionEngine))
            .constructor(ExecutionEngineConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExecutionEngine").build()).build();

    private static final SdkField SERVICE_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ServiceRole").getter(getter(StartNotebookExecutionRequest::serviceRole))
            .setter(setter(Builder::serviceRole))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceRole").build()).build();

    private static final SdkField NOTEBOOK_INSTANCE_SECURITY_GROUP_ID_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("NotebookInstanceSecurityGroupId")
            .getter(getter(StartNotebookExecutionRequest::notebookInstanceSecurityGroupId))
            .setter(setter(Builder::notebookInstanceSecurityGroupId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotebookInstanceSecurityGroupId")
                    .build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Tags")
            .getter(getter(StartNotebookExecutionRequest::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 NOTEBOOK_S3_LOCATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("NotebookS3Location")
            .getter(getter(StartNotebookExecutionRequest::notebookS3Location)).setter(setter(Builder::notebookS3Location))
            .constructor(NotebookS3LocationFromInput::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotebookS3Location").build())
            .build();

    private static final SdkField OUTPUT_NOTEBOOK_S3_LOCATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("OutputNotebookS3Location")
            .getter(getter(StartNotebookExecutionRequest::outputNotebookS3Location))
            .setter(setter(Builder::outputNotebookS3Location)).constructor(OutputNotebookS3LocationFromInput::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputNotebookS3Location").build())
            .build();

    private static final SdkField OUTPUT_NOTEBOOK_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("OutputNotebookFormat").getter(getter(StartNotebookExecutionRequest::outputNotebookFormatAsString))
            .setter(setter(Builder::outputNotebookFormat))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputNotebookFormat").build())
            .build();

    private static final SdkField> ENVIRONMENT_VARIABLES_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("EnvironmentVariables")
            .getter(getter(StartNotebookExecutionRequest::environmentVariables))
            .setter(setter(Builder::environmentVariables))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnvironmentVariables").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EDITOR_ID_FIELD,
            RELATIVE_PATH_FIELD, NOTEBOOK_EXECUTION_NAME_FIELD, NOTEBOOK_PARAMS_FIELD, EXECUTION_ENGINE_FIELD,
            SERVICE_ROLE_FIELD, NOTEBOOK_INSTANCE_SECURITY_GROUP_ID_FIELD, TAGS_FIELD, NOTEBOOK_S3_LOCATION_FIELD,
            OUTPUT_NOTEBOOK_S3_LOCATION_FIELD, OUTPUT_NOTEBOOK_FORMAT_FIELD, ENVIRONMENT_VARIABLES_FIELD));

    private final String editorId;

    private final String relativePath;

    private final String notebookExecutionName;

    private final String notebookParams;

    private final ExecutionEngineConfig executionEngine;

    private final String serviceRole;

    private final String notebookInstanceSecurityGroupId;

    private final List tags;

    private final NotebookS3LocationFromInput notebookS3Location;

    private final OutputNotebookS3LocationFromInput outputNotebookS3Location;

    private final String outputNotebookFormat;

    private final Map environmentVariables;

    private StartNotebookExecutionRequest(BuilderImpl builder) {
        super(builder);
        this.editorId = builder.editorId;
        this.relativePath = builder.relativePath;
        this.notebookExecutionName = builder.notebookExecutionName;
        this.notebookParams = builder.notebookParams;
        this.executionEngine = builder.executionEngine;
        this.serviceRole = builder.serviceRole;
        this.notebookInstanceSecurityGroupId = builder.notebookInstanceSecurityGroupId;
        this.tags = builder.tags;
        this.notebookS3Location = builder.notebookS3Location;
        this.outputNotebookS3Location = builder.outputNotebookS3Location;
        this.outputNotebookFormat = builder.outputNotebookFormat;
        this.environmentVariables = builder.environmentVariables;
    }

    /**
     * 

* The unique identifier of the Amazon EMR Notebook to use for notebook execution. *

* * @return The unique identifier of the Amazon EMR Notebook to use for notebook execution. */ public final String editorId() { return editorId; } /** *

* The path and file name of the notebook file for this execution, relative to the path specified for the Amazon EMR * Notebook. For example, if you specify a path of s3://MyBucket/MyNotebooks when you create an Amazon * EMR Notebook for a notebook with an ID of e-ABCDEFGHIJK1234567890ABCD (the EditorID of * this request), and you specify a RelativePath of * my_notebook_executions/notebook_execution.ipynb, the location of the file for the notebook execution * is * s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb * . *

* * @return The path and file name of the notebook file for this execution, relative to the path specified for the * Amazon EMR Notebook. For example, if you specify a path of s3://MyBucket/MyNotebooks when * you create an Amazon EMR Notebook for a notebook with an ID of e-ABCDEFGHIJK1234567890ABCD * (the EditorID of this request), and you specify a RelativePath of * my_notebook_executions/notebook_execution.ipynb, the location of the file for the notebook * execution is * s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb * . */ public final String relativePath() { return relativePath; } /** *

* An optional name for the notebook execution. *

* * @return An optional name for the notebook execution. */ public final String notebookExecutionName() { return notebookExecutionName; } /** *

* Input parameters in JSON format passed to the Amazon EMR Notebook at runtime for execution. *

* * @return Input parameters in JSON format passed to the Amazon EMR Notebook at runtime for execution. */ public final String notebookParams() { return notebookParams; } /** *

* Specifies the execution engine (cluster) that runs the notebook execution. *

* * @return Specifies the execution engine (cluster) that runs the notebook execution. */ public final ExecutionEngineConfig executionEngine() { return executionEngine; } /** *

* The name or ARN of the IAM role that is used as the service role for Amazon EMR (the Amazon EMR role) for the * notebook execution. *

* * @return The name or ARN of the IAM role that is used as the service role for Amazon EMR (the Amazon EMR role) for * the notebook execution. */ public final String serviceRole() { return serviceRole; } /** *

* The unique identifier of the Amazon EC2 security group to associate with the Amazon EMR Notebook for this * notebook execution. *

* * @return The unique identifier of the Amazon EC2 security group to associate with the Amazon EMR Notebook for this * notebook execution. */ public final String notebookInstanceSecurityGroupId() { return notebookInstanceSecurityGroupId; } /** * 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 associated with a notebook execution. 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 associated with a notebook execution. 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; } /** *

* The Amazon S3 location for the notebook execution input. *

* * @return The Amazon S3 location for the notebook execution input. */ public final NotebookS3LocationFromInput notebookS3Location() { return notebookS3Location; } /** *

* The Amazon S3 location for the notebook execution output. *

* * @return The Amazon S3 location for the notebook execution output. */ public final OutputNotebookS3LocationFromInput outputNotebookS3Location() { return outputNotebookS3Location; } /** *

* The output format for the notebook execution. *

*

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

* * @return The output format for the notebook execution. * @see OutputNotebookFormat */ public final OutputNotebookFormat outputNotebookFormat() { return OutputNotebookFormat.fromValue(outputNotebookFormat); } /** *

* The output format for the notebook execution. *

*

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

* * @return The output format for the notebook execution. * @see OutputNotebookFormat */ public final String outputNotebookFormatAsString() { return outputNotebookFormat; } /** * For responses, this returns true if the service returned a value for the EnvironmentVariables 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 hasEnvironmentVariables() { return environmentVariables != null && !(environmentVariables instanceof SdkAutoConstructMap); } /** *

* The environment variables associated with the notebook execution. *

*

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

* * @return The environment variables associated with the notebook execution. */ public final Map environmentVariables() { return environmentVariables; } @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(editorId()); hashCode = 31 * hashCode + Objects.hashCode(relativePath()); hashCode = 31 * hashCode + Objects.hashCode(notebookExecutionName()); hashCode = 31 * hashCode + Objects.hashCode(notebookParams()); hashCode = 31 * hashCode + Objects.hashCode(executionEngine()); hashCode = 31 * hashCode + Objects.hashCode(serviceRole()); hashCode = 31 * hashCode + Objects.hashCode(notebookInstanceSecurityGroupId()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(notebookS3Location()); hashCode = 31 * hashCode + Objects.hashCode(outputNotebookS3Location()); hashCode = 31 * hashCode + Objects.hashCode(outputNotebookFormatAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasEnvironmentVariables() ? environmentVariables() : null); 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 StartNotebookExecutionRequest)) { return false; } StartNotebookExecutionRequest other = (StartNotebookExecutionRequest) obj; return Objects.equals(editorId(), other.editorId()) && Objects.equals(relativePath(), other.relativePath()) && Objects.equals(notebookExecutionName(), other.notebookExecutionName()) && Objects.equals(notebookParams(), other.notebookParams()) && Objects.equals(executionEngine(), other.executionEngine()) && Objects.equals(serviceRole(), other.serviceRole()) && Objects.equals(notebookInstanceSecurityGroupId(), other.notebookInstanceSecurityGroupId()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(notebookS3Location(), other.notebookS3Location()) && Objects.equals(outputNotebookS3Location(), other.outputNotebookS3Location()) && Objects.equals(outputNotebookFormatAsString(), other.outputNotebookFormatAsString()) && hasEnvironmentVariables() == other.hasEnvironmentVariables() && Objects.equals(environmentVariables(), other.environmentVariables()); } /** * 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("StartNotebookExecutionRequest").add("EditorId", editorId()).add("RelativePath", relativePath()) .add("NotebookExecutionName", notebookExecutionName()).add("NotebookParams", notebookParams()) .add("ExecutionEngine", executionEngine()).add("ServiceRole", serviceRole()) .add("NotebookInstanceSecurityGroupId", notebookInstanceSecurityGroupId()).add("Tags", hasTags() ? tags() : null) .add("NotebookS3Location", notebookS3Location()).add("OutputNotebookS3Location", outputNotebookS3Location()) .add("OutputNotebookFormat", outputNotebookFormatAsString()) .add("EnvironmentVariables", hasEnvironmentVariables() ? environmentVariables() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "EditorId": return Optional.ofNullable(clazz.cast(editorId())); case "RelativePath": return Optional.ofNullable(clazz.cast(relativePath())); case "NotebookExecutionName": return Optional.ofNullable(clazz.cast(notebookExecutionName())); case "NotebookParams": return Optional.ofNullable(clazz.cast(notebookParams())); case "ExecutionEngine": return Optional.ofNullable(clazz.cast(executionEngine())); case "ServiceRole": return Optional.ofNullable(clazz.cast(serviceRole())); case "NotebookInstanceSecurityGroupId": return Optional.ofNullable(clazz.cast(notebookInstanceSecurityGroupId())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "NotebookS3Location": return Optional.ofNullable(clazz.cast(notebookS3Location())); case "OutputNotebookS3Location": return Optional.ofNullable(clazz.cast(outputNotebookS3Location())); case "OutputNotebookFormat": return Optional.ofNullable(clazz.cast(outputNotebookFormatAsString())); case "EnvironmentVariables": return Optional.ofNullable(clazz.cast(environmentVariables())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((StartNotebookExecutionRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends EmrRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The unique identifier of the Amazon EMR Notebook to use for notebook execution. *

* * @param editorId * The unique identifier of the Amazon EMR Notebook to use for notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder editorId(String editorId); /** *

* The path and file name of the notebook file for this execution, relative to the path specified for the Amazon * EMR Notebook. For example, if you specify a path of s3://MyBucket/MyNotebooks when you create an * Amazon EMR Notebook for a notebook with an ID of e-ABCDEFGHIJK1234567890ABCD (the * EditorID of this request), and you specify a RelativePath of * my_notebook_executions/notebook_execution.ipynb, the location of the file for the notebook * execution is * s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb * . *

* * @param relativePath * The path and file name of the notebook file for this execution, relative to the path specified for the * Amazon EMR Notebook. For example, if you specify a path of s3://MyBucket/MyNotebooks when * you create an Amazon EMR Notebook for a notebook with an ID of * e-ABCDEFGHIJK1234567890ABCD (the EditorID of this request), and you specify * a RelativePath of my_notebook_executions/notebook_execution.ipynb, the * location of the file for the notebook execution is * s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb * . * @return Returns a reference to this object so that method calls can be chained together. */ Builder relativePath(String relativePath); /** *

* An optional name for the notebook execution. *

* * @param notebookExecutionName * An optional name for the notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notebookExecutionName(String notebookExecutionName); /** *

* Input parameters in JSON format passed to the Amazon EMR Notebook at runtime for execution. *

* * @param notebookParams * Input parameters in JSON format passed to the Amazon EMR Notebook at runtime for execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notebookParams(String notebookParams); /** *

* Specifies the execution engine (cluster) that runs the notebook execution. *

* * @param executionEngine * Specifies the execution engine (cluster) that runs the notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder executionEngine(ExecutionEngineConfig executionEngine); /** *

* Specifies the execution engine (cluster) that runs the notebook execution. *

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

* When the {@link Consumer} completes, {@link ExecutionEngineConfig.Builder#build()} is called immediately and * its result is passed to {@link #executionEngine(ExecutionEngineConfig)}. * * @param executionEngine * a consumer that will call methods on {@link ExecutionEngineConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #executionEngine(ExecutionEngineConfig) */ default Builder executionEngine(Consumer executionEngine) { return executionEngine(ExecutionEngineConfig.builder().applyMutation(executionEngine).build()); } /** *

* The name or ARN of the IAM role that is used as the service role for Amazon EMR (the Amazon EMR role) for the * notebook execution. *

* * @param serviceRole * The name or ARN of the IAM role that is used as the service role for Amazon EMR (the Amazon EMR role) * for the notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceRole(String serviceRole); /** *

* The unique identifier of the Amazon EC2 security group to associate with the Amazon EMR Notebook for this * notebook execution. *

* * @param notebookInstanceSecurityGroupId * The unique identifier of the Amazon EC2 security group to associate with the Amazon EMR Notebook for * this notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notebookInstanceSecurityGroupId(String notebookInstanceSecurityGroupId); /** *

* A list of tags associated with a notebook execution. 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 associated with a notebook execution. 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 associated with a notebook execution. 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 associated with a notebook execution. 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 associated with a notebook execution. 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); /** *

* The Amazon S3 location for the notebook execution input. *

* * @param notebookS3Location * The Amazon S3 location for the notebook execution input. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notebookS3Location(NotebookS3LocationFromInput notebookS3Location); /** *

* The Amazon S3 location for the notebook execution input. *

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

* When the {@link Consumer} completes, {@link NotebookS3LocationFromInput.Builder#build()} is called * immediately and its result is passed to {@link #notebookS3Location(NotebookS3LocationFromInput)}. * * @param notebookS3Location * a consumer that will call methods on {@link NotebookS3LocationFromInput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #notebookS3Location(NotebookS3LocationFromInput) */ default Builder notebookS3Location(Consumer notebookS3Location) { return notebookS3Location(NotebookS3LocationFromInput.builder().applyMutation(notebookS3Location).build()); } /** *

* The Amazon S3 location for the notebook execution output. *

* * @param outputNotebookS3Location * The Amazon S3 location for the notebook execution output. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputNotebookS3Location(OutputNotebookS3LocationFromInput outputNotebookS3Location); /** *

* The Amazon S3 location for the notebook execution output. *

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

* When the {@link Consumer} completes, {@link OutputNotebookS3LocationFromInput.Builder#build()} is called * immediately and its result is passed to {@link #outputNotebookS3Location(OutputNotebookS3LocationFromInput)}. * * @param outputNotebookS3Location * a consumer that will call methods on {@link OutputNotebookS3LocationFromInput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputNotebookS3Location(OutputNotebookS3LocationFromInput) */ default Builder outputNotebookS3Location(Consumer outputNotebookS3Location) { return outputNotebookS3Location(OutputNotebookS3LocationFromInput.builder().applyMutation(outputNotebookS3Location) .build()); } /** *

* The output format for the notebook execution. *

* * @param outputNotebookFormat * The output format for the notebook execution. * @see OutputNotebookFormat * @return Returns a reference to this object so that method calls can be chained together. * @see OutputNotebookFormat */ Builder outputNotebookFormat(String outputNotebookFormat); /** *

* The output format for the notebook execution. *

* * @param outputNotebookFormat * The output format for the notebook execution. * @see OutputNotebookFormat * @return Returns a reference to this object so that method calls can be chained together. * @see OutputNotebookFormat */ Builder outputNotebookFormat(OutputNotebookFormat outputNotebookFormat); /** *

* The environment variables associated with the notebook execution. *

* * @param environmentVariables * The environment variables associated with the notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder environmentVariables(Map environmentVariables); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends EmrRequest.BuilderImpl implements Builder { private String editorId; private String relativePath; private String notebookExecutionName; private String notebookParams; private ExecutionEngineConfig executionEngine; private String serviceRole; private String notebookInstanceSecurityGroupId; private List tags = DefaultSdkAutoConstructList.getInstance(); private NotebookS3LocationFromInput notebookS3Location; private OutputNotebookS3LocationFromInput outputNotebookS3Location; private String outputNotebookFormat; private Map environmentVariables = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(StartNotebookExecutionRequest model) { super(model); editorId(model.editorId); relativePath(model.relativePath); notebookExecutionName(model.notebookExecutionName); notebookParams(model.notebookParams); executionEngine(model.executionEngine); serviceRole(model.serviceRole); notebookInstanceSecurityGroupId(model.notebookInstanceSecurityGroupId); tags(model.tags); notebookS3Location(model.notebookS3Location); outputNotebookS3Location(model.outputNotebookS3Location); outputNotebookFormat(model.outputNotebookFormat); environmentVariables(model.environmentVariables); } public final String getEditorId() { return editorId; } public final void setEditorId(String editorId) { this.editorId = editorId; } @Override public final Builder editorId(String editorId) { this.editorId = editorId; return this; } public final String getRelativePath() { return relativePath; } public final void setRelativePath(String relativePath) { this.relativePath = relativePath; } @Override public final Builder relativePath(String relativePath) { this.relativePath = relativePath; return this; } public final String getNotebookExecutionName() { return notebookExecutionName; } public final void setNotebookExecutionName(String notebookExecutionName) { this.notebookExecutionName = notebookExecutionName; } @Override public final Builder notebookExecutionName(String notebookExecutionName) { this.notebookExecutionName = notebookExecutionName; return this; } public final String getNotebookParams() { return notebookParams; } public final void setNotebookParams(String notebookParams) { this.notebookParams = notebookParams; } @Override public final Builder notebookParams(String notebookParams) { this.notebookParams = notebookParams; return this; } public final ExecutionEngineConfig.Builder getExecutionEngine() { return executionEngine != null ? executionEngine.toBuilder() : null; } public final void setExecutionEngine(ExecutionEngineConfig.BuilderImpl executionEngine) { this.executionEngine = executionEngine != null ? executionEngine.build() : null; } @Override public final Builder executionEngine(ExecutionEngineConfig executionEngine) { this.executionEngine = executionEngine; 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 getNotebookInstanceSecurityGroupId() { return notebookInstanceSecurityGroupId; } public final void setNotebookInstanceSecurityGroupId(String notebookInstanceSecurityGroupId) { this.notebookInstanceSecurityGroupId = notebookInstanceSecurityGroupId; } @Override public final Builder notebookInstanceSecurityGroupId(String notebookInstanceSecurityGroupId) { this.notebookInstanceSecurityGroupId = notebookInstanceSecurityGroupId; 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 NotebookS3LocationFromInput.Builder getNotebookS3Location() { return notebookS3Location != null ? notebookS3Location.toBuilder() : null; } public final void setNotebookS3Location(NotebookS3LocationFromInput.BuilderImpl notebookS3Location) { this.notebookS3Location = notebookS3Location != null ? notebookS3Location.build() : null; } @Override public final Builder notebookS3Location(NotebookS3LocationFromInput notebookS3Location) { this.notebookS3Location = notebookS3Location; return this; } public final OutputNotebookS3LocationFromInput.Builder getOutputNotebookS3Location() { return outputNotebookS3Location != null ? outputNotebookS3Location.toBuilder() : null; } public final void setOutputNotebookS3Location(OutputNotebookS3LocationFromInput.BuilderImpl outputNotebookS3Location) { this.outputNotebookS3Location = outputNotebookS3Location != null ? outputNotebookS3Location.build() : null; } @Override public final Builder outputNotebookS3Location(OutputNotebookS3LocationFromInput outputNotebookS3Location) { this.outputNotebookS3Location = outputNotebookS3Location; return this; } public final String getOutputNotebookFormat() { return outputNotebookFormat; } public final void setOutputNotebookFormat(String outputNotebookFormat) { this.outputNotebookFormat = outputNotebookFormat; } @Override public final Builder outputNotebookFormat(String outputNotebookFormat) { this.outputNotebookFormat = outputNotebookFormat; return this; } @Override public final Builder outputNotebookFormat(OutputNotebookFormat outputNotebookFormat) { this.outputNotebookFormat(outputNotebookFormat == null ? null : outputNotebookFormat.toString()); return this; } public final Map getEnvironmentVariables() { if (environmentVariables instanceof SdkAutoConstructMap) { return null; } return environmentVariables; } public final void setEnvironmentVariables(Map environmentVariables) { this.environmentVariables = EnvironmentVariablesMapCopier.copy(environmentVariables); } @Override public final Builder environmentVariables(Map environmentVariables) { this.environmentVariables = EnvironmentVariablesMapCopier.copy(environmentVariables); 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 StartNotebookExecutionRequest build() { return new StartNotebookExecutionRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy