Skip to content

Latest commit

 

History

History
270 lines (197 loc) · 17.8 KB

File metadata and controls

270 lines (197 loc) · 17.8 KB

Metadata

(metadata)

Overview

REST APIs for managing Version Metadata entities

Available Operations

deleteVersionMetadata

Delete metadata for a particular apiID and versionID.

Example Usage

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

const speakeasy = new Speakeasy({
  security: {
    apiKey: "<YOUR_API_KEY_HERE>",
  },
});

async function run() {
  const result = await speakeasy.metadata.deleteVersionMetadata({
    apiID: "<id>",
    versionID: "<id>",
    metaKey: "<value>",
    metaValue: "<value>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { metadataDeleteVersionMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/metadataDeleteVersionMetadata.js";

// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
  security: {
    apiKey: "<YOUR_API_KEY_HERE>",
  },
});

async function run() {
  const res = await metadataDeleteVersionMetadata(speakeasy, {
    apiID: "<id>",
    versionID: "<id>",
    metaKey: "<value>",
    metaValue: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.DeleteVersionMetadataRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<shared.ErrorT>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

getVersionMetadata

Get all metadata for a particular apiID and versionID.

Example Usage

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

const speakeasy = new Speakeasy({
  security: {
    apiKey: "<YOUR_API_KEY_HERE>",
  },
});

async function run() {
  const result = await speakeasy.metadata.getVersionMetadata({
    apiID: "<id>",
    versionID: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { metadataGetVersionMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/metadataGetVersionMetadata.js";

// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
  security: {
    apiKey: "<YOUR_API_KEY_HERE>",
  },
});

async function run() {
  const res = await metadataGetVersionMetadata(speakeasy, {
    apiID: "<id>",
    versionID: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetVersionMetadataRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetVersionMetadataResponse>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

insertVersionMetadata

Insert metadata for a particular apiID and versionID.

Example Usage

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

const speakeasy = new Speakeasy({
  security: {
    apiKey: "<YOUR_API_KEY_HERE>",
  },
});

async function run() {
  const result = await speakeasy.metadata.insertVersionMetadata({
    apiID: "<id>",
    versionID: "<id>",
    versionMetadata: {
      metaKey: "<value>",
      metaValue: "<value>",
    },
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js";
import { metadataInsertVersionMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/metadataInsertVersionMetadata.js";

// Use `SpeakeasyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const speakeasy = new SpeakeasyCore({
  security: {
    apiKey: "<YOUR_API_KEY_HERE>",
  },
});

async function run() {
  const res = await metadataInsertVersionMetadata(speakeasy, {
    apiID: "<id>",
    versionID: "<id>",
    versionMetadata: {
      metaKey: "<value>",
      metaValue: "<value>",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.InsertVersionMetadataRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.InsertVersionMetadataResponse>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*