Skip to content

Latest commit

 

History

History
448 lines (308 loc) · 20.7 KB

File metadata and controls

448 lines (308 loc) · 20.7 KB

ApiEndpoints

(apiEndpoints)

Overview

REST APIs for managing ApiEndpoint entities

Available Operations

deleteApiEndpoint

Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore).

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

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

$request = new Operations\DeleteApiEndpointRequest(
    apiEndpointID: '<id>',
    apiID: '<id>',
    versionID: '<id>',
);

$response = $sdk->apiEndpoints->deleteApiEndpoint(
    request: $request
);

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

Parameters

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

Response

?Operations\DeleteApiEndpointResponse

Errors

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

findApiEndpoint

Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema). This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID} endpoints.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

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

$request = new Operations\FindApiEndpointRequest(
    apiID: '<id>',
    displayName: 'Don_Kihn39',
    versionID: '<id>',
);

$response = $sdk->apiEndpoints->findApiEndpoint(
    request: $request
);

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

Parameters

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

Response

?Operations\FindApiEndpointResponse

Errors

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

generateOpenApiSpecForApiEndpoint

This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document. Returns the original document and the newly generated document allowing a diff to be performed to see what has changed.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

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

$request = new Operations\GenerateOpenApiSpecForApiEndpointRequest(
    apiEndpointID: '<id>',
    apiID: '<id>',
    versionID: '<id>',
);

$response = $sdk->apiEndpoints->generateOpenApiSpecForApiEndpoint(
    request: $request
);

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

Parameters

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

Response

?Operations\GenerateOpenApiSpecForApiEndpointResponse

Errors

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

generatePostmanCollectionForApiEndpoint

Generates a postman collection that allows the endpoint to be called from postman variables produced for any path/query/header parameters included in the OpenAPI document.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

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

$request = new Operations\GeneratePostmanCollectionForApiEndpointRequest(
    apiEndpointID: '<id>',
    apiID: '<id>',
    versionID: '<id>',
);

$response = $sdk->apiEndpoints->generatePostmanCollectionForApiEndpoint(
    request: $request
);

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

Parameters

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

Response

?Operations\GeneratePostmanCollectionForApiEndpointResponse

Errors

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

getAllApiEndpoints

Get all Api endpoints for a particular apiID.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

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

$request = new Operations\GetAllApiEndpointsRequest(
    apiID: '<id>',
);

$response = $sdk->apiEndpoints->getAllApiEndpoints(
    request: $request
);

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

Parameters

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

Response

?Operations\GetAllApiEndpointsResponse

Errors

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

getAllForVersionApiEndpoints

Get all ApiEndpoints for a particular apiID and versionID.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

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

$request = new Operations\GetAllForVersionApiEndpointsRequest(
    apiID: '<id>',
    versionID: '<id>',
);

$response = $sdk->apiEndpoints->getAllForVersionApiEndpoints(
    request: $request
);

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

Parameters

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

Response

?Operations\GetAllForVersionApiEndpointsResponse

Errors

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

getApiEndpoint

Get an ApiEndpoint.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

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

$request = new Operations\GetApiEndpointRequest(
    apiEndpointID: '<id>',
    apiID: '<id>',
    versionID: '<id>',
);

$response = $sdk->apiEndpoints->getApiEndpoint(
    request: $request
);

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

Parameters

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

Response

?Operations\GetApiEndpointResponse

Errors

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

upsertApiEndpoint

Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated.

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

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

$security = new Shared\Security(
    apiKey: '<YOUR_API_KEY_HERE>',
);

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

$request = new Operations\UpsertApiEndpointRequest(
    apiEndpoint: new Shared\ApiEndpointInput(
        apiEndpointId: '<id>',
        description: 'commandeer equate pish psst hoot ugh frankly supposing',
        displayName: 'Eliseo.Little15',
        method: '<value>',
        path: '/etc/defaults',
        versionId: '<id>',
    ),
    apiEndpointID: '<id>',
    apiID: '<id>',
    versionID: '<id>',
);

$response = $sdk->apiEndpoints->upsertApiEndpoint(
    request: $request
);

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

Parameters

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

Response

?Operations\UpsertApiEndpointResponse

Errors

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