software.amazon.awssdk.services.opensearch.model.AdvancedSecurityOptionsInput Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opensearch Show documentation
Show all versions of opensearch Show documentation
The AWS Java SDK for Open Search module holds the client classes that are used for
communicating with Open Search.
/*
* 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.opensearch.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.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;
/**
*
* Options for enabling and configuring fine-grained access control. For more information, see Fine-grained access control in
* Amazon OpenSearch Service.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AdvancedSecurityOptionsInput implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("Enabled").getter(getter(AdvancedSecurityOptionsInput::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(AdvancedSecurityOptionsInput::internalUserDatabaseEnabled))
.setter(setter(Builder::internalUserDatabaseEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InternalUserDatabaseEnabled")
.build()).build();
private static final SdkField MASTER_USER_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("MasterUserOptions")
.getter(getter(AdvancedSecurityOptionsInput::masterUserOptions)).setter(setter(Builder::masterUserOptions))
.constructor(MasterUserOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MasterUserOptions").build()).build();
private static final SdkField SAML_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SAMLOptions")
.getter(getter(AdvancedSecurityOptionsInput::samlOptions)).setter(setter(Builder::samlOptions))
.constructor(SAMLOptionsInput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SAMLOptions").build()).build();
private static final SdkField ANONYMOUS_AUTH_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AnonymousAuthEnabled").getter(getter(AdvancedSecurityOptionsInput::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, MASTER_USER_OPTIONS_FIELD, SAML_OPTIONS_FIELD, ANONYMOUS_AUTH_ENABLED_FIELD));
private static final long serialVersionUID = 1L;
private final Boolean enabled;
private final Boolean internalUserDatabaseEnabled;
private final MasterUserOptions masterUserOptions;
private final SAMLOptionsInput samlOptions;
private final Boolean anonymousAuthEnabled;
private AdvancedSecurityOptionsInput(BuilderImpl builder) {
this.enabled = builder.enabled;
this.internalUserDatabaseEnabled = builder.internalUserDatabaseEnabled;
this.masterUserOptions = builder.masterUserOptions;
this.samlOptions = builder.samlOptions;
this.anonymousAuthEnabled = builder.anonymousAuthEnabled;
}
/**
*
* True to enable fine-grained access control.
*
*
* @return True to enable fine-grained access control.
*/
public final Boolean enabled() {
return enabled;
}
/**
*
* True to enable the internal user database.
*
*
* @return True to enable the internal user database.
*/
public final Boolean internalUserDatabaseEnabled() {
return internalUserDatabaseEnabled;
}
/**
*
* Container for information about the master user.
*
*
* @return Container for information about the master user.
*/
public final MasterUserOptions masterUserOptions() {
return masterUserOptions;
}
/**
*
* Container for information about the SAML configuration for OpenSearch Dashboards.
*
*
* @return Container for information about the SAML configuration for OpenSearch Dashboards.
*/
public final SAMLOptionsInput samlOptions() {
return samlOptions;
}
/**
*
* True to enable a 30-day migration period during which administrators can create role mappings. Only necessary
* when enabling fine-grained access control on an existing domain.
*
*
* @return True to enable a 30-day migration period during which administrators can create role mappings. Only
* necessary when enabling fine-grained access control on an existing domain.
*/
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(masterUserOptions());
hashCode = 31 * hashCode + Objects.hashCode(samlOptions());
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 AdvancedSecurityOptionsInput)) {
return false;
}
AdvancedSecurityOptionsInput other = (AdvancedSecurityOptionsInput) obj;
return Objects.equals(enabled(), other.enabled())
&& Objects.equals(internalUserDatabaseEnabled(), other.internalUserDatabaseEnabled())
&& Objects.equals(masterUserOptions(), other.masterUserOptions())
&& Objects.equals(samlOptions(), other.samlOptions())
&& 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("AdvancedSecurityOptionsInput").add("Enabled", enabled())
.add("InternalUserDatabaseEnabled", internalUserDatabaseEnabled()).add("MasterUserOptions", masterUserOptions())
.add("SAMLOptions", samlOptions()).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 "MasterUserOptions":
return Optional.ofNullable(clazz.cast(masterUserOptions()));
case "SAMLOptions":
return Optional.ofNullable(clazz.cast(samlOptions()));
case "AnonymousAuthEnabled":
return Optional.ofNullable(clazz.cast(anonymousAuthEnabled()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy