com.amazonaws.services.cloudtrail.model.GetQueryResultsResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudtrail 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.cloudtrail.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetQueryResultsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
*
*/
private String queryStatus;
/**
*
* Shows the count of query results.
*
*/
private QueryStatistics queryStatistics;
/**
*
* Contains the individual event results of the query.
*
*/
private com.amazonaws.internal.SdkInternalList>> queryResultRows;
/**
*
* A token you can use to get the next page of query results.
*
*/
private String nextToken;
/**
*
* The error message returned if a query failed.
*
*/
private String errorMessage;
/**
*
* The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
*
*
* @param queryStatus
* The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
* @see QueryStatus
*/
public void setQueryStatus(String queryStatus) {
this.queryStatus = queryStatus;
}
/**
*
* The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
*
*
* @return The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
* @see QueryStatus
*/
public String getQueryStatus() {
return this.queryStatus;
}
/**
*
* The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
*
*
* @param queryStatus
* The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see QueryStatus
*/
public GetQueryResultsResult withQueryStatus(String queryStatus) {
setQueryStatus(queryStatus);
return this;
}
/**
*
* The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
*
*
* @param queryStatus
* The status of the query. Values include QUEUED
, RUNNING
, FINISHED
,
* FAILED
, TIMED_OUT
, or CANCELLED
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see QueryStatus
*/
public GetQueryResultsResult withQueryStatus(QueryStatus queryStatus) {
this.queryStatus = queryStatus.toString();
return this;
}
/**
*
* Shows the count of query results.
*
*
* @param queryStatistics
* Shows the count of query results.
*/
public void setQueryStatistics(QueryStatistics queryStatistics) {
this.queryStatistics = queryStatistics;
}
/**
*
* Shows the count of query results.
*
*
* @return Shows the count of query results.
*/
public QueryStatistics getQueryStatistics() {
return this.queryStatistics;
}
/**
*
* Shows the count of query results.
*
*
* @param queryStatistics
* Shows the count of query results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetQueryResultsResult withQueryStatistics(QueryStatistics queryStatistics) {
setQueryStatistics(queryStatistics);
return this;
}
/**
*
* Contains the individual event results of the query.
*
*
* @return Contains the individual event results of the query.
*/
public java.util.List>> getQueryResultRows() {
if (queryResultRows == null) {
queryResultRows = new com.amazonaws.internal.SdkInternalList>>();
}
return queryResultRows;
}
/**
*
* Contains the individual event results of the query.
*
*
* @param queryResultRows
* Contains the individual event results of the query.
*/
public void setQueryResultRows(java.util.Collection>> queryResultRows) {
if (queryResultRows == null) {
this.queryResultRows = null;
return;
}
this.queryResultRows = new com.amazonaws.internal.SdkInternalList>>(queryResultRows);
}
/**
*
* Contains the individual event results of the query.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setQueryResultRows(java.util.Collection)} or {@link #withQueryResultRows(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param queryResultRows
* Contains the individual event results of the query.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetQueryResultsResult withQueryResultRows(java.util.List>... queryResultRows) {
if (this.queryResultRows == null) {
setQueryResultRows(new com.amazonaws.internal.SdkInternalList>>(queryResultRows.length));
}
for (java.util.List> ele : queryResultRows) {
this.queryResultRows.add(ele);
}
return this;
}
/**
*
* Contains the individual event results of the query.
*
*
* @param queryResultRows
* Contains the individual event results of the query.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetQueryResultsResult withQueryResultRows(java.util.Collection>> queryResultRows) {
setQueryResultRows(queryResultRows);
return this;
}
/**
*
* A token you can use to get the next page of query results.
*
*
* @param nextToken
* A token you can use to get the next page of query results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* A token you can use to get the next page of query results.
*
*
* @return A token you can use to get the next page of query results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* A token you can use to get the next page of query results.
*
*
* @param nextToken
* A token you can use to get the next page of query results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetQueryResultsResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* The error message returned if a query failed.
*
*
* @param errorMessage
* The error message returned if a query failed.
*/
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
/**
*
* The error message returned if a query failed.
*
*
* @return The error message returned if a query failed.
*/
public String getErrorMessage() {
return this.errorMessage;
}
/**
*
* The error message returned if a query failed.
*
*
* @param errorMessage
* The error message returned if a query failed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetQueryResultsResult withErrorMessage(String errorMessage) {
setErrorMessage(errorMessage);
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 (getQueryStatus() != null)
sb.append("QueryStatus: ").append(getQueryStatus()).append(",");
if (getQueryStatistics() != null)
sb.append("QueryStatistics: ").append(getQueryStatistics()).append(",");
if (getQueryResultRows() != null)
sb.append("QueryResultRows: ").append(getQueryResultRows()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getErrorMessage() != null)
sb.append("ErrorMessage: ").append(getErrorMessage());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetQueryResultsResult == false)
return false;
GetQueryResultsResult other = (GetQueryResultsResult) obj;
if (other.getQueryStatus() == null ^ this.getQueryStatus() == null)
return false;
if (other.getQueryStatus() != null && other.getQueryStatus().equals(this.getQueryStatus()) == false)
return false;
if (other.getQueryStatistics() == null ^ this.getQueryStatistics() == null)
return false;
if (other.getQueryStatistics() != null && other.getQueryStatistics().equals(this.getQueryStatistics()) == false)
return false;
if (other.getQueryResultRows() == null ^ this.getQueryResultRows() == null)
return false;
if (other.getQueryResultRows() != null && other.getQueryResultRows().equals(this.getQueryResultRows()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getErrorMessage() == null ^ this.getErrorMessage() == null)
return false;
if (other.getErrorMessage() != null && other.getErrorMessage().equals(this.getErrorMessage()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getQueryStatus() == null) ? 0 : getQueryStatus().hashCode());
hashCode = prime * hashCode + ((getQueryStatistics() == null) ? 0 : getQueryStatistics().hashCode());
hashCode = prime * hashCode + ((getQueryResultRows() == null) ? 0 : getQueryResultRows().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getErrorMessage() == null) ? 0 : getErrorMessage().hashCode());
return hashCode;
}
@Override
public GetQueryResultsResult clone() {
try {
return (GetQueryResultsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}