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

software.amazon.awssdk.services.ssm.model.ResourceDataSyncS3Destination Maven / Gradle / Ivy

/*
 * 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.ssm.model;

import java.io.Serializable;
import java.util.Arrays;
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 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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Information about the target S3 bucket for the Resource Data Sync. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ResourceDataSyncS3Destination implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField BUCKET_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ResourceDataSyncS3Destination::bucketName)).setter(setter(Builder::bucketName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BucketName").build()).build(); private static final SdkField PREFIX_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ResourceDataSyncS3Destination::prefix)).setter(setter(Builder::prefix)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Prefix").build()).build(); private static final SdkField SYNC_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ResourceDataSyncS3Destination::syncFormatAsString)).setter(setter(Builder::syncFormat)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SyncFormat").build()).build(); private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ResourceDataSyncS3Destination::region)).setter(setter(Builder::region)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build(); private static final SdkField AWSKMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(ResourceDataSyncS3Destination::awskmsKeyARN)).setter(setter(Builder::awskmsKeyARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AWSKMSKeyARN").build()).build(); private static final SdkField DESTINATION_DATA_SHARING_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .getter(getter(ResourceDataSyncS3Destination::destinationDataSharing)) .setter(setter(Builder::destinationDataSharing)).constructor(ResourceDataSyncDestinationDataSharing::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationDataSharing").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUCKET_NAME_FIELD, PREFIX_FIELD, SYNC_FORMAT_FIELD, REGION_FIELD, AWSKMS_KEY_ARN_FIELD, DESTINATION_DATA_SHARING_FIELD)); private static final long serialVersionUID = 1L; private final String bucketName; private final String prefix; private final String syncFormat; private final String region; private final String awskmsKeyARN; private final ResourceDataSyncDestinationDataSharing destinationDataSharing; private ResourceDataSyncS3Destination(BuilderImpl builder) { this.bucketName = builder.bucketName; this.prefix = builder.prefix; this.syncFormat = builder.syncFormat; this.region = builder.region; this.awskmsKeyARN = builder.awskmsKeyARN; this.destinationDataSharing = builder.destinationDataSharing; } /** *

* The name of the S3 bucket where the aggregated data is stored. *

* * @return The name of the S3 bucket where the aggregated data is stored. */ public String bucketName() { return bucketName; } /** *

* An Amazon S3 prefix for the bucket. *

* * @return An Amazon S3 prefix for the bucket. */ public String prefix() { return prefix; } /** *

* A supported sync format. The following format is currently supported: JsonSerDe *

*

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

* * @return A supported sync format. The following format is currently supported: JsonSerDe * @see ResourceDataSyncS3Format */ public ResourceDataSyncS3Format syncFormat() { return ResourceDataSyncS3Format.fromValue(syncFormat); } /** *

* A supported sync format. The following format is currently supported: JsonSerDe *

*

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

* * @return A supported sync format. The following format is currently supported: JsonSerDe * @see ResourceDataSyncS3Format */ public String syncFormatAsString() { return syncFormat; } /** *

* The AWS Region with the S3 bucket targeted by the Resource Data Sync. *

* * @return The AWS Region with the S3 bucket targeted by the Resource Data Sync. */ public String region() { return region; } /** *

* The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the destination S3 * bucket. *

* * @return The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the * destination S3 bucket. */ public String awskmsKeyARN() { return awskmsKeyARN; } /** *

* Enables destination data sharing. By default, this field is null. *

* * @return Enables destination data sharing. By default, this field is null. */ public ResourceDataSyncDestinationDataSharing destinationDataSharing() { return destinationDataSharing; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(bucketName()); hashCode = 31 * hashCode + Objects.hashCode(prefix()); hashCode = 31 * hashCode + Objects.hashCode(syncFormatAsString()); hashCode = 31 * hashCode + Objects.hashCode(region()); hashCode = 31 * hashCode + Objects.hashCode(awskmsKeyARN()); hashCode = 31 * hashCode + Objects.hashCode(destinationDataSharing()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ResourceDataSyncS3Destination)) { return false; } ResourceDataSyncS3Destination other = (ResourceDataSyncS3Destination) obj; return Objects.equals(bucketName(), other.bucketName()) && Objects.equals(prefix(), other.prefix()) && Objects.equals(syncFormatAsString(), other.syncFormatAsString()) && Objects.equals(region(), other.region()) && Objects.equals(awskmsKeyARN(), other.awskmsKeyARN()) && Objects.equals(destinationDataSharing(), other.destinationDataSharing()); } /** * 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 String toString() { return ToString.builder("ResourceDataSyncS3Destination").add("BucketName", bucketName()).add("Prefix", prefix()) .add("SyncFormat", syncFormatAsString()).add("Region", region()).add("AWSKMSKeyARN", awskmsKeyARN()) .add("DestinationDataSharing", destinationDataSharing()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "BucketName": return Optional.ofNullable(clazz.cast(bucketName())); case "Prefix": return Optional.ofNullable(clazz.cast(prefix())); case "SyncFormat": return Optional.ofNullable(clazz.cast(syncFormatAsString())); case "Region": return Optional.ofNullable(clazz.cast(region())); case "AWSKMSKeyARN": return Optional.ofNullable(clazz.cast(awskmsKeyARN())); case "DestinationDataSharing": return Optional.ofNullable(clazz.cast(destinationDataSharing())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ResourceDataSyncS3Destination) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the S3 bucket where the aggregated data is stored. *

* * @param bucketName * The name of the S3 bucket where the aggregated data is stored. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bucketName(String bucketName); /** *

* An Amazon S3 prefix for the bucket. *

* * @param prefix * An Amazon S3 prefix for the bucket. * @return Returns a reference to this object so that method calls can be chained together. */ Builder prefix(String prefix); /** *

* A supported sync format. The following format is currently supported: JsonSerDe *

* * @param syncFormat * A supported sync format. The following format is currently supported: JsonSerDe * @see ResourceDataSyncS3Format * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceDataSyncS3Format */ Builder syncFormat(String syncFormat); /** *

* A supported sync format. The following format is currently supported: JsonSerDe *

* * @param syncFormat * A supported sync format. The following format is currently supported: JsonSerDe * @see ResourceDataSyncS3Format * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceDataSyncS3Format */ Builder syncFormat(ResourceDataSyncS3Format syncFormat); /** *

* The AWS Region with the S3 bucket targeted by the Resource Data Sync. *

* * @param region * The AWS Region with the S3 bucket targeted by the Resource Data Sync. * @return Returns a reference to this object so that method calls can be chained together. */ Builder region(String region); /** *

* The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the * destination S3 bucket. *

* * @param awskmsKeyARN * The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the * destination S3 bucket. * @return Returns a reference to this object so that method calls can be chained together. */ Builder awskmsKeyARN(String awskmsKeyARN); /** *

* Enables destination data sharing. By default, this field is null. *

* * @param destinationDataSharing * Enables destination data sharing. By default, this field is null. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinationDataSharing(ResourceDataSyncDestinationDataSharing destinationDataSharing); /** *

* Enables destination data sharing. By default, this field is null. *

* This is a convenience that creates an instance of the {@link ResourceDataSyncDestinationDataSharing.Builder} * avoiding the need to create one manually via {@link ResourceDataSyncDestinationDataSharing#builder()}. * * When the {@link Consumer} completes, {@link ResourceDataSyncDestinationDataSharing.Builder#build()} is called * immediately and its result is passed to * {@link #destinationDataSharing(ResourceDataSyncDestinationDataSharing)}. * * @param destinationDataSharing * a consumer that will call methods on {@link ResourceDataSyncDestinationDataSharing.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #destinationDataSharing(ResourceDataSyncDestinationDataSharing) */ default Builder destinationDataSharing(Consumer destinationDataSharing) { return destinationDataSharing(ResourceDataSyncDestinationDataSharing.builder().applyMutation(destinationDataSharing) .build()); } } static final class BuilderImpl implements Builder { private String bucketName; private String prefix; private String syncFormat; private String region; private String awskmsKeyARN; private ResourceDataSyncDestinationDataSharing destinationDataSharing; private BuilderImpl() { } private BuilderImpl(ResourceDataSyncS3Destination model) { bucketName(model.bucketName); prefix(model.prefix); syncFormat(model.syncFormat); region(model.region); awskmsKeyARN(model.awskmsKeyARN); destinationDataSharing(model.destinationDataSharing); } public final String getBucketName() { return bucketName; } @Override public final Builder bucketName(String bucketName) { this.bucketName = bucketName; return this; } public final void setBucketName(String bucketName) { this.bucketName = bucketName; } public final String getPrefix() { return prefix; } @Override public final Builder prefix(String prefix) { this.prefix = prefix; return this; } public final void setPrefix(String prefix) { this.prefix = prefix; } public final String getSyncFormat() { return syncFormat; } @Override public final Builder syncFormat(String syncFormat) { this.syncFormat = syncFormat; return this; } @Override public final Builder syncFormat(ResourceDataSyncS3Format syncFormat) { this.syncFormat(syncFormat == null ? null : syncFormat.toString()); return this; } public final void setSyncFormat(String syncFormat) { this.syncFormat = syncFormat; } public final String getRegion() { return region; } @Override public final Builder region(String region) { this.region = region; return this; } public final void setRegion(String region) { this.region = region; } public final String getAwskmsKeyARN() { return awskmsKeyARN; } @Override public final Builder awskmsKeyARN(String awskmsKeyARN) { this.awskmsKeyARN = awskmsKeyARN; return this; } public final void setAwskmsKeyARN(String awskmsKeyARN) { this.awskmsKeyARN = awskmsKeyARN; } public final ResourceDataSyncDestinationDataSharing.Builder getDestinationDataSharing() { return destinationDataSharing != null ? destinationDataSharing.toBuilder() : null; } @Override public final Builder destinationDataSharing(ResourceDataSyncDestinationDataSharing destinationDataSharing) { this.destinationDataSharing = destinationDataSharing; return this; } public final void setDestinationDataSharing(ResourceDataSyncDestinationDataSharing.BuilderImpl destinationDataSharing) { this.destinationDataSharing = destinationDataSharing != null ? destinationDataSharing.build() : null; } @Override public ResourceDataSyncS3Destination build() { return new ResourceDataSyncS3Destination(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy