
com.amazonaws.services.workspaces.model.WorkspaceDirectory Maven / Gradle / Ivy
Show all versions of aws-java-sdk-osgi Show documentation
/*
* Copyright 2011-2016 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.workspaces.model;
import java.io.Serializable;
/**
*
* Contains information about an AWS Directory Service directory for use with
* Amazon WorkSpaces.
*
*/
public class WorkspaceDirectory implements Serializable, Cloneable {
/**
*
* The directory identifier.
*
*/
private String directoryId;
/**
*
* The directory alias.
*
*/
private String alias;
/**
*
* The name of the directory.
*
*/
private String directoryName;
/**
*
* The registration code for the directory. This is the code that users
* enter in their Amazon WorkSpaces client application to connect to the
* directory.
*
*/
private String registrationCode;
/**
*
* An array of strings that contains the identifiers of the subnets used
* with the directory.
*
*/
private com.amazonaws.internal.SdkInternalList subnetIds;
/**
*
* An array of strings that contains the IP addresses of the DNS servers for
* the directory.
*
*/
private com.amazonaws.internal.SdkInternalList dnsIpAddresses;
/**
*
* The user name for the service account.
*
*/
private String customerUserName;
/**
*
* The identifier of the IAM role. This is the role that allows Amazon
* WorkSpaces to make calls to other services, such as Amazon EC2, on your
* behalf.
*
*/
private String iamRoleId;
/**
*
* The directory type.
*
*/
private String directoryType;
/**
*
* The identifier of the security group that is assigned to new WorkSpaces.
*
*/
private String workspaceSecurityGroupId;
/**
*
* The state of the directory's registration with Amazon WorkSpaces
*
*/
private String state;
/**
*
* A structure that specifies the default creation properties for all
* WorkSpaces in the directory.
*
*/
private DefaultWorkspaceCreationProperties workspaceCreationProperties;
/**
*
* The directory identifier.
*
*
* @param directoryId
* The directory identifier.
*/
public void setDirectoryId(String directoryId) {
this.directoryId = directoryId;
}
/**
*
* The directory identifier.
*
*
* @return The directory identifier.
*/
public String getDirectoryId() {
return this.directoryId;
}
/**
*
* The directory identifier.
*
*
* @param directoryId
* The directory identifier.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withDirectoryId(String directoryId) {
setDirectoryId(directoryId);
return this;
}
/**
*
* The directory alias.
*
*
* @param alias
* The directory alias.
*/
public void setAlias(String alias) {
this.alias = alias;
}
/**
*
* The directory alias.
*
*
* @return The directory alias.
*/
public String getAlias() {
return this.alias;
}
/**
*
* The directory alias.
*
*
* @param alias
* The directory alias.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withAlias(String alias) {
setAlias(alias);
return this;
}
/**
*
* The name of the directory.
*
*
* @param directoryName
* The name of the directory.
*/
public void setDirectoryName(String directoryName) {
this.directoryName = directoryName;
}
/**
*
* The name of the directory.
*
*
* @return The name of the directory.
*/
public String getDirectoryName() {
return this.directoryName;
}
/**
*
* The name of the directory.
*
*
* @param directoryName
* The name of the directory.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withDirectoryName(String directoryName) {
setDirectoryName(directoryName);
return this;
}
/**
*
* The registration code for the directory. This is the code that users
* enter in their Amazon WorkSpaces client application to connect to the
* directory.
*
*
* @param registrationCode
* The registration code for the directory. This is the code that
* users enter in their Amazon WorkSpaces client application to
* connect to the directory.
*/
public void setRegistrationCode(String registrationCode) {
this.registrationCode = registrationCode;
}
/**
*
* The registration code for the directory. This is the code that users
* enter in their Amazon WorkSpaces client application to connect to the
* directory.
*
*
* @return The registration code for the directory. This is the code that
* users enter in their Amazon WorkSpaces client application to
* connect to the directory.
*/
public String getRegistrationCode() {
return this.registrationCode;
}
/**
*
* The registration code for the directory. This is the code that users
* enter in their Amazon WorkSpaces client application to connect to the
* directory.
*
*
* @param registrationCode
* The registration code for the directory. This is the code that
* users enter in their Amazon WorkSpaces client application to
* connect to the directory.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withRegistrationCode(String registrationCode) {
setRegistrationCode(registrationCode);
return this;
}
/**
*
* An array of strings that contains the identifiers of the subnets used
* with the directory.
*
*
* @return An array of strings that contains the identifiers of the subnets
* used with the directory.
*/
public java.util.List getSubnetIds() {
if (subnetIds == null) {
subnetIds = new com.amazonaws.internal.SdkInternalList();
}
return subnetIds;
}
/**
*
* An array of strings that contains the identifiers of the subnets used
* with the directory.
*
*
* @param subnetIds
* An array of strings that contains the identifiers of the subnets
* used with the directory.
*/
public void setSubnetIds(java.util.Collection subnetIds) {
if (subnetIds == null) {
this.subnetIds = null;
return;
}
this.subnetIds = new com.amazonaws.internal.SdkInternalList(
subnetIds);
}
/**
*
* An array of strings that contains the identifiers of the subnets used
* with the directory.
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setSubnetIds(java.util.Collection)} or
* {@link #withSubnetIds(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param subnetIds
* An array of strings that contains the identifiers of the subnets
* used with the directory.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withSubnetIds(String... subnetIds) {
if (this.subnetIds == null) {
setSubnetIds(new com.amazonaws.internal.SdkInternalList(
subnetIds.length));
}
for (String ele : subnetIds) {
this.subnetIds.add(ele);
}
return this;
}
/**
*
* An array of strings that contains the identifiers of the subnets used
* with the directory.
*
*
* @param subnetIds
* An array of strings that contains the identifiers of the subnets
* used with the directory.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withSubnetIds(
java.util.Collection subnetIds) {
setSubnetIds(subnetIds);
return this;
}
/**
*
* An array of strings that contains the IP addresses of the DNS servers for
* the directory.
*
*
* @return An array of strings that contains the IP addresses of the DNS
* servers for the directory.
*/
public java.util.List getDnsIpAddresses() {
if (dnsIpAddresses == null) {
dnsIpAddresses = new com.amazonaws.internal.SdkInternalList();
}
return dnsIpAddresses;
}
/**
*
* An array of strings that contains the IP addresses of the DNS servers for
* the directory.
*
*
* @param dnsIpAddresses
* An array of strings that contains the IP addresses of the DNS
* servers for the directory.
*/
public void setDnsIpAddresses(java.util.Collection dnsIpAddresses) {
if (dnsIpAddresses == null) {
this.dnsIpAddresses = null;
return;
}
this.dnsIpAddresses = new com.amazonaws.internal.SdkInternalList(
dnsIpAddresses);
}
/**
*
* An array of strings that contains the IP addresses of the DNS servers for
* the directory.
*
*
* NOTE: This method appends the values to the existing list (if
* any). Use {@link #setDnsIpAddresses(java.util.Collection)} or
* {@link #withDnsIpAddresses(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param dnsIpAddresses
* An array of strings that contains the IP addresses of the DNS
* servers for the directory.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withDnsIpAddresses(String... dnsIpAddresses) {
if (this.dnsIpAddresses == null) {
setDnsIpAddresses(new com.amazonaws.internal.SdkInternalList(
dnsIpAddresses.length));
}
for (String ele : dnsIpAddresses) {
this.dnsIpAddresses.add(ele);
}
return this;
}
/**
*
* An array of strings that contains the IP addresses of the DNS servers for
* the directory.
*
*
* @param dnsIpAddresses
* An array of strings that contains the IP addresses of the DNS
* servers for the directory.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withDnsIpAddresses(
java.util.Collection dnsIpAddresses) {
setDnsIpAddresses(dnsIpAddresses);
return this;
}
/**
*
* The user name for the service account.
*
*
* @param customerUserName
* The user name for the service account.
*/
public void setCustomerUserName(String customerUserName) {
this.customerUserName = customerUserName;
}
/**
*
* The user name for the service account.
*
*
* @return The user name for the service account.
*/
public String getCustomerUserName() {
return this.customerUserName;
}
/**
*
* The user name for the service account.
*
*
* @param customerUserName
* The user name for the service account.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withCustomerUserName(String customerUserName) {
setCustomerUserName(customerUserName);
return this;
}
/**
*
* The identifier of the IAM role. This is the role that allows Amazon
* WorkSpaces to make calls to other services, such as Amazon EC2, on your
* behalf.
*
*
* @param iamRoleId
* The identifier of the IAM role. This is the role that allows
* Amazon WorkSpaces to make calls to other services, such as Amazon
* EC2, on your behalf.
*/
public void setIamRoleId(String iamRoleId) {
this.iamRoleId = iamRoleId;
}
/**
*
* The identifier of the IAM role. This is the role that allows Amazon
* WorkSpaces to make calls to other services, such as Amazon EC2, on your
* behalf.
*
*
* @return The identifier of the IAM role. This is the role that allows
* Amazon WorkSpaces to make calls to other services, such as Amazon
* EC2, on your behalf.
*/
public String getIamRoleId() {
return this.iamRoleId;
}
/**
*
* The identifier of the IAM role. This is the role that allows Amazon
* WorkSpaces to make calls to other services, such as Amazon EC2, on your
* behalf.
*
*
* @param iamRoleId
* The identifier of the IAM role. This is the role that allows
* Amazon WorkSpaces to make calls to other services, such as Amazon
* EC2, on your behalf.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withIamRoleId(String iamRoleId) {
setIamRoleId(iamRoleId);
return this;
}
/**
*
* The directory type.
*
*
* @param directoryType
* The directory type.
* @see WorkspaceDirectoryType
*/
public void setDirectoryType(String directoryType) {
this.directoryType = directoryType;
}
/**
*
* The directory type.
*
*
* @return The directory type.
* @see WorkspaceDirectoryType
*/
public String getDirectoryType() {
return this.directoryType;
}
/**
*
* The directory type.
*
*
* @param directoryType
* The directory type.
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see WorkspaceDirectoryType
*/
public WorkspaceDirectory withDirectoryType(String directoryType) {
setDirectoryType(directoryType);
return this;
}
/**
*
* The directory type.
*
*
* @param directoryType
* The directory type.
* @see WorkspaceDirectoryType
*/
public void setDirectoryType(WorkspaceDirectoryType directoryType) {
this.directoryType = directoryType.toString();
}
/**
*
* The directory type.
*
*
* @param directoryType
* The directory type.
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see WorkspaceDirectoryType
*/
public WorkspaceDirectory withDirectoryType(
WorkspaceDirectoryType directoryType) {
setDirectoryType(directoryType);
return this;
}
/**
*
* The identifier of the security group that is assigned to new WorkSpaces.
*
*
* @param workspaceSecurityGroupId
* The identifier of the security group that is assigned to new
* WorkSpaces.
*/
public void setWorkspaceSecurityGroupId(String workspaceSecurityGroupId) {
this.workspaceSecurityGroupId = workspaceSecurityGroupId;
}
/**
*
* The identifier of the security group that is assigned to new WorkSpaces.
*
*
* @return The identifier of the security group that is assigned to new
* WorkSpaces.
*/
public String getWorkspaceSecurityGroupId() {
return this.workspaceSecurityGroupId;
}
/**
*
* The identifier of the security group that is assigned to new WorkSpaces.
*
*
* @param workspaceSecurityGroupId
* The identifier of the security group that is assigned to new
* WorkSpaces.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withWorkspaceSecurityGroupId(
String workspaceSecurityGroupId) {
setWorkspaceSecurityGroupId(workspaceSecurityGroupId);
return this;
}
/**
*
* The state of the directory's registration with Amazon WorkSpaces
*
*
* @param state
* The state of the directory's registration with Amazon WorkSpaces
* @see WorkspaceDirectoryState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of the directory's registration with Amazon WorkSpaces
*
*
* @return The state of the directory's registration with Amazon WorkSpaces
* @see WorkspaceDirectoryState
*/
public String getState() {
return this.state;
}
/**
*
* The state of the directory's registration with Amazon WorkSpaces
*
*
* @param state
* The state of the directory's registration with Amazon WorkSpaces
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see WorkspaceDirectoryState
*/
public WorkspaceDirectory withState(String state) {
setState(state);
return this;
}
/**
*
* The state of the directory's registration with Amazon WorkSpaces
*
*
* @param state
* The state of the directory's registration with Amazon WorkSpaces
* @see WorkspaceDirectoryState
*/
public void setState(WorkspaceDirectoryState state) {
this.state = state.toString();
}
/**
*
* The state of the directory's registration with Amazon WorkSpaces
*
*
* @param state
* The state of the directory's registration with Amazon WorkSpaces
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see WorkspaceDirectoryState
*/
public WorkspaceDirectory withState(WorkspaceDirectoryState state) {
setState(state);
return this;
}
/**
*
* A structure that specifies the default creation properties for all
* WorkSpaces in the directory.
*
*
* @param workspaceCreationProperties
* A structure that specifies the default creation properties for all
* WorkSpaces in the directory.
*/
public void setWorkspaceCreationProperties(
DefaultWorkspaceCreationProperties workspaceCreationProperties) {
this.workspaceCreationProperties = workspaceCreationProperties;
}
/**
*
* A structure that specifies the default creation properties for all
* WorkSpaces in the directory.
*
*
* @return A structure that specifies the default creation properties for
* all WorkSpaces in the directory.
*/
public DefaultWorkspaceCreationProperties getWorkspaceCreationProperties() {
return this.workspaceCreationProperties;
}
/**
*
* A structure that specifies the default creation properties for all
* WorkSpaces in the directory.
*
*
* @param workspaceCreationProperties
* A structure that specifies the default creation properties for all
* WorkSpaces in the directory.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public WorkspaceDirectory withWorkspaceCreationProperties(
DefaultWorkspaceCreationProperties workspaceCreationProperties) {
setWorkspaceCreationProperties(workspaceCreationProperties);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @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: " + getDirectoryId() + ",");
if (getAlias() != null)
sb.append("Alias: " + getAlias() + ",");
if (getDirectoryName() != null)
sb.append("DirectoryName: " + getDirectoryName() + ",");
if (getRegistrationCode() != null)
sb.append("RegistrationCode: " + getRegistrationCode() + ",");
if (getSubnetIds() != null)
sb.append("SubnetIds: " + getSubnetIds() + ",");
if (getDnsIpAddresses() != null)
sb.append("DnsIpAddresses: " + getDnsIpAddresses() + ",");
if (getCustomerUserName() != null)
sb.append("CustomerUserName: " + getCustomerUserName() + ",");
if (getIamRoleId() != null)
sb.append("IamRoleId: " + getIamRoleId() + ",");
if (getDirectoryType() != null)
sb.append("DirectoryType: " + getDirectoryType() + ",");
if (getWorkspaceSecurityGroupId() != null)
sb.append("WorkspaceSecurityGroupId: "
+ getWorkspaceSecurityGroupId() + ",");
if (getState() != null)
sb.append("State: " + getState() + ",");
if (getWorkspaceCreationProperties() != null)
sb.append("WorkspaceCreationProperties: "
+ getWorkspaceCreationProperties());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof WorkspaceDirectory == false)
return false;
WorkspaceDirectory other = (WorkspaceDirectory) obj;
if (other.getDirectoryId() == null ^ this.getDirectoryId() == null)
return false;
if (other.getDirectoryId() != null
&& other.getDirectoryId().equals(this.getDirectoryId()) == false)
return false;
if (other.getAlias() == null ^ this.getAlias() == null)
return false;
if (other.getAlias() != null
&& other.getAlias().equals(this.getAlias()) == false)
return false;
if (other.getDirectoryName() == null ^ this.getDirectoryName() == null)
return false;
if (other.getDirectoryName() != null
&& other.getDirectoryName().equals(this.getDirectoryName()) == false)
return false;
if (other.getRegistrationCode() == null
^ this.getRegistrationCode() == null)
return false;
if (other.getRegistrationCode() != null
&& other.getRegistrationCode().equals(
this.getRegistrationCode()) == false)
return false;
if (other.getSubnetIds() == null ^ this.getSubnetIds() == null)
return false;
if (other.getSubnetIds() != null
&& other.getSubnetIds().equals(this.getSubnetIds()) == false)
return false;
if (other.getDnsIpAddresses() == null
^ this.getDnsIpAddresses() == null)
return false;
if (other.getDnsIpAddresses() != null
&& other.getDnsIpAddresses().equals(this.getDnsIpAddresses()) == false)
return false;
if (other.getCustomerUserName() == null
^ this.getCustomerUserName() == null)
return false;
if (other.getCustomerUserName() != null
&& other.getCustomerUserName().equals(
this.getCustomerUserName()) == false)
return false;
if (other.getIamRoleId() == null ^ this.getIamRoleId() == null)
return false;
if (other.getIamRoleId() != null
&& other.getIamRoleId().equals(this.getIamRoleId()) == false)
return false;
if (other.getDirectoryType() == null ^ this.getDirectoryType() == null)
return false;
if (other.getDirectoryType() != null
&& other.getDirectoryType().equals(this.getDirectoryType()) == false)
return false;
if (other.getWorkspaceSecurityGroupId() == null
^ this.getWorkspaceSecurityGroupId() == null)
return false;
if (other.getWorkspaceSecurityGroupId() != null
&& other.getWorkspaceSecurityGroupId().equals(
this.getWorkspaceSecurityGroupId()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null
&& other.getState().equals(this.getState()) == false)
return false;
if (other.getWorkspaceCreationProperties() == null
^ this.getWorkspaceCreationProperties() == null)
return false;
if (other.getWorkspaceCreationProperties() != null
&& other.getWorkspaceCreationProperties().equals(
this.getWorkspaceCreationProperties()) == 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
+ ((getAlias() == null) ? 0 : getAlias().hashCode());
hashCode = prime
* hashCode
+ ((getDirectoryName() == null) ? 0 : getDirectoryName()
.hashCode());
hashCode = prime
* hashCode
+ ((getRegistrationCode() == null) ? 0 : getRegistrationCode()
.hashCode());
hashCode = prime * hashCode
+ ((getSubnetIds() == null) ? 0 : getSubnetIds().hashCode());
hashCode = prime
* hashCode
+ ((getDnsIpAddresses() == null) ? 0 : getDnsIpAddresses()
.hashCode());
hashCode = prime
* hashCode
+ ((getCustomerUserName() == null) ? 0 : getCustomerUserName()
.hashCode());
hashCode = prime * hashCode
+ ((getIamRoleId() == null) ? 0 : getIamRoleId().hashCode());
hashCode = prime
* hashCode
+ ((getDirectoryType() == null) ? 0 : getDirectoryType()
.hashCode());
hashCode = prime
* hashCode
+ ((getWorkspaceSecurityGroupId() == null) ? 0
: getWorkspaceSecurityGroupId().hashCode());
hashCode = prime * hashCode
+ ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime
* hashCode
+ ((getWorkspaceCreationProperties() == null) ? 0
: getWorkspaceCreationProperties().hashCode());
return hashCode;
}
@Override
public WorkspaceDirectory clone() {
try {
return (WorkspaceDirectory) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}