Skip to content

Latest commit

 

History

History
408 lines (292 loc) · 19.3 KB

File metadata and controls

408 lines (292 loc) · 19.3 KB

Schemas

(schemas)

Overview

REST APIs for managing Schema entities

Available Operations

deleteSchema

Delete a particular schema revision for an Api.

Example Usage

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

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.schemas.deleteSchema({
    apiID: "string",
    revisionID: "string",
    versionID: "string",
  });

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

run();

Parameters

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

Response

Promise<operations.DeleteSchemaResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

downloadSchema

Download the latest schema for a particular apiID.

Example Usage

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

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

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

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

run();

Parameters

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

Response

Promise<operations.DownloadSchemaResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

downloadSchemaRevision

Download a particular schema revision for an Api.

Example Usage

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

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.schemas.downloadSchemaRevision({
    apiID: "string",
    revisionID: "string",
    versionID: "string",
  });

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

run();

Parameters

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

Response

Promise<operations.DownloadSchemaRevisionResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getSchema

Returns information about the last uploaded schema for a particular API version. This won't include the schema itself, that can be retrieved via the downloadSchema operation.

Example Usage

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

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

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

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

run();

Parameters

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

Response

Promise<operations.GetSchemaResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getSchemaDiff

Get a diff of two schema revisions for an Api.

Example Usage

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

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.schemas.getSchemaDiff({
    apiID: "string",
    baseRevisionID: "string",
    targetRevisionID: "string",
    versionID: "string",
  });

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

run();

Parameters

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

Response

Promise<operations.GetSchemaDiffResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getSchemaRevision

Returns information about the last uploaded schema for a particular schema revision. This won't include the schema itself, that can be retrieved via the downloadSchema operation.

Example Usage

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

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.schemas.getSchemaRevision({
    apiID: "string",
    revisionID: "string",
    versionID: "string",
  });

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

run();

Parameters

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

Response

Promise<operations.GetSchemaRevisionResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getSchemas

Returns information the schemas associated with a particular apiID. This won't include the schemas themselves, they can be retrieved via the downloadSchema operation.

Example Usage

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

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

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

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

run();

Parameters

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

Response

Promise<operations.GetSchemasResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

registerSchema

Allows uploading a schema for a particular API version. This will be used to populate ApiEndpoints and used as a base for any schema generation if present.

Example Usage

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

async function run() {
  const sdk = new Speakeasy({
    security: {
      apiKey: "<YOUR_API_KEY_HERE>",
    },
    workspaceID: "string",
  });

  const res = await sdk.schemas.registerSchema({
    requestBody: {
      file: {
        content: new TextEncoder().encode("0xCAFCA03e0e"),
        fileName: "bronze_table_blues.m2a",
      },
    },
    apiID: "string",
    versionID: "string",
  });

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

run();

Parameters

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

Response

Promise<operations.RegisterSchemaResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /