SDK Installation
Getting started
JDK 11 or later is required. The samples below show how a published SDK artifact is used: Gradle:How to build
After cloning the git repository to your file system you can build the SDK artifact from source to thebuild
directory by running ./gradlew build
on *nix systems or gradlew.bat
on Windows systems.
If you wish to build from source and publish the SDK artifact to your local Maven repository (on your filesystem) then use the following command (after cloning the git repo locally):
On *nix:
Logging
A logging framework/facade has not yet been adopted but is under consideration. For request and response logging (especially json bodies) use:SpeakeasyHTTPClient.setRedactedHeaders
.
Another option is to set the System property -Djdk.httpclient.HttpClient.log=all
. However, this second option does not log bodies.
SDK Example Usage
Example
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:Name | Type | Scheme |
---|---|---|
apiKeyAuth | http | HTTP Bearer |
apiKeyAuth
parameter must be set when initializing the SDK client instance. For example:
Available Resources and Operations
The available API operations and SDK implementation examples can be found within our API Reference documentationPagination
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the returned response object will have anext
method that can be called to pull down the next group of results. The next
function returns an Optional
value, which isPresent
until there are no more pages to be fetched.
Here’s an example of one such pagination call:
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception. By default, an API error will throw amodels/errors/APIException
exception. When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the list
method throws the following exceptions:
Error Type | Status Code | Content Type |
---|---|---|
models/errors/BadRequestError | 400 | application/json |
models/errors/UnauthorizedError | 401 | application/json |
models/errors/TooManyRequestsError | 429 | application/json |
models/errors/InternalServerError | 500 | application/json |
models/errors/APIException | 4XX, 5XX | */* |