com.amazonaws.services.finspacedata.model.CreateChangesetRequest Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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 com.amazonaws.services.finspacedata.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
* The request for a CreateChangeset operation.
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateChangesetRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* A token that ensures idempotency. This token expires in 10 minutes.
*
*/
private String clientToken;
/**
*
* The unique identifier for the FinSpace Dataset where the Changeset will be created.
*
*/
private String datasetId;
/**
*
* The option to indicate how a Changeset will be applied to a Dataset.
*
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
*
*/
private String changeType;
/**
*
* 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.
*
*/
private java.util.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.
*
*/
private java.util.Map formatParams;
/**
*
* A token that ensures idempotency. This token expires in 10 minutes.
*
*
* @param clientToken
* A token that ensures idempotency. This token expires in 10 minutes.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* A token that ensures idempotency. This token expires in 10 minutes.
*
*
* @return A token that ensures idempotency. This token expires in 10 minutes.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* 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.
*/
public CreateChangesetRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The unique identifier for the FinSpace Dataset where the Changeset will be created.
*
*
* @param datasetId
* The unique identifier for the FinSpace Dataset where the Changeset will be created.
*/
public void setDatasetId(String datasetId) {
this.datasetId = datasetId;
}
/**
*
* The unique identifier for the FinSpace Dataset where the Changeset will be created.
*
*
* @return The unique identifier for the FinSpace Dataset where the Changeset will be created.
*/
public String getDatasetId() {
return this.datasetId;
}
/**
*
* The unique identifier for the FinSpace Dataset where the Changeset will be created.
*
*
* @param datasetId
* The unique identifier for the FinSpace Dataset where the Changeset will be created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChangesetRequest withDatasetId(String datasetId) {
setDatasetId(datasetId);
return this;
}
/**
*
* The option to indicate how a Changeset will be applied to a Dataset.
*
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
*
*
* @param changeType
* The option to indicate how a Changeset will be applied to a Dataset.
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded
* Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
* @see ChangeType
*/
public void setChangeType(String changeType) {
this.changeType = changeType;
}
/**
*
* The option to indicate how a Changeset will be applied to a Dataset.
*
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
*
*
* @return The option to indicate how a Changeset will be applied to a Dataset.
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded
* Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
* @see ChangeType
*/
public String getChangeType() {
return this.changeType;
}
/**
*
* The option to indicate how a Changeset will be applied to a Dataset.
*
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
*
*
* @param changeType
* The option to indicate how a Changeset will be applied to a Dataset.
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded
* Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChangeType
*/
public CreateChangesetRequest withChangeType(String changeType) {
setChangeType(changeType);
return this;
}
/**
*
* The option to indicate how a Changeset will be applied to a Dataset.
*
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
*
*
* @param changeType
* The option to indicate how a Changeset will be applied to a Dataset.
*
* -
*
* REPLACE
– Changeset will be considered as a replacement to all prior loaded Changesets.
*
*
* -
*
* APPEND
– Changeset will be considered as an addition to the end of all prior loaded
* Changesets.
*
*
* -
*
* MODIFY
– Changeset is considered as a replacement to a specific prior ingested Changeset.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChangeType
*/
public CreateChangesetRequest withChangeType(ChangeType changeType) {
this.changeType = changeType.toString();
return this;
}
/**
*
* 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 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 java.util.Map getSourceParams() {
return 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.
*
*
* @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.
*/
public void setSourceParams(java.util.Map sourceParams) {
this.sourceParams = 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.
*
*
* @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.
*/
public CreateChangesetRequest withSourceParams(java.util.Map sourceParams) {
setSourceParams(sourceParams);
return this;
}
/**
* Add a single SourceParams entry
*
* @see CreateChangesetRequest#withSourceParams
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateChangesetRequest addSourceParamsEntry(String key, String value) {
if (null == this.sourceParams) {
this.sourceParams = new java.util.HashMap();
}
if (this.sourceParams.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.sourceParams.put(key, value);
return this;
}
/**
* Removes all the entries added into SourceParams.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChangesetRequest clearSourceParamsEntries() {
this.sourceParams = null;
return this;
}
/**
*
* 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 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 java.util.Map getFormatParams() {
return 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.
*
*
* @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.
*/
public void setFormatParams(java.util.Map formatParams) {
this.formatParams = 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.
*
*
* @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.
*/
public CreateChangesetRequest withFormatParams(java.util.Map formatParams) {
setFormatParams(formatParams);
return this;
}
/**
* Add a single FormatParams entry
*
* @see CreateChangesetRequest#withFormatParams
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateChangesetRequest addFormatParamsEntry(String key, String value) {
if (null == this.formatParams) {
this.formatParams = new java.util.HashMap();
}
if (this.formatParams.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.formatParams.put(key, value);
return this;
}
/**
* Removes all the entries added into FormatParams.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateChangesetRequest clearFormatParamsEntries() {
this.formatParams = null;
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getDatasetId() != null)
sb.append("DatasetId: ").append(getDatasetId()).append(",");
if (getChangeType() != null)
sb.append("ChangeType: ").append(getChangeType()).append(",");
if (getSourceParams() != null)
sb.append("SourceParams: ").append(getSourceParams()).append(",");
if (getFormatParams() != null)
sb.append("FormatParams: ").append(getFormatParams());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateChangesetRequest == false)
return false;
CreateChangesetRequest other = (CreateChangesetRequest) obj;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getDatasetId() == null ^ this.getDatasetId() == null)
return false;
if (other.getDatasetId() != null && other.getDatasetId().equals(this.getDatasetId()) == false)
return false;
if (other.getChangeType() == null ^ this.getChangeType() == null)
return false;
if (other.getChangeType() != null && other.getChangeType().equals(this.getChangeType()) == false)
return false;
if (other.getSourceParams() == null ^ this.getSourceParams() == null)
return false;
if (other.getSourceParams() != null && other.getSourceParams().equals(this.getSourceParams()) == false)
return false;
if (other.getFormatParams() == null ^ this.getFormatParams() == null)
return false;
if (other.getFormatParams() != null && other.getFormatParams().equals(this.getFormatParams()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getDatasetId() == null) ? 0 : getDatasetId().hashCode());
hashCode = prime * hashCode + ((getChangeType() == null) ? 0 : getChangeType().hashCode());
hashCode = prime * hashCode + ((getSourceParams() == null) ? 0 : getSourceParams().hashCode());
hashCode = prime * hashCode + ((getFormatParams() == null) ? 0 : getFormatParams().hashCode());
return hashCode;
}
@Override
public CreateChangesetRequest clone() {
return (CreateChangesetRequest) super.clone();
}
}