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

software.amazon.awssdk.services.elasticsearch.model.DomainEndpointOptions 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.elasticsearch.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;

/**
 * 

* Options to configure endpoint for the Elasticsearch domain. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DomainEndpointOptions implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ENFORCE_HTTPS_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .getter(getter(DomainEndpointOptions::enforceHTTPS)).setter(setter(Builder::enforceHTTPS)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnforceHTTPS").build()).build(); private static final SdkField TLS_SECURITY_POLICY_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(DomainEndpointOptions::tlsSecurityPolicyAsString)).setter(setter(Builder::tlsSecurityPolicy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TLSSecurityPolicy").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENFORCE_HTTPS_FIELD, TLS_SECURITY_POLICY_FIELD)); private static final long serialVersionUID = 1L; private final Boolean enforceHTTPS; private final String tlsSecurityPolicy; private DomainEndpointOptions(BuilderImpl builder) { this.enforceHTTPS = builder.enforceHTTPS; this.tlsSecurityPolicy = builder.tlsSecurityPolicy; } /** *

* Specify if only HTTPS endpoint should be enabled for the Elasticsearch domain. *

* * @return Specify if only HTTPS endpoint should be enabled for the Elasticsearch domain. */ public Boolean enforceHTTPS() { return enforceHTTPS; } /** *

* Specify the TLS security policy that needs to be applied to the HTTPS endpoint of Elasticsearch domain.
* It can be one of the following values: *

    *
  • Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 and higher.
  • *
  • Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2
  • *
*

*

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

* * @return Specify the TLS security policy that needs to be applied to the HTTPS endpoint of Elasticsearch domain.
* It can be one of the following values: *
    *
  • Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 and higher.
  • *
  • Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2
  • *
* @see TLSSecurityPolicy */ public TLSSecurityPolicy tlsSecurityPolicy() { return TLSSecurityPolicy.fromValue(tlsSecurityPolicy); } /** *

* Specify the TLS security policy that needs to be applied to the HTTPS endpoint of Elasticsearch domain.
* It can be one of the following values: *

    *
  • Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 and higher.
  • *
  • Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2
  • *
*

*

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

* * @return Specify the TLS security policy that needs to be applied to the HTTPS endpoint of Elasticsearch domain.
* It can be one of the following values: *
    *
  • Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 and higher.
  • *
  • Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2
  • *
* @see TLSSecurityPolicy */ public String tlsSecurityPolicyAsString() { return tlsSecurityPolicy; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(enforceHTTPS()); hashCode = 31 * hashCode + Objects.hashCode(tlsSecurityPolicyAsString()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DomainEndpointOptions)) { return false; } DomainEndpointOptions other = (DomainEndpointOptions) obj; return Objects.equals(enforceHTTPS(), other.enforceHTTPS()) && Objects.equals(tlsSecurityPolicyAsString(), other.tlsSecurityPolicyAsString()); } /** * 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 String toString() { return ToString.builder("DomainEndpointOptions").add("EnforceHTTPS", enforceHTTPS()) .add("TLSSecurityPolicy", tlsSecurityPolicyAsString()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "EnforceHTTPS": return Optional.ofNullable(clazz.cast(enforceHTTPS())); case "TLSSecurityPolicy": return Optional.ofNullable(clazz.cast(tlsSecurityPolicyAsString())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DomainEndpointOptions) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Specify if only HTTPS endpoint should be enabled for the Elasticsearch domain. *

* * @param enforceHTTPS * Specify if only HTTPS endpoint should be enabled for the Elasticsearch domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enforceHTTPS(Boolean enforceHTTPS); /** *

* Specify the TLS security policy that needs to be applied to the HTTPS endpoint of Elasticsearch domain.
* It can be one of the following values: *

    *
  • Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 and higher.
  • *
  • Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2
  • *
*

* * @param tlsSecurityPolicy * Specify the TLS security policy that needs to be applied to the HTTPS endpoint of Elasticsearch * domain.
* It can be one of the following values: *
    *
  • Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 and higher.
  • *
  • Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2
  • *
* @see TLSSecurityPolicy * @return Returns a reference to this object so that method calls can be chained together. * @see TLSSecurityPolicy */ Builder tlsSecurityPolicy(String tlsSecurityPolicy); /** *

* Specify the TLS security policy that needs to be applied to the HTTPS endpoint of Elasticsearch domain.
* It can be one of the following values: *

    *
  • Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 and higher.
  • *
  • Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2
  • *
*

* * @param tlsSecurityPolicy * Specify the TLS security policy that needs to be applied to the HTTPS endpoint of Elasticsearch * domain.
* It can be one of the following values: *
    *
  • Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 and higher.
  • *
  • Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only TLSv1.2
  • *
* @see TLSSecurityPolicy * @return Returns a reference to this object so that method calls can be chained together. * @see TLSSecurityPolicy */ Builder tlsSecurityPolicy(TLSSecurityPolicy tlsSecurityPolicy); } static final class BuilderImpl implements Builder { private Boolean enforceHTTPS; private String tlsSecurityPolicy; private BuilderImpl() { } private BuilderImpl(DomainEndpointOptions model) { enforceHTTPS(model.enforceHTTPS); tlsSecurityPolicy(model.tlsSecurityPolicy); } public final Boolean getEnforceHTTPS() { return enforceHTTPS; } @Override public final Builder enforceHTTPS(Boolean enforceHTTPS) { this.enforceHTTPS = enforceHTTPS; return this; } public final void setEnforceHTTPS(Boolean enforceHTTPS) { this.enforceHTTPS = enforceHTTPS; } public final String getTlsSecurityPolicy() { return tlsSecurityPolicy; } @Override public final Builder tlsSecurityPolicy(String tlsSecurityPolicy) { this.tlsSecurityPolicy = tlsSecurityPolicy; return this; } @Override public final Builder tlsSecurityPolicy(TLSSecurityPolicy tlsSecurityPolicy) { this.tlsSecurityPolicy(tlsSecurityPolicy == null ? null : tlsSecurityPolicy.toString()); return this; } public final void setTlsSecurityPolicy(String tlsSecurityPolicy) { this.tlsSecurityPolicy = tlsSecurityPolicy; } @Override public DomainEndpointOptions build() { return new DomainEndpointOptions(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy