software.amazon.awssdk.services.timestreamwrite.model.CreateBatchLoadTaskRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timestreamwrite Show documentation
Show all versions of timestreamwrite Show documentation
The AWS Java SDK for Timestream Write module holds the client classes that are used for
communicating with Timestream Write.
/*
* 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.timestreamwrite.model;
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.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.DefaultValueTrait;
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 CreateBatchLoadTaskRequest extends TimestreamWriteRequest implements
ToCopyableBuilder {
private static final SdkField CLIENT_TOKEN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ClientToken")
.getter(getter(CreateBatchLoadTaskRequest::clientToken))
.setter(setter(Builder::clientToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClientToken").build(),
DefaultValueTrait.idempotencyToken()).build();
private static final SdkField DATA_MODEL_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DataModelConfiguration")
.getter(getter(CreateBatchLoadTaskRequest::dataModelConfiguration)).setter(setter(Builder::dataModelConfiguration))
.constructor(DataModelConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataModelConfiguration").build())
.build();
private static final SdkField DATA_SOURCE_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DataSourceConfiguration")
.getter(getter(CreateBatchLoadTaskRequest::dataSourceConfiguration)).setter(setter(Builder::dataSourceConfiguration))
.constructor(DataSourceConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataSourceConfiguration").build())
.build();
private static final SdkField REPORT_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ReportConfiguration")
.getter(getter(CreateBatchLoadTaskRequest::reportConfiguration)).setter(setter(Builder::reportConfiguration))
.constructor(ReportConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReportConfiguration").build())
.build();
private static final SdkField TARGET_DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetDatabaseName").getter(getter(CreateBatchLoadTaskRequest::targetDatabaseName))
.setter(setter(Builder::targetDatabaseName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetDatabaseName").build())
.build();
private static final SdkField TARGET_TABLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetTableName").getter(getter(CreateBatchLoadTaskRequest::targetTableName))
.setter(setter(Builder::targetTableName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetTableName").build()).build();
private static final SdkField RECORD_VERSION_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("RecordVersion").getter(getter(CreateBatchLoadTaskRequest::recordVersion))
.setter(setter(Builder::recordVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecordVersion").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLIENT_TOKEN_FIELD,
DATA_MODEL_CONFIGURATION_FIELD, DATA_SOURCE_CONFIGURATION_FIELD, REPORT_CONFIGURATION_FIELD,
TARGET_DATABASE_NAME_FIELD, TARGET_TABLE_NAME_FIELD, RECORD_VERSION_FIELD));
private final String clientToken;
private final DataModelConfiguration dataModelConfiguration;
private final DataSourceConfiguration dataSourceConfiguration;
private final ReportConfiguration reportConfiguration;
private final String targetDatabaseName;
private final String targetTableName;
private final Long recordVersion;
private CreateBatchLoadTaskRequest(BuilderImpl builder) {
super(builder);
this.clientToken = builder.clientToken;
this.dataModelConfiguration = builder.dataModelConfiguration;
this.dataSourceConfiguration = builder.dataSourceConfiguration;
this.reportConfiguration = builder.reportConfiguration;
this.targetDatabaseName = builder.targetDatabaseName;
this.targetTableName = builder.targetTableName;
this.recordVersion = builder.recordVersion;
}
/**
*
*
* @return
*/
public final String clientToken() {
return clientToken;
}
/**
* Returns the value of the DataModelConfiguration property for this object.
*
* @return The value of the DataModelConfiguration property for this object.
*/
public final DataModelConfiguration dataModelConfiguration() {
return dataModelConfiguration;
}
/**
*
* Defines configuration details about the data source for a batch load task.
*
*
* @return Defines configuration details about the data source for a batch load task.
*/
public final DataSourceConfiguration dataSourceConfiguration() {
return dataSourceConfiguration;
}
/**
* Returns the value of the ReportConfiguration property for this object.
*
* @return The value of the ReportConfiguration property for this object.
*/
public final ReportConfiguration reportConfiguration() {
return reportConfiguration;
}
/**
*
* Target Timestream database for a batch load task.
*
*
* @return Target Timestream database for a batch load task.
*/
public final String targetDatabaseName() {
return targetDatabaseName;
}
/**
*
* Target Timestream table for a batch load task.
*
*
* @return Target Timestream table for a batch load task.
*/
public final String targetTableName() {
return targetTableName;
}
/**
*
*
* @return
*/
public final Long recordVersion() {
return recordVersion;
}
@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(clientToken());
hashCode = 31 * hashCode + Objects.hashCode(dataModelConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(dataSourceConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(reportConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(targetDatabaseName());
hashCode = 31 * hashCode + Objects.hashCode(targetTableName());
hashCode = 31 * hashCode + Objects.hashCode(recordVersion());
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 CreateBatchLoadTaskRequest)) {
return false;
}
CreateBatchLoadTaskRequest other = (CreateBatchLoadTaskRequest) obj;
return Objects.equals(clientToken(), other.clientToken())
&& Objects.equals(dataModelConfiguration(), other.dataModelConfiguration())
&& Objects.equals(dataSourceConfiguration(), other.dataSourceConfiguration())
&& Objects.equals(reportConfiguration(), other.reportConfiguration())
&& Objects.equals(targetDatabaseName(), other.targetDatabaseName())
&& Objects.equals(targetTableName(), other.targetTableName())
&& Objects.equals(recordVersion(), other.recordVersion());
}
/**
* 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("CreateBatchLoadTaskRequest")
.add("ClientToken", clientToken() == null ? null : "*** Sensitive Data Redacted ***")
.add("DataModelConfiguration", dataModelConfiguration())
.add("DataSourceConfiguration", dataSourceConfiguration()).add("ReportConfiguration", reportConfiguration())
.add("TargetDatabaseName", targetDatabaseName()).add("TargetTableName", targetTableName())
.add("RecordVersion", recordVersion()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ClientToken":
return Optional.ofNullable(clazz.cast(clientToken()));
case "DataModelConfiguration":
return Optional.ofNullable(clazz.cast(dataModelConfiguration()));
case "DataSourceConfiguration":
return Optional.ofNullable(clazz.cast(dataSourceConfiguration()));
case "ReportConfiguration":
return Optional.ofNullable(clazz.cast(reportConfiguration()));
case "TargetDatabaseName":
return Optional.ofNullable(clazz.cast(targetDatabaseName()));
case "TargetTableName":
return Optional.ofNullable(clazz.cast(targetTableName()));
case "RecordVersion":
return Optional.ofNullable(clazz.cast(recordVersion()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function