com.amazonaws.services.cleanrooms.model.AnalysisRuleCustom Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cleanrooms 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.cleanrooms.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A type of analysis rule that enables the table owner to approve custom SQL queries on their configured tables. It
* supports differential privacy.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AnalysisRuleCustom implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ARN of the analysis templates that are allowed by the custom analysis rule.
*
*/
private java.util.List allowedAnalyses;
/**
*
* The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when
* allowedAnalyses
is ANY_QUERY
.
*
*/
private java.util.List allowedAnalysisProviders;
/**
*
* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the
* direct query.
*
*/
private String additionalAnalyses;
/**
*
* A list of columns that aren't allowed to be shown in the query output.
*
*/
private java.util.List disallowedOutputColumns;
/**
*
* The differential privacy configuration.
*
*/
private DifferentialPrivacyConfiguration differentialPrivacy;
/**
*
* The ARN of the analysis templates that are allowed by the custom analysis rule.
*
*
* @return The ARN of the analysis templates that are allowed by the custom analysis rule.
*/
public java.util.List getAllowedAnalyses() {
return allowedAnalyses;
}
/**
*
* The ARN of the analysis templates that are allowed by the custom analysis rule.
*
*
* @param allowedAnalyses
* The ARN of the analysis templates that are allowed by the custom analysis rule.
*/
public void setAllowedAnalyses(java.util.Collection allowedAnalyses) {
if (allowedAnalyses == null) {
this.allowedAnalyses = null;
return;
}
this.allowedAnalyses = new java.util.ArrayList(allowedAnalyses);
}
/**
*
* The ARN of the analysis templates that are allowed by the custom analysis rule.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAllowedAnalyses(java.util.Collection)} or {@link #withAllowedAnalyses(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param allowedAnalyses
* The ARN of the analysis templates that are allowed by the custom analysis rule.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalysisRuleCustom withAllowedAnalyses(String... allowedAnalyses) {
if (this.allowedAnalyses == null) {
setAllowedAnalyses(new java.util.ArrayList(allowedAnalyses.length));
}
for (String ele : allowedAnalyses) {
this.allowedAnalyses.add(ele);
}
return this;
}
/**
*
* The ARN of the analysis templates that are allowed by the custom analysis rule.
*
*
* @param allowedAnalyses
* The ARN of the analysis templates that are allowed by the custom analysis rule.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalysisRuleCustom withAllowedAnalyses(java.util.Collection allowedAnalyses) {
setAllowedAnalyses(allowedAnalyses);
return this;
}
/**
*
* The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when
* allowedAnalyses
is ANY_QUERY
.
*
*
* @return The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule.
* Required when allowedAnalyses
is ANY_QUERY
.
*/
public java.util.List getAllowedAnalysisProviders() {
return allowedAnalysisProviders;
}
/**
*
* The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when
* allowedAnalyses
is ANY_QUERY
.
*
*
* @param allowedAnalysisProviders
* The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule.
* Required when allowedAnalyses
is ANY_QUERY
.
*/
public void setAllowedAnalysisProviders(java.util.Collection allowedAnalysisProviders) {
if (allowedAnalysisProviders == null) {
this.allowedAnalysisProviders = null;
return;
}
this.allowedAnalysisProviders = new java.util.ArrayList(allowedAnalysisProviders);
}
/**
*
* The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when
* allowedAnalyses
is ANY_QUERY
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAllowedAnalysisProviders(java.util.Collection)} or
* {@link #withAllowedAnalysisProviders(java.util.Collection)} if you want to override the existing values.
*
*
* @param allowedAnalysisProviders
* The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule.
* Required when allowedAnalyses
is ANY_QUERY
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalysisRuleCustom withAllowedAnalysisProviders(String... allowedAnalysisProviders) {
if (this.allowedAnalysisProviders == null) {
setAllowedAnalysisProviders(new java.util.ArrayList(allowedAnalysisProviders.length));
}
for (String ele : allowedAnalysisProviders) {
this.allowedAnalysisProviders.add(ele);
}
return this;
}
/**
*
* The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when
* allowedAnalyses
is ANY_QUERY
.
*
*
* @param allowedAnalysisProviders
* The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule.
* Required when allowedAnalyses
is ANY_QUERY
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalysisRuleCustom withAllowedAnalysisProviders(java.util.Collection allowedAnalysisProviders) {
setAllowedAnalysisProviders(allowedAnalysisProviders);
return this;
}
/**
*
* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the
* direct query.
*
*
* @param additionalAnalyses
* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of
* the direct query.
* @see AdditionalAnalyses
*/
public void setAdditionalAnalyses(String additionalAnalyses) {
this.additionalAnalyses = additionalAnalyses;
}
/**
*
* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the
* direct query.
*
*
* @return An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of
* the direct query.
* @see AdditionalAnalyses
*/
public String getAdditionalAnalyses() {
return this.additionalAnalyses;
}
/**
*
* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the
* direct query.
*
*
* @param additionalAnalyses
* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of
* the direct query.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AdditionalAnalyses
*/
public AnalysisRuleCustom withAdditionalAnalyses(String additionalAnalyses) {
setAdditionalAnalyses(additionalAnalyses);
return this;
}
/**
*
* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the
* direct query.
*
*
* @param additionalAnalyses
* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of
* the direct query.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AdditionalAnalyses
*/
public AnalysisRuleCustom withAdditionalAnalyses(AdditionalAnalyses additionalAnalyses) {
this.additionalAnalyses = additionalAnalyses.toString();
return this;
}
/**
*
* A list of columns that aren't allowed to be shown in the query output.
*
*
* @return A list of columns that aren't allowed to be shown in the query output.
*/
public java.util.List getDisallowedOutputColumns() {
return disallowedOutputColumns;
}
/**
*
* A list of columns that aren't allowed to be shown in the query output.
*
*
* @param disallowedOutputColumns
* A list of columns that aren't allowed to be shown in the query output.
*/
public void setDisallowedOutputColumns(java.util.Collection disallowedOutputColumns) {
if (disallowedOutputColumns == null) {
this.disallowedOutputColumns = null;
return;
}
this.disallowedOutputColumns = new java.util.ArrayList(disallowedOutputColumns);
}
/**
*
* A list of columns that aren't allowed to be shown in the query output.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDisallowedOutputColumns(java.util.Collection)} or
* {@link #withDisallowedOutputColumns(java.util.Collection)} if you want to override the existing values.
*
*
* @param disallowedOutputColumns
* A list of columns that aren't allowed to be shown in the query output.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalysisRuleCustom withDisallowedOutputColumns(String... disallowedOutputColumns) {
if (this.disallowedOutputColumns == null) {
setDisallowedOutputColumns(new java.util.ArrayList(disallowedOutputColumns.length));
}
for (String ele : disallowedOutputColumns) {
this.disallowedOutputColumns.add(ele);
}
return this;
}
/**
*
* A list of columns that aren't allowed to be shown in the query output.
*
*
* @param disallowedOutputColumns
* A list of columns that aren't allowed to be shown in the query output.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalysisRuleCustom withDisallowedOutputColumns(java.util.Collection disallowedOutputColumns) {
setDisallowedOutputColumns(disallowedOutputColumns);
return this;
}
/**
*
* The differential privacy configuration.
*
*
* @param differentialPrivacy
* The differential privacy configuration.
*/
public void setDifferentialPrivacy(DifferentialPrivacyConfiguration differentialPrivacy) {
this.differentialPrivacy = differentialPrivacy;
}
/**
*
* The differential privacy configuration.
*
*
* @return The differential privacy configuration.
*/
public DifferentialPrivacyConfiguration getDifferentialPrivacy() {
return this.differentialPrivacy;
}
/**
*
* The differential privacy configuration.
*
*
* @param differentialPrivacy
* The differential privacy configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnalysisRuleCustom withDifferentialPrivacy(DifferentialPrivacyConfiguration differentialPrivacy) {
setDifferentialPrivacy(differentialPrivacy);
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 (getAllowedAnalyses() != null)
sb.append("AllowedAnalyses: ").append(getAllowedAnalyses()).append(",");
if (getAllowedAnalysisProviders() != null)
sb.append("AllowedAnalysisProviders: ").append(getAllowedAnalysisProviders()).append(",");
if (getAdditionalAnalyses() != null)
sb.append("AdditionalAnalyses: ").append(getAdditionalAnalyses()).append(",");
if (getDisallowedOutputColumns() != null)
sb.append("DisallowedOutputColumns: ").append(getDisallowedOutputColumns()).append(",");
if (getDifferentialPrivacy() != null)
sb.append("DifferentialPrivacy: ").append(getDifferentialPrivacy());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AnalysisRuleCustom == false)
return false;
AnalysisRuleCustom other = (AnalysisRuleCustom) obj;
if (other.getAllowedAnalyses() == null ^ this.getAllowedAnalyses() == null)
return false;
if (other.getAllowedAnalyses() != null && other.getAllowedAnalyses().equals(this.getAllowedAnalyses()) == false)
return false;
if (other.getAllowedAnalysisProviders() == null ^ this.getAllowedAnalysisProviders() == null)
return false;
if (other.getAllowedAnalysisProviders() != null && other.getAllowedAnalysisProviders().equals(this.getAllowedAnalysisProviders()) == false)
return false;
if (other.getAdditionalAnalyses() == null ^ this.getAdditionalAnalyses() == null)
return false;
if (other.getAdditionalAnalyses() != null && other.getAdditionalAnalyses().equals(this.getAdditionalAnalyses()) == false)
return false;
if (other.getDisallowedOutputColumns() == null ^ this.getDisallowedOutputColumns() == null)
return false;
if (other.getDisallowedOutputColumns() != null && other.getDisallowedOutputColumns().equals(this.getDisallowedOutputColumns()) == false)
return false;
if (other.getDifferentialPrivacy() == null ^ this.getDifferentialPrivacy() == null)
return false;
if (other.getDifferentialPrivacy() != null && other.getDifferentialPrivacy().equals(this.getDifferentialPrivacy()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAllowedAnalyses() == null) ? 0 : getAllowedAnalyses().hashCode());
hashCode = prime * hashCode + ((getAllowedAnalysisProviders() == null) ? 0 : getAllowedAnalysisProviders().hashCode());
hashCode = prime * hashCode + ((getAdditionalAnalyses() == null) ? 0 : getAdditionalAnalyses().hashCode());
hashCode = prime * hashCode + ((getDisallowedOutputColumns() == null) ? 0 : getDisallowedOutputColumns().hashCode());
hashCode = prime * hashCode + ((getDifferentialPrivacy() == null) ? 0 : getDifferentialPrivacy().hashCode());
return hashCode;
}
@Override
public AnalysisRuleCustom clone() {
try {
return (AnalysisRuleCustom) 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.cleanrooms.model.transform.AnalysisRuleCustomMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}