Skip to content

Latest commit

 

History

History
203 lines (143 loc) · 11.1 KB

File metadata and controls

203 lines (143 loc) · 11.1 KB

Events

(events)

Overview

REST APIs for capturing event data

Available Operations

getWorkspaceEventsByTarget

Load recent events for a particular workspace

Example Usage

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

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

  const res = await sdk.events.getWorkspaceEventsByTarget({
    targetID: "<value>",
  });

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

run();

Parameters

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

Response

Promise<operations.GetWorkspaceEventsByTargetResponse>

Errors

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

getWorkspaceTargets

Load targets for a particular workspace

Example Usage

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

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

  const res = await sdk.events.getWorkspaceTargets({});

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

run();

Parameters

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

Response

Promise<operations.GetWorkspaceTargetsResponse>

Errors

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

postWorkspaceEvents

Sends an array of events to be stored for a particular workspace.

Example Usage

import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript";
import { GenerateBumpType, InteractionType, OpenapiDiffBumpType } from "@speakeasy-api/speakeasy-client-sdk-typescript/dist/sdk/models/shared";

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

  const res = await sdk.events.postWorkspaceEvents({
    requestBody: [
      {
        createdAt: new Date("2024-11-21T06:58:42.120Z"),
        executionId: "<value>",
        id: "<id>",
        interactionType: InteractionType.CliExec,
        localStartedAt: new Date("2024-05-07T12:35:47.182Z"),
        speakeasyApiKeyName: "<value>",
        speakeasyVersion: "<value>",
        success: false,
        workspaceId: "<value>",
      },
    ],
  });

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

run();

Parameters

Parameter Type Required Description
request operations.PostWorkspaceEventsRequest ✔️ The request object to use for the request.
retries utils.RetryConfig Configuration to override the default retry behavior of the client.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PostWorkspaceEventsResponse>

Errors

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

searchWorkspaceEvents

Search events for a particular workspace by any field

Example Usage

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

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

  const res = await sdk.events.searchWorkspaceEvents({});

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

run();

Parameters

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

Response

Promise<operations.SearchWorkspaceEventsResponse>

Errors

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