Skip to content

Latest commit

 

History

History
197 lines (129 loc) · 6.21 KB

README.md

File metadata and controls

197 lines (129 loc) · 6.21 KB

Auth

(auth)

Overview

REST APIs for managing Authentication

Available Operations

  • getAccessToken - Get or refresh an access token for the current workspace.
  • getUser - Get information about the current user.
  • getAccess - Get access allowances for a particular workspace
  • validateApiKey - Validate the current api key.

getAccessToken

Get or refresh an access token for the current workspace.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;

$sdk = SpeakeasyClientSDK\SDK::builder()->build();

$request = new Operations\GetAccessTokenRequest(
    workspaceId: '<id>',
);

$response = $sdk->auth->getAccessToken(
    request: $request
);

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

Parameters

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

Response

?Operations\GetAccessTokenResponse

Errors

Error Type Status Code Content Type
Errorors\Error 4XX application/json
Errorors\SDKException 5XX */*

getUser

Get information about the current user.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;

$sdk = SpeakeasyClientSDK\SDK::builder()
    ->setSecurity(
        new Shared\Security(
            apiKey: '<YOUR_API_KEY_HERE>',
        )
    )
    ->build();



$response = $sdk->auth->getUser(

);

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

Response

?Operations\GetUserResponse

Errors

Error Type Status Code Content Type
Errorors\Error 4XX application/json
Errorors\SDKException 5XX */*

getAccess

Checks if generation is permitted for a particular run of the CLI

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;

$sdk = SpeakeasyClientSDK\SDK::builder()
    ->setSecurity(
        new Shared\Security(
            apiKey: '<YOUR_API_KEY_HERE>',
        )
    )
    ->build();

$request = new Operations\GetWorkspaceAccessRequest();

$response = $sdk->auth->getAccess(
    request: $request
);

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

Parameters

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

Response

?Operations\GetWorkspaceAccessResponse

Errors

Error Type Status Code Content Type
Errorors\SDKException 4XX, 5XX */*

validateApiKey

Validate the current api key.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;

$sdk = SpeakeasyClientSDK\SDK::builder()
    ->setSecurity(
        new Shared\Security(
            apiKey: '<YOUR_API_KEY_HERE>',
        )
    )
    ->build();



$response = $sdk->auth->validateApiKey(

);

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

Response

?Operations\ValidateApiKeyResponse

Errors

Error Type Status Code Content Type
Errorors\Error 4XX application/json
Errorors\SDKException 5XX */*