
software.amazon.awssdk.services.databasemigration.model.KerberosAuthenticationSettings 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.databasemigration.model;
import java.io.Serializable;
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.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 using Kerberos authentication settings for use with DMS.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class KerberosAuthenticationSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField KEY_CACHE_SECRET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KeyCacheSecretId").getter(getter(KerberosAuthenticationSettings::keyCacheSecretId))
.setter(setter(Builder::keyCacheSecretId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyCacheSecretId").build()).build();
private static final SdkField KEY_CACHE_SECRET_IAM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KeyCacheSecretIamArn").getter(getter(KerberosAuthenticationSettings::keyCacheSecretIamArn))
.setter(setter(Builder::keyCacheSecretIamArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyCacheSecretIamArn").build())
.build();
private static final SdkField KRB5_FILE_CONTENTS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Krb5FileContents").getter(getter(KerberosAuthenticationSettings::krb5FileContents))
.setter(setter(Builder::krb5FileContents))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Krb5FileContents").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(KEY_CACHE_SECRET_ID_FIELD,
KEY_CACHE_SECRET_IAM_ARN_FIELD, KRB5_FILE_CONTENTS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String keyCacheSecretId;
private final String keyCacheSecretIamArn;
private final String krb5FileContents;
private KerberosAuthenticationSettings(BuilderImpl builder) {
this.keyCacheSecretId = builder.keyCacheSecretId;
this.keyCacheSecretIamArn = builder.keyCacheSecretIamArn;
this.krb5FileContents = builder.krb5FileContents;
}
/**
*
* Specifies the secret ID of the key cache for the replication instance.
*
*
* @return Specifies the secret ID of the key cache for the replication instance.
*/
public final String keyCacheSecretId() {
return keyCacheSecretId;
}
/**
*
* Specifies the Amazon Resource Name (ARN) of the IAM role that grants Amazon Web Services DMS access to the secret
* containing key cache file for the replication instance.
*
*
* @return Specifies the Amazon Resource Name (ARN) of the IAM role that grants Amazon Web Services DMS access to
* the secret containing key cache file for the replication instance.
*/
public final String keyCacheSecretIamArn() {
return keyCacheSecretIamArn;
}
/**
*
* Specifies the ID of the secret that stores the key cache file required for kerberos authentication of the
* replication instance.
*
*
* @return Specifies the ID of the secret that stores the key cache file required for kerberos authentication of the
* replication instance.
*/
public final String krb5FileContents() {
return krb5FileContents;
}
@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(keyCacheSecretId());
hashCode = 31 * hashCode + Objects.hashCode(keyCacheSecretIamArn());
hashCode = 31 * hashCode + Objects.hashCode(krb5FileContents());
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 KerberosAuthenticationSettings)) {
return false;
}
KerberosAuthenticationSettings other = (KerberosAuthenticationSettings) obj;
return Objects.equals(keyCacheSecretId(), other.keyCacheSecretId())
&& Objects.equals(keyCacheSecretIamArn(), other.keyCacheSecretIamArn())
&& Objects.equals(krb5FileContents(), other.krb5FileContents());
}
/**
* 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("KerberosAuthenticationSettings").add("KeyCacheSecretId", keyCacheSecretId())
.add("KeyCacheSecretIamArn", keyCacheSecretIamArn()).add("Krb5FileContents", krb5FileContents()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "KeyCacheSecretId":
return Optional.ofNullable(clazz.cast(keyCacheSecretId()));
case "KeyCacheSecretIamArn":
return Optional.ofNullable(clazz.cast(keyCacheSecretIamArn()));
case "Krb5FileContents":
return Optional.ofNullable(clazz.cast(krb5FileContents()));
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("KeyCacheSecretId", KEY_CACHE_SECRET_ID_FIELD);
map.put("KeyCacheSecretIamArn", KEY_CACHE_SECRET_IAM_ARN_FIELD);
map.put("Krb5FileContents", KRB5_FILE_CONTENTS_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy