speakeasy-api / speakeasy-client-sdk-php
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
- jms/serializer: ^3.22
Requires (Dev)
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^10
- rector/rector: ^0.18.13
- roave/security-advisories: dev-latest
- dev-main
- v0.37.8
- v0.37.7
- v0.37.6
- v0.37.5
- v0.37.4
- v0.37.3
- v0.37.2
- v0.37.1
- v0.37.0
- v0.36.15
- v0.36.14
- v0.36.13
- v0.36.12
- v0.36.11
- v0.36.10
- v0.36.9
- v0.36.8
- v0.36.7
- v0.36.6
- v0.36.5
- v0.36.4
- v0.36.3
- v0.36.2
- v0.36.1
- v0.36.0
- v0.35.1
- v0.35.0
- v0.34.0
- v0.33.2
- v0.33.1
- v0.33.0
- v0.32.0
- v0.31.0
- v0.30.2
- v0.30.1
- v0.30.0
- v0.29.0
- v0.28.0
- v0.27.2
- v0.27.1
- v0.27.0
- v0.26.0
- v0.25.0
- v0.24.1
- v0.24.0
- v0.23.0
- v0.22.0
- v0.21.0
- v0.20.1
- v0.20.0
- v0.19.0
- v0.18.0
- v0.17.0
- v0.16.1
- v0.16.0
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.0
- v0.13.0
- v0.12.2
- v0.12.1
- v0.12.0
- v0.11.1
- v0.11.0
- v0.10.0
- v0.9.0
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.2
- v0.1.1
- v0.1.0
- v0.0.2
- dev-speakeasy-sdk-regen-1714435932
- dev-speakeasy-sdk-regen-1679271166
- dev-speakeasy-sdk-regen-1679184793
- dev-speakeasy-sdk-regen-1679098273
- dev-speakeasy-sdk-regen-1679011916
- dev-speakeasy-sdk-regen-1678925613
- dev-speakeasy-sdk-regen-1678839131
This package is auto-updated.
Last update: 2024-04-30 00:14:04 UTC
README
SDK Installation
Composer
composer require "speakeasy-api/speakeasy-client-sdk-php"
SDK Example Usage
Example
<?php declare(strict_types=1); require 'vendor/autoload.php'; use Speakeasy\SpeakeasyClientSDK; use Speakeasy\SpeakeasyClientSDK\Models\Shared; use Speakeasy\SpeakeasyClientSDK\Models\Operations; $security = new Shared\Security(); $security->apiKey = '<YOUR_API_KEY_HERE>'; $sdk = SpeakeasyClientSDK\SDK::builder() ->setWorkspaceID('<value>') ->setSecurity($security) ->build(); try { $request = new Operations\GetApisRequest(); $request->metadata = [ 'South' => ['<value>'], ]; $request->op = new Operations\QueryParamOp(); $request->op->and = false; $response = $sdk->apis->getApis($request); if ($response->apis !== null) { // handle response } } catch (Throwable $e) { // handle exception }
Available Resources and Operations
Apis
- deleteApi - Delete an Api.
- generateOpenApiSpec - Generate an OpenAPI specification for a particular Api.
- generatePostmanCollection - Generate a Postman collection for a particular Api.
- getAllApiVersions - Get all Api versions for a particular ApiEndpoint.
- getApis - Get a list of Apis for a given workspace
- upsertApi - Upsert an Api
ApiEndpoints
- deleteApiEndpoint - Delete an ApiEndpoint.
- findApiEndpoint - Find an ApiEndpoint via its displayName.
- generateOpenApiSpecForApiEndpoint - Generate an OpenAPI specification for a particular ApiEndpoint.
- generatePostmanCollectionForApiEndpoint - Generate a Postman collection for a particular ApiEndpoint.
- getAllApiEndpoints - Get all Api endpoints for a particular apiID.
- getAllForVersionApiEndpoints - Get all ApiEndpoints for a particular apiID and versionID.
- getApiEndpoint - Get an ApiEndpoint.
- upsertApiEndpoint - Upsert an ApiEndpoint.
Metadata
- deleteVersionMetadata - Delete metadata for a particular apiID and versionID.
- getVersionMetadata - Get all metadata for a particular apiID and versionID.
- insertVersionMetadata - Insert metadata for a particular apiID and versionID.
Schemas
- deleteSchema - Delete a particular schema revision for an Api.
- downloadSchema - Download the latest schema for a particular apiID.
- downloadSchemaRevision - Download a particular schema revision for an Api.
- getSchema - Get information about the latest schema.
- getSchemaDiff - Get a diff of two schema revisions for an Api.
- getSchemaRevision - Get information about a particular schema revision for an Api.
- getSchemas - Get information about all schemas associated with a particular apiID.
- registerSchema - Register a schema.
Artifacts
- getBlob - Get blob for a particular digest
- getManifest - Get manifest for a particular reference
- getNamespaces - Each namespace contains many revisions.
- getRevisions
- getTags
- preflight - Get access token for communicating with OCI distribution endpoints
Auth
- getAccessToken - Get or refresh an access token for the current workspace.
- getUser - Get information about the current user.
- getWorkspaceAccess - Get access allowances for a particular workspace
- validateApiKey - Validate the current api key.
Requests
- generateRequestPostmanCollection - Generate a Postman collection for a particular request.
- getRequestFromEventLog - Get information about a particular request.
- queryEventLog - Query the event log to retrieve a list of requests.
Organizations
- getOrganizations - Get organizations for a user
Reports
- getChangesReportSignedUrl - Get the signed access url for the change reports for a particular document.
- getLintingReportSignedUrl - Get the signed access url for the linting reports for a particular document.
- uploadReport - Upload a report.
Embeds
- getEmbedAccessToken - Get an embed access token for the current workspace.
- getValidEmbedAccessTokens - Get all valid embed access tokens for the current workspace.
- revokeEmbedAccessToken - Revoke an embed access EmbedToken.
Events
- getWorkspaceEventsByTarget - Load recent events for a particular workspace
- getWorkspaceTargets - Load targets for a particular workspace
- postWorkspaceEvents - Post events for a specific workspace
- searchWorkspaceEvents - Search events for a particular workspace by any field
Server Selection
Server Selection
Select Server by Name
You can override the default server globally by passing a server name to the server: str
optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
Name | Server | Variables |
---|---|---|
prod |
https://api.prod.speakeasyapi.dev |
None |
Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the server_url: str
optional parameter when initializing the SDK client instance. For example:
Global Parameters
A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.
For example, you can set workspaceID
to '<value>'
at SDK initialization and then you do not have to pass the same value on calls to operations like getWorkspaceEventsByTarget
. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
Available Globals
The following global parameter is available.
Name | Type | Required | Description |
---|---|---|---|
workspaceID | string | The workspaceID parameter. |
Example
<?php declare(strict_types=1); require 'vendor/autoload.php'; use Speakeasy\SpeakeasyClientSDK; use Speakeasy\SpeakeasyClientSDK\Models\Shared; use Speakeasy\SpeakeasyClientSDK\Models\Operations; $security = new Shared\Security(); $security->apiKey = '<YOUR_API_KEY_HERE>'; $sdk = SpeakeasyClientSDK\SDK::builder() ->setWorkspaceID('<value>') ->setSecurity($security) ->build(); try { $request = new Operations\GetWorkspaceEventsByTargetRequest(); $request->afterCreatedAt = DateTime::createFromFormat( 'Y-m-d\TH:i:s+', '2024-04-01T04:00:29.393Z', ); $request->targetID = '<value>'; $response = $sdk->events->getWorkspaceEventsByTarget($request); if ($response->cliEventBatch !== null) { // handle response } } catch (Throwable $e) { // handle exception }
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release !