Skip to content

Latest commit

 

History

History
executable file
·
352 lines (244 loc) · 19.7 KB

File metadata and controls

executable file
·
352 lines (244 loc) · 19.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

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

(async() => {
  const sdk = new Speakeasy({
    security: {
      apiKey: "",
    },
  });

  const res = await sdk.apiEndpoints.deleteApiEndpoint({
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
})();

Parameters

Parameter Type Required Description
request operations.DeleteApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DeleteApiEndpointResponse>

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

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

(async() => {
  const sdk = new Speakeasy({
    security: {
      apiKey: "",
    },
  });

  const res = await sdk.apiEndpoints.findApiEndpoint({
    apiID: "string",
    displayName: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
})();

Parameters

Parameter Type Required Description
request operations.FindApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.FindApiEndpointResponse>

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

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

(async() => {
  const sdk = new Speakeasy({
    security: {
      apiKey: "",
    },
  });

  const res = await sdk.apiEndpoints.generateOpenApiSpecForApiEndpoint({
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
})();

Parameters

Parameter Type Required Description
request operations.GenerateOpenApiSpecForApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GenerateOpenApiSpecForApiEndpointResponse>

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

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

(async() => {
  const sdk = new Speakeasy({
    security: {
      apiKey: "",
    },
  });

  const res = await sdk.apiEndpoints.generatePostmanCollectionForApiEndpoint({
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
})();

Parameters

Parameter Type Required Description
request operations.GeneratePostmanCollectionForApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GeneratePostmanCollectionForApiEndpointResponse>

getAllApiEndpoints

Get all Api endpoints for a particular apiID.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

(async() => {
  const sdk = new Speakeasy({
    security: {
      apiKey: "",
    },
  });

  const res = await sdk.apiEndpoints.getAllApiEndpoints({
    apiID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
})();

Parameters

Parameter Type Required Description
request operations.GetAllApiEndpointsRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetAllApiEndpointsResponse>

getAllForVersionApiEndpoints

Get all ApiEndpoints for a particular apiID and versionID.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

(async() => {
  const sdk = new Speakeasy({
    security: {
      apiKey: "",
    },
  });

  const res = await sdk.apiEndpoints.getAllForVersionApiEndpoints({
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
})();

Parameters

Parameter Type Required Description
request operations.GetAllForVersionApiEndpointsRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetAllForVersionApiEndpointsResponse>

getApiEndpoint

Get an ApiEndpoint.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

(async() => {
  const sdk = new Speakeasy({
    security: {
      apiKey: "",
    },
  });

  const res = await sdk.apiEndpoints.getApiEndpoint({
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
})();

Parameters

Parameter Type Required Description
request operations.GetApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetApiEndpointResponse>

upsertApiEndpoint

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

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";

(async() => {
  const sdk = new Speakeasy({
    security: {
      apiKey: "",
    },
  });

  const res = await sdk.apiEndpoints.upsertApiEndpoint({
    apiEndpointInput: {
      apiEndpointId: "string",
      description: "Public-key systematic attitude",
      displayName: "string",
      method: "string",
      path: "/etc/periodic",
      versionId: "string",
    },
    apiEndpointID: "string",
    apiID: "string",
    versionID: "string",
  });

  if (res.statusCode == 200) {
    // handle response
  }
})();

Parameters

Parameter Type Required Description
request operations.UpsertApiEndpointRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UpsertApiEndpointResponse>