Skip to content

Latest commit

 

History

History
233 lines (159 loc) · 12 KB

File metadata and controls

233 lines (159 loc) · 12 KB

Events

(Events)

Overview

REST APIs for managing events captured by a speakeasy binary (CLI, GitHub Action etc)

Available Operations

  • GetEventsByTarget - Load recent events for a particular workspace
  • GetTargets - Load targets for a particular workspace
  • GetTargetsDeprecated - Load targets for a particular workspace
  • Post - Post events for a specific workspace
  • Search - Search events for a particular workspace by any field

GetEventsByTarget

Load recent events for a particular workspace

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

GetWorkspaceEventsByTargetRequest req = new GetWorkspaceEventsByTargetRequest() {
    TargetId = "<id>",
    WorkspaceId = "<id>",
};

var res = await sdk.Events.GetEventsByTargetAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetWorkspaceEventsByTargetRequest ✔️ The request object to use for the request.

Response

GetWorkspaceEventsByTargetResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 5XX application/json
SpeakeasySDK.Models.Errors.SDKException 4XX */*

GetTargets

Load targets for a particular workspace

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

GetWorkspaceTargetsRequest req = new GetWorkspaceTargetsRequest() {};

var res = await sdk.Events.GetTargetsAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetWorkspaceTargetsRequest ✔️ The request object to use for the request.

Response

GetWorkspaceTargetsResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 5XX application/json
SpeakeasySDK.Models.Errors.SDKException 4XX */*

GetTargetsDeprecated

Load targets for a particular workspace

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

GetWorkspaceTargetsDeprecatedRequest req = new GetWorkspaceTargetsDeprecatedRequest() {
    WorkspaceId = "<id>",
};

var res = await sdk.Events.GetTargetsDeprecatedAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetWorkspaceTargetsDeprecatedRequest ✔️ The request object to use for the request.

Response

GetWorkspaceTargetsDeprecatedResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 5XX application/json
SpeakeasySDK.Models.Errors.SDKException 4XX */*

Post

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

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;
using System;
using System.Collections.Generic;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

PostWorkspaceEventsRequest req = new PostWorkspaceEventsRequest() {
    RequestBody = new List<CliEvent>() {
        new CliEvent() {
            CreatedAt = System.DateTime.Parse("2024-05-07T03:24:39.583Z"),
            ExecutionId = "<id>",
            Id = "<id>",
            InteractionType = InteractionType.Quickstart,
            LocalStartedAt = System.DateTime.Parse("2024-09-08T05:59:33.876Z"),
            SpeakeasyApiKeyName = "<value>",
            SpeakeasyVersion = "<value>",
            Success = false,
            WorkspaceId = "<id>",
        },
    },
    WorkspaceId = "<id>",
};

var res = await sdk.Events.PostAsync(req);

// handle response

Parameters

Parameter Type Required Description
request PostWorkspaceEventsRequest ✔️ The request object to use for the request.

Response

PostWorkspaceEventsResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 5XX application/json
SpeakeasySDK.Models.Errors.SDKException 4XX */*

Search

Search events for a particular workspace by any field

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Operations;
using SpeakeasySDK.Models.Shared;

var sdk = new SDK(security: new Security() {
    APIKey = "<YOUR_API_KEY_HERE>",
});

SearchWorkspaceEventsRequest req = new SearchWorkspaceEventsRequest() {
    WorkspaceId = "<id>",
};

var res = await sdk.Events.SearchAsync(req);

// handle response

Parameters

Parameter Type Required Description
request SearchWorkspaceEventsRequest ✔️ The request object to use for the request.

Response

SearchWorkspaceEventsResponse

Errors

Error Type Status Code Content Type
SpeakeasySDK.Models.Errors.Error 5XX application/json
SpeakeasySDK.Models.Errors.SDKException 4XX */*