software.amazon.awssdk.services.finspacedata.model.UpdateDatasetRequest Maven / Gradle / Ivy
Show all versions of finspacedata 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.finspacedata.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;
/**
* The request for an UpdateDataset operation
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateDatasetRequest extends FinspaceDataRequest implements
ToCopyableBuilder {
private static final SdkField CLIENT_TOKEN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("clientToken")
.getter(getter(UpdateDatasetRequest::clientToken))
.setter(setter(Builder::clientToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientToken").build(),
DefaultValueTrait.idempotencyToken()).build();
private static final SdkField DATASET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("datasetId").getter(getter(UpdateDatasetRequest::datasetId)).setter(setter(Builder::datasetId))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("datasetId").build()).build();
private static final SdkField DATASET_TITLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("datasetTitle").getter(getter(UpdateDatasetRequest::datasetTitle)).setter(setter(Builder::datasetTitle))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("datasetTitle").build()).build();
private static final SdkField KIND_FIELD = SdkField. builder(MarshallingType.STRING).memberName("kind")
.getter(getter(UpdateDatasetRequest::kindAsString)).setter(setter(Builder::kind))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kind").build()).build();
private static final SdkField DATASET_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("datasetDescription").getter(getter(UpdateDatasetRequest::datasetDescription))
.setter(setter(Builder::datasetDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("datasetDescription").build())
.build();
private static final SdkField ALIAS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("alias")
.getter(getter(UpdateDatasetRequest::alias)).setter(setter(Builder::alias))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("alias").build()).build();
private static final SdkField SCHEMA_DEFINITION_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("schemaDefinition").getter(getter(UpdateDatasetRequest::schemaDefinition))
.setter(setter(Builder::schemaDefinition)).constructor(SchemaUnion::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("schemaDefinition").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLIENT_TOKEN_FIELD,
DATASET_ID_FIELD, DATASET_TITLE_FIELD, KIND_FIELD, DATASET_DESCRIPTION_FIELD, ALIAS_FIELD, SCHEMA_DEFINITION_FIELD));
private final String clientToken;
private final String datasetId;
private final String datasetTitle;
private final String kind;
private final String datasetDescription;
private final String alias;
private final SchemaUnion schemaDefinition;
private UpdateDatasetRequest(BuilderImpl builder) {
super(builder);
this.clientToken = builder.clientToken;
this.datasetId = builder.datasetId;
this.datasetTitle = builder.datasetTitle;
this.kind = builder.kind;
this.datasetDescription = builder.datasetDescription;
this.alias = builder.alias;
this.schemaDefinition = builder.schemaDefinition;
}
/**
*
* A token that ensures idempotency. This token expires in 10 minutes.
*
*
* @return A token that ensures idempotency. This token expires in 10 minutes.
*/
public final String clientToken() {
return clientToken;
}
/**
*
* The unique identifier for the Dataset to update.
*
*
* @return The unique identifier for the Dataset to update.
*/
public final String datasetId() {
return datasetId;
}
/**
*
* A display title for the Dataset.
*
*
* @return A display title for the Dataset.
*/
public final String datasetTitle() {
return datasetTitle;
}
/**
*
* The format in which the Dataset data is structured.
*
*
* -
*
* TABULAR
– Data is structured in a tabular format.
*
*
* -
*
* NON_TABULAR
– Data is structured in a non-tabular format.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #kind} will return
* {@link DatasetKind#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #kindAsString}.
*
*
* @return The format in which the Dataset data is structured.
*
* -
*
* TABULAR
– Data is structured in a tabular format.
*
*
* -
*
* NON_TABULAR
– Data is structured in a non-tabular format.
*
*
* @see DatasetKind
*/
public final DatasetKind kind() {
return DatasetKind.fromValue(kind);
}
/**
*
* The format in which the Dataset data is structured.
*
*
* -
*
* TABULAR
– Data is structured in a tabular format.
*
*
* -
*
* NON_TABULAR
– Data is structured in a non-tabular format.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #kind} will return
* {@link DatasetKind#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #kindAsString}.
*
*
* @return The format in which the Dataset data is structured.
*
* -
*
* TABULAR
– Data is structured in a tabular format.
*
*
* -
*
* NON_TABULAR
– Data is structured in a non-tabular format.
*
*
* @see DatasetKind
*/
public final String kindAsString() {
return kind;
}
/**
*
* A description for the Dataset.
*
*
* @return A description for the Dataset.
*/
public final String datasetDescription() {
return datasetDescription;
}
/**
*
* The unique resource identifier for a Dataset.
*
*
* @return The unique resource identifier for a Dataset.
*/
public final String alias() {
return alias;
}
/**
*
* Definition for a schema on a tabular Dataset.
*
*
* @return Definition for a schema on a tabular Dataset.
*/
public final SchemaUnion schemaDefinition() {
return schemaDefinition;
}
@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(datasetId());
hashCode = 31 * hashCode + Objects.hashCode(datasetTitle());
hashCode = 31 * hashCode + Objects.hashCode(kindAsString());
hashCode = 31 * hashCode + Objects.hashCode(datasetDescription());
hashCode = 31 * hashCode + Objects.hashCode(alias());
hashCode = 31 * hashCode + Objects.hashCode(schemaDefinition());
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 UpdateDatasetRequest)) {
return false;
}
UpdateDatasetRequest other = (UpdateDatasetRequest) obj;
return Objects.equals(clientToken(), other.clientToken()) && Objects.equals(datasetId(), other.datasetId())
&& Objects.equals(datasetTitle(), other.datasetTitle()) && Objects.equals(kindAsString(), other.kindAsString())
&& Objects.equals(datasetDescription(), other.datasetDescription()) && Objects.equals(alias(), other.alias())
&& Objects.equals(schemaDefinition(), other.schemaDefinition());
}
/**
* 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("UpdateDatasetRequest").add("ClientToken", clientToken()).add("DatasetId", datasetId())
.add("DatasetTitle", datasetTitle()).add("Kind", kindAsString()).add("DatasetDescription", datasetDescription())
.add("Alias", alias()).add("SchemaDefinition", schemaDefinition()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "clientToken":
return Optional.ofNullable(clazz.cast(clientToken()));
case "datasetId":
return Optional.ofNullable(clazz.cast(datasetId()));
case "datasetTitle":
return Optional.ofNullable(clazz.cast(datasetTitle()));
case "kind":
return Optional.ofNullable(clazz.cast(kindAsString()));
case "datasetDescription":
return Optional.ofNullable(clazz.cast(datasetDescription()));
case "alias":
return Optional.ofNullable(clazz.cast(alias()));
case "schemaDefinition":
return Optional.ofNullable(clazz.cast(schemaDefinition()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function