/* * 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.cloudtrail.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class StartQueryRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The SQL code of your query. *

*/ private String queryStatement; /** *

* The URI for the S3 bucket where CloudTrail delivers the query results. *

*/ private String deliveryS3Uri; /** *

* The alias that identifies a query template. *

*/ private String queryAlias; /** *

* The query parameters for the specified QueryAlias. *

*/ private com.amazonaws.internal.SdkInternalList queryParameters; /** *

* The SQL code of your query. *

* * @param queryStatement * The SQL code of your query. */ public void setQueryStatement(String queryStatement) { this.queryStatement = queryStatement; } /** *

* The SQL code of your query. *

* * @return The SQL code of your query. */ public String getQueryStatement() { return this.queryStatement; } /** *

* The SQL code of your query. *

* * @param queryStatement * The SQL code of your query. * @return Returns a reference to this object so that method calls can be chained together. */ public StartQueryRequest withQueryStatement(String queryStatement) { setQueryStatement(queryStatement); return this; } /** *

* The URI for the S3 bucket where CloudTrail delivers the query results. *

* * @param deliveryS3Uri * The URI for the S3 bucket where CloudTrail delivers the query results. */ public void setDeliveryS3Uri(String deliveryS3Uri) { this.deliveryS3Uri = deliveryS3Uri; } /** *

* The URI for the S3 bucket where CloudTrail delivers the query results. *

* * @return The URI for the S3 bucket where CloudTrail delivers the query results. */ public String getDeliveryS3Uri() { return this.deliveryS3Uri; } /** *

* The URI for the S3 bucket where CloudTrail delivers the query results. *

* * @param deliveryS3Uri * The URI for the S3 bucket where CloudTrail delivers the query results. * @return Returns a reference to this object so that method calls can be chained together. */ public StartQueryRequest withDeliveryS3Uri(String deliveryS3Uri) { setDeliveryS3Uri(deliveryS3Uri); return this; } /** *

* The alias that identifies a query template. *

* * @param queryAlias * The alias that identifies a query template. */ public void setQueryAlias(String queryAlias) { this.queryAlias = queryAlias; } /** *

* The alias that identifies a query template. *

* * @return The alias that identifies a query template. */ public String getQueryAlias() { return this.queryAlias; } /** *

* The alias that identifies a query template. *

* * @param queryAlias * The alias that identifies a query template. * @return Returns a reference to this object so that method calls can be chained together. */ public StartQueryRequest withQueryAlias(String queryAlias) { setQueryAlias(queryAlias); return this; } /** *

* The query parameters for the specified QueryAlias. *

* * @return The query parameters for the specified QueryAlias. */ public java.util.List getQueryParameters() { if (queryParameters == null) { queryParameters = new com.amazonaws.internal.SdkInternalList(); } return queryParameters; } /** *

* The query parameters for the specified QueryAlias. *

* * @param queryParameters * The query parameters for the specified QueryAlias. */ public void setQueryParameters(java.util.Collection queryParameters) { if (queryParameters == null) { this.queryParameters = null; return; } this.queryParameters = new com.amazonaws.internal.SdkInternalList(queryParameters); } /** *

* The query parameters for the specified QueryAlias. *

*

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

* * @param queryParameters * The query parameters for the specified QueryAlias. * @return Returns a reference to this object so that method calls can be chained together. */ public StartQueryRequest withQueryParameters(String... queryParameters) { if (this.queryParameters == null) { setQueryParameters(new com.amazonaws.internal.SdkInternalList(queryParameters.length)); } for (String ele : queryParameters) { this.queryParameters.add(ele); } return this; } /** *

* The query parameters for the specified QueryAlias. *

* * @param queryParameters * The query parameters for the specified QueryAlias. * @return Returns a reference to this object so that method calls can be chained together. */ public StartQueryRequest withQueryParameters(java.util.Collection queryParameters) { setQueryParameters(queryParameters); 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 (getQueryStatement() != null) sb.append("QueryStatement: ").append(getQueryStatement()).append(","); if (getDeliveryS3Uri() != null) sb.append("DeliveryS3Uri: ").append(getDeliveryS3Uri()).append(","); if (getQueryAlias() != null) sb.append("QueryAlias: ").append(getQueryAlias()).append(","); if (getQueryParameters() != null) sb.append("QueryParameters: ").append(getQueryParameters()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StartQueryRequest == false) return false; StartQueryRequest other = (StartQueryRequest) obj; if (other.getQueryStatement() == null ^ this.getQueryStatement() == null) return false; if (other.getQueryStatement() != null && other.getQueryStatement().equals(this.getQueryStatement()) == false) return false; if (other.getDeliveryS3Uri() == null ^ this.getDeliveryS3Uri() == null) return false; if (other.getDeliveryS3Uri() != null && other.getDeliveryS3Uri().equals(this.getDeliveryS3Uri()) == false) return false; if (other.getQueryAlias() == null ^ this.getQueryAlias() == null) return false; if (other.getQueryAlias() != null && other.getQueryAlias().equals(this.getQueryAlias()) == false) return false; if (other.getQueryParameters() == null ^ this.getQueryParameters() == null) return false; if (other.getQueryParameters() != null && other.getQueryParameters().equals(this.getQueryParameters()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getQueryStatement() == null) ? 0 : getQueryStatement().hashCode()); hashCode = prime * hashCode + ((getDeliveryS3Uri() == null) ? 0 : getDeliveryS3Uri().hashCode()); hashCode = prime * hashCode + ((getQueryAlias() == null) ? 0 : getQueryAlias().hashCode()); hashCode = prime * hashCode + ((getQueryParameters() == null) ? 0 : getQueryParameters().hashCode()); return hashCode; } @Override public StartQueryRequest clone() { return (StartQueryRequest) super.clone(); } }