Skip to content

Latest commit

 

History

History
683 lines (469 loc) · 34.3 KB

File metadata and controls

683 lines (469 loc) · 34.3 KB

Workspaces

(workspaces)

Overview

REST APIs for managing Workspaces (speakeasy tenancy)

Available Operations

create

Creates a workspace

Example Usage

import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.create(request={
        "created_at": dateutil.parser.isoparse("2024-06-17T07:14:55.338Z"),
        "id": "<id>",
        "name": "<value>",
        "organization_id": "<id>",
        "slug": "<value>",
        "updated_at": dateutil.parser.isoparse("2024-11-30T17:06:07.804Z"),
        "verified": True,
    })

    assert res.workspace is not None

    # Handle response
    print(res.workspace)

Parameters

Parameter Type Required Description
request shared.Workspace ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateWorkspaceResponse

Errors

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

create_token

Create a token for a particular workspace

Example Usage

import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.create_token(request={
        "workspace_token": {
            "alg": "<value>",
            "created_at": dateutil.parser.isoparse("2023-08-16T02:33:00.784Z"),
            "id": "<id>",
            "key": "<key>",
            "name": "<value>",
            "workspace_id": "<id>",
        },
        "workspace_id": "<id>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.CreateWorkspaceTokenRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateWorkspaceTokenResponse

Errors

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

delete_token

Delete a token for a particular workspace

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.delete_token(request={
        "token_id": "<id>",
        "workspace_id": "<id>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteWorkspaceTokenRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteWorkspaceTokenResponse

Errors

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

get

Get information about a particular workspace by context.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.get()

    assert res.workspace_and_organization is not None

    # Handle response
    print(res.workspace_and_organization)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetWorkspaceByContextResponse

Errors

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

get_all

Returns a list of workspaces a user has access too

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.get_all()

    assert res.workspaces is not None

    # Handle response
    print(res.workspaces)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetWorkspacesResponse

Errors

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

get_by_id

Get information about a particular workspace.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.get_by_id(request={
        "workspace_id": "<id>",
    })

    assert res.workspace is not None

    # Handle response
    print(res.workspace)

Parameters

Parameter Type Required Description
request operations.GetWorkspaceRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetWorkspaceResponse

Errors

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

get_feature_flags

Get workspace feature flags

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.get_feature_flags(request={
        "workspace_id": "<id>",
    })

    assert res.workspace_feature_flag_response is not None

    # Handle response
    print(res.workspace_feature_flag_response)

Parameters

Parameter Type Required Description
request operations.GetWorkspaceFeatureFlagsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetWorkspaceFeatureFlagsResponse

Errors

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

get_settings

Get settings about a particular workspace.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.get_settings(request={
        "workspace_id": "<id>",
    })

    assert res.workspace_settings is not None

    # Handle response
    print(res.workspace_settings)

Parameters

Parameter Type Required Description
request operations.GetWorkspaceSettingsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetWorkspaceSettingsResponse

Errors

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

get_team

Get team members for a particular workspace

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.get_team(request={
        "workspace_id": "<id>",
    })

    assert res.workspace_team_response is not None

    # Handle response
    print(res.workspace_team_response)

Parameters

Parameter Type Required Description
request operations.GetWorkspaceTeamRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetWorkspaceTeamResponse

Errors

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

get_tokens

Get tokens for a particular workspace

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.get_tokens(request={
        "workspace_id": "<id>",
    })

    assert res.classes is not None

    # Handle response
    print(res.classes)

Parameters

Parameter Type Required Description
request operations.GetWorkspaceTokensRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetWorkspaceTokensResponse

Errors

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

grant_access

Grant a user access to a particular workspace

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.grant_access(request={
        "email": "[email protected]",
        "workspace_id": "<id>",
    })

    assert res.workspace_invite_response is not None

    # Handle response
    print(res.workspace_invite_response)

Parameters

Parameter Type Required Description
request operations.GrantUserAccessToWorkspaceRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GrantUserAccessToWorkspaceResponse

Errors

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

revoke_access

Revoke a user's access to a particular workspace

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.revoke_access(request={
        "user_id": "<id>",
        "workspace_id": "<id>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.RevokeUserAccessToWorkspaceRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.RevokeUserAccessToWorkspaceResponse

Errors

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

update

Update information about a particular workspace.

Example Usage

import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.update(request={
        "workspace": {
            "created_at": dateutil.parser.isoparse("2025-07-28T19:04:48.565Z"),
            "id": "<id>",
            "name": "<value>",
            "organization_id": "<id>",
            "slug": "<value>",
            "updated_at": dateutil.parser.isoparse("2024-10-16T10:52:42.015Z"),
            "verified": True,
        },
        "workspace_id": "<id>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.UpdateWorkspaceDetailsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpdateWorkspaceDetailsResponse

Errors

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

update_settings

Update settings about a particular workspace.

Example Usage

import dateutil.parser
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

with Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
) as speakeasy:

    res = speakeasy.workspaces.update_settings(request={
        "workspace_settings": {
            "created_at": dateutil.parser.isoparse("2023-07-05T11:43:28.305Z"),
            "updated_at": dateutil.parser.isoparse("2024-05-14T05:39:21.874Z"),
            "webhook_url": "https://grown-pharmacopoeia.net",
            "workspace_id": "<id>",
        },
        "workspace_id": "<id>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.UpdateWorkspaceSettingsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpdateWorkspaceSettingsResponse

Errors

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