Skip to content

Latest commit

 

History

History
220 lines (150 loc) · 8.08 KB

File metadata and controls

220 lines (150 loc) · 8.08 KB

Oauth2.Clients

Overview

Available Operations

create

Create an OAuth2 client.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;
use Polar\Models\Components;

$sdk = Polar\Polar::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$request = new Components\OAuth2ClientConfiguration(
    redirectUris: [
        'https://impolite-hippodrome.com/',
        'https://acidic-tomography.net/',
    ],
    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 */*

get

Get an OAuth2 client by Client ID.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

$sdk = Polar\Polar::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->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;

$sdk = Polar\Polar::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->build();

$oAuth2ClientConfigurationUpdate = new Components\OAuth2ClientConfigurationUpdate(
    redirectUris: [
        'https://classic-cantaloupe.org',
        'https://corrupt-status.biz/',
    ],
    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 */*

delete

Delete an OAuth2 client.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Polar;

$sdk = Polar\Polar::builder()
    ->setSecurity(
        '<YOUR_BEARER_TOKEN_HERE>'
    )
    ->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 */*