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

software.amazon.awssdk.services.emr.model.NotebookExecution 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.29.15
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.io.Serializable;
import java.time.Instant;
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.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;

/**
 * 

* A notebook execution. An execution is a specific instance that an Amazon EMR Notebook is run using the * StartNotebookExecution action. *

*/ @Generated("software.amazon.awssdk:codegen") public final class NotebookExecution implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NOTEBOOK_EXECUTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("NotebookExecutionId").getter(getter(NotebookExecution::notebookExecutionId)) .setter(setter(Builder::notebookExecutionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotebookExecutionId").build()) .build(); private static final SdkField EDITOR_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EditorId").getter(getter(NotebookExecution::editorId)).setter(setter(Builder::editorId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EditorId").build()).build(); private static final SdkField EXECUTION_ENGINE_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ExecutionEngine") .getter(getter(NotebookExecution::executionEngine)).setter(setter(Builder::executionEngine)) .constructor(ExecutionEngineConfig::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExecutionEngine").build()).build(); private static final SdkField NOTEBOOK_EXECUTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("NotebookExecutionName").getter(getter(NotebookExecution::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(NotebookExecution::notebookParams)) .setter(setter(Builder::notebookParams)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotebookParams").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(NotebookExecution::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTime").getter(getter(NotebookExecution::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("EndTime").getter(getter(NotebookExecution::endTime)).setter(setter(Builder::endTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build(); private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Arn") .getter(getter(NotebookExecution::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build(); private static final SdkField OUTPUT_NOTEBOOK_URI_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("OutputNotebookURI").getter(getter(NotebookExecution::outputNotebookURI)) .setter(setter(Builder::outputNotebookURI)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputNotebookURI").build()).build(); private static final SdkField LAST_STATE_CHANGE_REASON_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("LastStateChangeReason").getter(getter(NotebookExecution::lastStateChangeReason)) .setter(setter(Builder::lastStateChangeReason)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastStateChangeReason").build()) .build(); private static final SdkField NOTEBOOK_INSTANCE_SECURITY_GROUP_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("NotebookInstanceSecurityGroupId") .getter(getter(NotebookExecution::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(NotebookExecution::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(NotebookExecution::notebookS3Location)).setter(setter(Builder::notebookS3Location)) .constructor(NotebookS3LocationForOutput::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(NotebookExecution::outputNotebookS3Location)).setter(setter(Builder::outputNotebookS3Location)) .constructor(OutputNotebookS3LocationForOutput::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(NotebookExecution::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(NotebookExecution::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(NOTEBOOK_EXECUTION_ID_FIELD, EDITOR_ID_FIELD, EXECUTION_ENGINE_FIELD, NOTEBOOK_EXECUTION_NAME_FIELD, NOTEBOOK_PARAMS_FIELD, STATUS_FIELD, START_TIME_FIELD, END_TIME_FIELD, ARN_FIELD, OUTPUT_NOTEBOOK_URI_FIELD, LAST_STATE_CHANGE_REASON_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 static final long serialVersionUID = 1L; private final String notebookExecutionId; private final String editorId; private final ExecutionEngineConfig executionEngine; private final String notebookExecutionName; private final String notebookParams; private final String status; private final Instant startTime; private final Instant endTime; private final String arn; private final String outputNotebookURI; private final String lastStateChangeReason; private final String notebookInstanceSecurityGroupId; private final List tags; private final NotebookS3LocationForOutput notebookS3Location; private final OutputNotebookS3LocationForOutput outputNotebookS3Location; private final String outputNotebookFormat; private final Map environmentVariables; private NotebookExecution(BuilderImpl builder) { this.notebookExecutionId = builder.notebookExecutionId; this.editorId = builder.editorId; this.executionEngine = builder.executionEngine; this.notebookExecutionName = builder.notebookExecutionName; this.notebookParams = builder.notebookParams; this.status = builder.status; this.startTime = builder.startTime; this.endTime = builder.endTime; this.arn = builder.arn; this.outputNotebookURI = builder.outputNotebookURI; this.lastStateChangeReason = builder.lastStateChangeReason; 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 a notebook execution. *

* * @return The unique identifier of a notebook execution. */ public final String notebookExecutionId() { return notebookExecutionId; } /** *

* The unique identifier of the Amazon EMR Notebook that is used for the notebook execution. *

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

* The execution engine, such as an Amazon EMR cluster, used to run the Amazon EMR notebook and perform the notebook * execution. *

* * @return The execution engine, such as an Amazon EMR cluster, used to run the Amazon EMR notebook and perform the * notebook execution. */ public final ExecutionEngineConfig executionEngine() { return executionEngine; } /** *

* A name for the notebook execution. *

* * @return A 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; } /** *

* The status of the notebook execution. *

*
    *
  • *

    * START_PENDING indicates that the cluster has received the execution request but execution has not * begun. *

    *
  • *
  • *

    * STARTING indicates that the execution is starting on the cluster. *

    *
  • *
  • *

    * RUNNING indicates that the execution is being processed by the cluster. *

    *
  • *
  • *

    * FINISHING indicates that execution processing is in the final stages. *

    *
  • *
  • *

    * FINISHED indicates that the execution has completed without error. *

    *
  • *
  • *

    * FAILING indicates that the execution is failing and will not finish successfully. *

    *
  • *
  • *

    * FAILED indicates that the execution failed. *

    *
  • *
  • *

    * STOP_PENDING indicates that the cluster has received a StopNotebookExecution request * and the stop is pending. *

    *
  • *
  • *

    * STOPPING indicates that the cluster is in the process of stopping the execution as a result of a * StopNotebookExecution request. *

    *
  • *
  • *

    * STOPPED indicates that the execution stopped because of a StopNotebookExecution * request. *

    *
  • *
*

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

* * @return The status of the notebook execution.

*
    *
  • *

    * START_PENDING indicates that the cluster has received the execution request but execution * has not begun. *

    *
  • *
  • *

    * STARTING indicates that the execution is starting on the cluster. *

    *
  • *
  • *

    * RUNNING indicates that the execution is being processed by the cluster. *

    *
  • *
  • *

    * FINISHING indicates that execution processing is in the final stages. *

    *
  • *
  • *

    * FINISHED indicates that the execution has completed without error. *

    *
  • *
  • *

    * FAILING indicates that the execution is failing and will not finish successfully. *

    *
  • *
  • *

    * FAILED indicates that the execution failed. *

    *
  • *
  • *

    * STOP_PENDING indicates that the cluster has received a StopNotebookExecution * request and the stop is pending. *

    *
  • *
  • *

    * STOPPING indicates that the cluster is in the process of stopping the execution as a result * of a StopNotebookExecution request. *

    *
  • *
  • *

    * STOPPED indicates that the execution stopped because of a StopNotebookExecution * request. *

    *
  • * @see NotebookExecutionStatus */ public final NotebookExecutionStatus status() { return NotebookExecutionStatus.fromValue(status); } /** *

    * The status of the notebook execution. *

    *
      *
    • *

      * START_PENDING indicates that the cluster has received the execution request but execution has not * begun. *

      *
    • *
    • *

      * STARTING indicates that the execution is starting on the cluster. *

      *
    • *
    • *

      * RUNNING indicates that the execution is being processed by the cluster. *

      *
    • *
    • *

      * FINISHING indicates that execution processing is in the final stages. *

      *
    • *
    • *

      * FINISHED indicates that the execution has completed without error. *

      *
    • *
    • *

      * FAILING indicates that the execution is failing and will not finish successfully. *

      *
    • *
    • *

      * FAILED indicates that the execution failed. *

      *
    • *
    • *

      * STOP_PENDING indicates that the cluster has received a StopNotebookExecution request * and the stop is pending. *

      *
    • *
    • *

      * STOPPING indicates that the cluster is in the process of stopping the execution as a result of a * StopNotebookExecution request. *

      *
    • *
    • *

      * STOPPED indicates that the execution stopped because of a StopNotebookExecution * request. *

      *
    • *
    *

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

    * * @return The status of the notebook execution.

    *
      *
    • *

      * START_PENDING indicates that the cluster has received the execution request but execution * has not begun. *

      *
    • *
    • *

      * STARTING indicates that the execution is starting on the cluster. *

      *
    • *
    • *

      * RUNNING indicates that the execution is being processed by the cluster. *

      *
    • *
    • *

      * FINISHING indicates that execution processing is in the final stages. *

      *
    • *
    • *

      * FINISHED indicates that the execution has completed without error. *

      *
    • *
    • *

      * FAILING indicates that the execution is failing and will not finish successfully. *

      *
    • *
    • *

      * FAILED indicates that the execution failed. *

      *
    • *
    • *

      * STOP_PENDING indicates that the cluster has received a StopNotebookExecution * request and the stop is pending. *

      *
    • *
    • *

      * STOPPING indicates that the cluster is in the process of stopping the execution as a result * of a StopNotebookExecution request. *

      *
    • *
    • *

      * STOPPED indicates that the execution stopped because of a StopNotebookExecution * request. *

      *
    • * @see NotebookExecutionStatus */ public final String statusAsString() { return status; } /** *

      * The timestamp when notebook execution started. *

      * * @return The timestamp when notebook execution started. */ public final Instant startTime() { return startTime; } /** *

      * The timestamp when notebook execution ended. *

      * * @return The timestamp when notebook execution ended. */ public final Instant endTime() { return endTime; } /** *

      * The Amazon Resource Name (ARN) of the notebook execution. *

      * * @return The Amazon Resource Name (ARN) of the notebook execution. */ public final String arn() { return arn; } /** *

      * The location of the notebook execution's output file in Amazon S3. *

      * * @return The location of the notebook execution's output file in Amazon S3. */ public final String outputNotebookURI() { return outputNotebookURI; } /** *

      * The reason for the latest status change of the notebook execution. *

      * * @return The reason for the latest status change of the notebook execution. */ public final String lastStateChangeReason() { return lastStateChangeReason; } /** *

      * The unique identifier of the Amazon EC2 security group associated with the Amazon EMR Notebook instance. For more * information see Specifying Amazon EC2 Security Groups for Amazon EMR Notebooks in the Amazon EMR Management Guide. *

      * * @return The unique identifier of the Amazon EC2 security group associated with the Amazon EMR Notebook instance. * For more information see Specifying Amazon EC2 Security Groups for Amazon EMR Notebooks in the Amazon EMR Management * Guide. */ 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 that stores the notebook execution input. *

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

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

      * * @return The Amazon S3 location for the notebook execution output. */ public final OutputNotebookS3LocationForOutput 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 + Objects.hashCode(notebookExecutionId()); hashCode = 31 * hashCode + Objects.hashCode(editorId()); hashCode = 31 * hashCode + Objects.hashCode(executionEngine()); hashCode = 31 * hashCode + Objects.hashCode(notebookExecutionName()); hashCode = 31 * hashCode + Objects.hashCode(notebookParams()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(outputNotebookURI()); hashCode = 31 * hashCode + Objects.hashCode(lastStateChangeReason()); 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 equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof NotebookExecution)) { return false; } NotebookExecution other = (NotebookExecution) obj; return Objects.equals(notebookExecutionId(), other.notebookExecutionId()) && Objects.equals(editorId(), other.editorId()) && Objects.equals(executionEngine(), other.executionEngine()) && Objects.equals(notebookExecutionName(), other.notebookExecutionName()) && Objects.equals(notebookParams(), other.notebookParams()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime()) && Objects.equals(arn(), other.arn()) && Objects.equals(outputNotebookURI(), other.outputNotebookURI()) && Objects.equals(lastStateChangeReason(), other.lastStateChangeReason()) && 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("NotebookExecution").add("NotebookExecutionId", notebookExecutionId()) .add("EditorId", editorId()).add("ExecutionEngine", executionEngine()) .add("NotebookExecutionName", notebookExecutionName()).add("NotebookParams", notebookParams()) .add("Status", statusAsString()).add("StartTime", startTime()).add("EndTime", endTime()).add("Arn", arn()) .add("OutputNotebookURI", outputNotebookURI()).add("LastStateChangeReason", lastStateChangeReason()) .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 "NotebookExecutionId": return Optional.ofNullable(clazz.cast(notebookExecutionId())); case "EditorId": return Optional.ofNullable(clazz.cast(editorId())); case "ExecutionEngine": return Optional.ofNullable(clazz.cast(executionEngine())); case "NotebookExecutionName": return Optional.ofNullable(clazz.cast(notebookExecutionName())); case "NotebookParams": return Optional.ofNullable(clazz.cast(notebookParams())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); case "Arn": return Optional.ofNullable(clazz.cast(arn())); case "OutputNotebookURI": return Optional.ofNullable(clazz.cast(outputNotebookURI())); case "LastStateChangeReason": return Optional.ofNullable(clazz.cast(lastStateChangeReason())); 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((NotebookExecution) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The unique identifier of a notebook execution. *

      * * @param notebookExecutionId * The unique identifier of a notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notebookExecutionId(String notebookExecutionId); /** *

      * The unique identifier of the Amazon EMR Notebook that is used for the notebook execution. *

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

      * The execution engine, such as an Amazon EMR cluster, used to run the Amazon EMR notebook and perform the * notebook execution. *

      * * @param executionEngine * The execution engine, such as an Amazon EMR cluster, used to run the Amazon EMR notebook and perform * the notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder executionEngine(ExecutionEngineConfig executionEngine); /** *

      * The execution engine, such as an Amazon EMR cluster, used to run the Amazon EMR notebook and perform 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()); } /** *

      * A name for the notebook execution. *

      * * @param notebookExecutionName * A 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); /** *

      * The status of the notebook execution. *

      *
        *
      • *

        * START_PENDING indicates that the cluster has received the execution request but execution has * not begun. *

        *
      • *
      • *

        * STARTING indicates that the execution is starting on the cluster. *

        *
      • *
      • *

        * RUNNING indicates that the execution is being processed by the cluster. *

        *
      • *
      • *

        * FINISHING indicates that execution processing is in the final stages. *

        *
      • *
      • *

        * FINISHED indicates that the execution has completed without error. *

        *
      • *
      • *

        * FAILING indicates that the execution is failing and will not finish successfully. *

        *
      • *
      • *

        * FAILED indicates that the execution failed. *

        *
      • *
      • *

        * STOP_PENDING indicates that the cluster has received a StopNotebookExecution * request and the stop is pending. *

        *
      • *
      • *

        * STOPPING indicates that the cluster is in the process of stopping the execution as a result of a * StopNotebookExecution request. *

        *
      • *
      • *

        * STOPPED indicates that the execution stopped because of a StopNotebookExecution * request. *

        *
      • *
      * * @param status * The status of the notebook execution.

      *
        *
      • *

        * START_PENDING indicates that the cluster has received the execution request but execution * has not begun. *

        *
      • *
      • *

        * STARTING indicates that the execution is starting on the cluster. *

        *
      • *
      • *

        * RUNNING indicates that the execution is being processed by the cluster. *

        *
      • *
      • *

        * FINISHING indicates that execution processing is in the final stages. *

        *
      • *
      • *

        * FINISHED indicates that the execution has completed without error. *

        *
      • *
      • *

        * FAILING indicates that the execution is failing and will not finish successfully. *

        *
      • *
      • *

        * FAILED indicates that the execution failed. *

        *
      • *
      • *

        * STOP_PENDING indicates that the cluster has received a StopNotebookExecution * request and the stop is pending. *

        *
      • *
      • *

        * STOPPING indicates that the cluster is in the process of stopping the execution as a * result of a StopNotebookExecution request. *

        *
      • *
      • *

        * STOPPED indicates that the execution stopped because of a * StopNotebookExecution request. *

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

        * The status of the notebook execution. *

        *
          *
        • *

          * START_PENDING indicates that the cluster has received the execution request but execution has * not begun. *

          *
        • *
        • *

          * STARTING indicates that the execution is starting on the cluster. *

          *
        • *
        • *

          * RUNNING indicates that the execution is being processed by the cluster. *

          *
        • *
        • *

          * FINISHING indicates that execution processing is in the final stages. *

          *
        • *
        • *

          * FINISHED indicates that the execution has completed without error. *

          *
        • *
        • *

          * FAILING indicates that the execution is failing and will not finish successfully. *

          *
        • *
        • *

          * FAILED indicates that the execution failed. *

          *
        • *
        • *

          * STOP_PENDING indicates that the cluster has received a StopNotebookExecution * request and the stop is pending. *

          *
        • *
        • *

          * STOPPING indicates that the cluster is in the process of stopping the execution as a result of a * StopNotebookExecution request. *

          *
        • *
        • *

          * STOPPED indicates that the execution stopped because of a StopNotebookExecution * request. *

          *
        • *
        * * @param status * The status of the notebook execution.

        *
          *
        • *

          * START_PENDING indicates that the cluster has received the execution request but execution * has not begun. *

          *
        • *
        • *

          * STARTING indicates that the execution is starting on the cluster. *

          *
        • *
        • *

          * RUNNING indicates that the execution is being processed by the cluster. *

          *
        • *
        • *

          * FINISHING indicates that execution processing is in the final stages. *

          *
        • *
        • *

          * FINISHED indicates that the execution has completed without error. *

          *
        • *
        • *

          * FAILING indicates that the execution is failing and will not finish successfully. *

          *
        • *
        • *

          * FAILED indicates that the execution failed. *

          *
        • *
        • *

          * STOP_PENDING indicates that the cluster has received a StopNotebookExecution * request and the stop is pending. *

          *
        • *
        • *

          * STOPPING indicates that the cluster is in the process of stopping the execution as a * result of a StopNotebookExecution request. *

          *
        • *
        • *

          * STOPPED indicates that the execution stopped because of a * StopNotebookExecution request. *

          *
        • * @see NotebookExecutionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see NotebookExecutionStatus */ Builder status(NotebookExecutionStatus status); /** *

          * The timestamp when notebook execution started. *

          * * @param startTime * The timestamp when notebook execution started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

          * The timestamp when notebook execution ended. *

          * * @param endTime * The timestamp when notebook execution ended. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

          * The Amazon Resource Name (ARN) of the notebook execution. *

          * * @param arn * The Amazon Resource Name (ARN) of the notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

          * The location of the notebook execution's output file in Amazon S3. *

          * * @param outputNotebookURI * The location of the notebook execution's output file in Amazon S3. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputNotebookURI(String outputNotebookURI); /** *

          * The reason for the latest status change of the notebook execution. *

          * * @param lastStateChangeReason * The reason for the latest status change of the notebook execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastStateChangeReason(String lastStateChangeReason); /** *

          * The unique identifier of the Amazon EC2 security group associated with the Amazon EMR Notebook instance. For * more information see Specifying Amazon EC2 Security Groups for Amazon EMR Notebooks in the Amazon EMR Management * Guide. *

          * * @param notebookInstanceSecurityGroupId * The unique identifier of the Amazon EC2 security group associated with the Amazon EMR Notebook * instance. For more information see Specifying Amazon EC2 Security Groups for Amazon EMR Notebooks in the Amazon EMR Management * Guide. * @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 that stores the notebook execution input. *

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

          * The Amazon S3 location that stores the notebook execution input. *

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

          * When the {@link Consumer} completes, {@link NotebookS3LocationForOutput.Builder#build()} is called * immediately and its result is passed to {@link #notebookS3Location(NotebookS3LocationForOutput)}. * * @param notebookS3Location * a consumer that will call methods on {@link NotebookS3LocationForOutput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #notebookS3Location(NotebookS3LocationForOutput) */ default Builder notebookS3Location(Consumer notebookS3Location) { return notebookS3Location(NotebookS3LocationForOutput.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(OutputNotebookS3LocationForOutput outputNotebookS3Location); /** *

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

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

          * When the {@link Consumer} completes, {@link OutputNotebookS3LocationForOutput.Builder#build()} is called * immediately and its result is passed to {@link #outputNotebookS3Location(OutputNotebookS3LocationForOutput)}. * * @param outputNotebookS3Location * a consumer that will call methods on {@link OutputNotebookS3LocationForOutput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputNotebookS3Location(OutputNotebookS3LocationForOutput) */ default Builder outputNotebookS3Location(Consumer outputNotebookS3Location) { return outputNotebookS3Location(OutputNotebookS3LocationForOutput.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); } static final class BuilderImpl implements Builder { private String notebookExecutionId; private String editorId; private ExecutionEngineConfig executionEngine; private String notebookExecutionName; private String notebookParams; private String status; private Instant startTime; private Instant endTime; private String arn; private String outputNotebookURI; private String lastStateChangeReason; private String notebookInstanceSecurityGroupId; private List tags = DefaultSdkAutoConstructList.getInstance(); private NotebookS3LocationForOutput notebookS3Location; private OutputNotebookS3LocationForOutput outputNotebookS3Location; private String outputNotebookFormat; private Map environmentVariables = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(NotebookExecution model) { notebookExecutionId(model.notebookExecutionId); editorId(model.editorId); executionEngine(model.executionEngine); notebookExecutionName(model.notebookExecutionName); notebookParams(model.notebookParams); status(model.status); startTime(model.startTime); endTime(model.endTime); arn(model.arn); outputNotebookURI(model.outputNotebookURI); lastStateChangeReason(model.lastStateChangeReason); notebookInstanceSecurityGroupId(model.notebookInstanceSecurityGroupId); tags(model.tags); notebookS3Location(model.notebookS3Location); outputNotebookS3Location(model.outputNotebookS3Location); outputNotebookFormat(model.outputNotebookFormat); environmentVariables(model.environmentVariables); } public final String getNotebookExecutionId() { return notebookExecutionId; } public final void setNotebookExecutionId(String notebookExecutionId) { this.notebookExecutionId = notebookExecutionId; } @Override public final Builder notebookExecutionId(String notebookExecutionId) { this.notebookExecutionId = notebookExecutionId; return this; } 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 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 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 String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(NotebookExecutionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getOutputNotebookURI() { return outputNotebookURI; } public final void setOutputNotebookURI(String outputNotebookURI) { this.outputNotebookURI = outputNotebookURI; } @Override public final Builder outputNotebookURI(String outputNotebookURI) { this.outputNotebookURI = outputNotebookURI; return this; } public final String getLastStateChangeReason() { return lastStateChangeReason; } public final void setLastStateChangeReason(String lastStateChangeReason) { this.lastStateChangeReason = lastStateChangeReason; } @Override public final Builder lastStateChangeReason(String lastStateChangeReason) { this.lastStateChangeReason = lastStateChangeReason; 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 NotebookS3LocationForOutput.Builder getNotebookS3Location() { return notebookS3Location != null ? notebookS3Location.toBuilder() : null; } public final void setNotebookS3Location(NotebookS3LocationForOutput.BuilderImpl notebookS3Location) { this.notebookS3Location = notebookS3Location != null ? notebookS3Location.build() : null; } @Override public final Builder notebookS3Location(NotebookS3LocationForOutput notebookS3Location) { this.notebookS3Location = notebookS3Location; return this; } public final OutputNotebookS3LocationForOutput.Builder getOutputNotebookS3Location() { return outputNotebookS3Location != null ? outputNotebookS3Location.toBuilder() : null; } public final void setOutputNotebookS3Location(OutputNotebookS3LocationForOutput.BuilderImpl outputNotebookS3Location) { this.outputNotebookS3Location = outputNotebookS3Location != null ? outputNotebookS3Location.build() : null; } @Override public final Builder outputNotebookS3Location(OutputNotebookS3LocationForOutput 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 NotebookExecution build() { return new NotebookExecution(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy