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

software.amazon.awssdk.services.finspacedata.model.UpdateChangesetRequest Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
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.finspacedata.model;

import java.util.Arrays;
import java.util.Collections;
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.DefaultValueTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * Request to update an existing changeset.
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateChangesetRequest extends FinspaceDataRequest implements
        ToCopyableBuilder {
    private static final SdkField CLIENT_TOKEN_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("clientToken")
            .getter(getter(UpdateChangesetRequest::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(UpdateChangesetRequest::datasetId)).setter(setter(Builder::datasetId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("datasetId").build()).build();

    private static final SdkField CHANGESET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("changesetId").getter(getter(UpdateChangesetRequest::changesetId)).setter(setter(Builder::changesetId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("changesetId").build()).build();

    private static final SdkField> SOURCE_PARAMS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("sourceParams")
            .getter(getter(UpdateChangesetRequest::sourceParams))
            .setter(setter(Builder::sourceParams))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourceParams").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField> FORMAT_PARAMS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("formatParams")
            .getter(getter(UpdateChangesetRequest::formatParams))
            .setter(setter(Builder::formatParams))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("formatParams").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLIENT_TOKEN_FIELD,
            DATASET_ID_FIELD, CHANGESET_ID_FIELD, SOURCE_PARAMS_FIELD, FORMAT_PARAMS_FIELD));

    private final String clientToken;

    private final String datasetId;

    private final String changesetId;

    private final Map sourceParams;

    private final Map formatParams;

    private UpdateChangesetRequest(BuilderImpl builder) {
        super(builder);
        this.clientToken = builder.clientToken;
        this.datasetId = builder.datasetId;
        this.changesetId = builder.changesetId;
        this.sourceParams = builder.sourceParams;
        this.formatParams = builder.formatParams;
    }

    /**
     * 

* 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 FinSpace Dataset in which the Changeset is created. *

* * @return The unique identifier for the FinSpace Dataset in which the Changeset is created. */ public final String datasetId() { return datasetId; } /** *

* The unique identifier for the Changeset to update. *

* * @return The unique identifier for the Changeset to update. */ public final String changesetId() { return changesetId; } /** * For responses, this returns true if the service returned a value for the SourceParams property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasSourceParams() { return sourceParams != null && !(sourceParams instanceof SdkAutoConstructMap); } /** *

* Options that define the location of the data being ingested (s3SourcePath) and the source of the * changeset (sourceType). *

*

* Both s3SourcePath and sourceType are required attributes. *

*

* Here is an example of how you could specify the sourceParams: *

*

* "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } *

*

* The S3 path that you specify must allow the FinSpace role access. To do that, you first need to configure the IAM * policy on S3 bucket. For more information, see Loading data from an Amazon S3 Bucket using the FinSpace APIsection. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasSourceParams} method. *

* * @return Options that define the location of the data being ingested (s3SourcePath) and the source of * the changeset (sourceType).

*

* Both s3SourcePath and sourceType are required attributes. *

*

* Here is an example of how you could specify the sourceParams: *

*

* "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } *

*

* The S3 path that you specify must allow the FinSpace role access. To do that, you first need to configure * the IAM policy on S3 bucket. For more information, see Loading data from an Amazon S3 Bucket using the FinSpace APIsection. */ public final Map sourceParams() { return sourceParams; } /** * For responses, this returns true if the service returned a value for the FormatParams property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasFormatParams() { return formatParams != null && !(formatParams instanceof SdkAutoConstructMap); } /** *

* Options that define the structure of the source file(s) including the format type (formatType), * header row (withHeader), data separation character (separator) and the type of * compression (compression). *

*

* formatType is a required attribute and can have the following values: *

*
    *
  • *

    * PARQUET – Parquet source file format. *

    *
  • *
  • *

    * CSV – CSV source file format. *

    *
  • *
  • *

    * JSON – JSON source file format. *

    *
  • *
  • *

    * XML – XML source file format. *

    *
  • *
*

* Here is an example of how you could specify the formatParams: *

*

* "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } *

*

* Note that if you only provide formatType as CSV, the rest of the attributes will * automatically default to CSV values as following: *

*

* { "withHeader": "true", "separator": "," } *

*

* For more information about supported file formats, see Supported Data Types and * File Formats in the FinSpace User Guide. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasFormatParams} method. *

* * @return Options that define the structure of the source file(s) including the format type ( * formatType), header row (withHeader), data separation character ( * separator) and the type of compression (compression).

*

* formatType is a required attribute and can have the following values: *

*
    *
  • *

    * PARQUET – Parquet source file format. *

    *
  • *
  • *

    * CSV – CSV source file format. *

    *
  • *
  • *

    * JSON – JSON source file format. *

    *
  • *
  • *

    * XML – XML source file format. *

    *
  • *
*

* Here is an example of how you could specify the formatParams: *

*

* "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } *

*

* Note that if you only provide formatType as CSV, the rest of the attributes * will automatically default to CSV values as following: *

*

* { "withHeader": "true", "separator": "," } *

*

* For more information about supported file formats, see Supported Data * Types and File Formats in the FinSpace User Guide. */ public final Map formatParams() { return formatParams; } @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(datasetId()); hashCode = 31 * hashCode + Objects.hashCode(changesetId()); hashCode = 31 * hashCode + Objects.hashCode(hasSourceParams() ? sourceParams() : null); hashCode = 31 * hashCode + Objects.hashCode(hasFormatParams() ? formatParams() : null); 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 UpdateChangesetRequest)) { return false; } UpdateChangesetRequest other = (UpdateChangesetRequest) obj; return Objects.equals(clientToken(), other.clientToken()) && Objects.equals(datasetId(), other.datasetId()) && Objects.equals(changesetId(), other.changesetId()) && hasSourceParams() == other.hasSourceParams() && Objects.equals(sourceParams(), other.sourceParams()) && hasFormatParams() == other.hasFormatParams() && Objects.equals(formatParams(), other.formatParams()); } /** * 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("UpdateChangesetRequest").add("ClientToken", clientToken()).add("DatasetId", datasetId()) .add("ChangesetId", changesetId()).add("SourceParams", hasSourceParams() ? sourceParams() : null) .add("FormatParams", hasFormatParams() ? formatParams() : null).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 "changesetId": return Optional.ofNullable(clazz.cast(changesetId())); case "sourceParams": return Optional.ofNullable(clazz.cast(sourceParams())); case "formatParams": return Optional.ofNullable(clazz.cast(formatParams())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateChangesetRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends FinspaceDataRequest.Builder, SdkPojo, CopyableBuilder { /** *

* A token that ensures idempotency. This token expires in 10 minutes. *

* * @param clientToken * A token that ensures idempotency. This token expires in 10 minutes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientToken(String clientToken); /** *

* The unique identifier for the FinSpace Dataset in which the Changeset is created. *

* * @param datasetId * The unique identifier for the FinSpace Dataset in which the Changeset is created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder datasetId(String datasetId); /** *

* The unique identifier for the Changeset to update. *

* * @param changesetId * The unique identifier for the Changeset to update. * @return Returns a reference to this object so that method calls can be chained together. */ Builder changesetId(String changesetId); /** *

* Options that define the location of the data being ingested (s3SourcePath) and the source of the * changeset (sourceType). *

*

* Both s3SourcePath and sourceType are required attributes. *

*

* Here is an example of how you could specify the sourceParams: *

*

* "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } *

*

* The S3 path that you specify must allow the FinSpace role access. To do that, you first need to configure the * IAM policy on S3 bucket. For more information, see Loading data from an Amazon S3 Bucket using the FinSpace APIsection. *

* * @param sourceParams * Options that define the location of the data being ingested (s3SourcePath) and the source * of the changeset (sourceType).

*

* Both s3SourcePath and sourceType are required attributes. *

*

* Here is an example of how you could specify the sourceParams: *

*

* "sourceParams": { "s3SourcePath": "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv", "sourceType": "S3" } *

*

* The S3 path that you specify must allow the FinSpace role access. To do that, you first need to * configure the IAM policy on S3 bucket. For more information, see Loading data from an Amazon S3 Bucket using the FinSpace APIsection. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceParams(Map sourceParams); /** *

* Options that define the structure of the source file(s) including the format type (formatType), * header row (withHeader), data separation character (separator) and the type of * compression (compression). *

*

* formatType is a required attribute and can have the following values: *

*
    *
  • *

    * PARQUET – Parquet source file format. *

    *
  • *
  • *

    * CSV – CSV source file format. *

    *
  • *
  • *

    * JSON – JSON source file format. *

    *
  • *
  • *

    * XML – XML source file format. *

    *
  • *
*

* Here is an example of how you could specify the formatParams: *

*

* "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } *

*

* Note that if you only provide formatType as CSV, the rest of the attributes will * automatically default to CSV values as following: *

*

* { "withHeader": "true", "separator": "," } *

*

* For more information about supported file formats, see Supported Data Types * and File Formats in the FinSpace User Guide. *

* * @param formatParams * Options that define the structure of the source file(s) including the format type ( * formatType), header row (withHeader), data separation character ( * separator) and the type of compression (compression).

*

* formatType is a required attribute and can have the following values: *

*
    *
  • *

    * PARQUET – Parquet source file format. *

    *
  • *
  • *

    * CSV – CSV source file format. *

    *
  • *
  • *

    * JSON – JSON source file format. *

    *
  • *
  • *

    * XML – XML source file format. *

    *
  • *
*

* Here is an example of how you could specify the formatParams: *

*

* "formatParams": { "formatType": "CSV", "withHeader": "true", "separator": ",", "compression":"None" } *

*

* Note that if you only provide formatType as CSV, the rest of the attributes * will automatically default to CSV values as following: *

*

* { "withHeader": "true", "separator": "," } *

*

* For more information about supported file formats, see Supported Data * Types and File Formats in the FinSpace User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder formatParams(Map formatParams); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends FinspaceDataRequest.BuilderImpl implements Builder { private String clientToken; private String datasetId; private String changesetId; private Map sourceParams = DefaultSdkAutoConstructMap.getInstance(); private Map formatParams = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(UpdateChangesetRequest model) { super(model); clientToken(model.clientToken); datasetId(model.datasetId); changesetId(model.changesetId); sourceParams(model.sourceParams); formatParams(model.formatParams); } 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 String getDatasetId() { return datasetId; } public final void setDatasetId(String datasetId) { this.datasetId = datasetId; } @Override public final Builder datasetId(String datasetId) { this.datasetId = datasetId; return this; } public final String getChangesetId() { return changesetId; } public final void setChangesetId(String changesetId) { this.changesetId = changesetId; } @Override public final Builder changesetId(String changesetId) { this.changesetId = changesetId; return this; } public final Map getSourceParams() { if (sourceParams instanceof SdkAutoConstructMap) { return null; } return sourceParams; } public final void setSourceParams(Map sourceParams) { this.sourceParams = SourceParamsCopier.copy(sourceParams); } @Override public final Builder sourceParams(Map sourceParams) { this.sourceParams = SourceParamsCopier.copy(sourceParams); return this; } public final Map getFormatParams() { if (formatParams instanceof SdkAutoConstructMap) { return null; } return formatParams; } public final void setFormatParams(Map formatParams) { this.formatParams = FormatParamsCopier.copy(formatParams); } @Override public final Builder formatParams(Map formatParams) { this.formatParams = FormatParamsCopier.copy(formatParams); 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 UpdateChangesetRequest build() { return new UpdateChangesetRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy