com.amazonaws.services.directory.model.CreateTrustRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-directory Show documentation
/*
* Copyright 2019-2024 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 com.amazonaws.services.directory.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* Directory Service for Microsoft Active Directory allows you to configure trust relationships. For example, you can
* establish a trust between your Managed Microsoft AD directory, and your existing self-managed Microsoft Active
* Directory. This would allow you to provide users and groups access to resources in either domain, with a single set
* of credentials.
*
*
* This action initiates the creation of the Amazon Web Services side of a trust relationship between an Managed
* Microsoft AD directory and an external domain.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateTrustRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.
*
*/
private String directoryId;
/**
*
* The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.
*
*/
private String remoteDomainName;
/**
*
* The trust password. The must be the same password that was used when creating the trust relationship on the
* external domain.
*
*/
private String trustPassword;
/**
*
* The direction of the trust relationship.
*
*/
private String trustDirection;
/**
*
* The trust relationship type. Forest
is the default.
*
*/
private String trustType;
/**
*
* The IP addresses of the remote DNS server associated with RemoteDomainName.
*
*/
private com.amazonaws.internal.SdkInternalList conditionalForwarderIpAddrs;
/**
*
* Optional parameter to enable selective authentication for the trust.
*
*/
private String selectiveAuth;
/**
*
* The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.
*
*
* @param directoryId
* The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.
*/
public void setDirectoryId(String directoryId) {
this.directoryId = directoryId;
}
/**
*
* The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.
*
*
* @return The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.
*/
public String getDirectoryId() {
return this.directoryId;
}
/**
*
* The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.
*
*
* @param directoryId
* The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTrustRequest withDirectoryId(String directoryId) {
setDirectoryId(directoryId);
return this;
}
/**
*
* The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.
*
*
* @param remoteDomainName
* The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.
*/
public void setRemoteDomainName(String remoteDomainName) {
this.remoteDomainName = remoteDomainName;
}
/**
*
* The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.
*
*
* @return The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.
*/
public String getRemoteDomainName() {
return this.remoteDomainName;
}
/**
*
* The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.
*
*
* @param remoteDomainName
* The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTrustRequest withRemoteDomainName(String remoteDomainName) {
setRemoteDomainName(remoteDomainName);
return this;
}
/**
*
* The trust password. The must be the same password that was used when creating the trust relationship on the
* external domain.
*
*
* @param trustPassword
* The trust password. The must be the same password that was used when creating the trust relationship on
* the external domain.
*/
public void setTrustPassword(String trustPassword) {
this.trustPassword = trustPassword;
}
/**
*
* The trust password. The must be the same password that was used when creating the trust relationship on the
* external domain.
*
*
* @return The trust password. The must be the same password that was used when creating the trust relationship on
* the external domain.
*/
public String getTrustPassword() {
return this.trustPassword;
}
/**
*
* The trust password. The must be the same password that was used when creating the trust relationship on the
* external domain.
*
*
* @param trustPassword
* The trust password. The must be the same password that was used when creating the trust relationship on
* the external domain.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTrustRequest withTrustPassword(String trustPassword) {
setTrustPassword(trustPassword);
return this;
}
/**
*
* The direction of the trust relationship.
*
*
* @param trustDirection
* The direction of the trust relationship.
* @see TrustDirection
*/
public void setTrustDirection(String trustDirection) {
this.trustDirection = trustDirection;
}
/**
*
* The direction of the trust relationship.
*
*
* @return The direction of the trust relationship.
* @see TrustDirection
*/
public String getTrustDirection() {
return this.trustDirection;
}
/**
*
* The direction of the trust relationship.
*
*
* @param trustDirection
* The direction of the trust relationship.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TrustDirection
*/
public CreateTrustRequest withTrustDirection(String trustDirection) {
setTrustDirection(trustDirection);
return this;
}
/**
*
* The direction of the trust relationship.
*
*
* @param trustDirection
* The direction of the trust relationship.
* @see TrustDirection
*/
public void setTrustDirection(TrustDirection trustDirection) {
withTrustDirection(trustDirection);
}
/**
*
* The direction of the trust relationship.
*
*
* @param trustDirection
* The direction of the trust relationship.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TrustDirection
*/
public CreateTrustRequest withTrustDirection(TrustDirection trustDirection) {
this.trustDirection = trustDirection.toString();
return this;
}
/**
*
* The trust relationship type. Forest
is the default.
*
*
* @param trustType
* The trust relationship type. Forest
is the default.
* @see TrustType
*/
public void setTrustType(String trustType) {
this.trustType = trustType;
}
/**
*
* The trust relationship type. Forest
is the default.
*
*
* @return The trust relationship type. Forest
is the default.
* @see TrustType
*/
public String getTrustType() {
return this.trustType;
}
/**
*
* The trust relationship type. Forest
is the default.
*
*
* @param trustType
* The trust relationship type. Forest
is the default.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TrustType
*/
public CreateTrustRequest withTrustType(String trustType) {
setTrustType(trustType);
return this;
}
/**
*
* The trust relationship type. Forest
is the default.
*
*
* @param trustType
* The trust relationship type. Forest
is the default.
* @see TrustType
*/
public void setTrustType(TrustType trustType) {
withTrustType(trustType);
}
/**
*
* The trust relationship type. Forest
is the default.
*
*
* @param trustType
* The trust relationship type. Forest
is the default.
* @return Returns a reference to this object so that method calls can be chained together.
* @see TrustType
*/
public CreateTrustRequest withTrustType(TrustType trustType) {
this.trustType = trustType.toString();
return this;
}
/**
*
* The IP addresses of the remote DNS server associated with RemoteDomainName.
*
*
* @return The IP addresses of the remote DNS server associated with RemoteDomainName.
*/
public java.util.List getConditionalForwarderIpAddrs() {
if (conditionalForwarderIpAddrs == null) {
conditionalForwarderIpAddrs = new com.amazonaws.internal.SdkInternalList();
}
return conditionalForwarderIpAddrs;
}
/**
*
* The IP addresses of the remote DNS server associated with RemoteDomainName.
*
*
* @param conditionalForwarderIpAddrs
* The IP addresses of the remote DNS server associated with RemoteDomainName.
*/
public void setConditionalForwarderIpAddrs(java.util.Collection conditionalForwarderIpAddrs) {
if (conditionalForwarderIpAddrs == null) {
this.conditionalForwarderIpAddrs = null;
return;
}
this.conditionalForwarderIpAddrs = new com.amazonaws.internal.SdkInternalList(conditionalForwarderIpAddrs);
}
/**
*
* The IP addresses of the remote DNS server associated with RemoteDomainName.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setConditionalForwarderIpAddrs(java.util.Collection)} or
* {@link #withConditionalForwarderIpAddrs(java.util.Collection)} if you want to override the existing values.
*
*
* @param conditionalForwarderIpAddrs
* The IP addresses of the remote DNS server associated with RemoteDomainName.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTrustRequest withConditionalForwarderIpAddrs(String... conditionalForwarderIpAddrs) {
if (this.conditionalForwarderIpAddrs == null) {
setConditionalForwarderIpAddrs(new com.amazonaws.internal.SdkInternalList(conditionalForwarderIpAddrs.length));
}
for (String ele : conditionalForwarderIpAddrs) {
this.conditionalForwarderIpAddrs.add(ele);
}
return this;
}
/**
*
* The IP addresses of the remote DNS server associated with RemoteDomainName.
*
*
* @param conditionalForwarderIpAddrs
* The IP addresses of the remote DNS server associated with RemoteDomainName.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTrustRequest withConditionalForwarderIpAddrs(java.util.Collection conditionalForwarderIpAddrs) {
setConditionalForwarderIpAddrs(conditionalForwarderIpAddrs);
return this;
}
/**
*
* Optional parameter to enable selective authentication for the trust.
*
*
* @param selectiveAuth
* Optional parameter to enable selective authentication for the trust.
* @see SelectiveAuth
*/
public void setSelectiveAuth(String selectiveAuth) {
this.selectiveAuth = selectiveAuth;
}
/**
*
* Optional parameter to enable selective authentication for the trust.
*
*
* @return Optional parameter to enable selective authentication for the trust.
* @see SelectiveAuth
*/
public String getSelectiveAuth() {
return this.selectiveAuth;
}
/**
*
* Optional parameter to enable selective authentication for the trust.
*
*
* @param selectiveAuth
* Optional parameter to enable selective authentication for the trust.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SelectiveAuth
*/
public CreateTrustRequest withSelectiveAuth(String selectiveAuth) {
setSelectiveAuth(selectiveAuth);
return this;
}
/**
*
* Optional parameter to enable selective authentication for the trust.
*
*
* @param selectiveAuth
* Optional parameter to enable selective authentication for the trust.
* @see SelectiveAuth
*/
public void setSelectiveAuth(SelectiveAuth selectiveAuth) {
withSelectiveAuth(selectiveAuth);
}
/**
*
* Optional parameter to enable selective authentication for the trust.
*
*
* @param selectiveAuth
* Optional parameter to enable selective authentication for the trust.
* @return Returns a reference to this object so that method calls can be chained together.
* @see SelectiveAuth
*/
public CreateTrustRequest withSelectiveAuth(SelectiveAuth selectiveAuth) {
this.selectiveAuth = selectiveAuth.toString();
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDirectoryId() != null)
sb.append("DirectoryId: ").append(getDirectoryId()).append(",");
if (getRemoteDomainName() != null)
sb.append("RemoteDomainName: ").append(getRemoteDomainName()).append(",");
if (getTrustPassword() != null)
sb.append("TrustPassword: ").append("***Sensitive Data Redacted***").append(",");
if (getTrustDirection() != null)
sb.append("TrustDirection: ").append(getTrustDirection()).append(",");
if (getTrustType() != null)
sb.append("TrustType: ").append(getTrustType()).append(",");
if (getConditionalForwarderIpAddrs() != null)
sb.append("ConditionalForwarderIpAddrs: ").append(getConditionalForwarderIpAddrs()).append(",");
if (getSelectiveAuth() != null)
sb.append("SelectiveAuth: ").append(getSelectiveAuth());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateTrustRequest == false)
return false;
CreateTrustRequest other = (CreateTrustRequest) obj;
if (other.getDirectoryId() == null ^ this.getDirectoryId() == null)
return false;
if (other.getDirectoryId() != null && other.getDirectoryId().equals(this.getDirectoryId()) == false)
return false;
if (other.getRemoteDomainName() == null ^ this.getRemoteDomainName() == null)
return false;
if (other.getRemoteDomainName() != null && other.getRemoteDomainName().equals(this.getRemoteDomainName()) == false)
return false;
if (other.getTrustPassword() == null ^ this.getTrustPassword() == null)
return false;
if (other.getTrustPassword() != null && other.getTrustPassword().equals(this.getTrustPassword()) == false)
return false;
if (other.getTrustDirection() == null ^ this.getTrustDirection() == null)
return false;
if (other.getTrustDirection() != null && other.getTrustDirection().equals(this.getTrustDirection()) == false)
return false;
if (other.getTrustType() == null ^ this.getTrustType() == null)
return false;
if (other.getTrustType() != null && other.getTrustType().equals(this.getTrustType()) == false)
return false;
if (other.getConditionalForwarderIpAddrs() == null ^ this.getConditionalForwarderIpAddrs() == null)
return false;
if (other.getConditionalForwarderIpAddrs() != null && other.getConditionalForwarderIpAddrs().equals(this.getConditionalForwarderIpAddrs()) == false)
return false;
if (other.getSelectiveAuth() == null ^ this.getSelectiveAuth() == null)
return false;
if (other.getSelectiveAuth() != null && other.getSelectiveAuth().equals(this.getSelectiveAuth()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDirectoryId() == null) ? 0 : getDirectoryId().hashCode());
hashCode = prime * hashCode + ((getRemoteDomainName() == null) ? 0 : getRemoteDomainName().hashCode());
hashCode = prime * hashCode + ((getTrustPassword() == null) ? 0 : getTrustPassword().hashCode());
hashCode = prime * hashCode + ((getTrustDirection() == null) ? 0 : getTrustDirection().hashCode());
hashCode = prime * hashCode + ((getTrustType() == null) ? 0 : getTrustType().hashCode());
hashCode = prime * hashCode + ((getConditionalForwarderIpAddrs() == null) ? 0 : getConditionalForwarderIpAddrs().hashCode());
hashCode = prime * hashCode + ((getSelectiveAuth() == null) ? 0 : getSelectiveAuth().hashCode());
return hashCode;
}
@Override
public CreateTrustRequest clone() {
return (CreateTrustRequest) super.clone();
}
}