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

* Returns a failure message. For example, the resource is already compliant. *

*/ private String failureMessage; /** *

* For resources that have failed to start execution, the API returns a resource key object. *

*/ private com.amazonaws.internal.SdkInternalList failedItems; /** *

* Returns a failure message. For example, the resource is already compliant. *

* * @param failureMessage * Returns a failure message. For example, the resource is already compliant. */ public void setFailureMessage(String failureMessage) { this.failureMessage = failureMessage; } /** *

* Returns a failure message. For example, the resource is already compliant. *

* * @return Returns a failure message. For example, the resource is already compliant. */ public String getFailureMessage() { return this.failureMessage; } /** *

* Returns a failure message. For example, the resource is already compliant. *

* * @param failureMessage * Returns a failure message. For example, the resource is already compliant. * @return Returns a reference to this object so that method calls can be chained together. */ public StartRemediationExecutionResult withFailureMessage(String failureMessage) { setFailureMessage(failureMessage); return this; } /** *

* For resources that have failed to start execution, the API returns a resource key object. *

* * @return For resources that have failed to start execution, the API returns a resource key object. */ public java.util.List getFailedItems() { if (failedItems == null) { failedItems = new com.amazonaws.internal.SdkInternalList(); } return failedItems; } /** *

* For resources that have failed to start execution, the API returns a resource key object. *

* * @param failedItems * For resources that have failed to start execution, the API returns a resource key object. */ public void setFailedItems(java.util.Collection failedItems) { if (failedItems == null) { this.failedItems = null; return; } this.failedItems = new com.amazonaws.internal.SdkInternalList(failedItems); } /** *

* For resources that have failed to start execution, the API returns a resource key object. *

*

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

* * @param failedItems * For resources that have failed to start execution, the API returns a resource key object. * @return Returns a reference to this object so that method calls can be chained together. */ public StartRemediationExecutionResult withFailedItems(ResourceKey... failedItems) { if (this.failedItems == null) { setFailedItems(new com.amazonaws.internal.SdkInternalList(failedItems.length)); } for (ResourceKey ele : failedItems) { this.failedItems.add(ele); } return this; } /** *

* For resources that have failed to start execution, the API returns a resource key object. *

* * @param failedItems * For resources that have failed to start execution, the API returns a resource key object. * @return Returns a reference to this object so that method calls can be chained together. */ public StartRemediationExecutionResult withFailedItems(java.util.Collection failedItems) { setFailedItems(failedItems); 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 (getFailureMessage() != null) sb.append("FailureMessage: ").append(getFailureMessage()).append(","); if (getFailedItems() != null) sb.append("FailedItems: ").append(getFailedItems()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StartRemediationExecutionResult == false) return false; StartRemediationExecutionResult other = (StartRemediationExecutionResult) obj; if (other.getFailureMessage() == null ^ this.getFailureMessage() == null) return false; if (other.getFailureMessage() != null && other.getFailureMessage().equals(this.getFailureMessage()) == false) return false; if (other.getFailedItems() == null ^ this.getFailedItems() == null) return false; if (other.getFailedItems() != null && other.getFailedItems().equals(this.getFailedItems()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFailureMessage() == null) ? 0 : getFailureMessage().hashCode()); hashCode = prime * hashCode + ((getFailedItems() == null) ? 0 : getFailedItems().hashCode()); return hashCode; } @Override public StartRemediationExecutionResult clone() { try { return (StartRemediationExecutionResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }