REST APIs for managing Authentication
- validate_api_key - Validate the current api key.
- get_user - Get information about the current user.
- get_access_token - Get or refresh an access token for the current workspace.
- get_allowances - Get access allowances for a particular workspace
Validate the current api key.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.auth.validate_api_key()
if ! res.api_key_details.nil?
# handle response
end
T.nilable(::OpenApiSDK::Operations::ValidateApiKeyResponse)
Get information about the current user.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.auth.get_user()
if ! res.user.nil?
# handle response
end
T.nilable(::OpenApiSDK::Operations::GetUserResponse)
Get or refresh an access token for the current workspace.
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
res = s.auth.get_access_token(workspace_id="<id>")
if ! res.access_token.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
workspace_id |
::String | ✔️ | The workspace ID |
T.nilable(::OpenApiSDK::Operations::GetAccessTokenResponse)
Checks if generation is permitted for a particular run of the CLI
require 'speakeasy_client_sdk_ruby'
s = ::OpenApiSDK::SpeakeasyClientSDK.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
api_key: "<YOUR_API_KEY_HERE>",
)
)
res = s.auth.get_allowances(gen_lock_id="<id>", target_type="<value>", passive=false)
if ! res.access_details.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
gen_lock_id |
T.nilable(::String) | ➖ | Unique identifier of the generation target. |
target_type |
T.nilable(::String) | ➖ | The type of the generated target. |
passive |
T.nilable(T::Boolean) | ➖ | Skip side-effects like incrementing metrics. |
T.nilable(::OpenApiSDK::Operations::GetWorkspaceAccessResponse)