software.amazon.awssdk.services.elasticsearch.model.AdvancedSecurityOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch Show documentation
Show all versions of elasticsearch Show documentation
The AWS Java SDK for Amazon Elasticsearch Service module holds the client classes that are used for
communicating with Amazon Elasticsearch Service
/*
* 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.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
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 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;
/**
*
* Specifies the advanced security configuration: whether advanced security is enabled, whether the internal database
* option is enabled.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AdvancedSecurityOptions implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("Enabled").getter(getter(AdvancedSecurityOptions::enabled)).setter(setter(Builder::enabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled").build()).build();
private static final SdkField INTERNAL_USER_DATABASE_ENABLED_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("InternalUserDatabaseEnabled")
.getter(getter(AdvancedSecurityOptions::internalUserDatabaseEnabled))
.setter(setter(Builder::internalUserDatabaseEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InternalUserDatabaseEnabled")
.build()).build();
private static final SdkField SAML_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SAMLOptions")
.getter(getter(AdvancedSecurityOptions::samlOptions)).setter(setter(Builder::samlOptions))
.constructor(SAMLOptionsOutput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SAMLOptions").build()).build();
private static final SdkField ANONYMOUS_AUTH_DISABLE_DATE_FIELD = SdkField
. builder(MarshallingType.INSTANT).memberName("AnonymousAuthDisableDate")
.getter(getter(AdvancedSecurityOptions::anonymousAuthDisableDate)).setter(setter(Builder::anonymousAuthDisableDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnonymousAuthDisableDate").build())
.build();
private static final SdkField ANONYMOUS_AUTH_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AnonymousAuthEnabled").getter(getter(AdvancedSecurityOptions::anonymousAuthEnabled))
.setter(setter(Builder::anonymousAuthEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnonymousAuthEnabled").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENABLED_FIELD,
INTERNAL_USER_DATABASE_ENABLED_FIELD, SAML_OPTIONS_FIELD, ANONYMOUS_AUTH_DISABLE_DATE_FIELD,
ANONYMOUS_AUTH_ENABLED_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final Boolean enabled;
private final Boolean internalUserDatabaseEnabled;
private final SAMLOptionsOutput samlOptions;
private final Instant anonymousAuthDisableDate;
private final Boolean anonymousAuthEnabled;
private AdvancedSecurityOptions(BuilderImpl builder) {
this.enabled = builder.enabled;
this.internalUserDatabaseEnabled = builder.internalUserDatabaseEnabled;
this.samlOptions = builder.samlOptions;
this.anonymousAuthDisableDate = builder.anonymousAuthDisableDate;
this.anonymousAuthEnabled = builder.anonymousAuthEnabled;
}
/**
*
* True if advanced security is enabled.
*
*
* @return True if advanced security is enabled.
*/
public final Boolean enabled() {
return enabled;
}
/**
*
* True if the internal user database is enabled.
*
*
* @return True if the internal user database is enabled.
*/
public final Boolean internalUserDatabaseEnabled() {
return internalUserDatabaseEnabled;
}
/**
*
* Describes the SAML application configured for a domain.
*
*
* @return Describes the SAML application configured for a domain.
*/
public final SAMLOptionsOutput samlOptions() {
return samlOptions;
}
/**
*
* Specifies the Anonymous Auth Disable Date when Anonymous Auth is enabled.
*
*
* @return Specifies the Anonymous Auth Disable Date when Anonymous Auth is enabled.
*/
public final Instant anonymousAuthDisableDate() {
return anonymousAuthDisableDate;
}
/**
*
* True if Anonymous auth is enabled. Anonymous auth can be enabled only when AdvancedSecurity is enabled on
* existing domains.
*
*
* @return True if Anonymous auth is enabled. Anonymous auth can be enabled only when AdvancedSecurity is enabled on
* existing domains.
*/
public final Boolean anonymousAuthEnabled() {
return anonymousAuthEnabled;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(enabled());
hashCode = 31 * hashCode + Objects.hashCode(internalUserDatabaseEnabled());
hashCode = 31 * hashCode + Objects.hashCode(samlOptions());
hashCode = 31 * hashCode + Objects.hashCode(anonymousAuthDisableDate());
hashCode = 31 * hashCode + Objects.hashCode(anonymousAuthEnabled());
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 AdvancedSecurityOptions)) {
return false;
}
AdvancedSecurityOptions other = (AdvancedSecurityOptions) obj;
return Objects.equals(enabled(), other.enabled())
&& Objects.equals(internalUserDatabaseEnabled(), other.internalUserDatabaseEnabled())
&& Objects.equals(samlOptions(), other.samlOptions())
&& Objects.equals(anonymousAuthDisableDate(), other.anonymousAuthDisableDate())
&& Objects.equals(anonymousAuthEnabled(), other.anonymousAuthEnabled());
}
/**
* 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("AdvancedSecurityOptions").add("Enabled", enabled())
.add("InternalUserDatabaseEnabled", internalUserDatabaseEnabled()).add("SAMLOptions", samlOptions())
.add("AnonymousAuthDisableDate", anonymousAuthDisableDate()).add("AnonymousAuthEnabled", anonymousAuthEnabled())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Enabled":
return Optional.ofNullable(clazz.cast(enabled()));
case "InternalUserDatabaseEnabled":
return Optional.ofNullable(clazz.cast(internalUserDatabaseEnabled()));
case "SAMLOptions":
return Optional.ofNullable(clazz.cast(samlOptions()));
case "AnonymousAuthDisableDate":
return Optional.ofNullable(clazz.cast(anonymousAuthDisableDate()));
case "AnonymousAuthEnabled":
return Optional.ofNullable(clazz.cast(anonymousAuthEnabled()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("Enabled", ENABLED_FIELD);
map.put("InternalUserDatabaseEnabled", INTERNAL_USER_DATABASE_ENABLED_FIELD);
map.put("SAMLOptions", SAML_OPTIONS_FIELD);
map.put("AnonymousAuthDisableDate", ANONYMOUS_AUTH_DISABLE_DATE_FIELD);
map.put("AnonymousAuthEnabled", ANONYMOUS_AUTH_ENABLED_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy