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

* Structure that describes scheduled query. *

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

* Scheduled query ARN. *

*/ private String arn; /** *

* Name of the scheduled query. *

*/ private String name; /** *

* The query to be run. *

*/ private String queryString; /** *

* Creation time of the scheduled query. *

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

* State of the scheduled query. *

*/ private String state; /** *

* Last time the query was run. *

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

* The next time the scheduled query is scheduled to run. *

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

* Schedule configuration. *

*/ private ScheduleConfiguration scheduleConfiguration; /** *

* Notification configuration. *

*/ private NotificationConfiguration notificationConfiguration; /** *

* Scheduled query target store configuration. *

*/ private TargetConfiguration targetConfiguration; /** *

* IAM role that Timestream uses to run the schedule query. *

*/ private String scheduledQueryExecutionRoleArn; /** *

* A customer provided KMS key used to encrypt the scheduled query resource. *

*/ private String kmsKeyId; /** *

* Error-reporting configuration for the scheduled query. *

*/ private ErrorReportConfiguration errorReportConfiguration; /** *

* Runtime summary for the last scheduled query run. *

*/ private ScheduledQueryRunSummary lastRunSummary; /** *

* Runtime summary for the last five failed scheduled query runs. *

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

* Scheduled query ARN. *

* * @param arn * Scheduled query ARN. */ public void setArn(String arn) { this.arn = arn; } /** *

* Scheduled query ARN. *

* * @return Scheduled query ARN. */ public String getArn() { return this.arn; } /** *

* Scheduled query ARN. *

* * @param arn * Scheduled query ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withArn(String arn) { setArn(arn); return this; } /** *

* Name of the scheduled query. *

* * @param name * Name of the scheduled query. */ public void setName(String name) { this.name = name; } /** *

* Name of the scheduled query. *

* * @return Name of the scheduled query. */ public String getName() { return this.name; } /** *

* Name of the scheduled query. *

* * @param name * Name of the scheduled query. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withName(String name) { setName(name); return this; } /** *

* The query to be run. *

* * @param queryString * The query to be run. */ public void setQueryString(String queryString) { this.queryString = queryString; } /** *

* The query to be run. *

* * @return The query to be run. */ public String getQueryString() { return this.queryString; } /** *

* The query to be run. *

* * @param queryString * The query to be run. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withQueryString(String queryString) { setQueryString(queryString); return this; } /** *

* Creation time of the scheduled query. *

* * @param creationTime * Creation time of the scheduled query. */ public void setCreationTime(java.util.Date creationTime) { this.creationTime = creationTime; } /** *

* Creation time of the scheduled query. *

* * @return Creation time of the scheduled query. */ public java.util.Date getCreationTime() { return this.creationTime; } /** *

* Creation time of the scheduled query. *

* * @param creationTime * Creation time of the scheduled query. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withCreationTime(java.util.Date creationTime) { setCreationTime(creationTime); return this; } /** *

* State of the scheduled query. *

* * @param state * State of the scheduled query. * @see ScheduledQueryState */ public void setState(String state) { this.state = state; } /** *

* State of the scheduled query. *

* * @return State of the scheduled query. * @see ScheduledQueryState */ public String getState() { return this.state; } /** *

* State of the scheduled query. *

* * @param state * State of the scheduled query. * @return Returns a reference to this object so that method calls can be chained together. * @see ScheduledQueryState */ public ScheduledQueryDescription withState(String state) { setState(state); return this; } /** *

* State of the scheduled query. *

* * @param state * State of the scheduled query. * @return Returns a reference to this object so that method calls can be chained together. * @see ScheduledQueryState */ public ScheduledQueryDescription withState(ScheduledQueryState state) { this.state = state.toString(); return this; } /** *

* Last time the query was run. *

* * @param previousInvocationTime * Last time the query was run. */ public void setPreviousInvocationTime(java.util.Date previousInvocationTime) { this.previousInvocationTime = previousInvocationTime; } /** *

* Last time the query was run. *

* * @return Last time the query was run. */ public java.util.Date getPreviousInvocationTime() { return this.previousInvocationTime; } /** *

* Last time the query was run. *

* * @param previousInvocationTime * Last time the query was run. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withPreviousInvocationTime(java.util.Date previousInvocationTime) { setPreviousInvocationTime(previousInvocationTime); return this; } /** *

* The next time the scheduled query is scheduled to run. *

* * @param nextInvocationTime * The next time the scheduled query is scheduled to run. */ public void setNextInvocationTime(java.util.Date nextInvocationTime) { this.nextInvocationTime = nextInvocationTime; } /** *

* The next time the scheduled query is scheduled to run. *

* * @return The next time the scheduled query is scheduled to run. */ public java.util.Date getNextInvocationTime() { return this.nextInvocationTime; } /** *

* The next time the scheduled query is scheduled to run. *

* * @param nextInvocationTime * The next time the scheduled query is scheduled to run. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withNextInvocationTime(java.util.Date nextInvocationTime) { setNextInvocationTime(nextInvocationTime); return this; } /** *

* Schedule configuration. *

* * @param scheduleConfiguration * Schedule configuration. */ public void setScheduleConfiguration(ScheduleConfiguration scheduleConfiguration) { this.scheduleConfiguration = scheduleConfiguration; } /** *

* Schedule configuration. *

* * @return Schedule configuration. */ public ScheduleConfiguration getScheduleConfiguration() { return this.scheduleConfiguration; } /** *

* Schedule configuration. *

* * @param scheduleConfiguration * Schedule configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withScheduleConfiguration(ScheduleConfiguration scheduleConfiguration) { setScheduleConfiguration(scheduleConfiguration); return this; } /** *

* Notification configuration. *

* * @param notificationConfiguration * Notification configuration. */ public void setNotificationConfiguration(NotificationConfiguration notificationConfiguration) { this.notificationConfiguration = notificationConfiguration; } /** *

* Notification configuration. *

* * @return Notification configuration. */ public NotificationConfiguration getNotificationConfiguration() { return this.notificationConfiguration; } /** *

* Notification configuration. *

* * @param notificationConfiguration * Notification configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withNotificationConfiguration(NotificationConfiguration notificationConfiguration) { setNotificationConfiguration(notificationConfiguration); return this; } /** *

* Scheduled query target store configuration. *

* * @param targetConfiguration * Scheduled query target store configuration. */ public void setTargetConfiguration(TargetConfiguration targetConfiguration) { this.targetConfiguration = targetConfiguration; } /** *

* Scheduled query target store configuration. *

* * @return Scheduled query target store configuration. */ public TargetConfiguration getTargetConfiguration() { return this.targetConfiguration; } /** *

* Scheduled query target store configuration. *

* * @param targetConfiguration * Scheduled query target store configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withTargetConfiguration(TargetConfiguration targetConfiguration) { setTargetConfiguration(targetConfiguration); return this; } /** *

* IAM role that Timestream uses to run the schedule query. *

* * @param scheduledQueryExecutionRoleArn * IAM role that Timestream uses to run the schedule query. */ public void setScheduledQueryExecutionRoleArn(String scheduledQueryExecutionRoleArn) { this.scheduledQueryExecutionRoleArn = scheduledQueryExecutionRoleArn; } /** *

* IAM role that Timestream uses to run the schedule query. *

* * @return IAM role that Timestream uses to run the schedule query. */ public String getScheduledQueryExecutionRoleArn() { return this.scheduledQueryExecutionRoleArn; } /** *

* IAM role that Timestream uses to run the schedule query. *

* * @param scheduledQueryExecutionRoleArn * IAM role that Timestream uses to run the schedule query. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withScheduledQueryExecutionRoleArn(String scheduledQueryExecutionRoleArn) { setScheduledQueryExecutionRoleArn(scheduledQueryExecutionRoleArn); return this; } /** *

* A customer provided KMS key used to encrypt the scheduled query resource. *

* * @param kmsKeyId * A customer provided KMS key used to encrypt the scheduled query resource. */ public void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } /** *

* A customer provided KMS key used to encrypt the scheduled query resource. *

* * @return A customer provided KMS key used to encrypt the scheduled query resource. */ public String getKmsKeyId() { return this.kmsKeyId; } /** *

* A customer provided KMS key used to encrypt the scheduled query resource. *

* * @param kmsKeyId * A customer provided KMS key used to encrypt the scheduled query resource. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withKmsKeyId(String kmsKeyId) { setKmsKeyId(kmsKeyId); return this; } /** *

* Error-reporting configuration for the scheduled query. *

* * @param errorReportConfiguration * Error-reporting configuration for the scheduled query. */ public void setErrorReportConfiguration(ErrorReportConfiguration errorReportConfiguration) { this.errorReportConfiguration = errorReportConfiguration; } /** *

* Error-reporting configuration for the scheduled query. *

* * @return Error-reporting configuration for the scheduled query. */ public ErrorReportConfiguration getErrorReportConfiguration() { return this.errorReportConfiguration; } /** *

* Error-reporting configuration for the scheduled query. *

* * @param errorReportConfiguration * Error-reporting configuration for the scheduled query. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withErrorReportConfiguration(ErrorReportConfiguration errorReportConfiguration) { setErrorReportConfiguration(errorReportConfiguration); return this; } /** *

* Runtime summary for the last scheduled query run. *

* * @param lastRunSummary * Runtime summary for the last scheduled query run. */ public void setLastRunSummary(ScheduledQueryRunSummary lastRunSummary) { this.lastRunSummary = lastRunSummary; } /** *

* Runtime summary for the last scheduled query run. *

* * @return Runtime summary for the last scheduled query run. */ public ScheduledQueryRunSummary getLastRunSummary() { return this.lastRunSummary; } /** *

* Runtime summary for the last scheduled query run. *

* * @param lastRunSummary * Runtime summary for the last scheduled query run. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withLastRunSummary(ScheduledQueryRunSummary lastRunSummary) { setLastRunSummary(lastRunSummary); return this; } /** *

* Runtime summary for the last five failed scheduled query runs. *

* * @return Runtime summary for the last five failed scheduled query runs. */ public java.util.List getRecentlyFailedRuns() { return recentlyFailedRuns; } /** *

* Runtime summary for the last five failed scheduled query runs. *

* * @param recentlyFailedRuns * Runtime summary for the last five failed scheduled query runs. */ public void setRecentlyFailedRuns(java.util.Collection recentlyFailedRuns) { if (recentlyFailedRuns == null) { this.recentlyFailedRuns = null; return; } this.recentlyFailedRuns = new java.util.ArrayList(recentlyFailedRuns); } /** *

* Runtime summary for the last five failed scheduled query runs. *

*

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

* * @param recentlyFailedRuns * Runtime summary for the last five failed scheduled query runs. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withRecentlyFailedRuns(ScheduledQueryRunSummary... recentlyFailedRuns) { if (this.recentlyFailedRuns == null) { setRecentlyFailedRuns(new java.util.ArrayList(recentlyFailedRuns.length)); } for (ScheduledQueryRunSummary ele : recentlyFailedRuns) { this.recentlyFailedRuns.add(ele); } return this; } /** *

* Runtime summary for the last five failed scheduled query runs. *

* * @param recentlyFailedRuns * Runtime summary for the last five failed scheduled query runs. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQueryDescription withRecentlyFailedRuns(java.util.Collection recentlyFailedRuns) { setRecentlyFailedRuns(recentlyFailedRuns); 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 (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getQueryString() != null) sb.append("QueryString: ").append("***Sensitive Data Redacted***").append(","); if (getCreationTime() != null) sb.append("CreationTime: ").append(getCreationTime()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getPreviousInvocationTime() != null) sb.append("PreviousInvocationTime: ").append(getPreviousInvocationTime()).append(","); if (getNextInvocationTime() != null) sb.append("NextInvocationTime: ").append(getNextInvocationTime()).append(","); if (getScheduleConfiguration() != null) sb.append("ScheduleConfiguration: ").append(getScheduleConfiguration()).append(","); if (getNotificationConfiguration() != null) sb.append("NotificationConfiguration: ").append(getNotificationConfiguration()).append(","); if (getTargetConfiguration() != null) sb.append("TargetConfiguration: ").append(getTargetConfiguration()).append(","); if (getScheduledQueryExecutionRoleArn() != null) sb.append("ScheduledQueryExecutionRoleArn: ").append(getScheduledQueryExecutionRoleArn()).append(","); if (getKmsKeyId() != null) sb.append("KmsKeyId: ").append(getKmsKeyId()).append(","); if (getErrorReportConfiguration() != null) sb.append("ErrorReportConfiguration: ").append(getErrorReportConfiguration()).append(","); if (getLastRunSummary() != null) sb.append("LastRunSummary: ").append(getLastRunSummary()).append(","); if (getRecentlyFailedRuns() != null) sb.append("RecentlyFailedRuns: ").append(getRecentlyFailedRuns()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ScheduledQueryDescription == false) return false; ScheduledQueryDescription other = (ScheduledQueryDescription) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == 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.getQueryString() == null ^ this.getQueryString() == null) return false; if (other.getQueryString() != null && other.getQueryString().equals(this.getQueryString()) == false) return false; if (other.getCreationTime() == null ^ this.getCreationTime() == null) return false; if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getPreviousInvocationTime() == null ^ this.getPreviousInvocationTime() == null) return false; if (other.getPreviousInvocationTime() != null && other.getPreviousInvocationTime().equals(this.getPreviousInvocationTime()) == false) return false; if (other.getNextInvocationTime() == null ^ this.getNextInvocationTime() == null) return false; if (other.getNextInvocationTime() != null && other.getNextInvocationTime().equals(this.getNextInvocationTime()) == false) return false; if (other.getScheduleConfiguration() == null ^ this.getScheduleConfiguration() == null) return false; if (other.getScheduleConfiguration() != null && other.getScheduleConfiguration().equals(this.getScheduleConfiguration()) == false) return false; if (other.getNotificationConfiguration() == null ^ this.getNotificationConfiguration() == null) return false; if (other.getNotificationConfiguration() != null && other.getNotificationConfiguration().equals(this.getNotificationConfiguration()) == false) return false; if (other.getTargetConfiguration() == null ^ this.getTargetConfiguration() == null) return false; if (other.getTargetConfiguration() != null && other.getTargetConfiguration().equals(this.getTargetConfiguration()) == false) return false; if (other.getScheduledQueryExecutionRoleArn() == null ^ this.getScheduledQueryExecutionRoleArn() == null) return false; if (other.getScheduledQueryExecutionRoleArn() != null && other.getScheduledQueryExecutionRoleArn().equals(this.getScheduledQueryExecutionRoleArn()) == false) return false; if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null) return false; if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) return false; if (other.getErrorReportConfiguration() == null ^ this.getErrorReportConfiguration() == null) return false; if (other.getErrorReportConfiguration() != null && other.getErrorReportConfiguration().equals(this.getErrorReportConfiguration()) == false) return false; if (other.getLastRunSummary() == null ^ this.getLastRunSummary() == null) return false; if (other.getLastRunSummary() != null && other.getLastRunSummary().equals(this.getLastRunSummary()) == false) return false; if (other.getRecentlyFailedRuns() == null ^ this.getRecentlyFailedRuns() == null) return false; if (other.getRecentlyFailedRuns() != null && other.getRecentlyFailedRuns().equals(this.getRecentlyFailedRuns()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getQueryString() == null) ? 0 : getQueryString().hashCode()); hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getPreviousInvocationTime() == null) ? 0 : getPreviousInvocationTime().hashCode()); hashCode = prime * hashCode + ((getNextInvocationTime() == null) ? 0 : getNextInvocationTime().hashCode()); hashCode = prime * hashCode + ((getScheduleConfiguration() == null) ? 0 : getScheduleConfiguration().hashCode()); hashCode = prime * hashCode + ((getNotificationConfiguration() == null) ? 0 : getNotificationConfiguration().hashCode()); hashCode = prime * hashCode + ((getTargetConfiguration() == null) ? 0 : getTargetConfiguration().hashCode()); hashCode = prime * hashCode + ((getScheduledQueryExecutionRoleArn() == null) ? 0 : getScheduledQueryExecutionRoleArn().hashCode()); hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getErrorReportConfiguration() == null) ? 0 : getErrorReportConfiguration().hashCode()); hashCode = prime * hashCode + ((getLastRunSummary() == null) ? 0 : getLastRunSummary().hashCode()); hashCode = prime * hashCode + ((getRecentlyFailedRuns() == null) ? 0 : getRecentlyFailedRuns().hashCode()); return hashCode; } @Override public ScheduledQueryDescription clone() { try { return (ScheduledQueryDescription) 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.timestreamquery.model.transform.ScheduledQueryDescriptionMarshaller.getInstance().marshall(this, protocolMarshaller); } }