permissionsToActions method

  1. @override
List<Action> permissionsToActions(
  1. List<QueuePermission> permissions
)
override

Convert a list of permissions to gRPC actions.

Implementation

@override
List<$p.Action> permissionsToActions(List<QueuePermission> permissions) {
  List<$p.Action> actions = permissions.fold(
      [],
      (actions, permission) => switch (permission) {
            QueuePermission.enqueue => [
                ...actions,
                $p.Action.QueueEnqueue,
              ],
            QueuePermission.dequeue => [...actions, $p.Action.QueueDequeue],
          });

  return actions;
}