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

software.amazon.awssdk.services.databasemigration.model.SybaseSettings Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Database Migration Service module holds the client classes that are used for communicating with AWS Database Migration Service.

There is a newer version: 2.30.1
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.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;

/**
 * 

* Provides information that defines a SAP ASE endpoint. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SybaseSettings implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DatabaseName").getter(getter(SybaseSettings::databaseName)).setter(setter(Builder::databaseName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabaseName").build()).build(); private static final SdkField PASSWORD_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Password").getter(getter(SybaseSettings::password)).setter(setter(Builder::password)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Password").build()).build(); private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Port") .getter(getter(SybaseSettings::port)).setter(setter(Builder::port)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Port").build()).build(); private static final SdkField SERVER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ServerName").getter(getter(SybaseSettings::serverName)).setter(setter(Builder::serverName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerName").build()).build(); private static final SdkField USERNAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Username").getter(getter(SybaseSettings::username)).setter(setter(Builder::username)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Username").build()).build(); private static final SdkField SECRETS_MANAGER_ACCESS_ROLE_ARN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("SecretsManagerAccessRoleArn") .getter(getter(SybaseSettings::secretsManagerAccessRoleArn)) .setter(setter(Builder::secretsManagerAccessRoleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretsManagerAccessRoleArn") .build()).build(); private static final SdkField SECRETS_MANAGER_SECRET_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SecretsManagerSecretId").getter(getter(SybaseSettings::secretsManagerSecretId)) .setter(setter(Builder::secretsManagerSecretId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretsManagerSecretId").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DATABASE_NAME_FIELD, PASSWORD_FIELD, PORT_FIELD, SERVER_NAME_FIELD, USERNAME_FIELD, SECRETS_MANAGER_ACCESS_ROLE_ARN_FIELD, SECRETS_MANAGER_SECRET_ID_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String databaseName; private final String password; private final Integer port; private final String serverName; private final String username; private final String secretsManagerAccessRoleArn; private final String secretsManagerSecretId; private SybaseSettings(BuilderImpl builder) { this.databaseName = builder.databaseName; this.password = builder.password; this.port = builder.port; this.serverName = builder.serverName; this.username = builder.username; this.secretsManagerAccessRoleArn = builder.secretsManagerAccessRoleArn; this.secretsManagerSecretId = builder.secretsManagerSecretId; } /** *

* Database name for the endpoint. *

* * @return Database name for the endpoint. */ public final String databaseName() { return databaseName; } /** *

* Endpoint connection password. *

* * @return Endpoint connection password. */ public final String password() { return password; } /** *

* Endpoint TCP port. The default is 5000. *

* * @return Endpoint TCP port. The default is 5000. */ public final Integer port() { return port; } /** *

* Fully qualified domain name of the endpoint. *

* * @return Fully qualified domain name of the endpoint. */ public final String serverName() { return serverName; } /** *

* Endpoint connection user name. *

* * @return Endpoint connection user name. */ public final String username() { return username; } /** *

* The full Amazon Resource Name (ARN) of the IAM role that specifies DMS as the trusted entity and grants the * required permissions to access the value in SecretsManagerSecret. The role must allow the * iam:PassRole action. SecretsManagerSecret has the value of the Amazon Web Services * Secrets Manager secret that allows access to the SAP ASE endpoint. *

* *

* You can specify one of two sets of values for these permissions. You can specify the values for this setting and * SecretsManagerSecretId. Or you can specify clear-text values for UserName, * Password, ServerName, and Port. You can't specify both. For more * information on creating this SecretsManagerSecret and the SecretsManagerAccessRoleArn * and SecretsManagerSecretId required to access it, see Using * secrets to access Database Migration Service resources in the Database Migration Service User Guide. *

*
* * @return The full Amazon Resource Name (ARN) of the IAM role that specifies DMS as the trusted entity and grants * the required permissions to access the value in SecretsManagerSecret. The role must allow * the iam:PassRole action. SecretsManagerSecret has the value of the Amazon Web * Services Secrets Manager secret that allows access to the SAP ASE endpoint.

*

* You can specify one of two sets of values for these permissions. You can specify the values for this * setting and SecretsManagerSecretId. Or you can specify clear-text values for * UserName, Password, ServerName, and Port. You can't * specify both. For more information on creating this SecretsManagerSecret and the * SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, * see Using secrets to access Database Migration Service resources in the Database Migration Service * User Guide. *

*/ public final String secretsManagerAccessRoleArn() { return secretsManagerAccessRoleArn; } /** *

* The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that contains the SAP SAE * endpoint connection details. *

* * @return The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that contains the * SAP SAE endpoint connection details. */ public final String secretsManagerSecretId() { return secretsManagerSecretId; } @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(databaseName()); hashCode = 31 * hashCode + Objects.hashCode(password()); hashCode = 31 * hashCode + Objects.hashCode(port()); hashCode = 31 * hashCode + Objects.hashCode(serverName()); hashCode = 31 * hashCode + Objects.hashCode(username()); hashCode = 31 * hashCode + Objects.hashCode(secretsManagerAccessRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(secretsManagerSecretId()); 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 SybaseSettings)) { return false; } SybaseSettings other = (SybaseSettings) obj; return Objects.equals(databaseName(), other.databaseName()) && Objects.equals(password(), other.password()) && Objects.equals(port(), other.port()) && Objects.equals(serverName(), other.serverName()) && Objects.equals(username(), other.username()) && Objects.equals(secretsManagerAccessRoleArn(), other.secretsManagerAccessRoleArn()) && Objects.equals(secretsManagerSecretId(), other.secretsManagerSecretId()); } /** * 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("SybaseSettings").add("DatabaseName", databaseName()) .add("Password", password() == null ? null : "*** Sensitive Data Redacted ***").add("Port", port()) .add("ServerName", serverName()).add("Username", username()) .add("SecretsManagerAccessRoleArn", secretsManagerAccessRoleArn()) .add("SecretsManagerSecretId", secretsManagerSecretId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DatabaseName": return Optional.ofNullable(clazz.cast(databaseName())); case "Password": return Optional.ofNullable(clazz.cast(password())); case "Port": return Optional.ofNullable(clazz.cast(port())); case "ServerName": return Optional.ofNullable(clazz.cast(serverName())); case "Username": return Optional.ofNullable(clazz.cast(username())); case "SecretsManagerAccessRoleArn": return Optional.ofNullable(clazz.cast(secretsManagerAccessRoleArn())); case "SecretsManagerSecretId": return Optional.ofNullable(clazz.cast(secretsManagerSecretId())); 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("DatabaseName", DATABASE_NAME_FIELD); map.put("Password", PASSWORD_FIELD); map.put("Port", PORT_FIELD); map.put("ServerName", SERVER_NAME_FIELD); map.put("Username", USERNAME_FIELD); map.put("SecretsManagerAccessRoleArn", SECRETS_MANAGER_ACCESS_ROLE_ARN_FIELD); map.put("SecretsManagerSecretId", SECRETS_MANAGER_SECRET_ID_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((SybaseSettings) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Database name for the endpoint. *

* * @param databaseName * Database name for the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder databaseName(String databaseName); /** *

* Endpoint connection password. *

* * @param password * Endpoint connection password. * @return Returns a reference to this object so that method calls can be chained together. */ Builder password(String password); /** *

* Endpoint TCP port. The default is 5000. *

* * @param port * Endpoint TCP port. The default is 5000. * @return Returns a reference to this object so that method calls can be chained together. */ Builder port(Integer port); /** *

* Fully qualified domain name of the endpoint. *

* * @param serverName * Fully qualified domain name of the endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverName(String serverName); /** *

* Endpoint connection user name. *

* * @param username * Endpoint connection user name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder username(String username); /** *

* The full Amazon Resource Name (ARN) of the IAM role that specifies DMS as the trusted entity and grants the * required permissions to access the value in SecretsManagerSecret. The role must allow the * iam:PassRole action. SecretsManagerSecret has the value of the Amazon Web Services * Secrets Manager secret that allows access to the SAP ASE endpoint. *

* *

* You can specify one of two sets of values for these permissions. You can specify the values for this setting * and SecretsManagerSecretId. Or you can specify clear-text values for UserName, * Password, ServerName, and Port. You can't specify both. For more * information on creating this SecretsManagerSecret and the * SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, see * * Using secrets to access Database Migration Service resources in the Database Migration Service User * Guide. *

*
* * @param secretsManagerAccessRoleArn * The full Amazon Resource Name (ARN) of the IAM role that specifies DMS as the trusted entity and * grants the required permissions to access the value in SecretsManagerSecret. The role * must allow the iam:PassRole action. SecretsManagerSecret has the value of * the Amazon Web Services Secrets Manager secret that allows access to the SAP ASE endpoint.

*

* You can specify one of two sets of values for these permissions. You can specify the values for this * setting and SecretsManagerSecretId. Or you can specify clear-text values for * UserName, Password, ServerName, and Port. You * can't specify both. For more information on creating this SecretsManagerSecret and the * SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access * it, see Using secrets to access Database Migration Service resources in the Database Migration Service * User Guide. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder secretsManagerAccessRoleArn(String secretsManagerAccessRoleArn); /** *

* The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that contains the SAP * SAE endpoint connection details. *

* * @param secretsManagerSecretId * The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that contains the * SAP SAE endpoint connection details. * @return Returns a reference to this object so that method calls can be chained together. */ Builder secretsManagerSecretId(String secretsManagerSecretId); } static final class BuilderImpl implements Builder { private String databaseName; private String password; private Integer port; private String serverName; private String username; private String secretsManagerAccessRoleArn; private String secretsManagerSecretId; private BuilderImpl() { } private BuilderImpl(SybaseSettings model) { databaseName(model.databaseName); password(model.password); port(model.port); serverName(model.serverName); username(model.username); secretsManagerAccessRoleArn(model.secretsManagerAccessRoleArn); secretsManagerSecretId(model.secretsManagerSecretId); } public final String getDatabaseName() { return databaseName; } public final void setDatabaseName(String databaseName) { this.databaseName = databaseName; } @Override public final Builder databaseName(String databaseName) { this.databaseName = databaseName; return this; } public final String getPassword() { return password; } public final void setPassword(String password) { this.password = password; } @Override public final Builder password(String password) { this.password = password; return this; } public final Integer getPort() { return port; } public final void setPort(Integer port) { this.port = port; } @Override public final Builder port(Integer port) { this.port = port; return this; } public final String getServerName() { return serverName; } public final void setServerName(String serverName) { this.serverName = serverName; } @Override public final Builder serverName(String serverName) { this.serverName = serverName; return this; } public final String getUsername() { return username; } public final void setUsername(String username) { this.username = username; } @Override public final Builder username(String username) { this.username = username; return this; } public final String getSecretsManagerAccessRoleArn() { return secretsManagerAccessRoleArn; } public final void setSecretsManagerAccessRoleArn(String secretsManagerAccessRoleArn) { this.secretsManagerAccessRoleArn = secretsManagerAccessRoleArn; } @Override public final Builder secretsManagerAccessRoleArn(String secretsManagerAccessRoleArn) { this.secretsManagerAccessRoleArn = secretsManagerAccessRoleArn; return this; } public final String getSecretsManagerSecretId() { return secretsManagerSecretId; } public final void setSecretsManagerSecretId(String secretsManagerSecretId) { this.secretsManagerSecretId = secretsManagerSecretId; } @Override public final Builder secretsManagerSecretId(String secretsManagerSecretId) { this.secretsManagerSecretId = secretsManagerSecretId; return this; } @Override public SybaseSettings build() { return new SybaseSettings(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy