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

software.amazon.awssdk.services.cleanrooms.model.CreateCollaborationRequest 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.29.15
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.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 java.util.stream.Collectors;
import java.util.stream.Stream;
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 CreateCollaborationRequest extends CleanRoomsRequest implements
        ToCopyableBuilder {
    private static final SdkField> MEMBERS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("members")
            .getter(getter(CreateCollaborationRequest::members))
            .setter(setter(Builder::members))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("members").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(MemberSpecification::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

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

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

    private static final SdkField> CREATOR_MEMBER_ABILITIES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("creatorMemberAbilities")
            .getter(getter(CreateCollaborationRequest::creatorMemberAbilitiesAsStrings))
            .setter(setter(Builder::creatorMemberAbilitiesWithStrings))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creatorMemberAbilities").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 CREATOR_DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("creatorDisplayName").getter(getter(CreateCollaborationRequest::creatorDisplayName))
            .setter(setter(Builder::creatorDisplayName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creatorDisplayName").build())
            .build();

    private static final SdkField DATA_ENCRYPTION_METADATA_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("dataEncryptionMetadata")
            .getter(getter(CreateCollaborationRequest::dataEncryptionMetadata)).setter(setter(Builder::dataEncryptionMetadata))
            .constructor(DataEncryptionMetadata::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataEncryptionMetadata").build())
            .build();

    private static final SdkField QUERY_LOG_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("queryLogStatus").getter(getter(CreateCollaborationRequest::queryLogStatusAsString))
            .setter(setter(Builder::queryLogStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("queryLogStatus").build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("tags")
            .getter(getter(CreateCollaborationRequest::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 CREATOR_PAYMENT_CONFIGURATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO)
            .memberName("creatorPaymentConfiguration")
            .getter(getter(CreateCollaborationRequest::creatorPaymentConfiguration))
            .setter(setter(Builder::creatorPaymentConfiguration))
            .constructor(PaymentConfiguration::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creatorPaymentConfiguration")
                    .build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MEMBERS_FIELD, NAME_FIELD,
            DESCRIPTION_FIELD, CREATOR_MEMBER_ABILITIES_FIELD, CREATOR_DISPLAY_NAME_FIELD, DATA_ENCRYPTION_METADATA_FIELD,
            QUERY_LOG_STATUS_FIELD, TAGS_FIELD, CREATOR_PAYMENT_CONFIGURATION_FIELD));

    private final List members;

    private final String name;

    private final String description;

    private final List creatorMemberAbilities;

    private final String creatorDisplayName;

    private final DataEncryptionMetadata dataEncryptionMetadata;

    private final String queryLogStatus;

    private final Map tags;

    private final PaymentConfiguration creatorPaymentConfiguration;

    private CreateCollaborationRequest(BuilderImpl builder) {
        super(builder);
        this.members = builder.members;
        this.name = builder.name;
        this.description = builder.description;
        this.creatorMemberAbilities = builder.creatorMemberAbilities;
        this.creatorDisplayName = builder.creatorDisplayName;
        this.dataEncryptionMetadata = builder.dataEncryptionMetadata;
        this.queryLogStatus = builder.queryLogStatus;
        this.tags = builder.tags;
        this.creatorPaymentConfiguration = builder.creatorPaymentConfiguration;
    }

    /**
     * For responses, this returns true if the service returned a value for the Members 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 hasMembers() {
        return members != null && !(members instanceof SdkAutoConstructList);
    }

    /**
     * 

* A list of initial members, not including the creator. This list is immutable. *

*

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

* * @return A list of initial members, not including the creator. This list is immutable. */ public final List members() { return members; } /** *

* The display name for a collaboration. *

* * @return The display name for a collaboration. */ public final String name() { return name; } /** *

* A description of the collaboration provided by the collaboration owner. *

* * @return A description of the collaboration provided by the collaboration owner. */ public final String description() { return description; } /** *

* The abilities granted to the collaboration creator. *

*

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

* * @return The abilities granted to the collaboration creator. */ public final List creatorMemberAbilities() { return MemberAbilitiesCopier.copyStringToEnum(creatorMemberAbilities); } /** * For responses, this returns true if the service returned a value for the CreatorMemberAbilities 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 hasCreatorMemberAbilities() { return creatorMemberAbilities != null && !(creatorMemberAbilities instanceof SdkAutoConstructList); } /** *

* The abilities granted to the collaboration creator. *

*

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

* * @return The abilities granted to the collaboration creator. */ public final List creatorMemberAbilitiesAsStrings() { return creatorMemberAbilities; } /** *

* The display name of the collaboration creator. *

* * @return The display name of the collaboration creator. */ public final String creatorDisplayName() { return creatorDisplayName; } /** *

* The settings for client-side encryption with Cryptographic Computing for Clean Rooms. *

* * @return The settings for client-side encryption with Cryptographic Computing for Clean Rooms. */ public final DataEncryptionMetadata dataEncryptionMetadata() { return dataEncryptionMetadata; } /** *

* An indicator as to whether query logging has been enabled or disabled for the collaboration. *

*

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

* * @return An indicator as to whether query logging has been enabled or disabled for the collaboration. * @see CollaborationQueryLogStatus */ public final CollaborationQueryLogStatus queryLogStatus() { return CollaborationQueryLogStatus.fromValue(queryLogStatus); } /** *

* An indicator as to whether query logging has been enabled or disabled for the collaboration. *

*

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

* * @return An indicator as to whether query logging has been enabled or disabled for the collaboration. * @see CollaborationQueryLogStatus */ public final String queryLogStatusAsString() { return queryLogStatus; } /** * 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); } /** *

* An optional label that you can assign to a resource when you create it. Each tag consists of a key and an * optional value, both of which you define. When you use tagging, you can also use tag-based access control in IAM * policies to control access to this resource. *

*

* 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 An optional label that you can assign to a resource when you create it. Each tag consists of a key and an * optional value, both of which you define. When you use tagging, you can also use tag-based access control * in IAM policies to control access to this resource. */ public final Map tags() { return tags; } /** *

* The collaboration creator's payment responsibilities set by the collaboration creator. *

*

* If the collaboration creator hasn't specified anyone as the member paying for query compute costs, then the * member who can query is the default payer. *

* * @return The collaboration creator's payment responsibilities set by the collaboration creator.

*

* If the collaboration creator hasn't specified anyone as the member paying for query compute costs, then * the member who can query is the default payer. */ public final PaymentConfiguration creatorPaymentConfiguration() { return creatorPaymentConfiguration; } @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(hasMembers() ? members() : null); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(hasCreatorMemberAbilities() ? creatorMemberAbilitiesAsStrings() : null); hashCode = 31 * hashCode + Objects.hashCode(creatorDisplayName()); hashCode = 31 * hashCode + Objects.hashCode(dataEncryptionMetadata()); hashCode = 31 * hashCode + Objects.hashCode(queryLogStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(creatorPaymentConfiguration()); 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 CreateCollaborationRequest)) { return false; } CreateCollaborationRequest other = (CreateCollaborationRequest) obj; return hasMembers() == other.hasMembers() && Objects.equals(members(), other.members()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && hasCreatorMemberAbilities() == other.hasCreatorMemberAbilities() && Objects.equals(creatorMemberAbilitiesAsStrings(), other.creatorMemberAbilitiesAsStrings()) && Objects.equals(creatorDisplayName(), other.creatorDisplayName()) && Objects.equals(dataEncryptionMetadata(), other.dataEncryptionMetadata()) && Objects.equals(queryLogStatusAsString(), other.queryLogStatusAsString()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(creatorPaymentConfiguration(), other.creatorPaymentConfiguration()); } /** * 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("CreateCollaborationRequest").add("Members", hasMembers() ? members() : null).add("Name", name()) .add("Description", description()) .add("CreatorMemberAbilities", hasCreatorMemberAbilities() ? creatorMemberAbilitiesAsStrings() : null) .add("CreatorDisplayName", creatorDisplayName()).add("DataEncryptionMetadata", dataEncryptionMetadata()) .add("QueryLogStatus", queryLogStatusAsString()).add("Tags", hasTags() ? tags() : null) .add("CreatorPaymentConfiguration", creatorPaymentConfiguration()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "members": return Optional.ofNullable(clazz.cast(members())); case "name": return Optional.ofNullable(clazz.cast(name())); case "description": return Optional.ofNullable(clazz.cast(description())); case "creatorMemberAbilities": return Optional.ofNullable(clazz.cast(creatorMemberAbilitiesAsStrings())); case "creatorDisplayName": return Optional.ofNullable(clazz.cast(creatorDisplayName())); case "dataEncryptionMetadata": return Optional.ofNullable(clazz.cast(dataEncryptionMetadata())); case "queryLogStatus": return Optional.ofNullable(clazz.cast(queryLogStatusAsString())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "creatorPaymentConfiguration": return Optional.ofNullable(clazz.cast(creatorPaymentConfiguration())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateCollaborationRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends CleanRoomsRequest.Builder, SdkPojo, CopyableBuilder { /** *

* A list of initial members, not including the creator. This list is immutable. *

* * @param members * A list of initial members, not including the creator. This list is immutable. * @return Returns a reference to this object so that method calls can be chained together. */ Builder members(Collection members); /** *

* A list of initial members, not including the creator. This list is immutable. *

* * @param members * A list of initial members, not including the creator. This list is immutable. * @return Returns a reference to this object so that method calls can be chained together. */ Builder members(MemberSpecification... members); /** *

* A list of initial members, not including the creator. This list is immutable. *

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

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

* The display name for a collaboration. *

* * @param name * The display name for a collaboration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* A description of the collaboration provided by the collaboration owner. *

* * @param description * A description of the collaboration provided by the collaboration owner. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The abilities granted to the collaboration creator. *

* * @param creatorMemberAbilities * The abilities granted to the collaboration creator. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creatorMemberAbilitiesWithStrings(Collection creatorMemberAbilities); /** *

* The abilities granted to the collaboration creator. *

* * @param creatorMemberAbilities * The abilities granted to the collaboration creator. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creatorMemberAbilitiesWithStrings(String... creatorMemberAbilities); /** *

* The abilities granted to the collaboration creator. *

* * @param creatorMemberAbilities * The abilities granted to the collaboration creator. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creatorMemberAbilities(Collection creatorMemberAbilities); /** *

* The abilities granted to the collaboration creator. *

* * @param creatorMemberAbilities * The abilities granted to the collaboration creator. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creatorMemberAbilities(MemberAbility... creatorMemberAbilities); /** *

* The display name of the collaboration creator. *

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

* The settings for client-side encryption with Cryptographic Computing for Clean Rooms. *

* * @param dataEncryptionMetadata * The settings for client-side encryption with Cryptographic Computing for Clean Rooms. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataEncryptionMetadata(DataEncryptionMetadata dataEncryptionMetadata); /** *

* The settings for client-side encryption with Cryptographic Computing for Clean Rooms. *

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

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

* An indicator as to whether query logging has been enabled or disabled for the collaboration. *

* * @param queryLogStatus * An indicator as to whether query logging has been enabled or disabled for the collaboration. * @see CollaborationQueryLogStatus * @return Returns a reference to this object so that method calls can be chained together. * @see CollaborationQueryLogStatus */ Builder queryLogStatus(String queryLogStatus); /** *

* An indicator as to whether query logging has been enabled or disabled for the collaboration. *

* * @param queryLogStatus * An indicator as to whether query logging has been enabled or disabled for the collaboration. * @see CollaborationQueryLogStatus * @return Returns a reference to this object so that method calls can be chained together. * @see CollaborationQueryLogStatus */ Builder queryLogStatus(CollaborationQueryLogStatus queryLogStatus); /** *

* An optional label that you can assign to a resource when you create it. Each tag consists of a key and an * optional value, both of which you define. When you use tagging, you can also use tag-based access control in * IAM policies to control access to this resource. *

* * @param tags * An optional label that you can assign to a resource when you create it. Each tag consists of a key and * an optional value, both of which you define. When you use tagging, you can also use tag-based access * control in IAM policies to control access to this resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

* The collaboration creator's payment responsibilities set by the collaboration creator. *

*

* If the collaboration creator hasn't specified anyone as the member paying for query compute costs, then the * member who can query is the default payer. *

* * @param creatorPaymentConfiguration * The collaboration creator's payment responsibilities set by the collaboration creator.

*

* If the collaboration creator hasn't specified anyone as the member paying for query compute costs, * then the member who can query is the default payer. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creatorPaymentConfiguration(PaymentConfiguration creatorPaymentConfiguration); /** *

* The collaboration creator's payment responsibilities set by the collaboration creator. *

*

* If the collaboration creator hasn't specified anyone as the member paying for query compute costs, then the * member who can query is the default payer. *

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

* When the {@link Consumer} completes, {@link PaymentConfiguration.Builder#build()} is called immediately and * its result is passed to {@link #creatorPaymentConfiguration(PaymentConfiguration)}. * * @param creatorPaymentConfiguration * a consumer that will call methods on {@link PaymentConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #creatorPaymentConfiguration(PaymentConfiguration) */ default Builder creatorPaymentConfiguration(Consumer creatorPaymentConfiguration) { return creatorPaymentConfiguration(PaymentConfiguration.builder().applyMutation(creatorPaymentConfiguration).build()); } @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends CleanRoomsRequest.BuilderImpl implements Builder { private List members = DefaultSdkAutoConstructList.getInstance(); private String name; private String description; private List creatorMemberAbilities = DefaultSdkAutoConstructList.getInstance(); private String creatorDisplayName; private DataEncryptionMetadata dataEncryptionMetadata; private String queryLogStatus; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private PaymentConfiguration creatorPaymentConfiguration; private BuilderImpl() { } private BuilderImpl(CreateCollaborationRequest model) { super(model); members(model.members); name(model.name); description(model.description); creatorMemberAbilitiesWithStrings(model.creatorMemberAbilities); creatorDisplayName(model.creatorDisplayName); dataEncryptionMetadata(model.dataEncryptionMetadata); queryLogStatus(model.queryLogStatus); tags(model.tags); creatorPaymentConfiguration(model.creatorPaymentConfiguration); } public final List getMembers() { List result = MemberListCopier.copyToBuilder(this.members); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setMembers(Collection members) { this.members = MemberListCopier.copyFromBuilder(members); } @Override public final Builder members(Collection members) { this.members = MemberListCopier.copy(members); return this; } @Override @SafeVarargs public final Builder members(MemberSpecification... members) { members(Arrays.asList(members)); return this; } @Override @SafeVarargs public final Builder members(Consumer... members) { members(Stream.of(members).map(c -> MemberSpecification.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } 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 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 getCreatorMemberAbilities() { if (creatorMemberAbilities instanceof SdkAutoConstructList) { return null; } return creatorMemberAbilities; } public final void setCreatorMemberAbilities(Collection creatorMemberAbilities) { this.creatorMemberAbilities = MemberAbilitiesCopier.copy(creatorMemberAbilities); } @Override public final Builder creatorMemberAbilitiesWithStrings(Collection creatorMemberAbilities) { this.creatorMemberAbilities = MemberAbilitiesCopier.copy(creatorMemberAbilities); return this; } @Override @SafeVarargs public final Builder creatorMemberAbilitiesWithStrings(String... creatorMemberAbilities) { creatorMemberAbilitiesWithStrings(Arrays.asList(creatorMemberAbilities)); return this; } @Override public final Builder creatorMemberAbilities(Collection creatorMemberAbilities) { this.creatorMemberAbilities = MemberAbilitiesCopier.copyEnumToString(creatorMemberAbilities); return this; } @Override @SafeVarargs public final Builder creatorMemberAbilities(MemberAbility... creatorMemberAbilities) { creatorMemberAbilities(Arrays.asList(creatorMemberAbilities)); return this; } public final String getCreatorDisplayName() { return creatorDisplayName; } public final void setCreatorDisplayName(String creatorDisplayName) { this.creatorDisplayName = creatorDisplayName; } @Override public final Builder creatorDisplayName(String creatorDisplayName) { this.creatorDisplayName = creatorDisplayName; return this; } public final DataEncryptionMetadata.Builder getDataEncryptionMetadata() { return dataEncryptionMetadata != null ? dataEncryptionMetadata.toBuilder() : null; } public final void setDataEncryptionMetadata(DataEncryptionMetadata.BuilderImpl dataEncryptionMetadata) { this.dataEncryptionMetadata = dataEncryptionMetadata != null ? dataEncryptionMetadata.build() : null; } @Override public final Builder dataEncryptionMetadata(DataEncryptionMetadata dataEncryptionMetadata) { this.dataEncryptionMetadata = dataEncryptionMetadata; return this; } public final String getQueryLogStatus() { return queryLogStatus; } public final void setQueryLogStatus(String queryLogStatus) { this.queryLogStatus = queryLogStatus; } @Override public final Builder queryLogStatus(String queryLogStatus) { this.queryLogStatus = queryLogStatus; return this; } @Override public final Builder queryLogStatus(CollaborationQueryLogStatus queryLogStatus) { this.queryLogStatus(queryLogStatus == null ? null : queryLogStatus.toString()); 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 PaymentConfiguration.Builder getCreatorPaymentConfiguration() { return creatorPaymentConfiguration != null ? creatorPaymentConfiguration.toBuilder() : null; } public final void setCreatorPaymentConfiguration(PaymentConfiguration.BuilderImpl creatorPaymentConfiguration) { this.creatorPaymentConfiguration = creatorPaymentConfiguration != null ? creatorPaymentConfiguration.build() : null; } @Override public final Builder creatorPaymentConfiguration(PaymentConfiguration creatorPaymentConfiguration) { this.creatorPaymentConfiguration = creatorPaymentConfiguration; 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 CreateCollaborationRequest build() { return new CreateCollaborationRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy