Skip to content

Latest commit

 

History

History
148 lines (85 loc) · 3.54 KB

File metadata and controls

148 lines (85 loc) · 3.54 KB

Auth

Overview

REST APIs for managing Authentication

Available Operations

validate_api_key

Validate the current api key.

Example Usage

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

Response

T.nilable(::OpenApiSDK::Operations::ValidateApiKeyResponse)

get_user

Get information about the current user.

Example Usage

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

Response

T.nilable(::OpenApiSDK::Operations::GetUserResponse)

get_access_token

Get or refresh an access token for the current workspace.

Example Usage

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

Parameters

Parameter Type Required Description
workspace_id ::String ✔️ The workspace ID

Response

T.nilable(::OpenApiSDK::Operations::GetAccessTokenResponse)

get_allowances

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

Example Usage

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

Parameters

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.

Response

T.nilable(::OpenApiSDK::Operations::GetWorkspaceAccessResponse)