/* * Copyright 2018-2023 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.connect.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* The Amazon Connect instance. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Instance implements Serializable, Cloneable, StructuredPojo { /** *

* The identifier of the Amazon Connect instance. You can find the instance ID in * the Amazon Resource Name (ARN) of the instance. *

*/ private String id; /** *

* The Amazon Resource Name (ARN) of the instance. *

*/ private String arn; /** *

* The identity management type. *

*/ private String identityManagementType; /** *

* The alias of instance. *

*/ private String instanceAlias; /** *

* When the instance was created. *

*/ private java.util.Date createdTime; /** *

* The service role of the instance. *

*/ private String serviceRole; /** *

* The state of the instance. *

*/ private String instanceStatus; /** *

* Relevant details why the instance was not successfully created. *

*/ private InstanceStatusReason statusReason; /** *

* Whether inbound calls are enabled. *

*/ private Boolean inboundCallsEnabled; /** *

* Whether outbound calls are enabled. *

*/ private Boolean outboundCallsEnabled; /** *

* This URL allows contact center users to access the Amazon Connect admin website. *

*/ private String instanceAccessUrl; /** *

* The identifier of the Amazon Connect instance. You can find the instance ID in * the Amazon Resource Name (ARN) of the instance. *

* * @param id * The identifier of the Amazon Connect instance. You can find the instance * ID in the Amazon Resource Name (ARN) of the instance. */ public void setId(String id) { this.id = id; } /** *

* The identifier of the Amazon Connect instance. You can find the instance ID in * the Amazon Resource Name (ARN) of the instance. *

* * @return The identifier of the Amazon Connect instance. You can find the instance * ID in the Amazon Resource Name (ARN) of the instance. */ public String getId() { return this.id; } /** *

* The identifier of the Amazon Connect instance. You can find the instance ID in * the Amazon Resource Name (ARN) of the instance. *

* * @param id * The identifier of the Amazon Connect instance. You can find the instance * ID in the Amazon Resource Name (ARN) of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withId(String id) { setId(id); return this; } /** *

* The Amazon Resource Name (ARN) of the instance. *

* * @param arn * The Amazon Resource Name (ARN) of the instance. */ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name (ARN) of the instance. *

* * @return The Amazon Resource Name (ARN) of the instance. */ public String getArn() { return this.arn; } /** *

* The Amazon Resource Name (ARN) of the instance. *

* * @param arn * The Amazon Resource Name (ARN) of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withArn(String arn) { setArn(arn); return this; } /** *

* The identity management type. *

* * @param identityManagementType * The identity management type. * @see DirectoryType */ public void setIdentityManagementType(String identityManagementType) { this.identityManagementType = identityManagementType; } /** *

* The identity management type. *

* * @return The identity management type. * @see DirectoryType */ public String getIdentityManagementType() { return this.identityManagementType; } /** *

* The identity management type. *

* * @param identityManagementType * The identity management type. * @return Returns a reference to this object so that method calls can be chained together. * @see DirectoryType */ public Instance withIdentityManagementType(String identityManagementType) { setIdentityManagementType(identityManagementType); return this; } /** *

* The identity management type. *

* * @param identityManagementType * The identity management type. * @return Returns a reference to this object so that method calls can be chained together. * @see DirectoryType */ public Instance withIdentityManagementType(DirectoryType identityManagementType) { this.identityManagementType = identityManagementType.toString(); return this; } /** *

* The alias of instance. *

* * @param instanceAlias * The alias of instance. */ public void setInstanceAlias(String instanceAlias) { this.instanceAlias = instanceAlias; } /** *

* The alias of instance. *

* * @return The alias of instance. */ public String getInstanceAlias() { return this.instanceAlias; } /** *

* The alias of instance. *

* * @param instanceAlias * The alias of instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withInstanceAlias(String instanceAlias) { setInstanceAlias(instanceAlias); return this; } /** *

* When the instance was created. *

* * @param createdTime * When the instance was created. */ public void setCreatedTime(java.util.Date createdTime) { this.createdTime = createdTime; } /** *

* When the instance was created. *

* * @return When the instance was created. */ public java.util.Date getCreatedTime() { return this.createdTime; } /** *

* When the instance was created. *

* * @param createdTime * When the instance was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withCreatedTime(java.util.Date createdTime) { setCreatedTime(createdTime); return this; } /** *

* The service role of the instance. *

* * @param serviceRole * The service role of the instance. */ public void setServiceRole(String serviceRole) { this.serviceRole = serviceRole; } /** *

* The service role of the instance. *

* * @return The service role of the instance. */ public String getServiceRole() { return this.serviceRole; } /** *

* The service role of the instance. *

* * @param serviceRole * The service role of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withServiceRole(String serviceRole) { setServiceRole(serviceRole); return this; } /** *

* The state of the instance. *

* * @param instanceStatus * The state of the instance. * @see InstanceStatus */ public void setInstanceStatus(String instanceStatus) { this.instanceStatus = instanceStatus; } /** *

* The state of the instance. *

* * @return The state of the instance. * @see InstanceStatus */ public String getInstanceStatus() { return this.instanceStatus; } /** *

* The state of the instance. *

* * @param instanceStatus * The state of the instance. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceStatus */ public Instance withInstanceStatus(String instanceStatus) { setInstanceStatus(instanceStatus); return this; } /** *

* The state of the instance. *

* * @param instanceStatus * The state of the instance. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceStatus */ public Instance withInstanceStatus(InstanceStatus instanceStatus) { this.instanceStatus = instanceStatus.toString(); return this; } /** *

* Relevant details why the instance was not successfully created. *

* * @param statusReason * Relevant details why the instance was not successfully created. */ public void setStatusReason(InstanceStatusReason statusReason) { this.statusReason = statusReason; } /** *

* Relevant details why the instance was not successfully created. *

* * @return Relevant details why the instance was not successfully created. */ public InstanceStatusReason getStatusReason() { return this.statusReason; } /** *

* Relevant details why the instance was not successfully created. *

* * @param statusReason * Relevant details why the instance was not successfully created. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withStatusReason(InstanceStatusReason statusReason) { setStatusReason(statusReason); return this; } /** *

* Whether inbound calls are enabled. *

* * @param inboundCallsEnabled * Whether inbound calls are enabled. */ public void setInboundCallsEnabled(Boolean inboundCallsEnabled) { this.inboundCallsEnabled = inboundCallsEnabled; } /** *

* Whether inbound calls are enabled. *

* * @return Whether inbound calls are enabled. */ public Boolean getInboundCallsEnabled() { return this.inboundCallsEnabled; } /** *

* Whether inbound calls are enabled. *

* * @param inboundCallsEnabled * Whether inbound calls are enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withInboundCallsEnabled(Boolean inboundCallsEnabled) { setInboundCallsEnabled(inboundCallsEnabled); return this; } /** *

* Whether inbound calls are enabled. *

* * @return Whether inbound calls are enabled. */ public Boolean isInboundCallsEnabled() { return this.inboundCallsEnabled; } /** *

* Whether outbound calls are enabled. *

* * @param outboundCallsEnabled * Whether outbound calls are enabled. */ public void setOutboundCallsEnabled(Boolean outboundCallsEnabled) { this.outboundCallsEnabled = outboundCallsEnabled; } /** *

* Whether outbound calls are enabled. *

* * @return Whether outbound calls are enabled. */ public Boolean getOutboundCallsEnabled() { return this.outboundCallsEnabled; } /** *

* Whether outbound calls are enabled. *

* * @param outboundCallsEnabled * Whether outbound calls are enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withOutboundCallsEnabled(Boolean outboundCallsEnabled) { setOutboundCallsEnabled(outboundCallsEnabled); return this; } /** *

* Whether outbound calls are enabled. *

* * @return Whether outbound calls are enabled. */ public Boolean isOutboundCallsEnabled() { return this.outboundCallsEnabled; } /** *

* This URL allows contact center users to access the Amazon Connect admin website. *

* * @param instanceAccessUrl * This URL allows contact center users to access the Amazon Connect admin website. */ public void setInstanceAccessUrl(String instanceAccessUrl) { this.instanceAccessUrl = instanceAccessUrl; } /** *

* This URL allows contact center users to access the Amazon Connect admin website. *

* * @return This URL allows contact center users to access the Amazon Connect admin website. */ public String getInstanceAccessUrl() { return this.instanceAccessUrl; } /** *

* This URL allows contact center users to access the Amazon Connect admin website. *

* * @param instanceAccessUrl * This URL allows contact center users to access the Amazon Connect admin website. * @return Returns a reference to this object so that method calls can be chained together. */ public Instance withInstanceAccessUrl(String instanceAccessUrl) { setInstanceAccessUrl(instanceAccessUrl); 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 (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getIdentityManagementType() != null) sb.append("IdentityManagementType: ").append(getIdentityManagementType()).append(","); if (getInstanceAlias() != null) sb.append("InstanceAlias: ").append("***Sensitive Data Redacted***").append(","); if (getCreatedTime() != null) sb.append("CreatedTime: ").append(getCreatedTime()).append(","); if (getServiceRole() != null) sb.append("ServiceRole: ").append(getServiceRole()).append(","); if (getInstanceStatus() != null) sb.append("InstanceStatus: ").append(getInstanceStatus()).append(","); if (getStatusReason() != null) sb.append("StatusReason: ").append(getStatusReason()).append(","); if (getInboundCallsEnabled() != null) sb.append("InboundCallsEnabled: ").append(getInboundCallsEnabled()).append(","); if (getOutboundCallsEnabled() != null) sb.append("OutboundCallsEnabled: ").append(getOutboundCallsEnabled()).append(","); if (getInstanceAccessUrl() != null) sb.append("InstanceAccessUrl: ").append(getInstanceAccessUrl()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Instance == false) return false; Instance other = (Instance) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getIdentityManagementType() == null ^ this.getIdentityManagementType() == null) return false; if (other.getIdentityManagementType() != null && other.getIdentityManagementType().equals(this.getIdentityManagementType()) == false) return false; if (other.getInstanceAlias() == null ^ this.getInstanceAlias() == null) return false; if (other.getInstanceAlias() != null && other.getInstanceAlias().equals(this.getInstanceAlias()) == false) return false; if (other.getCreatedTime() == null ^ this.getCreatedTime() == null) return false; if (other.getCreatedTime() != null && other.getCreatedTime().equals(this.getCreatedTime()) == false) return false; if (other.getServiceRole() == null ^ this.getServiceRole() == null) return false; if (other.getServiceRole() != null && other.getServiceRole().equals(this.getServiceRole()) == false) return false; if (other.getInstanceStatus() == null ^ this.getInstanceStatus() == null) return false; if (other.getInstanceStatus() != null && other.getInstanceStatus().equals(this.getInstanceStatus()) == false) return false; if (other.getStatusReason() == null ^ this.getStatusReason() == null) return false; if (other.getStatusReason() != null && other.getStatusReason().equals(this.getStatusReason()) == false) return false; if (other.getInboundCallsEnabled() == null ^ this.getInboundCallsEnabled() == null) return false; if (other.getInboundCallsEnabled() != null && other.getInboundCallsEnabled().equals(this.getInboundCallsEnabled()) == false) return false; if (other.getOutboundCallsEnabled() == null ^ this.getOutboundCallsEnabled() == null) return false; if (other.getOutboundCallsEnabled() != null && other.getOutboundCallsEnabled().equals(this.getOutboundCallsEnabled()) == false) return false; if (other.getInstanceAccessUrl() == null ^ this.getInstanceAccessUrl() == null) return false; if (other.getInstanceAccessUrl() != null && other.getInstanceAccessUrl().equals(this.getInstanceAccessUrl()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getIdentityManagementType() == null) ? 0 : getIdentityManagementType().hashCode()); hashCode = prime * hashCode + ((getInstanceAlias() == null) ? 0 : getInstanceAlias().hashCode()); hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode()); hashCode = prime * hashCode + ((getServiceRole() == null) ? 0 : getServiceRole().hashCode()); hashCode = prime * hashCode + ((getInstanceStatus() == null) ? 0 : getInstanceStatus().hashCode()); hashCode = prime * hashCode + ((getStatusReason() == null) ? 0 : getStatusReason().hashCode()); hashCode = prime * hashCode + ((getInboundCallsEnabled() == null) ? 0 : getInboundCallsEnabled().hashCode()); hashCode = prime * hashCode + ((getOutboundCallsEnabled() == null) ? 0 : getOutboundCallsEnabled().hashCode()); hashCode = prime * hashCode + ((getInstanceAccessUrl() == null) ? 0 : getInstanceAccessUrl().hashCode()); return hashCode; } @Override public Instance clone() { try { return (Instance) 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.connect.model.transform.InstanceMarshaller.getInstance().marshall(this, protocolMarshaller); } }