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

* An object representing an asynchronous update. *

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

* A UUID that is used to track the update. *

*/ private String id; /** *

* The current status of the update. *

*/ private String status; /** *

* The type of the update. *

*/ private String type; /** *

* A key-value map that contains the parameters associated with the update. *

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

* The Unix epoch timestamp in seconds for when the update was created. *

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

* Any errors associated with a Failed update. *

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

* A UUID that is used to track the update. *

* * @param id * A UUID that is used to track the update. */ public void setId(String id) { this.id = id; } /** *

* A UUID that is used to track the update. *

* * @return A UUID that is used to track the update. */ public String getId() { return this.id; } /** *

* A UUID that is used to track the update. *

* * @param id * A UUID that is used to track the update. * @return Returns a reference to this object so that method calls can be chained together. */ public Update withId(String id) { setId(id); return this; } /** *

* The current status of the update. *

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

* The current status of the update. *

* * @return The current status of the update. * @see UpdateStatus */ public String getStatus() { return this.status; } /** *

* The current status of the update. *

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

* The current status of the update. *

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

* The type of the update. *

* * @param type * The type of the update. * @see UpdateType */ public void setType(String type) { this.type = type; } /** *

* The type of the update. *

* * @return The type of the update. * @see UpdateType */ public String getType() { return this.type; } /** *

* The type of the update. *

* * @param type * The type of the update. * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateType */ public Update withType(String type) { setType(type); return this; } /** *

* The type of the update. *

* * @param type * The type of the update. * @return Returns a reference to this object so that method calls can be chained together. * @see UpdateType */ public Update withType(UpdateType type) { this.type = type.toString(); return this; } /** *

* A key-value map that contains the parameters associated with the update. *

* * @return A key-value map that contains the parameters associated with the update. */ public java.util.List getParams() { return params; } /** *

* A key-value map that contains the parameters associated with the update. *

* * @param params * A key-value map that contains the parameters associated with the update. */ public void setParams(java.util.Collection params) { if (params == null) { this.params = null; return; } this.params = new java.util.ArrayList(params); } /** *

* A key-value map that contains the parameters associated with the update. *

*

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

* * @param params * A key-value map that contains the parameters associated with the update. * @return Returns a reference to this object so that method calls can be chained together. */ public Update withParams(UpdateParam... params) { if (this.params == null) { setParams(new java.util.ArrayList(params.length)); } for (UpdateParam ele : params) { this.params.add(ele); } return this; } /** *

* A key-value map that contains the parameters associated with the update. *

* * @param params * A key-value map that contains the parameters associated with the update. * @return Returns a reference to this object so that method calls can be chained together. */ public Update withParams(java.util.Collection params) { setParams(params); return this; } /** *

* The Unix epoch timestamp in seconds for when the update was created. *

* * @param createdAt * The Unix epoch timestamp in seconds for when the update was created. */ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** *

* The Unix epoch timestamp in seconds for when the update was created. *

* * @return The Unix epoch timestamp in seconds for when the update was created. */ public java.util.Date getCreatedAt() { return this.createdAt; } /** *

* The Unix epoch timestamp in seconds for when the update was created. *

* * @param createdAt * The Unix epoch timestamp in seconds for when the update was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Update withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; } /** *

* Any errors associated with a Failed update. *

* * @return Any errors associated with a Failed update. */ public java.util.List getErrors() { return errors; } /** *

* Any errors associated with a Failed update. *

* * @param errors * Any errors associated with a Failed update. */ public void setErrors(java.util.Collection errors) { if (errors == null) { this.errors = null; return; } this.errors = new java.util.ArrayList(errors); } /** *

* Any errors associated with a Failed update. *

*

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

* * @param errors * Any errors associated with a Failed update. * @return Returns a reference to this object so that method calls can be chained together. */ public Update withErrors(ErrorDetail... errors) { if (this.errors == null) { setErrors(new java.util.ArrayList(errors.length)); } for (ErrorDetail ele : errors) { this.errors.add(ele); } return this; } /** *

* Any errors associated with a Failed update. *

* * @param errors * Any errors associated with a Failed update. * @return Returns a reference to this object so that method calls can be chained together. */ public Update withErrors(java.util.Collection errors) { setErrors(errors); 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 (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getParams() != null) sb.append("Params: ").append(getParams()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getErrors() != null) sb.append("Errors: ").append(getErrors()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Update == false) return false; Update other = (Update) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == 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.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getParams() == null ^ this.getParams() == null) return false; if (other.getParams() != null && other.getParams().equals(this.getParams()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getErrors() == null ^ this.getErrors() == null) return false; if (other.getErrors() != null && other.getErrors().equals(this.getErrors()) == 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 + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getParams() == null) ? 0 : getParams().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getErrors() == null) ? 0 : getErrors().hashCode()); return hashCode; } @Override public Update clone() { try { return (Update) 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.eks.model.transform.UpdateMarshaller.getInstance().marshall(this, protocolMarshaller); } }