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

software.amazon.awssdk.services.timestreamwrite.model.CreateBatchLoadTaskRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Timestream Write module holds the client classes that are used for communicating with Timestream Write.

There is a newer version: 2.28.4
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((CreateBatchLoadTaskRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends TimestreamWriteRequest.Builder, SdkPojo, CopyableBuilder { /** *

* * @param clientToken * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientToken(String clientToken); /** * Sets the value of the DataModelConfiguration property for this object. * * @param dataModelConfiguration * The new value for the DataModelConfiguration property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataModelConfiguration(DataModelConfiguration dataModelConfiguration); /** * Sets the value of the DataModelConfiguration property for this object. * * This is a convenience method that creates an instance of the {@link DataModelConfiguration.Builder} avoiding * the need to create one manually via {@link DataModelConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link DataModelConfiguration.Builder#build()} is called immediately and * its result is passed to {@link #dataModelConfiguration(DataModelConfiguration)}. * * @param dataModelConfiguration * a consumer that will call methods on {@link DataModelConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #dataModelConfiguration(DataModelConfiguration) */ default Builder dataModelConfiguration(Consumer dataModelConfiguration) { return dataModelConfiguration(DataModelConfiguration.builder().applyMutation(dataModelConfiguration).build()); } /** *

* Defines configuration details about the data source for a batch load task. *

* * @param dataSourceConfiguration * Defines configuration details about the data source for a batch load task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataSourceConfiguration(DataSourceConfiguration dataSourceConfiguration); /** *

* Defines configuration details about the data source for a batch load task. *

* This is a convenience method that creates an instance of the {@link DataSourceConfiguration.Builder} avoiding * the need to create one manually via {@link DataSourceConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link DataSourceConfiguration.Builder#build()} is called immediately * and its result is passed to {@link #dataSourceConfiguration(DataSourceConfiguration)}. * * @param dataSourceConfiguration * a consumer that will call methods on {@link DataSourceConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #dataSourceConfiguration(DataSourceConfiguration) */ default Builder dataSourceConfiguration(Consumer dataSourceConfiguration) { return dataSourceConfiguration(DataSourceConfiguration.builder().applyMutation(dataSourceConfiguration).build()); } /** * Sets the value of the ReportConfiguration property for this object. * * @param reportConfiguration * The new value for the ReportConfiguration property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reportConfiguration(ReportConfiguration reportConfiguration); /** * Sets the value of the ReportConfiguration property for this object. * * This is a convenience method that creates an instance of the {@link ReportConfiguration.Builder} avoiding the * need to create one manually via {@link ReportConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link ReportConfiguration.Builder#build()} is called immediately and * its result is passed to {@link #reportConfiguration(ReportConfiguration)}. * * @param reportConfiguration * a consumer that will call methods on {@link ReportConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #reportConfiguration(ReportConfiguration) */ default Builder reportConfiguration(Consumer reportConfiguration) { return reportConfiguration(ReportConfiguration.builder().applyMutation(reportConfiguration).build()); } /** *

* Target Timestream database for a batch load task. *

* * @param targetDatabaseName * Target Timestream database for a batch load task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetDatabaseName(String targetDatabaseName); /** *

* Target Timestream table for a batch load task. *

* * @param targetTableName * Target Timestream table for a batch load task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetTableName(String targetTableName); /** *

* * @param recordVersion * @return Returns a reference to this object so that method calls can be chained together. */ Builder recordVersion(Long recordVersion); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends TimestreamWriteRequest.BuilderImpl implements Builder { private String clientToken; private DataModelConfiguration dataModelConfiguration; private DataSourceConfiguration dataSourceConfiguration; private ReportConfiguration reportConfiguration; private String targetDatabaseName; private String targetTableName; private Long recordVersion; private BuilderImpl() { } private BuilderImpl(CreateBatchLoadTaskRequest model) { super(model); clientToken(model.clientToken); dataModelConfiguration(model.dataModelConfiguration); dataSourceConfiguration(model.dataSourceConfiguration); reportConfiguration(model.reportConfiguration); targetDatabaseName(model.targetDatabaseName); targetTableName(model.targetTableName); recordVersion(model.recordVersion); } public final String getClientToken() { return clientToken; } public final void setClientToken(String clientToken) { this.clientToken = clientToken; } @Override public final Builder clientToken(String clientToken) { this.clientToken = clientToken; return this; } public final DataModelConfiguration.Builder getDataModelConfiguration() { return dataModelConfiguration != null ? dataModelConfiguration.toBuilder() : null; } public final void setDataModelConfiguration(DataModelConfiguration.BuilderImpl dataModelConfiguration) { this.dataModelConfiguration = dataModelConfiguration != null ? dataModelConfiguration.build() : null; } @Override public final Builder dataModelConfiguration(DataModelConfiguration dataModelConfiguration) { this.dataModelConfiguration = dataModelConfiguration; return this; } public final DataSourceConfiguration.Builder getDataSourceConfiguration() { return dataSourceConfiguration != null ? dataSourceConfiguration.toBuilder() : null; } public final void setDataSourceConfiguration(DataSourceConfiguration.BuilderImpl dataSourceConfiguration) { this.dataSourceConfiguration = dataSourceConfiguration != null ? dataSourceConfiguration.build() : null; } @Override public final Builder dataSourceConfiguration(DataSourceConfiguration dataSourceConfiguration) { this.dataSourceConfiguration = dataSourceConfiguration; return this; } public final ReportConfiguration.Builder getReportConfiguration() { return reportConfiguration != null ? reportConfiguration.toBuilder() : null; } public final void setReportConfiguration(ReportConfiguration.BuilderImpl reportConfiguration) { this.reportConfiguration = reportConfiguration != null ? reportConfiguration.build() : null; } @Override public final Builder reportConfiguration(ReportConfiguration reportConfiguration) { this.reportConfiguration = reportConfiguration; return this; } public final String getTargetDatabaseName() { return targetDatabaseName; } public final void setTargetDatabaseName(String targetDatabaseName) { this.targetDatabaseName = targetDatabaseName; } @Override public final Builder targetDatabaseName(String targetDatabaseName) { this.targetDatabaseName = targetDatabaseName; return this; } public final String getTargetTableName() { return targetTableName; } public final void setTargetTableName(String targetTableName) { this.targetTableName = targetTableName; } @Override public final Builder targetTableName(String targetTableName) { this.targetTableName = targetTableName; return this; } public final Long getRecordVersion() { return recordVersion; } public final void setRecordVersion(Long recordVersion) { this.recordVersion = recordVersion; } @Override public final Builder recordVersion(Long recordVersion) { this.recordVersion = recordVersion; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateBatchLoadTaskRequest build() { return new CreateBatchLoadTaskRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy