gitea/src/5d42c91a-6e4d-4c26-80d7-1b1.../code.power

25 lines
573 B
Plaintext

/**
* List all organizations.
*
* @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 = "/admin/orgs";
// Set the query parameters.
$uri = $this->uri->get($path);
$uri->setVar('page', $page);
$uri->setVar('limit', $limit);
// Send the get request.
return $this->response->get(
$this->http->get($uri)
);
}