Skip to content

Latest commit

 

History

History
594 lines (400 loc) · 28.6 KB

File metadata and controls

594 lines (400 loc) · 28.6 KB

Workspaces

(Workspaces)

Overview

REST APIs for managing Workspaces (speakeasy tenancy)

Available Operations

Create

Creates a workspace

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;
using System;

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

Workspace req = new Workspace() {
    CreatedAt = System.DateTime.Parse("2024-06-17T07:14:55.338Z"),
    Id = "<id>",
    Name = "<value>",
    OrganizationId = "<id>",
    Slug = "<value>",
    UpdatedAt = System.DateTime.Parse("2024-11-30T17:06:07.804Z"),
    Verified = false,
};

var res = await sdk.Workspaces.CreateAsync(req);

// handle response

Parameters

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

Response

CreateWorkspaceResponse

Errors

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

CreateToken

Create a token for a particular workspace

Example Usage

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

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

CreateWorkspaceTokenRequest req = new CreateWorkspaceTokenRequest() {
    WorkspaceToken = new WorkspaceToken() {
        Alg = "<value>",
        CreatedAt = System.DateTime.Parse("2023-08-16T02:33:00.784Z"),
        Id = "<id>",
        Key = "<key>",
        Name = "<value>",
        WorkspaceId = "<id>",
    },
};

var res = await sdk.Workspaces.CreateTokenAsync(req);

// handle response

Parameters

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

Response

CreateWorkspaceTokenResponse

Errors

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

DeleteToken

Delete a token 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>",
});

DeleteWorkspaceTokenRequest req = new DeleteWorkspaceTokenRequest() {
    TokenID = "<id>",
};

var res = await sdk.Workspaces.DeleteTokenAsync(req);

// handle response

Parameters

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

Response

DeleteWorkspaceTokenResponse

Errors

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

Get

Get information about a particular workspace by context.

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;

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

var res = await sdk.Workspaces.GetAsync();

// handle response

Response

GetWorkspaceByContextResponse

Errors

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

GetAll

Returns a list of workspaces a user has access too

Example Usage

using SpeakeasySDK;
using SpeakeasySDK.Models.Shared;

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

var res = await sdk.Workspaces.GetAllAsync();

// handle response

Response

GetWorkspacesResponse

Errors

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

GetByID

Get information about 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>",
});

GetWorkspaceRequest req = new GetWorkspaceRequest() {};

var res = await sdk.Workspaces.GetByIDAsync(req);

// handle response

Parameters

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

Response

GetWorkspaceResponse

Errors

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

GetFeatureFlags

Get workspace feature flags

Example Usage

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

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

GetWorkspaceFeatureFlagsRequest req = new GetWorkspaceFeatureFlagsRequest() {};

var res = await sdk.Workspaces.GetFeatureFlagsAsync(req);

// handle response

Parameters

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

Response

GetWorkspaceFeatureFlagsResponse

Errors

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

GetSettings

Get settings about 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>",
});

GetWorkspaceSettingsRequest req = new GetWorkspaceSettingsRequest() {};

var res = await sdk.Workspaces.GetSettingsAsync(req);

// handle response

Parameters

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

Response

GetWorkspaceSettingsResponse

Errors

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

GetTeam

Get team members 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>",
});

GetWorkspaceTeamRequest req = new GetWorkspaceTeamRequest() {};

var res = await sdk.Workspaces.GetTeamAsync(req);

// handle response

Parameters

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

Response

GetWorkspaceTeamResponse

Errors

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

GetTokens

Get tokens 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>",
});

GetWorkspaceTokensRequest req = new GetWorkspaceTokensRequest() {};

var res = await sdk.Workspaces.GetTokensAsync(req);

// handle response

Parameters

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

Response

GetWorkspaceTokensResponse

Errors

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

GrantAccess

Grant a user access to 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>",
});

GrantUserAccessToWorkspaceRequest req = new GrantUserAccessToWorkspaceRequest() {
    Email = "[email protected]",
};

var res = await sdk.Workspaces.GrantAccessAsync(req);

// handle response

Parameters

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

Response

GrantUserAccessToWorkspaceResponse

Errors

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

RevokeAccess

Revoke a user's access to 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>",
});

RevokeUserAccessToWorkspaceRequest req = new RevokeUserAccessToWorkspaceRequest() {
    UserId = "<id>",
};

var res = await sdk.Workspaces.RevokeAccessAsync(req);

// handle response

Parameters

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

Response

RevokeUserAccessToWorkspaceResponse

Errors

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

Update

Update information about a particular workspace.

Example Usage

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

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

UpdateWorkspaceDetailsRequest req = new UpdateWorkspaceDetailsRequest() {
    Workspace = new Workspace() {
        CreatedAt = System.DateTime.Parse("2025-07-28T19:04:48.565Z"),
        Id = "<id>",
        Name = "<value>",
        OrganizationId = "<id>",
        Slug = "<value>",
        UpdatedAt = System.DateTime.Parse("2024-10-16T10:52:42.015Z"),
        Verified = false,
    },
};

var res = await sdk.Workspaces.UpdateAsync(req);

// handle response

Parameters

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

Response

UpdateWorkspaceDetailsResponse

Errors

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

UpdateSettings

Update settings about a particular workspace.

Example Usage

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

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

UpdateWorkspaceSettingsRequest req = new UpdateWorkspaceSettingsRequest() {
    WorkspaceSettings = new WorkspaceSettings() {
        CreatedAt = System.DateTime.Parse("2023-07-05T11:43:28.305Z"),
        UpdatedAt = System.DateTime.Parse("2024-05-14T05:39:21.874Z"),
        WebhookUrl = "https://grown-pharmacopoeia.net",
        WorkspaceId = "<id>",
    },
};

var res = await sdk.Workspaces.UpdateSettingsAsync(req);

// handle response

Parameters

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

Response

UpdateWorkspaceSettingsResponse

Errors

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