com.amazonaws.services.secretsmanager.model.ValidateResourcePolicyResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-secretsmanager Show documentation
/*
* Copyright 2019-2024 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.secretsmanager.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ValidateResourcePolicyResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* True if your policy passes validation, otherwise false.
*
*/
private Boolean policyValidationPassed;
/**
*
* Validation errors if your policy didn't pass validation.
*
*/
private java.util.List validationErrors;
/**
*
* True if your policy passes validation, otherwise false.
*
*
* @param policyValidationPassed
* True if your policy passes validation, otherwise false.
*/
public void setPolicyValidationPassed(Boolean policyValidationPassed) {
this.policyValidationPassed = policyValidationPassed;
}
/**
*
* True if your policy passes validation, otherwise false.
*
*
* @return True if your policy passes validation, otherwise false.
*/
public Boolean getPolicyValidationPassed() {
return this.policyValidationPassed;
}
/**
*
* True if your policy passes validation, otherwise false.
*
*
* @param policyValidationPassed
* True if your policy passes validation, otherwise false.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ValidateResourcePolicyResult withPolicyValidationPassed(Boolean policyValidationPassed) {
setPolicyValidationPassed(policyValidationPassed);
return this;
}
/**
*
* True if your policy passes validation, otherwise false.
*
*
* @return True if your policy passes validation, otherwise false.
*/
public Boolean isPolicyValidationPassed() {
return this.policyValidationPassed;
}
/**
*
* Validation errors if your policy didn't pass validation.
*
*
* @return Validation errors if your policy didn't pass validation.
*/
public java.util.List getValidationErrors() {
return validationErrors;
}
/**
*
* Validation errors if your policy didn't pass validation.
*
*
* @param validationErrors
* Validation errors if your policy didn't pass validation.
*/
public void setValidationErrors(java.util.Collection validationErrors) {
if (validationErrors == null) {
this.validationErrors = null;
return;
}
this.validationErrors = new java.util.ArrayList(validationErrors);
}
/**
*
* Validation errors if your policy didn't pass validation.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setValidationErrors(java.util.Collection)} or {@link #withValidationErrors(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param validationErrors
* Validation errors if your policy didn't pass validation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ValidateResourcePolicyResult withValidationErrors(ValidationErrorsEntry... validationErrors) {
if (this.validationErrors == null) {
setValidationErrors(new java.util.ArrayList(validationErrors.length));
}
for (ValidationErrorsEntry ele : validationErrors) {
this.validationErrors.add(ele);
}
return this;
}
/**
*
* Validation errors if your policy didn't pass validation.
*
*
* @param validationErrors
* Validation errors if your policy didn't pass validation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ValidateResourcePolicyResult withValidationErrors(java.util.Collection validationErrors) {
setValidationErrors(validationErrors);
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 (getPolicyValidationPassed() != null)
sb.append("PolicyValidationPassed: ").append(getPolicyValidationPassed()).append(",");
if (getValidationErrors() != null)
sb.append("ValidationErrors: ").append(getValidationErrors());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ValidateResourcePolicyResult == false)
return false;
ValidateResourcePolicyResult other = (ValidateResourcePolicyResult) obj;
if (other.getPolicyValidationPassed() == null ^ this.getPolicyValidationPassed() == null)
return false;
if (other.getPolicyValidationPassed() != null && other.getPolicyValidationPassed().equals(this.getPolicyValidationPassed()) == false)
return false;
if (other.getValidationErrors() == null ^ this.getValidationErrors() == null)
return false;
if (other.getValidationErrors() != null && other.getValidationErrors().equals(this.getValidationErrors()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPolicyValidationPassed() == null) ? 0 : getPolicyValidationPassed().hashCode());
hashCode = prime * hashCode + ((getValidationErrors() == null) ? 0 : getValidationErrors().hashCode());
return hashCode;
}
@Override
public ValidateResourcePolicyResult clone() {
try {
return (ValidateResourcePolicyResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}