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

software.amazon.awssdk.services.kinesisanalytics.model.S3Configuration 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.kinesisanalytics.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.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;

/**
 * 

* Provides a description of an Amazon S3 data source, including the Amazon Resource Name (ARN) of the S3 bucket, the * ARN of the IAM role that is used to access the bucket, and the name of the Amazon S3 object that contains the data. *

*/ @Generated("software.amazon.awssdk:codegen") public final class S3Configuration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RoleARN").getter(getter(S3Configuration::roleARN)).setter(setter(Builder::roleARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleARN").build()).build(); private static final SdkField BUCKET_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("BucketARN").getter(getter(S3Configuration::bucketARN)).setter(setter(Builder::bucketARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BucketARN").build()).build(); private static final SdkField FILE_KEY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FileKey").getter(getter(S3Configuration::fileKey)).setter(setter(Builder::fileKey)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileKey").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ROLE_ARN_FIELD, BUCKET_ARN_FIELD, FILE_KEY_FIELD)); private static final long serialVersionUID = 1L; private final String roleARN; private final String bucketARN; private final String fileKey; private S3Configuration(BuilderImpl builder) { this.roleARN = builder.roleARN; this.bucketARN = builder.bucketARN; this.fileKey = builder.fileKey; } /** *

* IAM ARN of the role used to access the data. *

* * @return IAM ARN of the role used to access the data. */ public final String roleARN() { return roleARN; } /** *

* ARN of the S3 bucket that contains the data. *

* * @return ARN of the S3 bucket that contains the data. */ public final String bucketARN() { return bucketARN; } /** *

* The name of the object that contains the data. *

* * @return The name of the object that contains the data. */ public final String fileKey() { return fileKey; } @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(roleARN()); hashCode = 31 * hashCode + Objects.hashCode(bucketARN()); hashCode = 31 * hashCode + Objects.hashCode(fileKey()); 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 S3Configuration)) { return false; } S3Configuration other = (S3Configuration) obj; return Objects.equals(roleARN(), other.roleARN()) && Objects.equals(bucketARN(), other.bucketARN()) && Objects.equals(fileKey(), other.fileKey()); } /** * 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("S3Configuration").add("RoleARN", roleARN()).add("BucketARN", bucketARN()) .add("FileKey", fileKey()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "RoleARN": return Optional.ofNullable(clazz.cast(roleARN())); case "BucketARN": return Optional.ofNullable(clazz.cast(bucketARN())); case "FileKey": return Optional.ofNullable(clazz.cast(fileKey())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((S3Configuration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* IAM ARN of the role used to access the data. *

* * @param roleARN * IAM ARN of the role used to access the data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleARN(String roleARN); /** *

* ARN of the S3 bucket that contains the data. *

* * @param bucketARN * ARN of the S3 bucket that contains the data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bucketARN(String bucketARN); /** *

* The name of the object that contains the data. *

* * @param fileKey * The name of the object that contains the data. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fileKey(String fileKey); } static final class BuilderImpl implements Builder { private String roleARN; private String bucketARN; private String fileKey; private BuilderImpl() { } private BuilderImpl(S3Configuration model) { roleARN(model.roleARN); bucketARN(model.bucketARN); fileKey(model.fileKey); } public final String getRoleARN() { return roleARN; } public final void setRoleARN(String roleARN) { this.roleARN = roleARN; } @Override public final Builder roleARN(String roleARN) { this.roleARN = roleARN; return this; } public final String getBucketARN() { return bucketARN; } public final void setBucketARN(String bucketARN) { this.bucketARN = bucketARN; } @Override public final Builder bucketARN(String bucketARN) { this.bucketARN = bucketARN; return this; } public final String getFileKey() { return fileKey; } public final void setFileKey(String fileKey) { this.fileKey = fileKey; } @Override public final Builder fileKey(String fileKey) { this.fileKey = fileKey; return this; } @Override public S3Configuration build() { return new S3Configuration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy