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

software.amazon.awssdk.services.cleanroomsml.model.CreateConfiguredAudienceModelRequest Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.28.6
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.cleanroomsml.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateConfiguredAudienceModelRequest extends CleanRoomsMlRequest implements
        ToCopyableBuilder {
    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(CreateConfiguredAudienceModelRequest::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField AUDIENCE_MODEL_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("audienceModelArn").getter(getter(CreateConfiguredAudienceModelRequest::audienceModelArn))
            .setter(setter(Builder::audienceModelArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("audienceModelArn").build()).build();

    private static final SdkField OUTPUT_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("outputConfig")
            .getter(getter(CreateConfiguredAudienceModelRequest::outputConfig)).setter(setter(Builder::outputConfig))
            .constructor(ConfiguredAudienceModelOutputConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("outputConfig").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("description").getter(getter(CreateConfiguredAudienceModelRequest::description))
            .setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final SdkField> SHARED_AUDIENCE_METRICS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("sharedAudienceMetrics")
            .getter(getter(CreateConfiguredAudienceModelRequest::sharedAudienceMetricsAsStrings))
            .setter(setter(Builder::sharedAudienceMetricsWithStrings))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sharedAudienceMetrics").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 MIN_MATCHING_SEED_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("minMatchingSeedSize").getter(getter(CreateConfiguredAudienceModelRequest::minMatchingSeedSize))
            .setter(setter(Builder::minMatchingSeedSize))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("minMatchingSeedSize").build())
            .build();

    private static final SdkField AUDIENCE_SIZE_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("audienceSizeConfig")
            .getter(getter(CreateConfiguredAudienceModelRequest::audienceSizeConfig)).setter(setter(Builder::audienceSizeConfig))
            .constructor(AudienceSizeConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("audienceSizeConfig").build())
            .build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("tags")
            .getter(getter(CreateConfiguredAudienceModelRequest::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField CHILD_RESOURCE_TAG_ON_CREATE_POLICY_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("childResourceTagOnCreatePolicy")
            .getter(getter(CreateConfiguredAudienceModelRequest::childResourceTagOnCreatePolicyAsString))
            .setter(setter(Builder::childResourceTagOnCreatePolicy))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("childResourceTagOnCreatePolicy")
                    .build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD,
            AUDIENCE_MODEL_ARN_FIELD, OUTPUT_CONFIG_FIELD, DESCRIPTION_FIELD, SHARED_AUDIENCE_METRICS_FIELD,
            MIN_MATCHING_SEED_SIZE_FIELD, AUDIENCE_SIZE_CONFIG_FIELD, TAGS_FIELD, CHILD_RESOURCE_TAG_ON_CREATE_POLICY_FIELD));

    private final String name;

    private final String audienceModelArn;

    private final ConfiguredAudienceModelOutputConfig outputConfig;

    private final String description;

    private final List sharedAudienceMetrics;

    private final Integer minMatchingSeedSize;

    private final AudienceSizeConfig audienceSizeConfig;

    private final Map tags;

    private final String childResourceTagOnCreatePolicy;

    private CreateConfiguredAudienceModelRequest(BuilderImpl builder) {
        super(builder);
        this.name = builder.name;
        this.audienceModelArn = builder.audienceModelArn;
        this.outputConfig = builder.outputConfig;
        this.description = builder.description;
        this.sharedAudienceMetrics = builder.sharedAudienceMetrics;
        this.minMatchingSeedSize = builder.minMatchingSeedSize;
        this.audienceSizeConfig = builder.audienceSizeConfig;
        this.tags = builder.tags;
        this.childResourceTagOnCreatePolicy = builder.childResourceTagOnCreatePolicy;
    }

    /**
     * 

* The name of the configured audience model. *

* * @return The name of the configured audience model. */ public final String name() { return name; } /** *

* The Amazon Resource Name (ARN) of the audience model to use for the configured audience model. *

* * @return The Amazon Resource Name (ARN) of the audience model to use for the configured audience model. */ public final String audienceModelArn() { return audienceModelArn; } /** *

* Configure the Amazon S3 location and IAM Role for audiences created using this configured audience model. Each * audience will have a unique location. The IAM Role must have s3:PutObject permission on the * destination Amazon S3 location. If the destination is protected with Amazon S3 KMS-SSE, then the Role must also * have the required KMS permissions. *

* * @return Configure the Amazon S3 location and IAM Role for audiences created using this configured audience model. * Each audience will have a unique location. The IAM Role must have s3:PutObject permission on * the destination Amazon S3 location. If the destination is protected with Amazon S3 KMS-SSE, then the Role * must also have the required KMS permissions. */ public final ConfiguredAudienceModelOutputConfig outputConfig() { return outputConfig; } /** *

* The description of the configured audience model. *

* * @return The description of the configured audience model. */ public final String description() { return description; } /** *

* Whether audience metrics are shared. *

*

* 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 #hasSharedAudienceMetrics} method. *

* * @return Whether audience metrics are shared. */ public final List sharedAudienceMetrics() { return MetricsListCopier.copyStringToEnum(sharedAudienceMetrics); } /** * For responses, this returns true if the service returned a value for the SharedAudienceMetrics 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 hasSharedAudienceMetrics() { return sharedAudienceMetrics != null && !(sharedAudienceMetrics instanceof SdkAutoConstructList); } /** *

* Whether audience metrics are shared. *

*

* 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 #hasSharedAudienceMetrics} method. *

* * @return Whether audience metrics are shared. */ public final List sharedAudienceMetricsAsStrings() { return sharedAudienceMetrics; } /** *

* The minimum number of users from the seed audience that must match with users in the training data of the * audience model. The default value is 500. *

* * @return The minimum number of users from the seed audience that must match with users in the training data of the * audience model. The default value is 500. */ public final Integer minMatchingSeedSize() { return minMatchingSeedSize; } /** *

* Configure the list of output sizes of audiences that can be created using this configured audience model. A * request to StartAudienceGenerationJob that uses this configured audience model must have an * audienceSize selected from this list. You can use the ABSOLUTE AudienceSize to * configure out audience sizes using the count of identifiers in the output. You can use the * Percentage AudienceSize to configure sizes in the range 1-100 percent. *

* * @return Configure the list of output sizes of audiences that can be created using this configured audience model. * A request to StartAudienceGenerationJob that uses this configured audience model must have an * audienceSize selected from this list. You can use the ABSOLUTE * AudienceSize to configure out audience sizes using the count of identifiers in the output. You can * use the Percentage AudienceSize to configure sizes in the range 1-100 percent. */ public final AudienceSizeConfig audienceSizeConfig() { return audienceSizeConfig; } /** * For responses, this returns true if the service returned a value for the Tags 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 hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

* The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists * of a key and an optional value, both of which you define. *

*

* The following basic restrictions apply to tags: *

*
    *
  • *

    * Maximum number of tags per resource - 50. *

    *
  • *
  • *

    * For each resource, each tag key must be unique, and each tag key can have only one value. *

    *
  • *
  • *

    * Maximum key length - 128 Unicode characters in UTF-8. *

    *
  • *
  • *

    * Maximum value length - 256 Unicode characters in UTF-8. *

    *
  • *
  • *

    * If your tagging schema is used across multiple services and resources, remember that other services may have * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable * in UTF-8, and the following characters: + - = . _ : / @. *

    *
  • *
  • *

    * Tag keys and values are case sensitive. *

    *
  • *
  • *

    * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for * AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws * as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the * limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit. *

    *
  • *
*

* 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 #hasTags} method. *

* * @return The optional metadata that you apply to the resource to help you categorize and organize them. Each tag * consists of a key and an optional value, both of which you define.

*

* The following basic restrictions apply to tags: *

*
    *
  • *

    * Maximum number of tags per resource - 50. *

    *
  • *
  • *

    * For each resource, each tag key must be unique, and each tag key can have only one value. *

    *
  • *
  • *

    * Maximum key length - 128 Unicode characters in UTF-8. *

    *
  • *
  • *

    * Maximum value length - 256 Unicode characters in UTF-8. *

    *
  • *
  • *

    * If your tagging schema is used across multiple services and resources, remember that other services may * have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces * representable in UTF-8, and the following characters: + - = . _ : / @. *

    *
  • *
  • *

    * Tag keys and values are case sensitive. *

    *
  • *
  • *

    * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is * reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. * If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user * tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count * against your tags per resource limit. *

    *
  • */ public final Map tags() { return tags; } /** *

    * Configure how the service tags audience generation jobs created using this configured audience model. If you * specify NONE, the tags from the StartAudienceGenerationJob request determine the tags of the * audience generation job. If you specify FROM_PARENT_RESOURCE, the audience generation job inherits * the tags from the configured audience model, by default. Tags in the StartAudienceGenerationJob will * override the default. *

    *

    * When the client is in a different account than the configured audience model, the tags from the client are never * applied to a resource in the caller's account. *

    *

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

    * * @return Configure how the service tags audience generation jobs created using this configured audience model. If * you specify NONE, the tags from the StartAudienceGenerationJob request determine the * tags of the audience generation job. If you specify FROM_PARENT_RESOURCE, the audience * generation job inherits the tags from the configured audience model, by default. Tags in the * StartAudienceGenerationJob will override the default.

    *

    * When the client is in a different account than the configured audience model, the tags from the client * are never applied to a resource in the caller's account. * @see TagOnCreatePolicy */ public final TagOnCreatePolicy childResourceTagOnCreatePolicy() { return TagOnCreatePolicy.fromValue(childResourceTagOnCreatePolicy); } /** *

    * Configure how the service tags audience generation jobs created using this configured audience model. If you * specify NONE, the tags from the StartAudienceGenerationJob request determine the tags of the * audience generation job. If you specify FROM_PARENT_RESOURCE, the audience generation job inherits * the tags from the configured audience model, by default. Tags in the StartAudienceGenerationJob will * override the default. *

    *

    * When the client is in a different account than the configured audience model, the tags from the client are never * applied to a resource in the caller's account. *

    *

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

    * * @return Configure how the service tags audience generation jobs created using this configured audience model. If * you specify NONE, the tags from the StartAudienceGenerationJob request determine the * tags of the audience generation job. If you specify FROM_PARENT_RESOURCE, the audience * generation job inherits the tags from the configured audience model, by default. Tags in the * StartAudienceGenerationJob will override the default.

    *

    * When the client is in a different account than the configured audience model, the tags from the client * are never applied to a resource in the caller's account. * @see TagOnCreatePolicy */ public final String childResourceTagOnCreatePolicyAsString() { return childResourceTagOnCreatePolicy; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(audienceModelArn()); hashCode = 31 * hashCode + Objects.hashCode(outputConfig()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(hasSharedAudienceMetrics() ? sharedAudienceMetricsAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(minMatchingSeedSize()); hashCode = 31 * hashCode + Objects.hashCode(audienceSizeConfig()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(childResourceTagOnCreatePolicyAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateConfiguredAudienceModelRequest)) { return false; } CreateConfiguredAudienceModelRequest other = (CreateConfiguredAudienceModelRequest) obj; return Objects.equals(name(), other.name()) && Objects.equals(audienceModelArn(), other.audienceModelArn()) && Objects.equals(outputConfig(), other.outputConfig()) && Objects.equals(description(), other.description()) && hasSharedAudienceMetrics() == other.hasSharedAudienceMetrics() && Objects.equals(sharedAudienceMetricsAsStrings(), other.sharedAudienceMetricsAsStrings()) && Objects.equals(minMatchingSeedSize(), other.minMatchingSeedSize()) && Objects.equals(audienceSizeConfig(), other.audienceSizeConfig()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(childResourceTagOnCreatePolicyAsString(), other.childResourceTagOnCreatePolicyAsString()); } /** * 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("CreateConfiguredAudienceModelRequest").add("Name", name()) .add("AudienceModelArn", audienceModelArn()).add("OutputConfig", outputConfig()) .add("Description", description()) .add("SharedAudienceMetrics", hasSharedAudienceMetrics() ? sharedAudienceMetricsAsStrings() : null) .add("MinMatchingSeedSize", minMatchingSeedSize()).add("AudienceSizeConfig", audienceSizeConfig()) .add("Tags", hasTags() ? tags() : null) .add("ChildResourceTagOnCreatePolicy", childResourceTagOnCreatePolicyAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "audienceModelArn": return Optional.ofNullable(clazz.cast(audienceModelArn())); case "outputConfig": return Optional.ofNullable(clazz.cast(outputConfig())); case "description": return Optional.ofNullable(clazz.cast(description())); case "sharedAudienceMetrics": return Optional.ofNullable(clazz.cast(sharedAudienceMetricsAsStrings())); case "minMatchingSeedSize": return Optional.ofNullable(clazz.cast(minMatchingSeedSize())); case "audienceSizeConfig": return Optional.ofNullable(clazz.cast(audienceSizeConfig())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "childResourceTagOnCreatePolicy": return Optional.ofNullable(clazz.cast(childResourceTagOnCreatePolicyAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateConfiguredAudienceModelRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends CleanRoomsMlRequest.Builder, SdkPojo, CopyableBuilder { /** *

    * The name of the configured audience model. *

    * * @param name * The name of the configured audience model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

    * The Amazon Resource Name (ARN) of the audience model to use for the configured audience model. *

    * * @param audienceModelArn * The Amazon Resource Name (ARN) of the audience model to use for the configured audience model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder audienceModelArn(String audienceModelArn); /** *

    * Configure the Amazon S3 location and IAM Role for audiences created using this configured audience model. * Each audience will have a unique location. The IAM Role must have s3:PutObject permission on the * destination Amazon S3 location. If the destination is protected with Amazon S3 KMS-SSE, then the Role must * also have the required KMS permissions. *

    * * @param outputConfig * Configure the Amazon S3 location and IAM Role for audiences created using this configured audience * model. Each audience will have a unique location. The IAM Role must have s3:PutObject * permission on the destination Amazon S3 location. If the destination is protected with Amazon S3 * KMS-SSE, then the Role must also have the required KMS permissions. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputConfig(ConfiguredAudienceModelOutputConfig outputConfig); /** *

    * Configure the Amazon S3 location and IAM Role for audiences created using this configured audience model. * Each audience will have a unique location. The IAM Role must have s3:PutObject permission on the * destination Amazon S3 location. If the destination is protected with Amazon S3 KMS-SSE, then the Role must * also have the required KMS permissions. *

    * This is a convenience method that creates an instance of the * {@link ConfiguredAudienceModelOutputConfig.Builder} avoiding the need to create one manually via * {@link ConfiguredAudienceModelOutputConfig#builder()}. * *

    * When the {@link Consumer} completes, {@link ConfiguredAudienceModelOutputConfig.Builder#build()} is called * immediately and its result is passed to {@link #outputConfig(ConfiguredAudienceModelOutputConfig)}. * * @param outputConfig * a consumer that will call methods on {@link ConfiguredAudienceModelOutputConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputConfig(ConfiguredAudienceModelOutputConfig) */ default Builder outputConfig(Consumer outputConfig) { return outputConfig(ConfiguredAudienceModelOutputConfig.builder().applyMutation(outputConfig).build()); } /** *

    * The description of the configured audience model. *

    * * @param description * The description of the configured audience model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

    * Whether audience metrics are shared. *

    * * @param sharedAudienceMetrics * Whether audience metrics are shared. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sharedAudienceMetricsWithStrings(Collection sharedAudienceMetrics); /** *

    * Whether audience metrics are shared. *

    * * @param sharedAudienceMetrics * Whether audience metrics are shared. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sharedAudienceMetricsWithStrings(String... sharedAudienceMetrics); /** *

    * Whether audience metrics are shared. *

    * * @param sharedAudienceMetrics * Whether audience metrics are shared. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sharedAudienceMetrics(Collection sharedAudienceMetrics); /** *

    * Whether audience metrics are shared. *

    * * @param sharedAudienceMetrics * Whether audience metrics are shared. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sharedAudienceMetrics(SharedAudienceMetrics... sharedAudienceMetrics); /** *

    * The minimum number of users from the seed audience that must match with users in the training data of the * audience model. The default value is 500. *

    * * @param minMatchingSeedSize * The minimum number of users from the seed audience that must match with users in the training data of * the audience model. The default value is 500. * @return Returns a reference to this object so that method calls can be chained together. */ Builder minMatchingSeedSize(Integer minMatchingSeedSize); /** *

    * Configure the list of output sizes of audiences that can be created using this configured audience model. A * request to StartAudienceGenerationJob that uses this configured audience model must have an * audienceSize selected from this list. You can use the ABSOLUTE AudienceSize * to configure out audience sizes using the count of identifiers in the output. You can use the * Percentage AudienceSize to configure sizes in the range 1-100 percent. *

    * * @param audienceSizeConfig * Configure the list of output sizes of audiences that can be created using this configured audience * model. A request to StartAudienceGenerationJob that uses this configured audience model must * have an audienceSize selected from this list. You can use the ABSOLUTE * AudienceSize to configure out audience sizes using the count of identifiers in the output. You * can use the Percentage AudienceSize to configure sizes in the range 1-100 percent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder audienceSizeConfig(AudienceSizeConfig audienceSizeConfig); /** *

    * Configure the list of output sizes of audiences that can be created using this configured audience model. A * request to StartAudienceGenerationJob that uses this configured audience model must have an * audienceSize selected from this list. You can use the ABSOLUTE AudienceSize * to configure out audience sizes using the count of identifiers in the output. You can use the * Percentage AudienceSize to configure sizes in the range 1-100 percent. *

    * This is a convenience method that creates an instance of the {@link AudienceSizeConfig.Builder} avoiding the * need to create one manually via {@link AudienceSizeConfig#builder()}. * *

    * When the {@link Consumer} completes, {@link AudienceSizeConfig.Builder#build()} is called immediately and its * result is passed to {@link #audienceSizeConfig(AudienceSizeConfig)}. * * @param audienceSizeConfig * a consumer that will call methods on {@link AudienceSizeConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #audienceSizeConfig(AudienceSizeConfig) */ default Builder audienceSizeConfig(Consumer audienceSizeConfig) { return audienceSizeConfig(AudienceSizeConfig.builder().applyMutation(audienceSizeConfig).build()); } /** *

    * The optional metadata that you apply to the resource to help you categorize and organize them. Each tag * consists of a key and an optional value, both of which you define. *

    *

    * The following basic restrictions apply to tags: *

    *
      *
    • *

      * Maximum number of tags per resource - 50. *

      *
    • *
    • *

      * For each resource, each tag key must be unique, and each tag key can have only one value. *

      *
    • *
    • *

      * Maximum key length - 128 Unicode characters in UTF-8. *

      *
    • *
    • *

      * Maximum value length - 256 Unicode characters in UTF-8. *

      *
    • *
    • *

      * If your tagging schema is used across multiple services and resources, remember that other services may have * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces * representable in UTF-8, and the following characters: + - = . _ : / @. *

      *
    • *
    • *

      * Tag keys and values are case sensitive. *

      *
    • *
    • *

      * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved * for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value * has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count * against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per * resource limit. *

      *
    • *
    * * @param tags * The optional metadata that you apply to the resource to help you categorize and organize them. Each * tag consists of a key and an optional value, both of which you define.

    *

    * The following basic restrictions apply to tags: *

    *
      *
    • *

      * Maximum number of tags per resource - 50. *

      *
    • *
    • *

      * For each resource, each tag key must be unique, and each tag key can have only one value. *

      *
    • *
    • *

      * Maximum key length - 128 Unicode characters in UTF-8. *

      *
    • *
    • *

      * Maximum value length - 256 Unicode characters in UTF-8. *

      *
    • *
    • *

      * If your tagging schema is used across multiple services and resources, remember that other services * may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and * spaces representable in UTF-8, and the following characters: + - = . _ : / @. *

      *
    • *
    • *

      * Tag keys and values are case sensitive. *

      *
    • *
    • *

      * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is * reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this * prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to * be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not * count against your tags per resource limit. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

      * Configure how the service tags audience generation jobs created using this configured audience model. If you * specify NONE, the tags from the StartAudienceGenerationJob request determine the tags of * the audience generation job. If you specify FROM_PARENT_RESOURCE, the audience generation job * inherits the tags from the configured audience model, by default. Tags in the * StartAudienceGenerationJob will override the default. *

      *

      * When the client is in a different account than the configured audience model, the tags from the client are * never applied to a resource in the caller's account. *

      * * @param childResourceTagOnCreatePolicy * Configure how the service tags audience generation jobs created using this configured audience model. * If you specify NONE, the tags from the StartAudienceGenerationJob request * determine the tags of the audience generation job. If you specify FROM_PARENT_RESOURCE, * the audience generation job inherits the tags from the configured audience model, by default. Tags in * the StartAudienceGenerationJob will override the default.

      *

      * When the client is in a different account than the configured audience model, the tags from the client * are never applied to a resource in the caller's account. * @see TagOnCreatePolicy * @return Returns a reference to this object so that method calls can be chained together. * @see TagOnCreatePolicy */ Builder childResourceTagOnCreatePolicy(String childResourceTagOnCreatePolicy); /** *

      * Configure how the service tags audience generation jobs created using this configured audience model. If you * specify NONE, the tags from the StartAudienceGenerationJob request determine the tags of * the audience generation job. If you specify FROM_PARENT_RESOURCE, the audience generation job * inherits the tags from the configured audience model, by default. Tags in the * StartAudienceGenerationJob will override the default. *

      *

      * When the client is in a different account than the configured audience model, the tags from the client are * never applied to a resource in the caller's account. *

      * * @param childResourceTagOnCreatePolicy * Configure how the service tags audience generation jobs created using this configured audience model. * If you specify NONE, the tags from the StartAudienceGenerationJob request * determine the tags of the audience generation job. If you specify FROM_PARENT_RESOURCE, * the audience generation job inherits the tags from the configured audience model, by default. Tags in * the StartAudienceGenerationJob will override the default.

      *

      * When the client is in a different account than the configured audience model, the tags from the client * are never applied to a resource in the caller's account. * @see TagOnCreatePolicy * @return Returns a reference to this object so that method calls can be chained together. * @see TagOnCreatePolicy */ Builder childResourceTagOnCreatePolicy(TagOnCreatePolicy childResourceTagOnCreatePolicy); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends CleanRoomsMlRequest.BuilderImpl implements Builder { private String name; private String audienceModelArn; private ConfiguredAudienceModelOutputConfig outputConfig; private String description; private List sharedAudienceMetrics = DefaultSdkAutoConstructList.getInstance(); private Integer minMatchingSeedSize; private AudienceSizeConfig audienceSizeConfig; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private String childResourceTagOnCreatePolicy; private BuilderImpl() { } private BuilderImpl(CreateConfiguredAudienceModelRequest model) { super(model); name(model.name); audienceModelArn(model.audienceModelArn); outputConfig(model.outputConfig); description(model.description); sharedAudienceMetricsWithStrings(model.sharedAudienceMetrics); minMatchingSeedSize(model.minMatchingSeedSize); audienceSizeConfig(model.audienceSizeConfig); tags(model.tags); childResourceTagOnCreatePolicy(model.childResourceTagOnCreatePolicy); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getAudienceModelArn() { return audienceModelArn; } public final void setAudienceModelArn(String audienceModelArn) { this.audienceModelArn = audienceModelArn; } @Override public final Builder audienceModelArn(String audienceModelArn) { this.audienceModelArn = audienceModelArn; return this; } public final ConfiguredAudienceModelOutputConfig.Builder getOutputConfig() { return outputConfig != null ? outputConfig.toBuilder() : null; } public final void setOutputConfig(ConfiguredAudienceModelOutputConfig.BuilderImpl outputConfig) { this.outputConfig = outputConfig != null ? outputConfig.build() : null; } @Override public final Builder outputConfig(ConfiguredAudienceModelOutputConfig outputConfig) { this.outputConfig = outputConfig; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Collection getSharedAudienceMetrics() { if (sharedAudienceMetrics instanceof SdkAutoConstructList) { return null; } return sharedAudienceMetrics; } public final void setSharedAudienceMetrics(Collection sharedAudienceMetrics) { this.sharedAudienceMetrics = MetricsListCopier.copy(sharedAudienceMetrics); } @Override public final Builder sharedAudienceMetricsWithStrings(Collection sharedAudienceMetrics) { this.sharedAudienceMetrics = MetricsListCopier.copy(sharedAudienceMetrics); return this; } @Override @SafeVarargs public final Builder sharedAudienceMetricsWithStrings(String... sharedAudienceMetrics) { sharedAudienceMetricsWithStrings(Arrays.asList(sharedAudienceMetrics)); return this; } @Override public final Builder sharedAudienceMetrics(Collection sharedAudienceMetrics) { this.sharedAudienceMetrics = MetricsListCopier.copyEnumToString(sharedAudienceMetrics); return this; } @Override @SafeVarargs public final Builder sharedAudienceMetrics(SharedAudienceMetrics... sharedAudienceMetrics) { sharedAudienceMetrics(Arrays.asList(sharedAudienceMetrics)); return this; } public final Integer getMinMatchingSeedSize() { return minMatchingSeedSize; } public final void setMinMatchingSeedSize(Integer minMatchingSeedSize) { this.minMatchingSeedSize = minMatchingSeedSize; } @Override public final Builder minMatchingSeedSize(Integer minMatchingSeedSize) { this.minMatchingSeedSize = minMatchingSeedSize; return this; } public final AudienceSizeConfig.Builder getAudienceSizeConfig() { return audienceSizeConfig != null ? audienceSizeConfig.toBuilder() : null; } public final void setAudienceSizeConfig(AudienceSizeConfig.BuilderImpl audienceSizeConfig) { this.audienceSizeConfig = audienceSizeConfig != null ? audienceSizeConfig.build() : null; } @Override public final Builder audienceSizeConfig(AudienceSizeConfig audienceSizeConfig) { this.audienceSizeConfig = audienceSizeConfig; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagMapCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagMapCopier.copy(tags); return this; } public final String getChildResourceTagOnCreatePolicy() { return childResourceTagOnCreatePolicy; } public final void setChildResourceTagOnCreatePolicy(String childResourceTagOnCreatePolicy) { this.childResourceTagOnCreatePolicy = childResourceTagOnCreatePolicy; } @Override public final Builder childResourceTagOnCreatePolicy(String childResourceTagOnCreatePolicy) { this.childResourceTagOnCreatePolicy = childResourceTagOnCreatePolicy; return this; } @Override public final Builder childResourceTagOnCreatePolicy(TagOnCreatePolicy childResourceTagOnCreatePolicy) { this.childResourceTagOnCreatePolicy(childResourceTagOnCreatePolicy == null ? null : childResourceTagOnCreatePolicy .toString()); return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateConfiguredAudienceModelRequest build() { return new CreateConfiguredAudienceModelRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy