Skip to content

hdresearch/kotlin-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Orchestrator Control Plane API Kotlin SDK

vers-sdk v0.1.8

It is generated with Sterling.

Installation

Gradle (Kotlin DSL)

dependencies {
    implementation("com.vers.sdk:vers-sdk:0.1.8")
}

Gradle (Groovy)

implementation 'com.vers.sdk:vers-sdk:0.1.8'

Usage

import com.vers.sdk.VersSdkClient
import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
    val client = VersSdkClient(
        apiKey = "your-api-key",
    )

    client.use {
        // Call API methods
        // val response = it.someOperation()
    }
}

Configuration

Parameter Environment Variable Default Description
baseUrl VERS_BASE_URL https://api.vers.sh API base URL
apiKey VERS_API_KEY Bearer token for authentication
maxRetries 2 Maximum retry attempts
timeout 30 Request timeout in seconds

Error Handling

import com.vers.sdk.*

try {
    val response = client.someOperation()
} catch (e: NotFoundError) {
    println("Resource not found: ${e.status}")
} catch (e: RateLimitError) {
    println("Rate limited, retry later")
} catch (e: APIError) {
    println("API error: ${e.status} - ${e.message}")
} catch (e: APIConnectionError) {
    println("Connection failed: ${e.message}")
}

Logging

Set the VERS_LOG environment variable to control log verbosity:

  • debug — all request/response details
  • info — retries and important events
  • warn — warnings (default)
  • error — errors only
  • off — no logging

License

Apache-2.0

About

Vers SDK — generated from the Vers OpenAPI spec

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages