Skip to content

speakeasy-api/speakeasy-client-sdk-ruby

Repository files navigation

SDK Installation

gem install speakeasy_client_sdk_ruby

SDK Example Usage

Example

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::GetApisRequest.new()
    
res = s.apis.get_apis(req)

if ! res.apis.nil?
  # handle response
end

Available Resources and Operations

Server Selection

Server Selection

Select Server by Name

You can override the default server globally by passing a server name to the server: str optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:

Name Server Variables
prod https://api.prod.speakeasyapi.dev None

Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the server_url: str optional parameter when initializing the SDK client instance. For example:

Global Parameters

A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed.

For example, you can set workspaceID to "<value>" at SDK initialization and then you do not have to pass the same value on calls to operations like get_workspace. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.

Available Globals

The following global parameter is available.

Name Type Required Description
workspace_id ::String The workspace_id parameter.

Example

require 'speakeasy_client_sdk_ruby'


s = ::SpeakeasyClientSDK::SDK.new
s.config_security(
  ::SpeakeasyClientSDK::Shared::Security.new(
    api_key: "<YOUR_API_KEY_HERE>",
  )
)


req = ::SpeakeasyClientSDK::Operations::GetWorkspaceRequest.new()
    
res = s.workspaces.get_workspace(req)

if ! res.workspace.nil?
  # handle response
end

SDK Generated by Speakeasy