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 API section.
*
*
* 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 API section.
*/
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 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(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 API section.
*
*
* @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 API section.
* @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;
}
}
}