software.amazon.awssdk.services.kinesisanalytics.model.S3ReferenceDataSource Maven / Gradle / Ivy
Show all versions of kinesis Show documentation
/*
* Copyright 2013-2018 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.util.Objects;
import java.util.Optional;
import javax.annotation.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.kinesisanalytics.transform.S3ReferenceDataSourceMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Identifies the S3 bucket and object that contains the reference data. Also identifies the IAM role Amazon Kinesis
* Analytics can assume to read this object on your behalf.
*
*
* An Amazon Kinesis Analytics application loads reference data only once. If the data changes, you call the
* UpdateApplication operation to trigger reloading of data into your application.
*
*/
@Generated("software.amazon.awssdk:codegen")
public class S3ReferenceDataSource implements StructuredPojo,
ToCopyableBuilder {
private final String bucketARN;
private final String fileKey;
private final String referenceRoleARN;
private S3ReferenceDataSource(BuilderImpl builder) {
this.bucketARN = builder.bucketARN;
this.fileKey = builder.fileKey;
this.referenceRoleARN = builder.referenceRoleARN;
}
/**
*
* Amazon Resource Name (ARN) of the S3 bucket.
*
*
* @return Amazon Resource Name (ARN) of the S3 bucket.
*/
public String bucketARN() {
return bucketARN;
}
/**
*
* Object key name containing reference data.
*
*
* @return Object key name containing reference data.
*/
public String fileKey() {
return fileKey;
}
/**
*
* ARN of the IAM role that the service can assume to read data on your behalf. This role must have permission for
* the s3:GetObject
action on the object and trust policy that allows Amazon Kinesis Analytics service
* principal to assume this role.
*
*
* @return ARN of the IAM role that the service can assume to read data on your behalf. This role must have
* permission for the s3:GetObject
action on the object and trust policy that allows Amazon
* Kinesis Analytics service principal to assume this role.
*/
public String referenceRoleARN() {
return referenceRoleARN;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(bucketARN());
hashCode = 31 * hashCode + Objects.hashCode(fileKey());
hashCode = 31 * hashCode + Objects.hashCode(referenceRoleARN());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof S3ReferenceDataSource)) {
return false;
}
S3ReferenceDataSource other = (S3ReferenceDataSource) obj;
return Objects.equals(bucketARN(), other.bucketARN()) && Objects.equals(fileKey(), other.fileKey())
&& Objects.equals(referenceRoleARN(), other.referenceRoleARN());
}
@Override
public String toString() {
return ToString.builder("S3ReferenceDataSource").add("BucketARN", bucketARN()).add("FileKey", fileKey())
.add("ReferenceRoleARN", referenceRoleARN()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BucketARN":
return Optional.of(clazz.cast(bucketARN()));
case "FileKey":
return Optional.of(clazz.cast(fileKey()));
case "ReferenceRoleARN":
return Optional.of(clazz.cast(referenceRoleARN()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
S3ReferenceDataSourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* Amazon Resource Name (ARN) of the S3 bucket.
*
*
* @param bucketARN
* Amazon Resource Name (ARN) of the S3 bucket.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder bucketARN(String bucketARN);
/**
*
* Object key name containing reference data.
*
*
* @param fileKey
* Object key name containing reference data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder fileKey(String fileKey);
/**
*
* ARN of the IAM role that the service can assume to read data on your behalf. This role must have permission
* for the s3:GetObject
action on the object and trust policy that allows Amazon Kinesis Analytics
* service principal to assume this role.
*
*
* @param referenceRoleARN
* ARN of the IAM role that the service can assume to read data on your behalf. This role must have
* permission for the s3:GetObject
action on the object and trust policy that allows Amazon
* Kinesis Analytics service principal to assume this role.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder referenceRoleARN(String referenceRoleARN);
}
static final class BuilderImpl implements Builder {
private String bucketARN;
private String fileKey;
private String referenceRoleARN;
private BuilderImpl() {
}
private BuilderImpl(S3ReferenceDataSource model) {
bucketARN(model.bucketARN);
fileKey(model.fileKey);
referenceRoleARN(model.referenceRoleARN);
}
public final String getBucketARN() {
return bucketARN;
}
@Override
public final Builder bucketARN(String bucketARN) {
this.bucketARN = bucketARN;
return this;
}
public final void setBucketARN(String bucketARN) {
this.bucketARN = bucketARN;
}
public final String getFileKey() {
return fileKey;
}
@Override
public final Builder fileKey(String fileKey) {
this.fileKey = fileKey;
return this;
}
public final void setFileKey(String fileKey) {
this.fileKey = fileKey;
}
public final String getReferenceRoleARN() {
return referenceRoleARN;
}
@Override
public final Builder referenceRoleARN(String referenceRoleARN) {
this.referenceRoleARN = referenceRoleARN;
return this;
}
public final void setReferenceRoleARN(String referenceRoleARN) {
this.referenceRoleARN = referenceRoleARN;
}
@Override
public S3ReferenceDataSource build() {
return new S3ReferenceDataSource(this);
}
}
}