updateDataSourcePermissions method
Updates the permissions to a data source.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalFailureException.
May throw InvalidParameterValueException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter awsAccountId :
The Amazon Web Services account ID.
Parameter dataSourceId :
The ID of the data source. This ID is unique per Amazon Web Services
Region for each Amazon Web Services account.
Parameter grantPermissions :
A list of resource permissions that you want to grant on the data source.
Parameter revokePermissions :
A list of resource permissions that you want to revoke on the data source.
Implementation
Future<UpdateDataSourcePermissionsResponse> updateDataSourcePermissions({
required String awsAccountId,
required String dataSourceId,
List<ResourcePermission>? grantPermissions,
List<ResourcePermission>? revokePermissions,
}) async {
final $payload = <String, dynamic>{
if (grantPermissions != null) 'GrantPermissions': grantPermissions,
if (revokePermissions != null) 'RevokePermissions': revokePermissions,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/accounts/${Uri.encodeComponent(awsAccountId)}/data-sources/${Uri.encodeComponent(dataSourceId)}/permissions',
exceptionFnMap: _exceptionFns,
);
return UpdateDataSourcePermissionsResponse.fromJson(response);
}