Skip to content

Latest commit

 

History

History
273 lines (180 loc) · 12.5 KB

File metadata and controls

273 lines (180 loc) · 12.5 KB

Apis

(Apis)

Overview

REST APIs for managing Api entities

Available Operations

DeleteApi

Delete a particular version of an Api. The will also delete all associated ApiEndpoints, Metadata, Schemas & Request Logs (if using a Postgres datastore).

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

DeleteApiRequest req = new DeleteApiRequest() {
    ApiID = "<value>",
    VersionID = "<value>",
};

var res = await sdk.Apis.DeleteApiAsync(req);

// handle response

Parameters

Parameter Type Required Description
request DeleteApiRequest ✔️ The request object to use for the request.

Response

DeleteApiResponse

Errors

Error Object Status Code Content Type
SpeakeasySDK.Models.Errors.SDKException 4xx-5xx /

GenerateOpenApiSpec

This endpoint will generate any missing operations 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

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

GenerateOpenApiSpecRequest req = new GenerateOpenApiSpecRequest() {
    ApiID = "<value>",
    VersionID = "<value>",
};

var res = await sdk.Apis.GenerateOpenApiSpecAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GenerateOpenApiSpecRequest ✔️ The request object to use for the request.

Response

GenerateOpenApiSpecResponse

Errors

Error Object Status Code Content Type
SpeakeasySDK.Models.Errors.SDKException 4xx-5xx /

GeneratePostmanCollection

Generates a postman collection containing all endpoints for a particular API. Includes variables produced for any path/query/header parameters included in the OpenAPI document.

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

GeneratePostmanCollectionRequest req = new GeneratePostmanCollectionRequest() {
    ApiID = "<value>",
    VersionID = "<value>",
};

var res = await sdk.Apis.GeneratePostmanCollectionAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GeneratePostmanCollectionRequest ✔️ The request object to use for the request.

Response

GeneratePostmanCollectionResponse

Errors

Error Object Status Code Content Type
SpeakeasySDK.Models.Errors.SDKException 4xx-5xx /

GetAllApiVersions

Get all Api versions for a particular ApiEndpoint. Supports filtering the versions based on metadata attributes.

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using System.Collections.Generic;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

GetAllApiVersionsRequest req = new GetAllApiVersionsRequest() {
    ApiID = "<value>",
};

var res = await sdk.Apis.GetAllApiVersionsAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetAllApiVersionsRequest ✔️ The request object to use for the request.

Response

GetAllApiVersionsResponse

Errors

Error Object Status Code Content Type
SpeakeasySDK.Models.Errors.SDKException 4xx-5xx /

GetApis

Get a list of all Apis and their versions for a given workspace. Supports filtering the APIs based on metadata attributes.

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using System.Collections.Generic;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

GetApisRequest req = new GetApisRequest() {};

var res = await sdk.Apis.GetApisAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetApisRequest ✔️ The request object to use for the request.

Response

GetApisResponse

Errors

Error Object Status Code Content Type
SpeakeasySDK.Models.Errors.SDKException 4xx-5xx /

UpsertApi

Upsert an Api. If the Api does not exist, it will be created. If the Api exists, it will be updated.

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
using System.Collections.Generic;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

UpsertApiRequest req = new UpsertApiRequest() {
    Api = new ApiInput() {
        ApiId = "<value>",
        Description = "Synchronised 5th generation knowledge user",
        VersionId = "<value>",
    },
    ApiID = "<value>",
};

var res = await sdk.Apis.UpsertApiAsync(req);

// handle response

Parameters

Parameter Type Required Description
request UpsertApiRequest ✔️ The request object to use for the request.

Response

UpsertApiResponse

Errors

Error Object Status Code Content Type
SpeakeasySDK.Models.Errors.SDKException 4xx-5xx /