software.amazon.awssdk.services.connect.model.InstanceStorageConfig Maven / Gradle / Ivy
Show all versions of connect Show documentation
/*
* 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.connect.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;
/**
*
* The storage configuration for the instance.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class InstanceStorageConfig implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ASSOCIATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AssociationId").getter(getter(InstanceStorageConfig::associationId))
.setter(setter(Builder::associationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AssociationId").build()).build();
private static final SdkField STORAGE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StorageType").getter(getter(InstanceStorageConfig::storageTypeAsString))
.setter(setter(Builder::storageType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageType").build()).build();
private static final SdkField S3_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("S3Config").getter(getter(InstanceStorageConfig::s3Config)).setter(setter(Builder::s3Config))
.constructor(S3Config::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3Config").build()).build();
private static final SdkField KINESIS_VIDEO_STREAM_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("KinesisVideoStreamConfig")
.getter(getter(InstanceStorageConfig::kinesisVideoStreamConfig)).setter(setter(Builder::kinesisVideoStreamConfig))
.constructor(KinesisVideoStreamConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KinesisVideoStreamConfig").build())
.build();
private static final SdkField KINESIS_STREAM_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("KinesisStreamConfig")
.getter(getter(InstanceStorageConfig::kinesisStreamConfig)).setter(setter(Builder::kinesisStreamConfig))
.constructor(KinesisStreamConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KinesisStreamConfig").build())
.build();
private static final SdkField KINESIS_FIREHOSE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("KinesisFirehoseConfig")
.getter(getter(InstanceStorageConfig::kinesisFirehoseConfig)).setter(setter(Builder::kinesisFirehoseConfig))
.constructor(KinesisFirehoseConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KinesisFirehoseConfig").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ASSOCIATION_ID_FIELD,
STORAGE_TYPE_FIELD, S3_CONFIG_FIELD, KINESIS_VIDEO_STREAM_CONFIG_FIELD, KINESIS_STREAM_CONFIG_FIELD,
KINESIS_FIREHOSE_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final String associationId;
private final String storageType;
private final S3Config s3Config;
private final KinesisVideoStreamConfig kinesisVideoStreamConfig;
private final KinesisStreamConfig kinesisStreamConfig;
private final KinesisFirehoseConfig kinesisFirehoseConfig;
private InstanceStorageConfig(BuilderImpl builder) {
this.associationId = builder.associationId;
this.storageType = builder.storageType;
this.s3Config = builder.s3Config;
this.kinesisVideoStreamConfig = builder.kinesisVideoStreamConfig;
this.kinesisStreamConfig = builder.kinesisStreamConfig;
this.kinesisFirehoseConfig = builder.kinesisFirehoseConfig;
}
/**
*
* The existing association identifier that uniquely identifies the resource type and storage config for the given
* instance ID.
*
*
* @return The existing association identifier that uniquely identifies the resource type and storage config for the
* given instance ID.
*/
public final String associationId() {
return associationId;
}
/**
*
* A valid storage type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #storageType} will
* return {@link StorageType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #storageTypeAsString}.
*
*
* @return A valid storage type.
* @see StorageType
*/
public final StorageType storageType() {
return StorageType.fromValue(storageType);
}
/**
*
* A valid storage type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #storageType} will
* return {@link StorageType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #storageTypeAsString}.
*
*
* @return A valid storage type.
* @see StorageType
*/
public final String storageTypeAsString() {
return storageType;
}
/**
*
* The S3 bucket configuration.
*
*
* @return The S3 bucket configuration.
*/
public final S3Config s3Config() {
return s3Config;
}
/**
*
* The configuration of the Kinesis video stream.
*
*
* @return The configuration of the Kinesis video stream.
*/
public final KinesisVideoStreamConfig kinesisVideoStreamConfig() {
return kinesisVideoStreamConfig;
}
/**
*
* The configuration of the Kinesis data stream.
*
*
* @return The configuration of the Kinesis data stream.
*/
public final KinesisStreamConfig kinesisStreamConfig() {
return kinesisStreamConfig;
}
/**
*
* The configuration of the Kinesis Firehose delivery stream.
*
*
* @return The configuration of the Kinesis Firehose delivery stream.
*/
public final KinesisFirehoseConfig kinesisFirehoseConfig() {
return kinesisFirehoseConfig;
}
@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(associationId());
hashCode = 31 * hashCode + Objects.hashCode(storageTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(s3Config());
hashCode = 31 * hashCode + Objects.hashCode(kinesisVideoStreamConfig());
hashCode = 31 * hashCode + Objects.hashCode(kinesisStreamConfig());
hashCode = 31 * hashCode + Objects.hashCode(kinesisFirehoseConfig());
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 InstanceStorageConfig)) {
return false;
}
InstanceStorageConfig other = (InstanceStorageConfig) obj;
return Objects.equals(associationId(), other.associationId())
&& Objects.equals(storageTypeAsString(), other.storageTypeAsString())
&& Objects.equals(s3Config(), other.s3Config())
&& Objects.equals(kinesisVideoStreamConfig(), other.kinesisVideoStreamConfig())
&& Objects.equals(kinesisStreamConfig(), other.kinesisStreamConfig())
&& Objects.equals(kinesisFirehoseConfig(), other.kinesisFirehoseConfig());
}
/**
* 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("InstanceStorageConfig").add("AssociationId", associationId())
.add("StorageType", storageTypeAsString()).add("S3Config", s3Config())
.add("KinesisVideoStreamConfig", kinesisVideoStreamConfig()).add("KinesisStreamConfig", kinesisStreamConfig())
.add("KinesisFirehoseConfig", kinesisFirehoseConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AssociationId":
return Optional.ofNullable(clazz.cast(associationId()));
case "StorageType":
return Optional.ofNullable(clazz.cast(storageTypeAsString()));
case "S3Config":
return Optional.ofNullable(clazz.cast(s3Config()));
case "KinesisVideoStreamConfig":
return Optional.ofNullable(clazz.cast(kinesisVideoStreamConfig()));
case "KinesisStreamConfig":
return Optional.ofNullable(clazz.cast(kinesisStreamConfig()));
case "KinesisFirehoseConfig":
return Optional.ofNullable(clazz.cast(kinesisFirehoseConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function