You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Start Global Parameters [global-parameters] -->
28
-
## Global Parameters
35
+
<!-- Start Authentication [security] -->
36
+
## Authentication
37
+
38
+
### Per-Client Security Schemes
39
+
40
+
This SDK supports the following security schemes globally:
41
+
42
+
| Name | Type | Scheme |
43
+
| --------------------- | ------ | ----------- |
44
+
|`APIKey`| apiKey | API key |
45
+
|`Bearer`| http | HTTP Bearer |
46
+
|`WorkspaceIdentifier`| apiKey | API key |
47
+
48
+
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
<!-- Start Global Parameters [global-parameters] -->
30
76
## Global Parameters
31
77
32
78
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.
33
79
34
-
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 `GetWorkspace`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
80
+
For example, you can set `workspace_id` to `"<id>"` at SDK initialization and then you do not have to pass the same value on calls to operations like `GetAccessToken`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration.
35
81
36
82
37
83
### Available Globals
38
84
39
85
The following global parameter is available.
40
86
41
-
| Name | Type | Required | Description |
42
-
| ---- | ---- |:--------:| ----------- |
43
-
| workspaceID | string || The WorkspaceID parameter. |
@@ -127,43 +173,63 @@ var res = await sdk.Auth.GetWorkspaceAccessAsync(req);
127
173
<!-- Start Error Handling [errors] -->
128
174
## Error Handling
129
175
130
-
Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.
176
+
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
177
+
178
+
By default, an API error will raise a `SpeakeasySDK.Models.Errors.SDKException` exception, which has the following properties:
|`RawResponse`|*HttpResponseMessage*| The raw HTTP response |
185
+
|`Body`|*string*| The response content |
186
+
187
+
When custom error responses are specified for an operation, the SDK may also throw their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `GenerateCodeSamplePreviewAsync` method throws the following exceptions:
You can override the default server globally by passing a server name to the `server: string` 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:
The default server can also be overridden globally by passing a URL to the `serverUrl: str` optional parameter when initializing the SDK client instance. For example:
This SDK supports the following security schemes globally:
276
+
// handle response
277
+
```
196
278
197
-
| Name | Type | Scheme |
198
-
| ----------- | ----------- | ----------- |
199
-
|`APIKey`| apiKey | API key |
200
-
|`Bearer`| http | HTTP Bearer |
279
+
### Override Server URL Per-Client
201
280
202
-
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
281
+
The default server can also be overridden globally by passing a URL to the `serverUrl: string` optional parameter when initializing the SDK client instance. For example:
0 commit comments