software.amazon.awssdk.services.finspacedata.model.CreateDatasetRequest 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 a CreateDataset operation
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateDatasetRequest extends FinspaceDataRequest implements
ToCopyableBuilder {
private static final SdkField CLIENT_TOKEN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("clientToken")
.getter(getter(CreateDatasetRequest::clientToken))
.setter(setter(Builder::clientToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientToken").build(),
DefaultValueTrait.idempotencyToken()).build();
private static final SdkField DATASET_TITLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("datasetTitle").getter(getter(CreateDatasetRequest::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(CreateDatasetRequest::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(CreateDatasetRequest::datasetDescription))
.setter(setter(Builder::datasetDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("datasetDescription").build())
.build();
private static final SdkField OWNER_INFO_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ownerInfo")
.getter(getter(CreateDatasetRequest::ownerInfo)).setter(setter(Builder::ownerInfo))
.constructor(DatasetOwnerInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ownerInfo").build()).build();
private static final SdkField PERMISSION_GROUP_PARAMS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("permissionGroupParams")
.getter(getter(CreateDatasetRequest::permissionGroupParams)).setter(setter(Builder::permissionGroupParams))
.constructor(PermissionGroupParams::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("permissionGroupParams").build())
.build();
private static final SdkField ALIAS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("alias")
.getter(getter(CreateDatasetRequest::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(CreateDatasetRequest::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_TITLE_FIELD, KIND_FIELD, DATASET_DESCRIPTION_FIELD, OWNER_INFO_FIELD, PERMISSION_GROUP_PARAMS_FIELD,
ALIAS_FIELD, SCHEMA_DEFINITION_FIELD));
private final String clientToken;
private final String datasetTitle;
private final String kind;
private final String datasetDescription;
private final DatasetOwnerInfo ownerInfo;
private final PermissionGroupParams permissionGroupParams;
private final String alias;
private final SchemaUnion schemaDefinition;
private CreateDatasetRequest(BuilderImpl builder) {
super(builder);
this.clientToken = builder.clientToken;
this.datasetTitle = builder.datasetTitle;
this.kind = builder.kind;
this.datasetDescription = builder.datasetDescription;
this.ownerInfo = builder.ownerInfo;
this.permissionGroupParams = builder.permissionGroupParams;
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;
}
/**
*
* Display title for a FinSpace Dataset.
*
*
* @return Display title for a FinSpace Dataset.
*/
public final String datasetTitle() {
return datasetTitle;
}
/**
*
* The format in which 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 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 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 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;
}
/**
*
* Description of a Dataset.
*
*
* @return Description of a Dataset.
*/
public final String datasetDescription() {
return datasetDescription;
}
/**
*
* Contact information for a Dataset owner.
*
*
* @return Contact information for a Dataset owner.
*/
public final DatasetOwnerInfo ownerInfo() {
return ownerInfo;
}
/**
*
* Permission group parameters for Dataset permissions.
*
*
* @return Permission group parameters for Dataset permissions.
*/
public final PermissionGroupParams permissionGroupParams() {
return permissionGroupParams;
}
/**
*
* 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(datasetTitle());
hashCode = 31 * hashCode + Objects.hashCode(kindAsString());
hashCode = 31 * hashCode + Objects.hashCode(datasetDescription());
hashCode = 31 * hashCode + Objects.hashCode(ownerInfo());
hashCode = 31 * hashCode + Objects.hashCode(permissionGroupParams());
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 CreateDatasetRequest)) {
return false;
}
CreateDatasetRequest other = (CreateDatasetRequest) obj;
return Objects.equals(clientToken(), other.clientToken()) && Objects.equals(datasetTitle(), other.datasetTitle())
&& Objects.equals(kindAsString(), other.kindAsString())
&& Objects.equals(datasetDescription(), other.datasetDescription())
&& Objects.equals(ownerInfo(), other.ownerInfo())
&& Objects.equals(permissionGroupParams(), other.permissionGroupParams())
&& 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("CreateDatasetRequest").add("ClientToken", clientToken()).add("DatasetTitle", datasetTitle())
.add("Kind", kindAsString()).add("DatasetDescription", datasetDescription()).add("OwnerInfo", ownerInfo())
.add("PermissionGroupParams", permissionGroupParams()).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 "datasetTitle":
return Optional.ofNullable(clazz.cast(datasetTitle()));
case "kind":
return Optional.ofNullable(clazz.cast(kindAsString()));
case "datasetDescription":
return Optional.ofNullable(clazz.cast(datasetDescription()));
case "ownerInfo":
return Optional.ofNullable(clazz.cast(ownerInfo()));
case "permissionGroupParams":
return Optional.ofNullable(clazz.cast(permissionGroupParams()));
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