/* * 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; /** *

* Scheduled Query *

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

* The Amazon Resource Name. *

*/ private String arn; /** *

* The name of the scheduled query. *

*/ private String name; /** *

* The creation time of the scheduled query. *

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

* State of scheduled query. *

*/ private String state; /** *

* The last time the scheduled query was run. *

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

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

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

* Configuration for scheduled query error reporting. *

*/ private ErrorReportConfiguration errorReportConfiguration; /** *

* Target data source where final scheduled query result will be written. *

*/ private TargetDestination targetDestination; /** *

* Status of the last scheduled query run. *

*/ private String lastRunStatus; /** *

* The Amazon Resource Name. *

* * @param arn * The Amazon Resource Name. */ public void setArn(String arn) { this.arn = arn; } /** *

* The Amazon Resource Name. *

* * @return The Amazon Resource Name. */ public String getArn() { return this.arn; } /** *

* The Amazon Resource Name. *

* * @param arn * The Amazon Resource Name. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQuery withArn(String arn) { setArn(arn); return this; } /** *

* The name of the scheduled query. *

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

* The name of the scheduled query. *

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

* The name of the scheduled query. *

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

* The creation time of the scheduled query. *

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

* The creation time of the scheduled query. *

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

* The creation time of the scheduled query. *

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

* State of scheduled query. *

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

* State of scheduled query. *

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

* State of scheduled query. *

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

* State of scheduled query. *

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

* The last time the scheduled query was run. *

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

* The last time the scheduled query was run. *

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

* The last time the scheduled query was run. *

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

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

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

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

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

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

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

* Configuration for scheduled query error reporting. *

* * @param errorReportConfiguration * Configuration for scheduled query error reporting. */ public void setErrorReportConfiguration(ErrorReportConfiguration errorReportConfiguration) { this.errorReportConfiguration = errorReportConfiguration; } /** *

* Configuration for scheduled query error reporting. *

* * @return Configuration for scheduled query error reporting. */ public ErrorReportConfiguration getErrorReportConfiguration() { return this.errorReportConfiguration; } /** *

* Configuration for scheduled query error reporting. *

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

* Target data source where final scheduled query result will be written. *

* * @param targetDestination * Target data source where final scheduled query result will be written. */ public void setTargetDestination(TargetDestination targetDestination) { this.targetDestination = targetDestination; } /** *

* Target data source where final scheduled query result will be written. *

* * @return Target data source where final scheduled query result will be written. */ public TargetDestination getTargetDestination() { return this.targetDestination; } /** *

* Target data source where final scheduled query result will be written. *

* * @param targetDestination * Target data source where final scheduled query result will be written. * @return Returns a reference to this object so that method calls can be chained together. */ public ScheduledQuery withTargetDestination(TargetDestination targetDestination) { setTargetDestination(targetDestination); return this; } /** *

* Status of the last scheduled query run. *

* * @param lastRunStatus * Status of the last scheduled query run. * @see ScheduledQueryRunStatus */ public void setLastRunStatus(String lastRunStatus) { this.lastRunStatus = lastRunStatus; } /** *

* Status of the last scheduled query run. *

* * @return Status of the last scheduled query run. * @see ScheduledQueryRunStatus */ public String getLastRunStatus() { return this.lastRunStatus; } /** *

* Status of the last scheduled query run. *

* * @param lastRunStatus * Status of the last scheduled query run. * @return Returns a reference to this object so that method calls can be chained together. * @see ScheduledQueryRunStatus */ public ScheduledQuery withLastRunStatus(String lastRunStatus) { setLastRunStatus(lastRunStatus); return this; } /** *

* Status of the last scheduled query run. *

* * @param lastRunStatus * Status of the last scheduled query run. * @return Returns a reference to this object so that method calls can be chained together. * @see ScheduledQueryRunStatus */ public ScheduledQuery withLastRunStatus(ScheduledQueryRunStatus lastRunStatus) { this.lastRunStatus = lastRunStatus.toString(); 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 (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 (getErrorReportConfiguration() != null) sb.append("ErrorReportConfiguration: ").append(getErrorReportConfiguration()).append(","); if (getTargetDestination() != null) sb.append("TargetDestination: ").append(getTargetDestination()).append(","); if (getLastRunStatus() != null) sb.append("LastRunStatus: ").append(getLastRunStatus()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ScheduledQuery == false) return false; ScheduledQuery other = (ScheduledQuery) 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.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.getErrorReportConfiguration() == null ^ this.getErrorReportConfiguration() == null) return false; if (other.getErrorReportConfiguration() != null && other.getErrorReportConfiguration().equals(this.getErrorReportConfiguration()) == false) return false; if (other.getTargetDestination() == null ^ this.getTargetDestination() == null) return false; if (other.getTargetDestination() != null && other.getTargetDestination().equals(this.getTargetDestination()) == false) return false; if (other.getLastRunStatus() == null ^ this.getLastRunStatus() == null) return false; if (other.getLastRunStatus() != null && other.getLastRunStatus().equals(this.getLastRunStatus()) == 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 + ((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 + ((getErrorReportConfiguration() == null) ? 0 : getErrorReportConfiguration().hashCode()); hashCode = prime * hashCode + ((getTargetDestination() == null) ? 0 : getTargetDestination().hashCode()); hashCode = prime * hashCode + ((getLastRunStatus() == null) ? 0 : getLastRunStatus().hashCode()); return hashCode; } @Override public ScheduledQuery clone() { try { return (ScheduledQuery) 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.ScheduledQueryMarshaller.getInstance().marshall(this, protocolMarshaller); } }