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

software.amazon.awssdk.services.athena.model.EngineVersion Maven / Gradle / Ivy

/*
 * 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.athena.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The Athena engine version for running queries, or the PySpark engine version for running sessions. *

*/ @Generated("software.amazon.awssdk:codegen") public final class EngineVersion implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField SELECTED_ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SelectedEngineVersion").getter(getter(EngineVersion::selectedEngineVersion)) .setter(setter(Builder::selectedEngineVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SelectedEngineVersion").build()) .build(); private static final SdkField EFFECTIVE_ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EffectiveEngineVersion").getter(getter(EngineVersion::effectiveEngineVersion)) .setter(setter(Builder::effectiveEngineVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EffectiveEngineVersion").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SELECTED_ENGINE_VERSION_FIELD, EFFECTIVE_ENGINE_VERSION_FIELD)); private static final long serialVersionUID = 1L; private final String selectedEngineVersion; private final String effectiveEngineVersion; private EngineVersion(BuilderImpl builder) { this.selectedEngineVersion = builder.selectedEngineVersion; this.effectiveEngineVersion = builder.effectiveEngineVersion; } /** *

* The engine version requested by the user. Possible values are determined by the output of * ListEngineVersions, including AUTO. The default is AUTO. *

* * @return The engine version requested by the user. Possible values are determined by the output of * ListEngineVersions, including AUTO. The default is AUTO. */ public final String selectedEngineVersion() { return selectedEngineVersion; } /** *

* Read only. The engine version on which the query runs. If the user requests a valid engine version other than * Auto, the effective engine version is the same as the engine version that the user requested. If the user * requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version is * made by a CreateWorkGroup or UpdateWorkGroup operation, the * EffectiveEngineVersion field is ignored. *

* * @return Read only. The engine version on which the query runs. If the user requests a valid engine version other * than Auto, the effective engine version is the same as the engine version that the user requested. If the * user requests Auto, the effective engine version is chosen by Athena. When a request to update the engine * version is made by a CreateWorkGroup or UpdateWorkGroup operation, the * EffectiveEngineVersion field is ignored. */ public final String effectiveEngineVersion() { return effectiveEngineVersion; } @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(selectedEngineVersion()); hashCode = 31 * hashCode + Objects.hashCode(effectiveEngineVersion()); 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 EngineVersion)) { return false; } EngineVersion other = (EngineVersion) obj; return Objects.equals(selectedEngineVersion(), other.selectedEngineVersion()) && Objects.equals(effectiveEngineVersion(), other.effectiveEngineVersion()); } /** * 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("EngineVersion").add("SelectedEngineVersion", selectedEngineVersion()) .add("EffectiveEngineVersion", effectiveEngineVersion()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "SelectedEngineVersion": return Optional.ofNullable(clazz.cast(selectedEngineVersion())); case "EffectiveEngineVersion": return Optional.ofNullable(clazz.cast(effectiveEngineVersion())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((EngineVersion) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The engine version requested by the user. Possible values are determined by the output of * ListEngineVersions, including AUTO. The default is AUTO. *

* * @param selectedEngineVersion * The engine version requested by the user. Possible values are determined by the output of * ListEngineVersions, including AUTO. The default is AUTO. * @return Returns a reference to this object so that method calls can be chained together. */ Builder selectedEngineVersion(String selectedEngineVersion); /** *

* Read only. The engine version on which the query runs. If the user requests a valid engine version other than * Auto, the effective engine version is the same as the engine version that the user requested. If the user * requests Auto, the effective engine version is chosen by Athena. When a request to update the engine version * is made by a CreateWorkGroup or UpdateWorkGroup operation, the * EffectiveEngineVersion field is ignored. *

* * @param effectiveEngineVersion * Read only. The engine version on which the query runs. If the user requests a valid engine version * other than Auto, the effective engine version is the same as the engine version that the user * requested. If the user requests Auto, the effective engine version is chosen by Athena. When a request * to update the engine version is made by a CreateWorkGroup or UpdateWorkGroup * operation, the EffectiveEngineVersion field is ignored. * @return Returns a reference to this object so that method calls can be chained together. */ Builder effectiveEngineVersion(String effectiveEngineVersion); } static final class BuilderImpl implements Builder { private String selectedEngineVersion; private String effectiveEngineVersion; private BuilderImpl() { } private BuilderImpl(EngineVersion model) { selectedEngineVersion(model.selectedEngineVersion); effectiveEngineVersion(model.effectiveEngineVersion); } public final String getSelectedEngineVersion() { return selectedEngineVersion; } public final void setSelectedEngineVersion(String selectedEngineVersion) { this.selectedEngineVersion = selectedEngineVersion; } @Override public final Builder selectedEngineVersion(String selectedEngineVersion) { this.selectedEngineVersion = selectedEngineVersion; return this; } public final String getEffectiveEngineVersion() { return effectiveEngineVersion; } public final void setEffectiveEngineVersion(String effectiveEngineVersion) { this.effectiveEngineVersion = effectiveEngineVersion; } @Override public final Builder effectiveEngineVersion(String effectiveEngineVersion) { this.effectiveEngineVersion = effectiveEngineVersion; return this; } @Override public EngineVersion build() { return new EngineVersion(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy