(repositories)
Get a repository by ID.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$response = $sdk->repositories->get(
id: '<value>'
);
if ($response->repository !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
?Operations\RepositoriesGetResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
List repositories.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Operations;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$request = new Operations\RepositoriesListRequest();
$responses = $sdk->repositories->list(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
$request |
Operations\RepositoriesListRequest | ✔️ | The request object to use for the request. |
?Operations\RepositoriesListResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |
Update a repository.
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$security = '<YOUR_BEARER_TOKEN_HERE>';
$sdk = Polar\Polar::builder()->setSecurity($security)->build();
$repositoryUpdate = new Components\RepositoryUpdate();
$response = $sdk->repositories->update(
id: '<value>',
repositoryUpdate: $repositoryUpdate
);
if ($response->repository !== null) {
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
string | ✔️ | N/A |
repositoryUpdate |
Components\RepositoryUpdate | ✔️ | N/A |
?Operations\RepositoriesUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
Errors\NotPermitted | 403 | application/json |
Errors\ResourceNotFound | 404 | application/json |
Errors\HTTPValidationError | 422 | application/json |
Errors\APIException | 4XX, 5XX | */* |