Skip to content

Latest commit

 

History

History
156 lines (99 loc) · 5.75 KB

README.md

File metadata and controls

156 lines (99 loc) · 5.75 KB

Repositories

(repositories)

Overview

Available Operations

  • get - Get Repository
  • list - List Repositories
  • update - Update Repository

get

Get a repository by ID.

Example Usage

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
}

Parameters

Parameter Type Required Description
id string ✔️ N/A

Response

?Operations\RepositoriesGetResponse

Errors

Error Type Status Code Content Type
Errors\ResourceNotFound 404 application/json
Errors\HTTPValidationError 422 application/json
Errors\APIException 4XX, 5XX */*

list

List repositories.

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
$request Operations\RepositoriesListRequest ✔️ The request object to use for the request.

Response

?Operations\RepositoriesListResponse

Errors

Error Type Status Code Content Type
Errors\HTTPValidationError 422 application/json
Errors\APIException 4XX, 5XX */*

update

Update a repository.

Example Usage

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
}

Parameters

Parameter Type Required Description
id string ✔️ N/A
repositoryUpdate Components\RepositoryUpdate ✔️ N/A

Response

?Operations\RepositoriesUpdateResponse

Errors

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 */*