software.amazon.awssdk.services.iotsitewise.model.PutStorageConfigurationRequest Maven / Gradle / Ivy
Show all versions of iotsitewise 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.iotsitewise.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.awscore.AwsRequestOverrideConfiguration;
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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class PutStorageConfigurationRequest extends IoTSiteWiseRequest implements
ToCopyableBuilder {
private static final SdkField STORAGE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("storageType").getter(getter(PutStorageConfigurationRequest::storageTypeAsString))
.setter(setter(Builder::storageType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("storageType").build()).build();
private static final SdkField MULTI_LAYER_STORAGE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("multiLayerStorage")
.getter(getter(PutStorageConfigurationRequest::multiLayerStorage)).setter(setter(Builder::multiLayerStorage))
.constructor(MultiLayerStorage::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("multiLayerStorage").build()).build();
private static final SdkField DISASSOCIATED_DATA_STORAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("disassociatedDataStorage")
.getter(getter(PutStorageConfigurationRequest::disassociatedDataStorageAsString))
.setter(setter(Builder::disassociatedDataStorage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("disassociatedDataStorage").build())
.build();
private static final SdkField RETENTION_PERIOD_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("retentionPeriod")
.getter(getter(PutStorageConfigurationRequest::retentionPeriod)).setter(setter(Builder::retentionPeriod))
.constructor(RetentionPeriod::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("retentionPeriod").build()).build();
private static final SdkField WARM_TIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("warmTier").getter(getter(PutStorageConfigurationRequest::warmTierAsString))
.setter(setter(Builder::warmTier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("warmTier").build()).build();
private static final SdkField WARM_TIER_RETENTION_PERIOD_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("warmTierRetentionPeriod")
.getter(getter(PutStorageConfigurationRequest::warmTierRetentionPeriod))
.setter(setter(Builder::warmTierRetentionPeriod)).constructor(WarmTierRetentionPeriod::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("warmTierRetentionPeriod").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STORAGE_TYPE_FIELD,
MULTI_LAYER_STORAGE_FIELD, DISASSOCIATED_DATA_STORAGE_FIELD, RETENTION_PERIOD_FIELD, WARM_TIER_FIELD,
WARM_TIER_RETENTION_PERIOD_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("storageType", STORAGE_TYPE_FIELD);
put("multiLayerStorage", MULTI_LAYER_STORAGE_FIELD);
put("disassociatedDataStorage", DISASSOCIATED_DATA_STORAGE_FIELD);
put("retentionPeriod", RETENTION_PERIOD_FIELD);
put("warmTier", WARM_TIER_FIELD);
put("warmTierRetentionPeriod", WARM_TIER_RETENTION_PERIOD_FIELD);
}
});
private final String storageType;
private final MultiLayerStorage multiLayerStorage;
private final String disassociatedDataStorage;
private final RetentionPeriod retentionPeriod;
private final String warmTier;
private final WarmTierRetentionPeriod warmTierRetentionPeriod;
private PutStorageConfigurationRequest(BuilderImpl builder) {
super(builder);
this.storageType = builder.storageType;
this.multiLayerStorage = builder.multiLayerStorage;
this.disassociatedDataStorage = builder.disassociatedDataStorage;
this.retentionPeriod = builder.retentionPeriod;
this.warmTier = builder.warmTier;
this.warmTierRetentionPeriod = builder.warmTierRetentionPeriod;
}
/**
*
* The storage tier that you specified for your data. The storageType
parameter can be one of the
* following values:
*
*
* -
*
* SITEWISE_DEFAULT_STORAGE
– IoT SiteWise saves your data into the hot tier. The hot tier is a
* service-managed database.
*
*
* -
*
* MULTI_LAYER_STORAGE
– IoT SiteWise saves your data in both the cold tier and the hot tier. The cold
* tier is a customer-managed Amazon S3 bucket.
*
*
*
*
* 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 The storage tier that you specified for your data. The storageType
parameter can be one of
* the following values:
*
* -
*
* SITEWISE_DEFAULT_STORAGE
– IoT SiteWise saves your data into the hot tier. The hot tier is a
* service-managed database.
*
*
* -
*
* MULTI_LAYER_STORAGE
– IoT SiteWise saves your data in both the cold tier and the hot tier.
* The cold tier is a customer-managed Amazon S3 bucket.
*
*
* @see StorageType
*/
public final StorageType storageType() {
return StorageType.fromValue(storageType);
}
/**
*
* The storage tier that you specified for your data. The storageType
parameter can be one of the
* following values:
*
*
* -
*
* SITEWISE_DEFAULT_STORAGE
– IoT SiteWise saves your data into the hot tier. The hot tier is a
* service-managed database.
*
*
* -
*
* MULTI_LAYER_STORAGE
– IoT SiteWise saves your data in both the cold tier and the hot tier. The cold
* tier is a customer-managed Amazon S3 bucket.
*
*
*
*
* 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 The storage tier that you specified for your data. The storageType
parameter can be one of
* the following values:
*
* -
*
* SITEWISE_DEFAULT_STORAGE
– IoT SiteWise saves your data into the hot tier. The hot tier is a
* service-managed database.
*
*
* -
*
* MULTI_LAYER_STORAGE
– IoT SiteWise saves your data in both the cold tier and the hot tier.
* The cold tier is a customer-managed Amazon S3 bucket.
*
*
* @see StorageType
*/
public final String storageTypeAsString() {
return storageType;
}
/**
*
* Identifies a storage destination. If you specified MULTI_LAYER_STORAGE
for the storage type, you
* must specify a MultiLayerStorage
object.
*
*
* @return Identifies a storage destination. If you specified MULTI_LAYER_STORAGE
for the storage type,
* you must specify a MultiLayerStorage
object.
*/
public final MultiLayerStorage multiLayerStorage() {
return multiLayerStorage;
}
/**
*
* Contains the storage configuration for time series (data streams) that aren't associated with asset properties.
* The disassociatedDataStorage
can be one of the following values:
*
*
* -
*
* ENABLED
– IoT SiteWise accepts time series that aren't associated with asset properties.
*
*
*
* After the disassociatedDataStorage
is enabled, you can't disable it.
*
*
* -
*
* DISABLED
– IoT SiteWise doesn't accept time series (data streams) that aren't associated with asset
* properties.
*
*
*
*
* For more information, see Data streams in the IoT
* SiteWise User Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #disassociatedDataStorage} will return {@link DisassociatedDataStorageState#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #disassociatedDataStorageAsString}.
*
*
* @return Contains the storage configuration for time series (data streams) that aren't associated with asset
* properties. The disassociatedDataStorage
can be one of the following values:
*
* -
*
* ENABLED
– IoT SiteWise accepts time series that aren't associated with asset properties.
*
*
*
* After the disassociatedDataStorage
is enabled, you can't disable it.
*
*
* -
*
* DISABLED
– IoT SiteWise doesn't accept time series (data streams) that aren't associated
* with asset properties.
*
*
*
*
* For more information, see Data streams in
* the IoT SiteWise User Guide.
* @see DisassociatedDataStorageState
*/
public final DisassociatedDataStorageState disassociatedDataStorage() {
return DisassociatedDataStorageState.fromValue(disassociatedDataStorage);
}
/**
*
* Contains the storage configuration for time series (data streams) that aren't associated with asset properties.
* The disassociatedDataStorage
can be one of the following values:
*
*
* -
*
* ENABLED
– IoT SiteWise accepts time series that aren't associated with asset properties.
*
*
*
* After the disassociatedDataStorage
is enabled, you can't disable it.
*
*
* -
*
* DISABLED
– IoT SiteWise doesn't accept time series (data streams) that aren't associated with asset
* properties.
*
*
*
*
* For more information, see Data streams in the IoT
* SiteWise User Guide.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #disassociatedDataStorage} will return {@link DisassociatedDataStorageState#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #disassociatedDataStorageAsString}.
*
*
* @return Contains the storage configuration for time series (data streams) that aren't associated with asset
* properties. The disassociatedDataStorage
can be one of the following values:
*
* -
*
* ENABLED
– IoT SiteWise accepts time series that aren't associated with asset properties.
*
*
*
* After the disassociatedDataStorage
is enabled, you can't disable it.
*
*
* -
*
* DISABLED
– IoT SiteWise doesn't accept time series (data streams) that aren't associated
* with asset properties.
*
*
*
*
* For more information, see Data streams in
* the IoT SiteWise User Guide.
* @see DisassociatedDataStorageState
*/
public final String disassociatedDataStorageAsString() {
return disassociatedDataStorage;
}
/**
* Returns the value of the RetentionPeriod property for this object.
*
* @return The value of the RetentionPeriod property for this object.
*/
public final RetentionPeriod retentionPeriod() {
return retentionPeriod;
}
/**
*
* A service managed storage tier optimized for analytical queries. It stores periodically uploaded, buffered and
* historical data ingested with the CreaeBulkImportJob API.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #warmTier} will
* return {@link WarmTierState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #warmTierAsString}.
*
*
* @return A service managed storage tier optimized for analytical queries. It stores periodically uploaded,
* buffered and historical data ingested with the CreaeBulkImportJob API.
* @see WarmTierState
*/
public final WarmTierState warmTier() {
return WarmTierState.fromValue(warmTier);
}
/**
*
* A service managed storage tier optimized for analytical queries. It stores periodically uploaded, buffered and
* historical data ingested with the CreaeBulkImportJob API.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #warmTier} will
* return {@link WarmTierState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #warmTierAsString}.
*
*
* @return A service managed storage tier optimized for analytical queries. It stores periodically uploaded,
* buffered and historical data ingested with the CreaeBulkImportJob API.
* @see WarmTierState
*/
public final String warmTierAsString() {
return warmTier;
}
/**
*
* Set this period to specify how long your data is stored in the warm tier before it is deleted. You can set this
* only if cold tier is enabled.
*
*
* @return Set this period to specify how long your data is stored in the warm tier before it is deleted. You can
* set this only if cold tier is enabled.
*/
public final WarmTierRetentionPeriod warmTierRetentionPeriod() {
return warmTierRetentionPeriod;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(storageTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(multiLayerStorage());
hashCode = 31 * hashCode + Objects.hashCode(disassociatedDataStorageAsString());
hashCode = 31 * hashCode + Objects.hashCode(retentionPeriod());
hashCode = 31 * hashCode + Objects.hashCode(warmTierAsString());
hashCode = 31 * hashCode + Objects.hashCode(warmTierRetentionPeriod());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof PutStorageConfigurationRequest)) {
return false;
}
PutStorageConfigurationRequest other = (PutStorageConfigurationRequest) obj;
return Objects.equals(storageTypeAsString(), other.storageTypeAsString())
&& Objects.equals(multiLayerStorage(), other.multiLayerStorage())
&& Objects.equals(disassociatedDataStorageAsString(), other.disassociatedDataStorageAsString())
&& Objects.equals(retentionPeriod(), other.retentionPeriod())
&& Objects.equals(warmTierAsString(), other.warmTierAsString())
&& Objects.equals(warmTierRetentionPeriod(), other.warmTierRetentionPeriod());
}
/**
* 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("PutStorageConfigurationRequest").add("StorageType", storageTypeAsString())
.add("MultiLayerStorage", multiLayerStorage())
.add("DisassociatedDataStorage", disassociatedDataStorageAsString()).add("RetentionPeriod", retentionPeriod())
.add("WarmTier", warmTierAsString()).add("WarmTierRetentionPeriod", warmTierRetentionPeriod()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "storageType":
return Optional.ofNullable(clazz.cast(storageTypeAsString()));
case "multiLayerStorage":
return Optional.ofNullable(clazz.cast(multiLayerStorage()));
case "disassociatedDataStorage":
return Optional.ofNullable(clazz.cast(disassociatedDataStorageAsString()));
case "retentionPeriod":
return Optional.ofNullable(clazz.cast(retentionPeriod()));
case "warmTier":
return Optional.ofNullable(clazz.cast(warmTierAsString()));
case "warmTierRetentionPeriod":
return Optional.ofNullable(clazz.cast(warmTierRetentionPeriod()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function