mirror of
https://github.com/hanzo-kt/sdk.git
synced 2026-10-30 20:43:57 +00:00
Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and Android. Generated with openapi-generator kotlin (library=jvm-okhttp4, useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai. Co-authored-by: Hanzo Dev <[email protected]>
5.1 KiB
5.1 KiB
NamespacesApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| kvCreateNamespace | POST /v1/kv/namespaces | Create namespace |
| kvDeleteNamespace | DELETE /v1/kv/namespaces/{name} | Delete namespace and all keys |
| kvGetNamespace | GET /v1/kv/namespaces/{name} | Get namespace |
| kvListNamespaces | GET /v1/kv/namespaces | List namespaces |
kvCreateNamespace
KvNamespace kvCreateNamespace(kvCreateNamespaceRequest)
Create namespace
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = NamespacesApi()
val kvCreateNamespaceRequest : KvCreateNamespaceRequest = // KvCreateNamespaceRequest |
try {
val result : KvNamespace = apiInstance.kvCreateNamespace(kvCreateNamespaceRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling NamespacesApi#kvCreateNamespace")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling NamespacesApi#kvCreateNamespace")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| kvCreateNamespaceRequest | KvCreateNamespaceRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
kvDeleteNamespace
kotlin.Any kvDeleteNamespace(name)
Delete namespace and all keys
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = NamespacesApi()
val name : kotlin.String = name_example // kotlin.String |
try {
val result : kotlin.Any = apiInstance.kvDeleteNamespace(name)
println(result)
} catch (e: ClientException) {
println("4xx response calling NamespacesApi#kvDeleteNamespace")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling NamespacesApi#kvDeleteNamespace")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | kotlin.String |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
kvGetNamespace
KvNamespace kvGetNamespace(name)
Get namespace
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = NamespacesApi()
val name : kotlin.String = name_example // kotlin.String |
try {
val result : KvNamespace = apiInstance.kvGetNamespace(name)
println(result)
} catch (e: ClientException) {
println("4xx response calling NamespacesApi#kvGetNamespace")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling NamespacesApi#kvGetNamespace")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | kotlin.String |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
kvListNamespaces
kotlin.collections.List<KvNamespace> kvListNamespaces()
List namespaces
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = NamespacesApi()
try {
val result : kotlin.collections.List<KvNamespace> = apiInstance.kvListNamespaces()
println(result)
} catch (e: ClientException) {
println("4xx response calling NamespacesApi#kvListNamespaces")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling NamespacesApi#kvListNamespaces")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
kotlin.collections.List<KvNamespace>
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json