Skip to content

Latest commit

 

History

History
259 lines (165 loc) · 9.2 KB

README.md

File metadata and controls

259 lines (165 loc) · 9.2 KB

Clients

(oauth2->clients)

Overview

Available Operations

list

List OAuth2 clients.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

$security = '<YOUR_BEARER_TOKEN_HERE>';

$sdk = Polar\Polar::builder()->setSecurity($security)->build();



$responses = $sdk->oauth2->clients->list(
    page: 1,
    limit: 10

);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
page ?int Page number, defaults to 1.
limit ?int Size of a page, defaults to 10. Maximum is 100.

Response

?Operations\Oauth2ClientsListResponse

Errors

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

create

Create an OAuth2 client.

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();

$request = new Components\OAuth2ClientConfiguration(
    redirectUris: [
        'https://probable-heating.com/',
    ],
    clientName: '<value>',
);

$response = $sdk->oauth2->clients->create(
    request: $request
);

if ($response->any !== null) {
    // handle response
}

Parameters

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

Response

?Operations\Oauth2ClientsOauth2CreateClientResponse

Errors

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

delete

Delete an OAuth2 client.

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->oauth2->clients->delete(
    clientId: '<id>'
);

if ($response->any !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
clientId string ✔️ N/A

Response

?Operations\Oauth2ClientsOauth2DeleteClientResponse

Errors

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

get

Get an OAuth2 client by Client 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->oauth2->clients->get(
    clientId: '<id>'
);

if ($response->any !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
clientId string ✔️ N/A

Response

?Operations\Oauth2ClientsOauth2GetClientResponse

Errors

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

update

Update an OAuth2 client.

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();

$oAuth2ClientConfigurationUpdate = new Components\OAuth2ClientConfigurationUpdate(
    redirectUris: [
        'https://passionate-flu.org',
    ],
    clientName: '<value>',
    clientId: '<id>',
);

$response = $sdk->oauth2->clients->update(
    clientId: '<id>',
    oAuth2ClientConfigurationUpdate: $oAuth2ClientConfigurationUpdate

);

if ($response->any !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
clientId string ✔️ N/A
oAuth2ClientConfigurationUpdate Components\OAuth2ClientConfigurationUpdate ✔️ N/A

Response

?Operations\Oauth2ClientsOauth2UpdateClientResponse

Errors

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