}, array{}> * * 200: Resources returned */ #[NoAdminRequired] #[ApiRoute(verb: 'GET', url: '/{teamId}/resources', root: '/teams')] public function resolveOne(string $teamId): DataResponse { /** * @var list $resolvedResources * @psalm-suppress PossiblyNullArgument The route is limited to logged-in users */ $resolvedResources = $this->teamManager->getSharedWith($teamId, $this->userId); return new DataResponse(['resources' => $resolvedResources]); } /** * Get all teams of a resource * * @param string $providerId Identifier of the provider (e.g. deck, talk, collectives) * @param string $resourceId Unique id of the resource to list teams for (e.g. deck board id) * @return DataResponse}, array{}> * * 200: Teams returned */ #[NoAdminRequired] #[ApiRoute(verb: 'GET', url: '/resources/{providerId}/{resourceId}', root: '/teams')] public function listTeams(string $providerId, string $resourceId): DataResponse { /** @psalm-suppress PossiblyNullArgument The route is limited to logged-in users */ $teams = $this->teamManager->getTeamsForResource($providerId, $resourceId, $this->userId); /** @var list $teams */ $teams = array_values(array_map(function (Team $team) { $response = $team->jsonSerialize(); /** @psalm-suppress PossiblyNullArgument The route is limited to logged in users */ $response['resources'] = $this->teamManager->getSharedWith($team->getId(), $this->userId); return $response; }, $teams)); return new DataResponse([ 'teams' => $teams, ]); } }