Skip to content

Latest commit

 

History

History
176 lines (112 loc) · 7.59 KB

File metadata and controls

176 lines (112 loc) · 7.59 KB

Auth

(auth)

Overview

REST APIs for managing Authentication

Available Operations

get_access_token

Get or refresh an access token for the current workspace.

Example Usage

from speakeasy_client_sdk_python import Speakeasy

s = Speakeasy()


res = s.auth.get_access_token(request={
    "workspace_id": "<value>",
})

if res.access_token is not None:
    # handle response
    pass

Parameters

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

Response

operations.GetAccessTokenResponse

Errors

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

get_user

Get information about the current user.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.auth.get_user()

if res.user is not None:
    # handle response
    pass

Parameters

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

Response

operations.GetUserResponse

Errors

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

get_workspace_access

Checks if generation is permitted for a particular run of the CLI

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.auth.get_workspace_access()

if res.access_details is not None:
    # handle response
    pass

Parameters

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

Response

operations.GetWorkspaceAccessResponse

Errors

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

validate_api_key

Validate the current api key.

Example Usage

from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared

s = Speakeasy(
    security=shared.Security(
        api_key="<YOUR_API_KEY_HERE>",
    ),
)


res = s.auth.validate_api_key()

if res.api_key_details is not None:
    # handle response
    pass

Parameters

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

Response

operations.ValidateAPIKeyResponse

Errors

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