/* * 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.resiliencehub.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Defines a recommendation template created with the CreateRecommendationTemplate action. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RecommendationTemplate implements Serializable, Cloneable, StructuredPojo { /** *
* The Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:
* partition
:resiliencehub:region
:account
:app/app-id
. For more
* information about ARNs, see
* Amazon Resource Names (ARNs) in the AWS General Reference guide.
*
* The Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn:partition
* :resiliencehub:region
:account
:app-assessment/app-id
. For more information
* about ARNs, see Amazon
* Resource Names (ARNs) in the AWS General Reference guide.
*
* The end time for the action. *
*/ private java.util.Date endTime; /** ** The format of the recommendation template. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The message for the recommendation template. *
*/ private String message; /** ** The name for the recommendation template. *
*/ private String name; /** ** Indicates if replacements are needed. *
*/ private Boolean needsReplacements; /** ** Identifiers for the recommendations used in the recommendation template. *
*/ private java.util.List* The Amazon Resource Name (ARN) for the recommendation template. *
*/ private String recommendationTemplateArn; /** ** An array of strings that specify the recommendation template type or types. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** The start time for the action. *
*/ private java.util.Date startTime; /** ** The status of the action. *
*/ private String status; /** ** The tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag * consists of a key/value pair. *
*/ private java.util.Map* The file location of the template. *
*/ private S3Location templatesLocation; /** *
* The Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:
* partition
:resiliencehub:region
:account
:app/app-id
. For more
* information about ARNs, see
* Amazon Resource Names (ARNs) in the AWS General Reference guide.
*
partition
:resiliencehub:region
:account
:app/app-id
. For
* more information about ARNs, see Amazon Resource Names
* (ARNs) in the AWS General Reference guide.
*/
public void setAppArn(String appArn) {
this.appArn = appArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:
* partition
:resiliencehub:region
:account
:app/app-id
. For more
* information about ARNs, see
* Amazon Resource Names (ARNs) in the AWS General Reference guide.
*
partition
:resiliencehub:region
:account
:app/app-id
.
* For more information about ARNs, see Amazon Resource Names
* (ARNs) in the AWS General Reference guide.
*/
public String getAppArn() {
return this.appArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:
* partition
:resiliencehub:region
:account
:app/app-id
. For more
* information about ARNs, see
* Amazon Resource Names (ARNs) in the AWS General Reference guide.
*
partition
:resiliencehub:region
:account
:app/app-id
. For
* more information about ARNs, see Amazon Resource Names
* (ARNs) in the AWS General Reference guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecommendationTemplate withAppArn(String appArn) {
setAppArn(appArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn:partition
* :resiliencehub:region
:account
:app-assessment/app-id
. For more information
* about ARNs, see Amazon
* Resource Names (ARNs) in the AWS General Reference guide.
*
partition
* :resiliencehub:region
:account
:app-assessment/app-id
. For more
* information about ARNs, see Amazon Resource Names
* (ARNs) in the AWS General Reference guide.
*/
public void setAssessmentArn(String assessmentArn) {
this.assessmentArn = assessmentArn;
}
/**
*
* The Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn:partition
* :resiliencehub:region
:account
:app-assessment/app-id
. For more information
* about ARNs, see Amazon
* Resource Names (ARNs) in the AWS General Reference guide.
*
partition
* :resiliencehub:region
:account
:app-assessment/app-id
. For more
* information about ARNs, see Amazon Resource Names
* (ARNs) in the AWS General Reference guide.
*/
public String getAssessmentArn() {
return this.assessmentArn;
}
/**
*
* The Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn:partition
* :resiliencehub:region
:account
:app-assessment/app-id
. For more information
* about ARNs, see Amazon
* Resource Names (ARNs) in the AWS General Reference guide.
*
partition
* :resiliencehub:region
:account
:app-assessment/app-id
. For more
* information about ARNs, see Amazon Resource Names
* (ARNs) in the AWS General Reference guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RecommendationTemplate withAssessmentArn(String assessmentArn) {
setAssessmentArn(assessmentArn);
return this;
}
/**
* * The end time for the action. *
* * @param endTime * The end time for the action. */ public void setEndTime(java.util.Date endTime) { this.endTime = endTime; } /** ** The end time for the action. *
* * @return The end time for the action. */ public java.util.Date getEndTime() { return this.endTime; } /** ** The end time for the action. *
* * @param endTime * The end time for the action. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withEndTime(java.util.Date endTime) { setEndTime(endTime); return this; } /** ** The format of the recommendation template. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The format of the recommendation template. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The format of the recommendation template. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The format of the recommendation template. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The template is CloudFormation JSON. *
** The template is CloudFormation YAML. *
** The message for the recommendation template. *
* * @param message * The message for the recommendation template. */ public void setMessage(String message) { this.message = message; } /** ** The message for the recommendation template. *
* * @return The message for the recommendation template. */ public String getMessage() { return this.message; } /** ** The message for the recommendation template. *
* * @param message * The message for the recommendation template. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withMessage(String message) { setMessage(message); return this; } /** ** The name for the recommendation template. *
* * @param name * The name for the recommendation template. */ public void setName(String name) { this.name = name; } /** ** The name for the recommendation template. *
* * @return The name for the recommendation template. */ public String getName() { return this.name; } /** ** The name for the recommendation template. *
* * @param name * The name for the recommendation template. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withName(String name) { setName(name); return this; } /** ** Indicates if replacements are needed. *
* * @param needsReplacements * Indicates if replacements are needed. */ public void setNeedsReplacements(Boolean needsReplacements) { this.needsReplacements = needsReplacements; } /** ** Indicates if replacements are needed. *
* * @return Indicates if replacements are needed. */ public Boolean getNeedsReplacements() { return this.needsReplacements; } /** ** Indicates if replacements are needed. *
* * @param needsReplacements * Indicates if replacements are needed. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withNeedsReplacements(Boolean needsReplacements) { setNeedsReplacements(needsReplacements); return this; } /** ** Indicates if replacements are needed. *
* * @return Indicates if replacements are needed. */ public Boolean isNeedsReplacements() { return this.needsReplacements; } /** ** Identifiers for the recommendations used in the recommendation template. *
* * @return Identifiers for the recommendations used in the recommendation template. */ public java.util.List* Identifiers for the recommendations used in the recommendation template. *
* * @param recommendationIds * Identifiers for the recommendations used in the recommendation template. */ public void setRecommendationIds(java.util.Collection* Identifiers for the recommendations used in the recommendation template. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setRecommendationIds(java.util.Collection)} or {@link #withRecommendationIds(java.util.Collection)} if * you want to override the existing values. *
* * @param recommendationIds * Identifiers for the recommendations used in the recommendation template. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withRecommendationIds(String... recommendationIds) { if (this.recommendationIds == null) { setRecommendationIds(new java.util.ArrayList* Identifiers for the recommendations used in the recommendation template. *
* * @param recommendationIds * Identifiers for the recommendations used in the recommendation template. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withRecommendationIds(java.util.Collection* The Amazon Resource Name (ARN) for the recommendation template. *
* * @param recommendationTemplateArn * The Amazon Resource Name (ARN) for the recommendation template. */ public void setRecommendationTemplateArn(String recommendationTemplateArn) { this.recommendationTemplateArn = recommendationTemplateArn; } /** ** The Amazon Resource Name (ARN) for the recommendation template. *
* * @return The Amazon Resource Name (ARN) for the recommendation template. */ public String getRecommendationTemplateArn() { return this.recommendationTemplateArn; } /** ** The Amazon Resource Name (ARN) for the recommendation template. *
* * @param recommendationTemplateArn * The Amazon Resource Name (ARN) for the recommendation template. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withRecommendationTemplateArn(String recommendationTemplateArn) { setRecommendationTemplateArn(recommendationTemplateArn); return this; } /** ** An array of strings that specify the recommendation template type or types. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** An array of strings that specify the recommendation template type or types. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** An array of strings that specify the recommendation template type or types. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setRecommendationTypes(java.util.Collection)} or {@link #withRecommendationTypes(java.util.Collection)} * if you want to override the existing values. *
* * @param recommendationTypes * An array of strings that specify the recommendation template type or types. ** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** An array of strings that specify the recommendation template type or types. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** An array of strings that specify the recommendation template type or types. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** The template is an AlarmRecommendation template. *
** The template is a SopRecommendation template. *
** The template is a TestRecommendation template. *
** The start time for the action. *
* * @param startTime * The start time for the action. */ public void setStartTime(java.util.Date startTime) { this.startTime = startTime; } /** ** The start time for the action. *
* * @return The start time for the action. */ public java.util.Date getStartTime() { return this.startTime; } /** ** The start time for the action. *
* * @param startTime * The start time for the action. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withStartTime(java.util.Date startTime) { setStartTime(startTime); return this; } /** ** The status of the action. *
* * @param status * The status of the action. * @see RecommendationTemplateStatus */ public void setStatus(String status) { this.status = status; } /** ** The status of the action. *
* * @return The status of the action. * @see RecommendationTemplateStatus */ public String getStatus() { return this.status; } /** ** The status of the action. *
* * @param status * The status of the action. * @return Returns a reference to this object so that method calls can be chained together. * @see RecommendationTemplateStatus */ public RecommendationTemplate withStatus(String status) { setStatus(status); return this; } /** ** The status of the action. *
* * @param status * The status of the action. * @return Returns a reference to this object so that method calls can be chained together. * @see RecommendationTemplateStatus */ public RecommendationTemplate withStatus(RecommendationTemplateStatus status) { this.status = status.toString(); return this; } /** ** The tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag * consists of a key/value pair. *
* * @return The tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. * Each tag consists of a key/value pair. */ public java.util.Map* The tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag * consists of a key/value pair. *
* * @param tags * The tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. * Each tag consists of a key/value pair. */ public void setTags(java.util.Map* The tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. Each tag * consists of a key/value pair. *
* * @param tags * The tags assigned to the resource. A tag is a label that you assign to an Amazon Web Services resource. * Each tag consists of a key/value pair. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withTags(java.util.Map* The file location of the template. *
* * @param templatesLocation * The file location of the template. */ public void setTemplatesLocation(S3Location templatesLocation) { this.templatesLocation = templatesLocation; } /** ** The file location of the template. *
* * @return The file location of the template. */ public S3Location getTemplatesLocation() { return this.templatesLocation; } /** ** The file location of the template. *
* * @param templatesLocation * The file location of the template. * @return Returns a reference to this object so that method calls can be chained together. */ public RecommendationTemplate withTemplatesLocation(S3Location templatesLocation) { setTemplatesLocation(templatesLocation); 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 (getAppArn() != null) sb.append("AppArn: ").append(getAppArn()).append(","); if (getAssessmentArn() != null) sb.append("AssessmentArn: ").append(getAssessmentArn()).append(","); if (getEndTime() != null) sb.append("EndTime: ").append(getEndTime()).append(","); if (getFormat() != null) sb.append("Format: ").append(getFormat()).append(","); if (getMessage() != null) sb.append("Message: ").append(getMessage()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getNeedsReplacements() != null) sb.append("NeedsReplacements: ").append(getNeedsReplacements()).append(","); if (getRecommendationIds() != null) sb.append("RecommendationIds: ").append(getRecommendationIds()).append(","); if (getRecommendationTemplateArn() != null) sb.append("RecommendationTemplateArn: ").append(getRecommendationTemplateArn()).append(","); if (getRecommendationTypes() != null) sb.append("RecommendationTypes: ").append(getRecommendationTypes()).append(","); if (getStartTime() != null) sb.append("StartTime: ").append(getStartTime()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getTags() != null) sb.append("Tags: ").append("***Sensitive Data Redacted***").append(","); if (getTemplatesLocation() != null) sb.append("TemplatesLocation: ").append(getTemplatesLocation()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RecommendationTemplate == false) return false; RecommendationTemplate other = (RecommendationTemplate) obj; if (other.getAppArn() == null ^ this.getAppArn() == null) return false; if (other.getAppArn() != null && other.getAppArn().equals(this.getAppArn()) == false) return false; if (other.getAssessmentArn() == null ^ this.getAssessmentArn() == null) return false; if (other.getAssessmentArn() != null && other.getAssessmentArn().equals(this.getAssessmentArn()) == false) return false; if (other.getEndTime() == null ^ this.getEndTime() == null) return false; if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false) return false; if (other.getFormat() == null ^ this.getFormat() == null) return false; if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == false) return false; if (other.getMessage() == null ^ this.getMessage() == null) return false; if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getNeedsReplacements() == null ^ this.getNeedsReplacements() == null) return false; if (other.getNeedsReplacements() != null && other.getNeedsReplacements().equals(this.getNeedsReplacements()) == false) return false; if (other.getRecommendationIds() == null ^ this.getRecommendationIds() == null) return false; if (other.getRecommendationIds() != null && other.getRecommendationIds().equals(this.getRecommendationIds()) == false) return false; if (other.getRecommendationTemplateArn() == null ^ this.getRecommendationTemplateArn() == null) return false; if (other.getRecommendationTemplateArn() != null && other.getRecommendationTemplateArn().equals(this.getRecommendationTemplateArn()) == false) return false; if (other.getRecommendationTypes() == null ^ this.getRecommendationTypes() == null) return false; if (other.getRecommendationTypes() != null && other.getRecommendationTypes().equals(this.getRecommendationTypes()) == false) return false; if (other.getStartTime() == null ^ this.getStartTime() == null) return false; if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == 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.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getTemplatesLocation() == null ^ this.getTemplatesLocation() == null) return false; if (other.getTemplatesLocation() != null && other.getTemplatesLocation().equals(this.getTemplatesLocation()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAppArn() == null) ? 0 : getAppArn().hashCode()); hashCode = prime * hashCode + ((getAssessmentArn() == null) ? 0 : getAssessmentArn().hashCode()); hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getNeedsReplacements() == null) ? 0 : getNeedsReplacements().hashCode()); hashCode = prime * hashCode + ((getRecommendationIds() == null) ? 0 : getRecommendationIds().hashCode()); hashCode = prime * hashCode + ((getRecommendationTemplateArn() == null) ? 0 : getRecommendationTemplateArn().hashCode()); hashCode = prime * hashCode + ((getRecommendationTypes() == null) ? 0 : getRecommendationTypes().hashCode()); hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getTemplatesLocation() == null) ? 0 : getTemplatesLocation().hashCode()); return hashCode; } @Override public RecommendationTemplate clone() { try { return (RecommendationTemplate) 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.resiliencehub.model.transform.RecommendationTemplateMarshaller.getInstance().marshall(this, protocolMarshaller); } }