All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.cleanrooms.model.AnalysisRuleAggregation Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Clean Rooms module holds the client classes that are used for communicating with Clean Rooms.

There is a newer version: 2.28.3
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.cleanrooms.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* A type of analysis rule that enables query structure and specified queries that produce aggregate statistics. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AnalysisRuleAggregation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField> AGGREGATE_COLUMNS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("aggregateColumns") .getter(getter(AnalysisRuleAggregation::aggregateColumns)) .setter(setter(Builder::aggregateColumns)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("aggregateColumns").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(AggregateColumn::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> JOIN_COLUMNS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("joinColumns") .getter(getter(AnalysisRuleAggregation::joinColumns)) .setter(setter(Builder::joinColumns)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("joinColumns").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField JOIN_REQUIRED_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("joinRequired").getter(getter(AnalysisRuleAggregation::joinRequiredAsString)) .setter(setter(Builder::joinRequired)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("joinRequired").build()).build(); private static final SdkField> ALLOWED_JOIN_OPERATORS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("allowedJoinOperators") .getter(getter(AnalysisRuleAggregation::allowedJoinOperatorsAsStrings)) .setter(setter(Builder::allowedJoinOperatorsWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("allowedJoinOperators").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> DIMENSION_COLUMNS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("dimensionColumns") .getter(getter(AnalysisRuleAggregation::dimensionColumns)) .setter(setter(Builder::dimensionColumns)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dimensionColumns").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> SCALAR_FUNCTIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("scalarFunctions") .getter(getter(AnalysisRuleAggregation::scalarFunctionsAsStrings)) .setter(setter(Builder::scalarFunctionsWithStrings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("scalarFunctions").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> OUTPUT_CONSTRAINTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("outputConstraints") .getter(getter(AnalysisRuleAggregation::outputConstraints)) .setter(setter(Builder::outputConstraints)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("outputConstraints").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(AggregationConstraint::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField ADDITIONAL_ANALYSES_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("additionalAnalyses").getter(getter(AnalysisRuleAggregation::additionalAnalysesAsString)) .setter(setter(Builder::additionalAnalyses)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("additionalAnalyses").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(AGGREGATE_COLUMNS_FIELD, JOIN_COLUMNS_FIELD, JOIN_REQUIRED_FIELD, ALLOWED_JOIN_OPERATORS_FIELD, DIMENSION_COLUMNS_FIELD, SCALAR_FUNCTIONS_FIELD, OUTPUT_CONSTRAINTS_FIELD, ADDITIONAL_ANALYSES_FIELD)); private static final long serialVersionUID = 1L; private final List aggregateColumns; private final List joinColumns; private final String joinRequired; private final List allowedJoinOperators; private final List dimensionColumns; private final List scalarFunctions; private final List outputConstraints; private final String additionalAnalyses; private AnalysisRuleAggregation(BuilderImpl builder) { this.aggregateColumns = builder.aggregateColumns; this.joinColumns = builder.joinColumns; this.joinRequired = builder.joinRequired; this.allowedJoinOperators = builder.allowedJoinOperators; this.dimensionColumns = builder.dimensionColumns; this.scalarFunctions = builder.scalarFunctions; this.outputConstraints = builder.outputConstraints; this.additionalAnalyses = builder.additionalAnalyses; } /** * For responses, this returns true if the service returned a value for the AggregateColumns property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasAggregateColumns() { return aggregateColumns != null && !(aggregateColumns instanceof SdkAutoConstructList); } /** *

* The columns that query runners are allowed to use in aggregation queries. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAggregateColumns} method. *

* * @return The columns that query runners are allowed to use in aggregation queries. */ public final List aggregateColumns() { return aggregateColumns; } /** * For responses, this returns true if the service returned a value for the JoinColumns property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasJoinColumns() { return joinColumns != null && !(joinColumns instanceof SdkAutoConstructList); } /** *

* Columns in configured table that can be used in join statements and/or as aggregate columns. They can never be * outputted directly. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasJoinColumns} method. *

* * @return Columns in configured table that can be used in join statements and/or as aggregate columns. They can * never be outputted directly. */ public final List joinColumns() { return joinColumns; } /** *

* Control that requires member who runs query to do a join with their configured table and/or other configured * table in query. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #joinRequired} will * return {@link JoinRequiredOption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #joinRequiredAsString}. *

* * @return Control that requires member who runs query to do a join with their configured table and/or other * configured table in query. * @see JoinRequiredOption */ public final JoinRequiredOption joinRequired() { return JoinRequiredOption.fromValue(joinRequired); } /** *

* Control that requires member who runs query to do a join with their configured table and/or other configured * table in query. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #joinRequired} will * return {@link JoinRequiredOption#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #joinRequiredAsString}. *

* * @return Control that requires member who runs query to do a join with their configured table and/or other * configured table in query. * @see JoinRequiredOption */ public final String joinRequiredAsString() { return joinRequired; } /** *

* Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is AND. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAllowedJoinOperators} method. *

* * @return Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is * AND. */ public final List allowedJoinOperators() { return JoinOperatorsListCopier.copyStringToEnum(allowedJoinOperators); } /** * For responses, this returns true if the service returned a value for the AllowedJoinOperators property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasAllowedJoinOperators() { return allowedJoinOperators != null && !(allowedJoinOperators instanceof SdkAutoConstructList); } /** *

* Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is AND. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasAllowedJoinOperators} method. *

* * @return Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is * AND. */ public final List allowedJoinOperatorsAsStrings() { return allowedJoinOperators; } /** * For responses, this returns true if the service returned a value for the DimensionColumns property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasDimensionColumns() { return dimensionColumns != null && !(dimensionColumns instanceof SdkAutoConstructList); } /** *

* The columns that query runners are allowed to select, group by, or filter by. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasDimensionColumns} method. *

* * @return The columns that query runners are allowed to select, group by, or filter by. */ public final List dimensionColumns() { return dimensionColumns; } /** *

* Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of * metrics. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasScalarFunctions} method. *

* * @return Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of * metrics. */ public final List scalarFunctions() { return ScalarFunctionsListCopier.copyStringToEnum(scalarFunctions); } /** * For responses, this returns true if the service returned a value for the ScalarFunctions property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasScalarFunctions() { return scalarFunctions != null && !(scalarFunctions instanceof SdkAutoConstructList); } /** *

* Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of * metrics. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasScalarFunctions} method. *

* * @return Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of * metrics. */ public final List scalarFunctionsAsStrings() { return scalarFunctions; } /** * For responses, this returns true if the service returned a value for the OutputConstraints property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasOutputConstraints() { return outputConstraints != null && !(outputConstraints instanceof SdkAutoConstructList); } /** *

* Columns that must meet a specific threshold value (after an aggregation function is applied to it) for each * output row to be returned. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasOutputConstraints} method. *

* * @return Columns that must meet a specific threshold value (after an aggregation function is applied to it) for * each output row to be returned. */ public final List outputConstraints() { return outputConstraints; } /** *

* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the * direct query. *

*

* The additionalAnalyses parameter is currently supported for the list analysis rule ( * AnalysisRuleList) and the custom analysis rule (AnalysisRuleCustom). *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #additionalAnalyses} will return {@link AdditionalAnalyses#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #additionalAnalysesAsString}. *

* * @return An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of * the direct query.

*

* The additionalAnalyses parameter is currently supported for the list analysis rule ( * AnalysisRuleList) and the custom analysis rule (AnalysisRuleCustom). * @see AdditionalAnalyses */ public final AdditionalAnalyses additionalAnalyses() { return AdditionalAnalyses.fromValue(additionalAnalyses); } /** *

* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the * direct query. *

*

* The additionalAnalyses parameter is currently supported for the list analysis rule ( * AnalysisRuleList) and the custom analysis rule (AnalysisRuleCustom). *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #additionalAnalyses} will return {@link AdditionalAnalyses#UNKNOWN_TO_SDK_VERSION}. The raw value returned * by the service is available from {@link #additionalAnalysesAsString}. *

* * @return An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of * the direct query.

*

* The additionalAnalyses parameter is currently supported for the list analysis rule ( * AnalysisRuleList) and the custom analysis rule (AnalysisRuleCustom). * @see AdditionalAnalyses */ public final String additionalAnalysesAsString() { return additionalAnalyses; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(hasAggregateColumns() ? aggregateColumns() : null); hashCode = 31 * hashCode + Objects.hashCode(hasJoinColumns() ? joinColumns() : null); hashCode = 31 * hashCode + Objects.hashCode(joinRequiredAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasAllowedJoinOperators() ? allowedJoinOperatorsAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(hasDimensionColumns() ? dimensionColumns() : null); hashCode = 31 * hashCode + Objects.hashCode(hasScalarFunctions() ? scalarFunctionsAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(hasOutputConstraints() ? outputConstraints() : null); hashCode = 31 * hashCode + Objects.hashCode(additionalAnalysesAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AnalysisRuleAggregation)) { return false; } AnalysisRuleAggregation other = (AnalysisRuleAggregation) obj; return hasAggregateColumns() == other.hasAggregateColumns() && Objects.equals(aggregateColumns(), other.aggregateColumns()) && hasJoinColumns() == other.hasJoinColumns() && Objects.equals(joinColumns(), other.joinColumns()) && Objects.equals(joinRequiredAsString(), other.joinRequiredAsString()) && hasAllowedJoinOperators() == other.hasAllowedJoinOperators() && Objects.equals(allowedJoinOperatorsAsStrings(), other.allowedJoinOperatorsAsStrings()) && hasDimensionColumns() == other.hasDimensionColumns() && Objects.equals(dimensionColumns(), other.dimensionColumns()) && hasScalarFunctions() == other.hasScalarFunctions() && Objects.equals(scalarFunctionsAsStrings(), other.scalarFunctionsAsStrings()) && hasOutputConstraints() == other.hasOutputConstraints() && Objects.equals(outputConstraints(), other.outputConstraints()) && Objects.equals(additionalAnalysesAsString(), other.additionalAnalysesAsString()); } /** * 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. */ @Override public final String toString() { return ToString.builder("AnalysisRuleAggregation") .add("AggregateColumns", hasAggregateColumns() ? aggregateColumns() : null) .add("JoinColumns", hasJoinColumns() ? joinColumns() : null).add("JoinRequired", joinRequiredAsString()) .add("AllowedJoinOperators", hasAllowedJoinOperators() ? allowedJoinOperatorsAsStrings() : null) .add("DimensionColumns", hasDimensionColumns() ? dimensionColumns() : null) .add("ScalarFunctions", hasScalarFunctions() ? scalarFunctionsAsStrings() : null) .add("OutputConstraints", hasOutputConstraints() ? outputConstraints() : null) .add("AdditionalAnalyses", additionalAnalysesAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "aggregateColumns": return Optional.ofNullable(clazz.cast(aggregateColumns())); case "joinColumns": return Optional.ofNullable(clazz.cast(joinColumns())); case "joinRequired": return Optional.ofNullable(clazz.cast(joinRequiredAsString())); case "allowedJoinOperators": return Optional.ofNullable(clazz.cast(allowedJoinOperatorsAsStrings())); case "dimensionColumns": return Optional.ofNullable(clazz.cast(dimensionColumns())); case "scalarFunctions": return Optional.ofNullable(clazz.cast(scalarFunctionsAsStrings())); case "outputConstraints": return Optional.ofNullable(clazz.cast(outputConstraints())); case "additionalAnalyses": return Optional.ofNullable(clazz.cast(additionalAnalysesAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AnalysisRuleAggregation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The columns that query runners are allowed to use in aggregation queries. *

* * @param aggregateColumns * The columns that query runners are allowed to use in aggregation queries. * @return Returns a reference to this object so that method calls can be chained together. */ Builder aggregateColumns(Collection aggregateColumns); /** *

* The columns that query runners are allowed to use in aggregation queries. *

* * @param aggregateColumns * The columns that query runners are allowed to use in aggregation queries. * @return Returns a reference to this object so that method calls can be chained together. */ Builder aggregateColumns(AggregateColumn... aggregateColumns); /** *

* The columns that query runners are allowed to use in aggregation queries. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.cleanrooms.model.AggregateColumn.Builder} avoiding the need to create * one manually via {@link software.amazon.awssdk.services.cleanrooms.model.AggregateColumn#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.cleanrooms.model.AggregateColumn.Builder#build()} is called * immediately and its result is passed to {@link #aggregateColumns(List)}. * * @param aggregateColumns * a consumer that will call methods on * {@link software.amazon.awssdk.services.cleanrooms.model.AggregateColumn.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #aggregateColumns(java.util.Collection) */ Builder aggregateColumns(Consumer... aggregateColumns); /** *

* Columns in configured table that can be used in join statements and/or as aggregate columns. They can never * be outputted directly. *

* * @param joinColumns * Columns in configured table that can be used in join statements and/or as aggregate columns. They can * never be outputted directly. * @return Returns a reference to this object so that method calls can be chained together. */ Builder joinColumns(Collection joinColumns); /** *

* Columns in configured table that can be used in join statements and/or as aggregate columns. They can never * be outputted directly. *

* * @param joinColumns * Columns in configured table that can be used in join statements and/or as aggregate columns. They can * never be outputted directly. * @return Returns a reference to this object so that method calls can be chained together. */ Builder joinColumns(String... joinColumns); /** *

* Control that requires member who runs query to do a join with their configured table and/or other configured * table in query. *

* * @param joinRequired * Control that requires member who runs query to do a join with their configured table and/or other * configured table in query. * @see JoinRequiredOption * @return Returns a reference to this object so that method calls can be chained together. * @see JoinRequiredOption */ Builder joinRequired(String joinRequired); /** *

* Control that requires member who runs query to do a join with their configured table and/or other configured * table in query. *

* * @param joinRequired * Control that requires member who runs query to do a join with their configured table and/or other * configured table in query. * @see JoinRequiredOption * @return Returns a reference to this object so that method calls can be chained together. * @see JoinRequiredOption */ Builder joinRequired(JoinRequiredOption joinRequired); /** *

* Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is AND * . *

* * @param allowedJoinOperators * Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is * AND. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allowedJoinOperatorsWithStrings(Collection allowedJoinOperators); /** *

* Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is AND * . *

* * @param allowedJoinOperators * Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is * AND. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allowedJoinOperatorsWithStrings(String... allowedJoinOperators); /** *

* Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is AND * . *

* * @param allowedJoinOperators * Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is * AND. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allowedJoinOperators(Collection allowedJoinOperators); /** *

* Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is AND * . *

* * @param allowedJoinOperators * Which logical operators (if any) are to be used in an INNER JOIN match condition. Default is * AND. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allowedJoinOperators(JoinOperator... allowedJoinOperators); /** *

* The columns that query runners are allowed to select, group by, or filter by. *

* * @param dimensionColumns * The columns that query runners are allowed to select, group by, or filter by. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dimensionColumns(Collection dimensionColumns); /** *

* The columns that query runners are allowed to select, group by, or filter by. *

* * @param dimensionColumns * The columns that query runners are allowed to select, group by, or filter by. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dimensionColumns(String... dimensionColumns); /** *

* Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of * metrics. *

* * @param scalarFunctions * Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation * of metrics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scalarFunctionsWithStrings(Collection scalarFunctions); /** *

* Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of * metrics. *

* * @param scalarFunctions * Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation * of metrics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scalarFunctionsWithStrings(String... scalarFunctions); /** *

* Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of * metrics. *

* * @param scalarFunctions * Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation * of metrics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scalarFunctions(Collection scalarFunctions); /** *

* Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation of * metrics. *

* * @param scalarFunctions * Set of scalar functions that are allowed to be used on dimension columns and the output of aggregation * of metrics. * @return Returns a reference to this object so that method calls can be chained together. */ Builder scalarFunctions(ScalarFunctions... scalarFunctions); /** *

* Columns that must meet a specific threshold value (after an aggregation function is applied to it) for each * output row to be returned. *

* * @param outputConstraints * Columns that must meet a specific threshold value (after an aggregation function is applied to it) for * each output row to be returned. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputConstraints(Collection outputConstraints); /** *

* Columns that must meet a specific threshold value (after an aggregation function is applied to it) for each * output row to be returned. *

* * @param outputConstraints * Columns that must meet a specific threshold value (after an aggregation function is applied to it) for * each output row to be returned. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputConstraints(AggregationConstraint... outputConstraints); /** *

* Columns that must meet a specific threshold value (after an aggregation function is applied to it) for each * output row to be returned. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.cleanrooms.model.AggregationConstraint.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.cleanrooms.model.AggregationConstraint#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.cleanrooms.model.AggregationConstraint.Builder#build()} is called * immediately and its result is passed to {@link #outputConstraints(List)}. * * @param outputConstraints * a consumer that will call methods on * {@link software.amazon.awssdk.services.cleanrooms.model.AggregationConstraint.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputConstraints(java.util.Collection) */ Builder outputConstraints(Consumer... outputConstraints); /** *

* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the * direct query. *

*

* The additionalAnalyses parameter is currently supported for the list analysis rule ( * AnalysisRuleList) and the custom analysis rule (AnalysisRuleCustom). *

* * @param additionalAnalyses * An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output * of the direct query.

*

* The additionalAnalyses parameter is currently supported for the list analysis rule ( * AnalysisRuleList) and the custom analysis rule (AnalysisRuleCustom). * @see AdditionalAnalyses * @return Returns a reference to this object so that method calls can be chained together. * @see AdditionalAnalyses */ Builder additionalAnalyses(String additionalAnalyses); /** *

* An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the * direct query. *

*

* The additionalAnalyses parameter is currently supported for the list analysis rule ( * AnalysisRuleList) and the custom analysis rule (AnalysisRuleCustom). *

* * @param additionalAnalyses * An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output * of the direct query.

*

* The additionalAnalyses parameter is currently supported for the list analysis rule ( * AnalysisRuleList) and the custom analysis rule (AnalysisRuleCustom). * @see AdditionalAnalyses * @return Returns a reference to this object so that method calls can be chained together. * @see AdditionalAnalyses */ Builder additionalAnalyses(AdditionalAnalyses additionalAnalyses); } static final class BuilderImpl implements Builder { private List aggregateColumns = DefaultSdkAutoConstructList.getInstance(); private List joinColumns = DefaultSdkAutoConstructList.getInstance(); private String joinRequired; private List allowedJoinOperators = DefaultSdkAutoConstructList.getInstance(); private List dimensionColumns = DefaultSdkAutoConstructList.getInstance(); private List scalarFunctions = DefaultSdkAutoConstructList.getInstance(); private List outputConstraints = DefaultSdkAutoConstructList.getInstance(); private String additionalAnalyses; private BuilderImpl() { } private BuilderImpl(AnalysisRuleAggregation model) { aggregateColumns(model.aggregateColumns); joinColumns(model.joinColumns); joinRequired(model.joinRequired); allowedJoinOperatorsWithStrings(model.allowedJoinOperators); dimensionColumns(model.dimensionColumns); scalarFunctionsWithStrings(model.scalarFunctions); outputConstraints(model.outputConstraints); additionalAnalyses(model.additionalAnalyses); } public final List getAggregateColumns() { List result = AnalysisRuleAggregationAggregateColumnsListCopier .copyToBuilder(this.aggregateColumns); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAggregateColumns(Collection aggregateColumns) { this.aggregateColumns = AnalysisRuleAggregationAggregateColumnsListCopier.copyFromBuilder(aggregateColumns); } @Override public final Builder aggregateColumns(Collection aggregateColumns) { this.aggregateColumns = AnalysisRuleAggregationAggregateColumnsListCopier.copy(aggregateColumns); return this; } @Override @SafeVarargs public final Builder aggregateColumns(AggregateColumn... aggregateColumns) { aggregateColumns(Arrays.asList(aggregateColumns)); return this; } @Override @SafeVarargs public final Builder aggregateColumns(Consumer... aggregateColumns) { aggregateColumns(Stream.of(aggregateColumns).map(c -> AggregateColumn.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final Collection getJoinColumns() { if (joinColumns instanceof SdkAutoConstructList) { return null; } return joinColumns; } public final void setJoinColumns(Collection joinColumns) { this.joinColumns = AnalysisRuleColumnListCopier.copy(joinColumns); } @Override public final Builder joinColumns(Collection joinColumns) { this.joinColumns = AnalysisRuleColumnListCopier.copy(joinColumns); return this; } @Override @SafeVarargs public final Builder joinColumns(String... joinColumns) { joinColumns(Arrays.asList(joinColumns)); return this; } public final String getJoinRequired() { return joinRequired; } public final void setJoinRequired(String joinRequired) { this.joinRequired = joinRequired; } @Override public final Builder joinRequired(String joinRequired) { this.joinRequired = joinRequired; return this; } @Override public final Builder joinRequired(JoinRequiredOption joinRequired) { this.joinRequired(joinRequired == null ? null : joinRequired.toString()); return this; } public final Collection getAllowedJoinOperators() { if (allowedJoinOperators instanceof SdkAutoConstructList) { return null; } return allowedJoinOperators; } public final void setAllowedJoinOperators(Collection allowedJoinOperators) { this.allowedJoinOperators = JoinOperatorsListCopier.copy(allowedJoinOperators); } @Override public final Builder allowedJoinOperatorsWithStrings(Collection allowedJoinOperators) { this.allowedJoinOperators = JoinOperatorsListCopier.copy(allowedJoinOperators); return this; } @Override @SafeVarargs public final Builder allowedJoinOperatorsWithStrings(String... allowedJoinOperators) { allowedJoinOperatorsWithStrings(Arrays.asList(allowedJoinOperators)); return this; } @Override public final Builder allowedJoinOperators(Collection allowedJoinOperators) { this.allowedJoinOperators = JoinOperatorsListCopier.copyEnumToString(allowedJoinOperators); return this; } @Override @SafeVarargs public final Builder allowedJoinOperators(JoinOperator... allowedJoinOperators) { allowedJoinOperators(Arrays.asList(allowedJoinOperators)); return this; } public final Collection getDimensionColumns() { if (dimensionColumns instanceof SdkAutoConstructList) { return null; } return dimensionColumns; } public final void setDimensionColumns(Collection dimensionColumns) { this.dimensionColumns = AnalysisRuleColumnListCopier.copy(dimensionColumns); } @Override public final Builder dimensionColumns(Collection dimensionColumns) { this.dimensionColumns = AnalysisRuleColumnListCopier.copy(dimensionColumns); return this; } @Override @SafeVarargs public final Builder dimensionColumns(String... dimensionColumns) { dimensionColumns(Arrays.asList(dimensionColumns)); return this; } public final Collection getScalarFunctions() { if (scalarFunctions instanceof SdkAutoConstructList) { return null; } return scalarFunctions; } public final void setScalarFunctions(Collection scalarFunctions) { this.scalarFunctions = ScalarFunctionsListCopier.copy(scalarFunctions); } @Override public final Builder scalarFunctionsWithStrings(Collection scalarFunctions) { this.scalarFunctions = ScalarFunctionsListCopier.copy(scalarFunctions); return this; } @Override @SafeVarargs public final Builder scalarFunctionsWithStrings(String... scalarFunctions) { scalarFunctionsWithStrings(Arrays.asList(scalarFunctions)); return this; } @Override public final Builder scalarFunctions(Collection scalarFunctions) { this.scalarFunctions = ScalarFunctionsListCopier.copyEnumToString(scalarFunctions); return this; } @Override @SafeVarargs public final Builder scalarFunctions(ScalarFunctions... scalarFunctions) { scalarFunctions(Arrays.asList(scalarFunctions)); return this; } public final List getOutputConstraints() { List result = AggregationConstraintsCopier.copyToBuilder(this.outputConstraints); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setOutputConstraints(Collection outputConstraints) { this.outputConstraints = AggregationConstraintsCopier.copyFromBuilder(outputConstraints); } @Override public final Builder outputConstraints(Collection outputConstraints) { this.outputConstraints = AggregationConstraintsCopier.copy(outputConstraints); return this; } @Override @SafeVarargs public final Builder outputConstraints(AggregationConstraint... outputConstraints) { outputConstraints(Arrays.asList(outputConstraints)); return this; } @Override @SafeVarargs public final Builder outputConstraints(Consumer... outputConstraints) { outputConstraints(Stream.of(outputConstraints).map(c -> AggregationConstraint.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getAdditionalAnalyses() { return additionalAnalyses; } public final void setAdditionalAnalyses(String additionalAnalyses) { this.additionalAnalyses = additionalAnalyses; } @Override public final Builder additionalAnalyses(String additionalAnalyses) { this.additionalAnalyses = additionalAnalyses; return this; } @Override public final Builder additionalAnalyses(AdditionalAnalyses additionalAnalyses) { this.additionalAnalyses(additionalAnalyses == null ? null : additionalAnalyses.toString()); return this; } @Override public AnalysisRuleAggregation build() { return new AnalysisRuleAggregation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy