gitea/src/c3dfbf28-1a28-4fd3-a0b5-12b06ecaadf3/code.power

28 lines
591 B
Plaintext
Raw Normal View History

2023-04-15 15:08:07 +00:00
/**
* List all the teams a user belongs to.
*
* @param int $page Page number of results to return (1-based).
* @param int $limit Page size of results.
*
* @return array|null
* @since 3.2.0
**/
public function list(
int $page = 1,
int $limit = 10
): ?array
{
// Build the request path.
$path = '/user/teams';
// Build the URL
$url = $this->uri->get($path);
$url->setVar('page', $page);
$url->setVar('limit', $limit);
// Send the get request.
return $this->response->get(
$this->http->get($url)
);
}