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

software.amazon.awssdk.services.dataexchange.model.ExportAssetsToS3ResponseDetails Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.28.5
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.dataexchange.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;

/**
 * 

* Details about the export to Amazon S3 response. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ExportAssetsToS3ResponseDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField> ASSET_DESTINATIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("AssetDestinations") .getter(getter(ExportAssetsToS3ResponseDetails::assetDestinations)) .setter(setter(Builder::assetDestinations)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssetDestinations").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(AssetDestinationEntry::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField DATA_SET_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DataSetId").getter(getter(ExportAssetsToS3ResponseDetails::dataSetId)) .setter(setter(Builder::dataSetId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataSetId").build()).build(); private static final SdkField ENCRYPTION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Encryption") .getter(getter(ExportAssetsToS3ResponseDetails::encryption)).setter(setter(Builder::encryption)) .constructor(ExportServerSideEncryption::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Encryption").build()).build(); private static final SdkField REVISION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RevisionId").getter(getter(ExportAssetsToS3ResponseDetails::revisionId)) .setter(setter(Builder::revisionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RevisionId").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ASSET_DESTINATIONS_FIELD, DATA_SET_ID_FIELD, ENCRYPTION_FIELD, REVISION_ID_FIELD)); private static final long serialVersionUID = 1L; private final List assetDestinations; private final String dataSetId; private final ExportServerSideEncryption encryption; private final String revisionId; private ExportAssetsToS3ResponseDetails(BuilderImpl builder) { this.assetDestinations = builder.assetDestinations; this.dataSetId = builder.dataSetId; this.encryption = builder.encryption; this.revisionId = builder.revisionId; } /** * For responses, this returns true if the service returned a value for the AssetDestinations 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 hasAssetDestinations() { return assetDestinations != null && !(assetDestinations instanceof SdkAutoConstructList); } /** *

* The destination in Amazon S3 where the asset is exported. *

*

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

* * @return The destination in Amazon S3 where the asset is exported. */ public final List assetDestinations() { return assetDestinations; } /** *

* The unique identifier for the data set associated with this export job. *

* * @return The unique identifier for the data set associated with this export job. */ public final String dataSetId() { return dataSetId; } /** *

* Encryption configuration of the export job. *

* * @return Encryption configuration of the export job. */ public final ExportServerSideEncryption encryption() { return encryption; } /** *

* The unique identifier for the revision associated with this export response. *

* * @return The unique identifier for the revision associated with this export response. */ public final String revisionId() { return revisionId; } @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(hasAssetDestinations() ? assetDestinations() : null); hashCode = 31 * hashCode + Objects.hashCode(dataSetId()); hashCode = 31 * hashCode + Objects.hashCode(encryption()); hashCode = 31 * hashCode + Objects.hashCode(revisionId()); 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 ExportAssetsToS3ResponseDetails)) { return false; } ExportAssetsToS3ResponseDetails other = (ExportAssetsToS3ResponseDetails) obj; return hasAssetDestinations() == other.hasAssetDestinations() && Objects.equals(assetDestinations(), other.assetDestinations()) && Objects.equals(dataSetId(), other.dataSetId()) && Objects.equals(encryption(), other.encryption()) && Objects.equals(revisionId(), other.revisionId()); } /** * 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("ExportAssetsToS3ResponseDetails") .add("AssetDestinations", hasAssetDestinations() ? assetDestinations() : null).add("DataSetId", dataSetId()) .add("Encryption", encryption()).add("RevisionId", revisionId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AssetDestinations": return Optional.ofNullable(clazz.cast(assetDestinations())); case "DataSetId": return Optional.ofNullable(clazz.cast(dataSetId())); case "Encryption": return Optional.ofNullable(clazz.cast(encryption())); case "RevisionId": return Optional.ofNullable(clazz.cast(revisionId())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ExportAssetsToS3ResponseDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The destination in Amazon S3 where the asset is exported. *

* * @param assetDestinations * The destination in Amazon S3 where the asset is exported. * @return Returns a reference to this object so that method calls can be chained together. */ Builder assetDestinations(Collection assetDestinations); /** *

* The destination in Amazon S3 where the asset is exported. *

* * @param assetDestinations * The destination in Amazon S3 where the asset is exported. * @return Returns a reference to this object so that method calls can be chained together. */ Builder assetDestinations(AssetDestinationEntry... assetDestinations); /** *

* The destination in Amazon S3 where the asset is exported. *

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

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

* The unique identifier for the data set associated with this export job. *

* * @param dataSetId * The unique identifier for the data set associated with this export job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataSetId(String dataSetId); /** *

* Encryption configuration of the export job. *

* * @param encryption * Encryption configuration of the export job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryption(ExportServerSideEncryption encryption); /** *

* Encryption configuration of the export job. *

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

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

* The unique identifier for the revision associated with this export response. *

* * @param revisionId * The unique identifier for the revision associated with this export response. * @return Returns a reference to this object so that method calls can be chained together. */ Builder revisionId(String revisionId); } static final class BuilderImpl implements Builder { private List assetDestinations = DefaultSdkAutoConstructList.getInstance(); private String dataSetId; private ExportServerSideEncryption encryption; private String revisionId; private BuilderImpl() { } private BuilderImpl(ExportAssetsToS3ResponseDetails model) { assetDestinations(model.assetDestinations); dataSetId(model.dataSetId); encryption(model.encryption); revisionId(model.revisionId); } public final List getAssetDestinations() { List result = ListOfAssetDestinationEntryCopier.copyToBuilder(this.assetDestinations); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setAssetDestinations(Collection assetDestinations) { this.assetDestinations = ListOfAssetDestinationEntryCopier.copyFromBuilder(assetDestinations); } @Override public final Builder assetDestinations(Collection assetDestinations) { this.assetDestinations = ListOfAssetDestinationEntryCopier.copy(assetDestinations); return this; } @Override @SafeVarargs public final Builder assetDestinations(AssetDestinationEntry... assetDestinations) { assetDestinations(Arrays.asList(assetDestinations)); return this; } @Override @SafeVarargs public final Builder assetDestinations(Consumer... assetDestinations) { assetDestinations(Stream.of(assetDestinations).map(c -> AssetDestinationEntry.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getDataSetId() { return dataSetId; } public final void setDataSetId(String dataSetId) { this.dataSetId = dataSetId; } @Override public final Builder dataSetId(String dataSetId) { this.dataSetId = dataSetId; return this; } public final ExportServerSideEncryption.Builder getEncryption() { return encryption != null ? encryption.toBuilder() : null; } public final void setEncryption(ExportServerSideEncryption.BuilderImpl encryption) { this.encryption = encryption != null ? encryption.build() : null; } @Override public final Builder encryption(ExportServerSideEncryption encryption) { this.encryption = encryption; return this; } public final String getRevisionId() { return revisionId; } public final void setRevisionId(String revisionId) { this.revisionId = revisionId; } @Override public final Builder revisionId(String revisionId) { this.revisionId = revisionId; return this; } @Override public ExportAssetsToS3ResponseDetails build() { return new ExportAssetsToS3ResponseDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy