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

software.amazon.awssdk.services.opensearch.model.AdvancedSecurityOptionsInput Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Open Search module holds the client classes that are used for communicating with Open Search.

There is a newer version: 2.29.39
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.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 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 getter(Function g) { return obj -> g.apply((AdvancedSecurityOptionsInput) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* True to enable fine-grained access control. *

* * @param enabled * True to enable fine-grained access control. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enabled(Boolean enabled); /** *

* True to enable the internal user database. *

* * @param internalUserDatabaseEnabled * True to enable the internal user database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder internalUserDatabaseEnabled(Boolean internalUserDatabaseEnabled); /** *

* Container for information about the master user. *

* * @param masterUserOptions * Container for information about the master user. * @return Returns a reference to this object so that method calls can be chained together. */ Builder masterUserOptions(MasterUserOptions masterUserOptions); /** *

* Container for information about the master user. *

* This is a convenience method that creates an instance of the {@link MasterUserOptions.Builder} avoiding the * need to create one manually via {@link MasterUserOptions#builder()}. * *

* When the {@link Consumer} completes, {@link MasterUserOptions.Builder#build()} is called immediately and its * result is passed to {@link #masterUserOptions(MasterUserOptions)}. * * @param masterUserOptions * a consumer that will call methods on {@link MasterUserOptions.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #masterUserOptions(MasterUserOptions) */ default Builder masterUserOptions(Consumer masterUserOptions) { return masterUserOptions(MasterUserOptions.builder().applyMutation(masterUserOptions).build()); } /** *

* Container for information about the SAML configuration for OpenSearch Dashboards. *

* * @param samlOptions * Container for information about the SAML configuration for OpenSearch Dashboards. * @return Returns a reference to this object so that method calls can be chained together. */ Builder samlOptions(SAMLOptionsInput samlOptions); /** *

* Container for information about the SAML configuration for OpenSearch Dashboards. *

* This is a convenience method that creates an instance of the {@link SAMLOptionsInput.Builder} avoiding the * need to create one manually via {@link SAMLOptionsInput#builder()}. * *

* When the {@link Consumer} completes, {@link SAMLOptionsInput.Builder#build()} is called immediately and its * result is passed to {@link #samlOptions(SAMLOptionsInput)}. * * @param samlOptions * a consumer that will call methods on {@link SAMLOptionsInput.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #samlOptions(SAMLOptionsInput) */ default Builder samlOptions(Consumer samlOptions) { return samlOptions(SAMLOptionsInput.builder().applyMutation(samlOptions).build()); } /** *

* 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. *

* * @param anonymousAuthEnabled * 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 Returns a reference to this object so that method calls can be chained together. */ Builder anonymousAuthEnabled(Boolean anonymousAuthEnabled); } static final class BuilderImpl implements Builder { private Boolean enabled; private Boolean internalUserDatabaseEnabled; private MasterUserOptions masterUserOptions; private SAMLOptionsInput samlOptions; private Boolean anonymousAuthEnabled; private BuilderImpl() { } private BuilderImpl(AdvancedSecurityOptionsInput model) { enabled(model.enabled); internalUserDatabaseEnabled(model.internalUserDatabaseEnabled); masterUserOptions(model.masterUserOptions); samlOptions(model.samlOptions); anonymousAuthEnabled(model.anonymousAuthEnabled); } public final Boolean getEnabled() { return enabled; } public final void setEnabled(Boolean enabled) { this.enabled = enabled; } @Override public final Builder enabled(Boolean enabled) { this.enabled = enabled; return this; } public final Boolean getInternalUserDatabaseEnabled() { return internalUserDatabaseEnabled; } public final void setInternalUserDatabaseEnabled(Boolean internalUserDatabaseEnabled) { this.internalUserDatabaseEnabled = internalUserDatabaseEnabled; } @Override public final Builder internalUserDatabaseEnabled(Boolean internalUserDatabaseEnabled) { this.internalUserDatabaseEnabled = internalUserDatabaseEnabled; return this; } public final MasterUserOptions.Builder getMasterUserOptions() { return masterUserOptions != null ? masterUserOptions.toBuilder() : null; } public final void setMasterUserOptions(MasterUserOptions.BuilderImpl masterUserOptions) { this.masterUserOptions = masterUserOptions != null ? masterUserOptions.build() : null; } @Override public final Builder masterUserOptions(MasterUserOptions masterUserOptions) { this.masterUserOptions = masterUserOptions; return this; } public final SAMLOptionsInput.Builder getSamlOptions() { return samlOptions != null ? samlOptions.toBuilder() : null; } public final void setSamlOptions(SAMLOptionsInput.BuilderImpl samlOptions) { this.samlOptions = samlOptions != null ? samlOptions.build() : null; } @Override public final Builder samlOptions(SAMLOptionsInput samlOptions) { this.samlOptions = samlOptions; return this; } public final Boolean getAnonymousAuthEnabled() { return anonymousAuthEnabled; } public final void setAnonymousAuthEnabled(Boolean anonymousAuthEnabled) { this.anonymousAuthEnabled = anonymousAuthEnabled; } @Override public final Builder anonymousAuthEnabled(Boolean anonymousAuthEnabled) { this.anonymousAuthEnabled = anonymousAuthEnabled; return this; } @Override public AdvancedSecurityOptionsInput build() { return new AdvancedSecurityOptionsInput(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy