I want to set DatasetParameter to DataSet using aws-sdk-go-v2
.
The version used is github.com/aws/aws-sdk-go-v2/service/quicksight v1.39.1
.
Sending the following Input will result in a 400 error.
input := &quicksight.UpdateDataSetInput{
AwsAccountId: accountID,
DataSetId: dataSetID,
Name: dataSetName,
ImportMode: types.DataSetImportModeSpice,
PhysicalTableMap: map[string]types.PhysicalTable{
"test": &types.PhysicalTableMemberS3Source{
Value: types.S3Source{
DataSourceArn: dataSourceArn,
InputColumns: []types.InputColumn{
{
Name: aws.String("name"),
Type: types.InputColumnDataTypeString,
},
},
UploadSettings: &types.UploadSettings{
Format: types.FileFormatCsv,
},
},
},
},
DatasetParameters: []types.DatasetParameter{
{
StringDatasetParameter: &types.StringDatasetParameter{
Id: aws.String("string"),
Name: aws.String("string"),
ValueType: types.DatasetParameterValueTypeSingleValued,
DefaultValues: &types.StringDatasetParameterDefaultValues{
StaticValues: []string{"string"},
},
},
IntegerDatasetParameter: &types.IntegerDatasetParameter{
Id: aws.String("integer"),
Name: aws.String("integer"),
ValueType: types.DatasetParameterValueTypeSingleValued,
DefaultValues: &types.IntegerDatasetParameterDefaultValues{
StaticValues: []int64{1},
},
},
},
},
}
Error updating DataSet: operation error QuickSight: UpdateDataSet, https response error StatusCode: 400, RequestID: e3af0468-e092-44b2-93cc-136a958e3b03, InvalidParameterValueException: Malformed dataset parameters.
If StringDatasetParameter and IntegerDatasetParameter are different DatasetParameters, the request will succeed.
DatasetParameters: []types.DatasetParameter{
{
StringDatasetParameter: &types.StringDatasetParameter{
Id: aws.String("string"),
Name: aws.String("string"),
ValueType: types.DatasetParameterValueTypeSingleValued,
DefaultValues: &types.StringDatasetParameterDefaultValues{
StaticValues: []string{"string"},
},
},
},
{
IntegerDatasetParameter: &types.IntegerDatasetParameter{
Id: aws.String("integer"),
Name: aws.String("integer"),
ValueType: types.DatasetParameterValueTypeSingleValued,
DefaultValues: &types.IntegerDatasetParameterDefaultValues{
StaticValues: []int64{1},
},
},
},
},
Does this behavior mean that only one of StringDatasetParameter, IntegerDatasetParameter, DecimalDatasetParameter, DateTimeDatasetParameter, must be set for the DatasetParameter item to be valid?
Since it is not mentioned in the API Document, I cannot determine if it is correct or not.