updateDashboardPermissions method
Future<UpdateDashboardPermissionsResponse>
updateDashboardPermissions({
- required String awsAccountId,
- required String dashboardId,
- List<
ResourcePermission> ? grantPermissions, - List<
ResourcePermission> ? revokePermissions,
Updates read and write permissions on a dashboard.
May throw ThrottlingException. May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw UnsupportedUserEditionException. May throw ConflictException. May throw InternalFailureException.
Parameter awsAccountId
:
The ID of the AWS account that contains the dashboard whose permissions
you're updating.
Parameter dashboardId
:
The ID for the dashboard.
Parameter grantPermissions
:
The permissions that you want to grant on this resource.
Parameter revokePermissions
:
The permissions that you want to revoke from this resource.
Implementation
Future<UpdateDashboardPermissionsResponse> updateDashboardPermissions({
required String awsAccountId,
required String dashboardId,
List<ResourcePermission>? grantPermissions,
List<ResourcePermission>? revokePermissions,
}) async {
ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
_s.validateStringLength(
'awsAccountId',
awsAccountId,
12,
12,
isRequired: true,
);
ArgumentError.checkNotNull(dashboardId, 'dashboardId');
_s.validateStringLength(
'dashboardId',
dashboardId,
1,
2048,
isRequired: true,
);
final $payload = <String, dynamic>{
if (grantPermissions != null) 'GrantPermissions': grantPermissions,
if (revokePermissions != null) 'RevokePermissions': revokePermissions,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/accounts/${Uri.encodeComponent(awsAccountId)}/dashboards/${Uri.encodeComponent(dashboardId)}/permissions',
exceptionFnMap: _exceptionFns,
);
return UpdateDashboardPermissionsResponse.fromJson(response);
}