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

software.amazon.awssdk.services.redshift.model.Parameter Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Redshift module holds the client classes that are used for communicating with Amazon Redshift 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.redshift.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;

/**
 * 

* Describes a parameter in a cluster parameter group. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Parameter implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField PARAMETER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ParameterName").getter(getter(Parameter::parameterName)).setter(setter(Builder::parameterName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterName").build()).build(); private static final SdkField PARAMETER_VALUE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ParameterValue").getter(getter(Parameter::parameterValue)).setter(setter(Builder::parameterValue)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterValue").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(Parameter::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Source") .getter(getter(Parameter::source)).setter(setter(Builder::source)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build(); private static final SdkField DATA_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DataType").getter(getter(Parameter::dataType)).setter(setter(Builder::dataType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataType").build()).build(); private static final SdkField ALLOWED_VALUES_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AllowedValues").getter(getter(Parameter::allowedValues)).setter(setter(Builder::allowedValues)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllowedValues").build()).build(); private static final SdkField APPLY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ApplyType").getter(getter(Parameter::applyTypeAsString)).setter(setter(Builder::applyType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplyType").build()).build(); private static final SdkField IS_MODIFIABLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("IsModifiable").getter(getter(Parameter::isModifiable)).setter(setter(Builder::isModifiable)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsModifiable").build()).build(); private static final SdkField MINIMUM_ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MinimumEngineVersion").getter(getter(Parameter::minimumEngineVersion)) .setter(setter(Builder::minimumEngineVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MinimumEngineVersion").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PARAMETER_NAME_FIELD, PARAMETER_VALUE_FIELD, DESCRIPTION_FIELD, SOURCE_FIELD, DATA_TYPE_FIELD, ALLOWED_VALUES_FIELD, APPLY_TYPE_FIELD, IS_MODIFIABLE_FIELD, MINIMUM_ENGINE_VERSION_FIELD)); private static final long serialVersionUID = 1L; private final String parameterName; private final String parameterValue; private final String description; private final String source; private final String dataType; private final String allowedValues; private final String applyType; private final Boolean isModifiable; private final String minimumEngineVersion; private Parameter(BuilderImpl builder) { this.parameterName = builder.parameterName; this.parameterValue = builder.parameterValue; this.description = builder.description; this.source = builder.source; this.dataType = builder.dataType; this.allowedValues = builder.allowedValues; this.applyType = builder.applyType; this.isModifiable = builder.isModifiable; this.minimumEngineVersion = builder.minimumEngineVersion; } /** *

* The name of the parameter. *

* * @return The name of the parameter. */ public final String parameterName() { return parameterName; } /** *

* The value of the parameter. If ParameterName is wlm_json_configuration, then the * maximum size of ParameterValue is 8000 characters. *

* * @return The value of the parameter. If ParameterName is wlm_json_configuration, then * the maximum size of ParameterValue is 8000 characters. */ public final String parameterValue() { return parameterValue; } /** *

* A description of the parameter. *

* * @return A description of the parameter. */ public final String description() { return description; } /** *

* The source of the parameter value, such as "engine-default" or "user". *

* * @return The source of the parameter value, such as "engine-default" or "user". */ public final String source() { return source; } /** *

* The data type of the parameter. *

* * @return The data type of the parameter. */ public final String dataType() { return dataType; } /** *

* The valid range of values for the parameter. *

* * @return The valid range of values for the parameter. */ public final String allowedValues() { return allowedValues; } /** *

* Specifies how to apply the WLM configuration parameter. Some properties can be applied dynamically, while other * properties require that any associated clusters be rebooted for the configuration changes to be applied. For more * information about parameters and parameter groups, go to Amazon Redshift * Parameter Groups in the Amazon Redshift Cluster Management Guide. *

*

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

* * @return Specifies how to apply the WLM configuration parameter. Some properties can be applied dynamically, while * other properties require that any associated clusters be rebooted for the configuration changes to be * applied. For more information about parameters and parameter groups, go to Amazon * Redshift Parameter Groups in the Amazon Redshift Cluster Management Guide. * @see ParameterApplyType */ public final ParameterApplyType applyType() { return ParameterApplyType.fromValue(applyType); } /** *

* Specifies how to apply the WLM configuration parameter. Some properties can be applied dynamically, while other * properties require that any associated clusters be rebooted for the configuration changes to be applied. For more * information about parameters and parameter groups, go to Amazon Redshift * Parameter Groups in the Amazon Redshift Cluster Management Guide. *

*

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

* * @return Specifies how to apply the WLM configuration parameter. Some properties can be applied dynamically, while * other properties require that any associated clusters be rebooted for the configuration changes to be * applied. For more information about parameters and parameter groups, go to Amazon * Redshift Parameter Groups in the Amazon Redshift Cluster Management Guide. * @see ParameterApplyType */ public final String applyTypeAsString() { return applyType; } /** *

* If true, the parameter can be modified. Some parameters have security or operational implications * that prevent them from being changed. *

* * @return If true, the parameter can be modified. Some parameters have security or operational * implications that prevent them from being changed. */ public final Boolean isModifiable() { return isModifiable; } /** *

* The earliest engine version to which the parameter can apply. *

* * @return The earliest engine version to which the parameter can apply. */ public final String minimumEngineVersion() { return minimumEngineVersion; } @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(parameterName()); hashCode = 31 * hashCode + Objects.hashCode(parameterValue()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(source()); hashCode = 31 * hashCode + Objects.hashCode(dataType()); hashCode = 31 * hashCode + Objects.hashCode(allowedValues()); hashCode = 31 * hashCode + Objects.hashCode(applyTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(isModifiable()); hashCode = 31 * hashCode + Objects.hashCode(minimumEngineVersion()); 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 Parameter)) { return false; } Parameter other = (Parameter) obj; return Objects.equals(parameterName(), other.parameterName()) && Objects.equals(parameterValue(), other.parameterValue()) && Objects.equals(description(), other.description()) && Objects.equals(source(), other.source()) && Objects.equals(dataType(), other.dataType()) && Objects.equals(allowedValues(), other.allowedValues()) && Objects.equals(applyTypeAsString(), other.applyTypeAsString()) && Objects.equals(isModifiable(), other.isModifiable()) && Objects.equals(minimumEngineVersion(), other.minimumEngineVersion()); } /** * 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("Parameter").add("ParameterName", parameterName()).add("ParameterValue", parameterValue()) .add("Description", description()).add("Source", source()).add("DataType", dataType()) .add("AllowedValues", allowedValues()).add("ApplyType", applyTypeAsString()).add("IsModifiable", isModifiable()) .add("MinimumEngineVersion", minimumEngineVersion()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ParameterName": return Optional.ofNullable(clazz.cast(parameterName())); case "ParameterValue": return Optional.ofNullable(clazz.cast(parameterValue())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Source": return Optional.ofNullable(clazz.cast(source())); case "DataType": return Optional.ofNullable(clazz.cast(dataType())); case "AllowedValues": return Optional.ofNullable(clazz.cast(allowedValues())); case "ApplyType": return Optional.ofNullable(clazz.cast(applyTypeAsString())); case "IsModifiable": return Optional.ofNullable(clazz.cast(isModifiable())); case "MinimumEngineVersion": return Optional.ofNullable(clazz.cast(minimumEngineVersion())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Parameter) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the parameter. *

* * @param parameterName * The name of the parameter. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parameterName(String parameterName); /** *

* The value of the parameter. If ParameterName is wlm_json_configuration, then the * maximum size of ParameterValue is 8000 characters. *

* * @param parameterValue * The value of the parameter. If ParameterName is wlm_json_configuration, then * the maximum size of ParameterValue is 8000 characters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parameterValue(String parameterValue); /** *

* A description of the parameter. *

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

* The source of the parameter value, such as "engine-default" or "user". *

* * @param source * The source of the parameter value, such as "engine-default" or "user". * @return Returns a reference to this object so that method calls can be chained together. */ Builder source(String source); /** *

* The data type of the parameter. *

* * @param dataType * The data type of the parameter. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataType(String dataType); /** *

* The valid range of values for the parameter. *

* * @param allowedValues * The valid range of values for the parameter. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allowedValues(String allowedValues); /** *

* Specifies how to apply the WLM configuration parameter. Some properties can be applied dynamically, while * other properties require that any associated clusters be rebooted for the configuration changes to be * applied. For more information about parameters and parameter groups, go to Amazon Redshift * Parameter Groups in the Amazon Redshift Cluster Management Guide. *

* * @param applyType * Specifies how to apply the WLM configuration parameter. Some properties can be applied dynamically, * while other properties require that any associated clusters be rebooted for the configuration changes * to be applied. For more information about parameters and parameter groups, go to Amazon * Redshift Parameter Groups in the Amazon Redshift Cluster Management Guide. * @see ParameterApplyType * @return Returns a reference to this object so that method calls can be chained together. * @see ParameterApplyType */ Builder applyType(String applyType); /** *

* Specifies how to apply the WLM configuration parameter. Some properties can be applied dynamically, while * other properties require that any associated clusters be rebooted for the configuration changes to be * applied. For more information about parameters and parameter groups, go to Amazon Redshift * Parameter Groups in the Amazon Redshift Cluster Management Guide. *

* * @param applyType * Specifies how to apply the WLM configuration parameter. Some properties can be applied dynamically, * while other properties require that any associated clusters be rebooted for the configuration changes * to be applied. For more information about parameters and parameter groups, go to Amazon * Redshift Parameter Groups in the Amazon Redshift Cluster Management Guide. * @see ParameterApplyType * @return Returns a reference to this object so that method calls can be chained together. * @see ParameterApplyType */ Builder applyType(ParameterApplyType applyType); /** *

* If true, the parameter can be modified. Some parameters have security or operational * implications that prevent them from being changed. *

* * @param isModifiable * If true, the parameter can be modified. Some parameters have security or operational * implications that prevent them from being changed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isModifiable(Boolean isModifiable); /** *

* The earliest engine version to which the parameter can apply. *

* * @param minimumEngineVersion * The earliest engine version to which the parameter can apply. * @return Returns a reference to this object so that method calls can be chained together. */ Builder minimumEngineVersion(String minimumEngineVersion); } static final class BuilderImpl implements Builder { private String parameterName; private String parameterValue; private String description; private String source; private String dataType; private String allowedValues; private String applyType; private Boolean isModifiable; private String minimumEngineVersion; private BuilderImpl() { } private BuilderImpl(Parameter model) { parameterName(model.parameterName); parameterValue(model.parameterValue); description(model.description); source(model.source); dataType(model.dataType); allowedValues(model.allowedValues); applyType(model.applyType); isModifiable(model.isModifiable); minimumEngineVersion(model.minimumEngineVersion); } public final String getParameterName() { return parameterName; } public final void setParameterName(String parameterName) { this.parameterName = parameterName; } @Override public final Builder parameterName(String parameterName) { this.parameterName = parameterName; return this; } public final String getParameterValue() { return parameterValue; } public final void setParameterValue(String parameterValue) { this.parameterValue = parameterValue; } @Override public final Builder parameterValue(String parameterValue) { this.parameterValue = parameterValue; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getSource() { return source; } public final void setSource(String source) { this.source = source; } @Override public final Builder source(String source) { this.source = source; return this; } public final String getDataType() { return dataType; } public final void setDataType(String dataType) { this.dataType = dataType; } @Override public final Builder dataType(String dataType) { this.dataType = dataType; return this; } public final String getAllowedValues() { return allowedValues; } public final void setAllowedValues(String allowedValues) { this.allowedValues = allowedValues; } @Override public final Builder allowedValues(String allowedValues) { this.allowedValues = allowedValues; return this; } public final String getApplyType() { return applyType; } public final void setApplyType(String applyType) { this.applyType = applyType; } @Override public final Builder applyType(String applyType) { this.applyType = applyType; return this; } @Override public final Builder applyType(ParameterApplyType applyType) { this.applyType(applyType == null ? null : applyType.toString()); return this; } public final Boolean getIsModifiable() { return isModifiable; } public final void setIsModifiable(Boolean isModifiable) { this.isModifiable = isModifiable; } @Override public final Builder isModifiable(Boolean isModifiable) { this.isModifiable = isModifiable; return this; } public final String getMinimumEngineVersion() { return minimumEngineVersion; } public final void setMinimumEngineVersion(String minimumEngineVersion) { this.minimumEngineVersion = minimumEngineVersion; } @Override public final Builder minimumEngineVersion(String minimumEngineVersion) { this.minimumEngineVersion = minimumEngineVersion; return this; } @Override public Parameter build() { return new Parameter(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy