Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

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";
import { DeleteSchemaResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations";

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

sdk.schemas.deleteSchema({
  apiID: "mollitia",
  revisionID: "laborum",
  versionID: "dolores",
}).then((res: DeleteSchemaResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

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>

downloadSchema

Download the latest schema for a particular apiID.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
import { DownloadSchemaResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations";

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

sdk.schemas.downloadSchema({
  apiID: "dolorem",
  versionID: "corporis",
}).then((res: DownloadSchemaResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

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>

downloadSchemaRevision

Download a particular schema revision for an Api.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
import { DownloadSchemaRevisionResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations";

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

sdk.schemas.downloadSchemaRevision({
  apiID: "explicabo",
  revisionID: "nobis",
  versionID: "enim",
}).then((res: DownloadSchemaRevisionResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

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>

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";
import { GetSchemaResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations";

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

sdk.schemas.getSchema({
  apiID: "omnis",
  versionID: "nemo",
}).then((res: GetSchemaResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

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>

getSchemaDiff

Get a diff of two schema revisions for an Api.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
import { GetSchemaDiffResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations";

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

sdk.schemas.getSchemaDiff({
  apiID: "minima",
  baseRevisionID: "excepturi",
  targetRevisionID: "accusantium",
  versionID: "iure",
}).then((res: GetSchemaDiffResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

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>

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";
import { GetSchemaRevisionResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations";

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

sdk.schemas.getSchemaRevision({
  apiID: "culpa",
  revisionID: "doloribus",
  versionID: "sapiente",
}).then((res: GetSchemaRevisionResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

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>

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";
import { GetSchemasResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations";

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

sdk.schemas.getSchemas({
  apiID: "architecto",
  versionID: "mollitia",
}).then((res: GetSchemasResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

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>

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";
import { RegisterSchemaResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/operations";

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

sdk.schemas.registerSchema({
  requestBody: {
    file: {
      content: "dolorem".encode(),
      file: "culpa",
    },
  },
  apiID: "consequuntur",
  versionID: "repellat",
}).then((res: RegisterSchemaResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

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>