/* * 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.lightsail.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateGUISessionAccessDetailsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* The resource name. *

*/ private String resourceName; /** *

* The status of the operation. *

*/ private String status; /** *

* The percentage of completion for the operation. *

*/ private Integer percentageComplete; /** *

* The reason the operation failed. *

*/ private String failureReason; /** *

* Returns information about the specified NICE DCV GUI session. *

*/ private java.util.List sessions; /** *

* The resource name. *

* * @param resourceName * The resource name. */ public void setResourceName(String resourceName) { this.resourceName = resourceName; } /** *

* The resource name. *

* * @return The resource name. */ public String getResourceName() { return this.resourceName; } /** *

* The resource name. *

* * @param resourceName * The resource name. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateGUISessionAccessDetailsResult withResourceName(String resourceName) { setResourceName(resourceName); return this; } /** *

* The status of the operation. *

* * @param status * The status of the operation. * @see Status */ public void setStatus(String status) { this.status = status; } /** *

* The status of the operation. *

* * @return The status of the operation. * @see Status */ public String getStatus() { return this.status; } /** *

* The status of the operation. *

* * @param status * The status of the operation. * @return Returns a reference to this object so that method calls can be chained together. * @see Status */ public CreateGUISessionAccessDetailsResult withStatus(String status) { setStatus(status); return this; } /** *

* The status of the operation. *

* * @param status * The status of the operation. * @return Returns a reference to this object so that method calls can be chained together. * @see Status */ public CreateGUISessionAccessDetailsResult withStatus(Status status) { this.status = status.toString(); return this; } /** *

* The percentage of completion for the operation. *

* * @param percentageComplete * The percentage of completion for the operation. */ public void setPercentageComplete(Integer percentageComplete) { this.percentageComplete = percentageComplete; } /** *

* The percentage of completion for the operation. *

* * @return The percentage of completion for the operation. */ public Integer getPercentageComplete() { return this.percentageComplete; } /** *

* The percentage of completion for the operation. *

* * @param percentageComplete * The percentage of completion for the operation. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateGUISessionAccessDetailsResult withPercentageComplete(Integer percentageComplete) { setPercentageComplete(percentageComplete); return this; } /** *

* The reason the operation failed. *

* * @param failureReason * The reason the operation failed. */ public void setFailureReason(String failureReason) { this.failureReason = failureReason; } /** *

* The reason the operation failed. *

* * @return The reason the operation failed. */ public String getFailureReason() { return this.failureReason; } /** *

* The reason the operation failed. *

* * @param failureReason * The reason the operation failed. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateGUISessionAccessDetailsResult withFailureReason(String failureReason) { setFailureReason(failureReason); return this; } /** *

* Returns information about the specified NICE DCV GUI session. *

* * @return Returns information about the specified NICE DCV GUI session. */ public java.util.List getSessions() { return sessions; } /** *

* Returns information about the specified NICE DCV GUI session. *

* * @param sessions * Returns information about the specified NICE DCV GUI session. */ public void setSessions(java.util.Collection sessions) { if (sessions == null) { this.sessions = null; return; } this.sessions = new java.util.ArrayList(sessions); } /** *

* Returns information about the specified NICE DCV GUI session. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSessions(java.util.Collection)} or {@link #withSessions(java.util.Collection)} if you want to override * the existing values. *

* * @param sessions * Returns information about the specified NICE DCV GUI session. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateGUISessionAccessDetailsResult withSessions(Session... sessions) { if (this.sessions == null) { setSessions(new java.util.ArrayList(sessions.length)); } for (Session ele : sessions) { this.sessions.add(ele); } return this; } /** *

* Returns information about the specified NICE DCV GUI session. *

* * @param sessions * Returns information about the specified NICE DCV GUI session. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateGUISessionAccessDetailsResult withSessions(java.util.Collection sessions) { setSessions(sessions); 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 (getResourceName() != null) sb.append("ResourceName: ").append(getResourceName()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getPercentageComplete() != null) sb.append("PercentageComplete: ").append(getPercentageComplete()).append(","); if (getFailureReason() != null) sb.append("FailureReason: ").append(getFailureReason()).append(","); if (getSessions() != null) sb.append("Sessions: ").append(getSessions()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateGUISessionAccessDetailsResult == false) return false; CreateGUISessionAccessDetailsResult other = (CreateGUISessionAccessDetailsResult) obj; if (other.getResourceName() == null ^ this.getResourceName() == null) return false; if (other.getResourceName() != null && other.getResourceName().equals(this.getResourceName()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getPercentageComplete() == null ^ this.getPercentageComplete() == null) return false; if (other.getPercentageComplete() != null && other.getPercentageComplete().equals(this.getPercentageComplete()) == false) return false; if (other.getFailureReason() == null ^ this.getFailureReason() == null) return false; if (other.getFailureReason() != null && other.getFailureReason().equals(this.getFailureReason()) == false) return false; if (other.getSessions() == null ^ this.getSessions() == null) return false; if (other.getSessions() != null && other.getSessions().equals(this.getSessions()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getResourceName() == null) ? 0 : getResourceName().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getPercentageComplete() == null) ? 0 : getPercentageComplete().hashCode()); hashCode = prime * hashCode + ((getFailureReason() == null) ? 0 : getFailureReason().hashCode()); hashCode = prime * hashCode + ((getSessions() == null) ? 0 : getSessions().hashCode()); return hashCode; } @Override public CreateGUISessionAccessDetailsResult clone() { try { return (CreateGUISessionAccessDetailsResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }