updateDashboardPermissions method

Future<UpdateDashboardPermissionsResponse> updateDashboardPermissions({
  1. required String awsAccountId,
  2. required String dashboardId,
  3. List<ResourcePermission>? grantLinkPermissions,
  4. List<ResourcePermission>? grantPermissions,
  5. List<ResourcePermission>? revokeLinkPermissions,
  6. List<ResourcePermission>? revokePermissions,
})

Updates read and write permissions on a dashboard.

May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnsupportedUserEditionException.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the dashboard whose permissions you're updating.

Parameter dashboardId : The ID for the dashboard.

Parameter grantLinkPermissions : Grants link permissions to all users in a defined namespace.

Parameter grantPermissions : The permissions that you want to grant on this resource.

Parameter revokeLinkPermissions : Revokes link permissions from all users in a defined namespace.

Parameter revokePermissions : The permissions that you want to revoke from this resource.

Implementation

Future<UpdateDashboardPermissionsResponse> updateDashboardPermissions({
  required String awsAccountId,
  required String dashboardId,
  List<ResourcePermission>? grantLinkPermissions,
  List<ResourcePermission>? grantPermissions,
  List<ResourcePermission>? revokeLinkPermissions,
  List<ResourcePermission>? revokePermissions,
}) async {
  final $payload = <String, dynamic>{
    if (grantLinkPermissions != null)
      'GrantLinkPermissions': grantLinkPermissions,
    if (grantPermissions != null) 'GrantPermissions': grantPermissions,
    if (revokeLinkPermissions != null)
      'RevokeLinkPermissions': revokeLinkPermissions,
    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);
}