com.amazonaws.services.directory.model.SharedDirectory Maven / Gradle / Ivy
Show all versions of aws-java-sdk-directory Show documentation
/*
* Copyright 2015-2020 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.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Details about the shared directory in the directory owner account for which the share request in the directory
* consumer account has been accepted.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SharedDirectory implements Serializable, Cloneable, StructuredPojo {
/**
*
* Identifier of the directory owner account, which contains the directory that has been shared to the consumer
* account.
*
*/
private String ownerAccountId;
/**
*
* Identifier of the directory in the directory owner account.
*
*/
private String ownerDirectoryId;
/**
*
* The method used when sharing a directory to determine whether the directory should be shared within your AWS
* organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory request (
* HANDSHAKE
).
*
*/
private String shareMethod;
/**
*
* Identifier of the directory consumer account that has access to the shared directory (
* OwnerDirectoryId
) in the directory owner account.
*
*/
private String sharedAccountId;
/**
*
* Identifier of the shared directory in the directory consumer account. This identifier is different for each
* directory owner account.
*
*/
private String sharedDirectoryId;
/**
*
* Current directory status of the shared AWS Managed Microsoft AD directory.
*
*/
private String shareStatus;
/**
*
* A directory share request that is sent by the directory owner to the directory consumer. The request includes a
* typed message to help the directory consumer administrator determine whether to approve or reject the share
* invitation.
*
*/
private String shareNotes;
/**
*
* The date and time that the shared directory was created.
*
*/
private java.util.Date createdDateTime;
/**
*
* The date and time that the shared directory was last updated.
*
*/
private java.util.Date lastUpdatedDateTime;
/**
*
* Identifier of the directory owner account, which contains the directory that has been shared to the consumer
* account.
*
*
* @param ownerAccountId
* Identifier of the directory owner account, which contains the directory that has been shared to the
* consumer account.
*/
public void setOwnerAccountId(String ownerAccountId) {
this.ownerAccountId = ownerAccountId;
}
/**
*
* Identifier of the directory owner account, which contains the directory that has been shared to the consumer
* account.
*
*
* @return Identifier of the directory owner account, which contains the directory that has been shared to the
* consumer account.
*/
public String getOwnerAccountId() {
return this.ownerAccountId;
}
/**
*
* Identifier of the directory owner account, which contains the directory that has been shared to the consumer
* account.
*
*
* @param ownerAccountId
* Identifier of the directory owner account, which contains the directory that has been shared to the
* consumer account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SharedDirectory withOwnerAccountId(String ownerAccountId) {
setOwnerAccountId(ownerAccountId);
return this;
}
/**
*
* Identifier of the directory in the directory owner account.
*
*
* @param ownerDirectoryId
* Identifier of the directory in the directory owner account.
*/
public void setOwnerDirectoryId(String ownerDirectoryId) {
this.ownerDirectoryId = ownerDirectoryId;
}
/**
*
* Identifier of the directory in the directory owner account.
*
*
* @return Identifier of the directory in the directory owner account.
*/
public String getOwnerDirectoryId() {
return this.ownerDirectoryId;
}
/**
*
* Identifier of the directory in the directory owner account.
*
*
* @param ownerDirectoryId
* Identifier of the directory in the directory owner account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SharedDirectory withOwnerDirectoryId(String ownerDirectoryId) {
setOwnerDirectoryId(ownerDirectoryId);
return this;
}
/**
*
* The method used when sharing a directory to determine whether the directory should be shared within your AWS
* organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory request (
* HANDSHAKE
).
*
*
* @param shareMethod
* The method used when sharing a directory to determine whether the directory should be shared within your
* AWS organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory
* request (HANDSHAKE
).
* @see ShareMethod
*/
public void setShareMethod(String shareMethod) {
this.shareMethod = shareMethod;
}
/**
*
* The method used when sharing a directory to determine whether the directory should be shared within your AWS
* organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory request (
* HANDSHAKE
).
*
*
* @return The method used when sharing a directory to determine whether the directory should be shared within your
* AWS organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory
* request (HANDSHAKE
).
* @see ShareMethod
*/
public String getShareMethod() {
return this.shareMethod;
}
/**
*
* The method used when sharing a directory to determine whether the directory should be shared within your AWS
* organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory request (
* HANDSHAKE
).
*
*
* @param shareMethod
* The method used when sharing a directory to determine whether the directory should be shared within your
* AWS organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory
* request (HANDSHAKE
).
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShareMethod
*/
public SharedDirectory withShareMethod(String shareMethod) {
setShareMethod(shareMethod);
return this;
}
/**
*
* The method used when sharing a directory to determine whether the directory should be shared within your AWS
* organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory request (
* HANDSHAKE
).
*
*
* @param shareMethod
* The method used when sharing a directory to determine whether the directory should be shared within your
* AWS organization (ORGANIZATIONS
) or with any AWS account by sending a shared directory
* request (HANDSHAKE
).
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShareMethod
*/
public SharedDirectory withShareMethod(ShareMethod shareMethod) {
this.shareMethod = shareMethod.toString();
return this;
}
/**
*
* Identifier of the directory consumer account that has access to the shared directory (
* OwnerDirectoryId
) in the directory owner account.
*
*
* @param sharedAccountId
* Identifier of the directory consumer account that has access to the shared directory (
* OwnerDirectoryId
) in the directory owner account.
*/
public void setSharedAccountId(String sharedAccountId) {
this.sharedAccountId = sharedAccountId;
}
/**
*
* Identifier of the directory consumer account that has access to the shared directory (
* OwnerDirectoryId
) in the directory owner account.
*
*
* @return Identifier of the directory consumer account that has access to the shared directory (
* OwnerDirectoryId
) in the directory owner account.
*/
public String getSharedAccountId() {
return this.sharedAccountId;
}
/**
*
* Identifier of the directory consumer account that has access to the shared directory (
* OwnerDirectoryId
) in the directory owner account.
*
*
* @param sharedAccountId
* Identifier of the directory consumer account that has access to the shared directory (
* OwnerDirectoryId
) in the directory owner account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SharedDirectory withSharedAccountId(String sharedAccountId) {
setSharedAccountId(sharedAccountId);
return this;
}
/**
*
* Identifier of the shared directory in the directory consumer account. This identifier is different for each
* directory owner account.
*
*
* @param sharedDirectoryId
* Identifier of the shared directory in the directory consumer account. This identifier is different for
* each directory owner account.
*/
public void setSharedDirectoryId(String sharedDirectoryId) {
this.sharedDirectoryId = sharedDirectoryId;
}
/**
*
* Identifier of the shared directory in the directory consumer account. This identifier is different for each
* directory owner account.
*
*
* @return Identifier of the shared directory in the directory consumer account. This identifier is different for
* each directory owner account.
*/
public String getSharedDirectoryId() {
return this.sharedDirectoryId;
}
/**
*
* Identifier of the shared directory in the directory consumer account. This identifier is different for each
* directory owner account.
*
*
* @param sharedDirectoryId
* Identifier of the shared directory in the directory consumer account. This identifier is different for
* each directory owner account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SharedDirectory withSharedDirectoryId(String sharedDirectoryId) {
setSharedDirectoryId(sharedDirectoryId);
return this;
}
/**
*
* Current directory status of the shared AWS Managed Microsoft AD directory.
*
*
* @param shareStatus
* Current directory status of the shared AWS Managed Microsoft AD directory.
* @see ShareStatus
*/
public void setShareStatus(String shareStatus) {
this.shareStatus = shareStatus;
}
/**
*
* Current directory status of the shared AWS Managed Microsoft AD directory.
*
*
* @return Current directory status of the shared AWS Managed Microsoft AD directory.
* @see ShareStatus
*/
public String getShareStatus() {
return this.shareStatus;
}
/**
*
* Current directory status of the shared AWS Managed Microsoft AD directory.
*
*
* @param shareStatus
* Current directory status of the shared AWS Managed Microsoft AD directory.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShareStatus
*/
public SharedDirectory withShareStatus(String shareStatus) {
setShareStatus(shareStatus);
return this;
}
/**
*
* Current directory status of the shared AWS Managed Microsoft AD directory.
*
*
* @param shareStatus
* Current directory status of the shared AWS Managed Microsoft AD directory.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShareStatus
*/
public SharedDirectory withShareStatus(ShareStatus shareStatus) {
this.shareStatus = shareStatus.toString();
return this;
}
/**
*
* A directory share request that is sent by the directory owner to the directory consumer. The request includes a
* typed message to help the directory consumer administrator determine whether to approve or reject the share
* invitation.
*
*
* @param shareNotes
* A directory share request that is sent by the directory owner to the directory consumer. The request
* includes a typed message to help the directory consumer administrator determine whether to approve or
* reject the share invitation.
*/
public void setShareNotes(String shareNotes) {
this.shareNotes = shareNotes;
}
/**
*
* A directory share request that is sent by the directory owner to the directory consumer. The request includes a
* typed message to help the directory consumer administrator determine whether to approve or reject the share
* invitation.
*
*
* @return A directory share request that is sent by the directory owner to the directory consumer. The request
* includes a typed message to help the directory consumer administrator determine whether to approve or
* reject the share invitation.
*/
public String getShareNotes() {
return this.shareNotes;
}
/**
*
* A directory share request that is sent by the directory owner to the directory consumer. The request includes a
* typed message to help the directory consumer administrator determine whether to approve or reject the share
* invitation.
*
*
* @param shareNotes
* A directory share request that is sent by the directory owner to the directory consumer. The request
* includes a typed message to help the directory consumer administrator determine whether to approve or
* reject the share invitation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SharedDirectory withShareNotes(String shareNotes) {
setShareNotes(shareNotes);
return this;
}
/**
*
* The date and time that the shared directory was created.
*
*
* @param createdDateTime
* The date and time that the shared directory was created.
*/
public void setCreatedDateTime(java.util.Date createdDateTime) {
this.createdDateTime = createdDateTime;
}
/**
*
* The date and time that the shared directory was created.
*
*
* @return The date and time that the shared directory was created.
*/
public java.util.Date getCreatedDateTime() {
return this.createdDateTime;
}
/**
*
* The date and time that the shared directory was created.
*
*
* @param createdDateTime
* The date and time that the shared directory was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SharedDirectory withCreatedDateTime(java.util.Date createdDateTime) {
setCreatedDateTime(createdDateTime);
return this;
}
/**
*
* The date and time that the shared directory was last updated.
*
*
* @param lastUpdatedDateTime
* The date and time that the shared directory was last updated.
*/
public void setLastUpdatedDateTime(java.util.Date lastUpdatedDateTime) {
this.lastUpdatedDateTime = lastUpdatedDateTime;
}
/**
*
* The date and time that the shared directory was last updated.
*
*
* @return The date and time that the shared directory was last updated.
*/
public java.util.Date getLastUpdatedDateTime() {
return this.lastUpdatedDateTime;
}
/**
*
* The date and time that the shared directory was last updated.
*
*
* @param lastUpdatedDateTime
* The date and time that the shared directory was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SharedDirectory withLastUpdatedDateTime(java.util.Date lastUpdatedDateTime) {
setLastUpdatedDateTime(lastUpdatedDateTime);
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 (getOwnerAccountId() != null)
sb.append("OwnerAccountId: ").append(getOwnerAccountId()).append(",");
if (getOwnerDirectoryId() != null)
sb.append("OwnerDirectoryId: ").append(getOwnerDirectoryId()).append(",");
if (getShareMethod() != null)
sb.append("ShareMethod: ").append(getShareMethod()).append(",");
if (getSharedAccountId() != null)
sb.append("SharedAccountId: ").append(getSharedAccountId()).append(",");
if (getSharedDirectoryId() != null)
sb.append("SharedDirectoryId: ").append(getSharedDirectoryId()).append(",");
if (getShareStatus() != null)
sb.append("ShareStatus: ").append(getShareStatus()).append(",");
if (getShareNotes() != null)
sb.append("ShareNotes: ").append("***Sensitive Data Redacted***").append(",");
if (getCreatedDateTime() != null)
sb.append("CreatedDateTime: ").append(getCreatedDateTime()).append(",");
if (getLastUpdatedDateTime() != null)
sb.append("LastUpdatedDateTime: ").append(getLastUpdatedDateTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SharedDirectory == false)
return false;
SharedDirectory other = (SharedDirectory) obj;
if (other.getOwnerAccountId() == null ^ this.getOwnerAccountId() == null)
return false;
if (other.getOwnerAccountId() != null && other.getOwnerAccountId().equals(this.getOwnerAccountId()) == false)
return false;
if (other.getOwnerDirectoryId() == null ^ this.getOwnerDirectoryId() == null)
return false;
if (other.getOwnerDirectoryId() != null && other.getOwnerDirectoryId().equals(this.getOwnerDirectoryId()) == false)
return false;
if (other.getShareMethod() == null ^ this.getShareMethod() == null)
return false;
if (other.getShareMethod() != null && other.getShareMethod().equals(this.getShareMethod()) == false)
return false;
if (other.getSharedAccountId() == null ^ this.getSharedAccountId() == null)
return false;
if (other.getSharedAccountId() != null && other.getSharedAccountId().equals(this.getSharedAccountId()) == false)
return false;
if (other.getSharedDirectoryId() == null ^ this.getSharedDirectoryId() == null)
return false;
if (other.getSharedDirectoryId() != null && other.getSharedDirectoryId().equals(this.getSharedDirectoryId()) == false)
return false;
if (other.getShareStatus() == null ^ this.getShareStatus() == null)
return false;
if (other.getShareStatus() != null && other.getShareStatus().equals(this.getShareStatus()) == false)
return false;
if (other.getShareNotes() == null ^ this.getShareNotes() == null)
return false;
if (other.getShareNotes() != null && other.getShareNotes().equals(this.getShareNotes()) == false)
return false;
if (other.getCreatedDateTime() == null ^ this.getCreatedDateTime() == null)
return false;
if (other.getCreatedDateTime() != null && other.getCreatedDateTime().equals(this.getCreatedDateTime()) == false)
return false;
if (other.getLastUpdatedDateTime() == null ^ this.getLastUpdatedDateTime() == null)
return false;
if (other.getLastUpdatedDateTime() != null && other.getLastUpdatedDateTime().equals(this.getLastUpdatedDateTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getOwnerAccountId() == null) ? 0 : getOwnerAccountId().hashCode());
hashCode = prime * hashCode + ((getOwnerDirectoryId() == null) ? 0 : getOwnerDirectoryId().hashCode());
hashCode = prime * hashCode + ((getShareMethod() == null) ? 0 : getShareMethod().hashCode());
hashCode = prime * hashCode + ((getSharedAccountId() == null) ? 0 : getSharedAccountId().hashCode());
hashCode = prime * hashCode + ((getSharedDirectoryId() == null) ? 0 : getSharedDirectoryId().hashCode());
hashCode = prime * hashCode + ((getShareStatus() == null) ? 0 : getShareStatus().hashCode());
hashCode = prime * hashCode + ((getShareNotes() == null) ? 0 : getShareNotes().hashCode());
hashCode = prime * hashCode + ((getCreatedDateTime() == null) ? 0 : getCreatedDateTime().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedDateTime() == null) ? 0 : getLastUpdatedDateTime().hashCode());
return hashCode;
}
@Override
public SharedDirectory clone() {
try {
return (SharedDirectory) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.directory.model.transform.SharedDirectoryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}