updateDataSource method

Future<UpdateDataSourceResponse> updateDataSource({
  1. required String awsAccountId,
  2. required String dataSourceId,
  3. required String name,
  4. DataSourceCredentials? credentials,
  5. DataSourceParameters? dataSourceParameters,
  6. SslProperties? sslProperties,
  7. VpcConnectionProperties? vpcConnectionProperties,
})

Updates a data source.

May throw AccessDeniedException. May throw ConflictException. May throw InvalidParameterValueException. May throw ThrottlingException. May throw ResourceNotFoundException. May throw InternalFailureException.

Parameter awsAccountId : The AWS account ID.

Parameter dataSourceId : The ID of the data source. This ID is unique per AWS Region for each AWS account.

Parameter name : A display name for the data source.

Parameter credentials : The credentials that QuickSight that uses to connect to your underlying source. Currently, only credentials based on user name and password are supported.

Parameter dataSourceParameters : The parameters that QuickSight uses to connect to your underlying source.

Parameter sslProperties : Secure Socket Layer (SSL) properties that apply when QuickSight connects to your underlying source.

Parameter vpcConnectionProperties : Use this parameter only when you want QuickSight to use a VPC connection when connecting to your underlying source.

Implementation

Future<UpdateDataSourceResponse> updateDataSource({
  required String awsAccountId,
  required String dataSourceId,
  required String name,
  DataSourceCredentials? credentials,
  DataSourceParameters? dataSourceParameters,
  SslProperties? sslProperties,
  VpcConnectionProperties? vpcConnectionProperties,
}) async {
  ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
  _s.validateStringLength(
    'awsAccountId',
    awsAccountId,
    12,
    12,
    isRequired: true,
  );
  ArgumentError.checkNotNull(dataSourceId, 'dataSourceId');
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'Name': name,
    if (credentials != null) 'Credentials': credentials,
    if (dataSourceParameters != null)
      'DataSourceParameters': dataSourceParameters,
    if (sslProperties != null) 'SslProperties': sslProperties,
    if (vpcConnectionProperties != null)
      'VpcConnectionProperties': vpcConnectionProperties,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/data-sources/${Uri.encodeComponent(dataSourceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDataSourceResponse.fromJson(response);
}