software.amazon.awssdk.services.dataexchange.model.ExportAssetsToS3RequestDetails Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dataexchange Show documentation
Show all versions of dataexchange Show documentation
The AWS Java SDK for DataExchange module holds the client classes that are used for
communicating with DataExchange.
/*
* 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 of the operation to be performed by the job.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExportAssetsToS3RequestDetails implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField> ASSET_DESTINATIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AssetDestinations")
.getter(getter(ExportAssetsToS3RequestDetails::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(ExportAssetsToS3RequestDetails::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(ExportAssetsToS3RequestDetails::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(ExportAssetsToS3RequestDetails::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 ExportAssetsToS3RequestDetails(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 for the asset.
*
*
* 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 for the asset.
*/
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 for the export job.
*
*
* @return Encryption configuration for the export job.
*/
public final ExportServerSideEncryption encryption() {
return encryption;
}
/**
*
* The unique identifier for the revision associated with this export request.
*
*
* @return The unique identifier for the revision associated with this export request.
*/
public final String revisionId() {
return revisionId;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> 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 ExportAssetsToS3RequestDetails)) {
return false;
}
ExportAssetsToS3RequestDetails other = (ExportAssetsToS3RequestDetails) 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("ExportAssetsToS3RequestDetails")
.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