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]>
8.6 KiB
KMSApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| kmsCreateKmsKey | POST /v1/kms/kms/keys | Create a KMS encryption key |
| kmsDecryptData | POST /v1/kms/kms/keys/{keyId}/decrypt | Decrypt data with a KMS key |
| kmsDeleteKmsKey | DELETE /v1/kms/kms/keys/{keyId} | Delete a KMS key |
| kmsEncryptData | POST /v1/kms/kms/keys/{keyId}/encrypt | Encrypt data with a KMS key |
| kmsListKmsKeys | GET /v1/kms/kms/keys | List KMS encryption keys |
| kmsUpdateKmsKey | PATCH /v1/kms/kms/keys/{keyId} | Update a KMS key |
kmsCreateKmsKey
KmsCreateKmsKey200Response kmsCreateKmsKey(kmsCreateKmsKeyRequest)
Create a KMS encryption key
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = KMSApi()
val kmsCreateKmsKeyRequest : KmsCreateKmsKeyRequest = // KmsCreateKmsKeyRequest |
try {
val result : KmsCreateKmsKey200Response = apiInstance.kmsCreateKmsKey(kmsCreateKmsKeyRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling KMSApi#kmsCreateKmsKey")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling KMSApi#kmsCreateKmsKey")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| kmsCreateKmsKeyRequest | KmsCreateKmsKeyRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
kmsDecryptData
KmsDecryptDataResponse kmsDecryptData(keyId, kmsDecryptDataRequest)
Decrypt data with a KMS key
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = KMSApi()
val keyId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID |
val kmsDecryptDataRequest : KmsDecryptDataRequest = // KmsDecryptDataRequest |
try {
val result : KmsDecryptDataResponse = apiInstance.kmsDecryptData(keyId, kmsDecryptDataRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling KMSApi#kmsDecryptData")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling KMSApi#kmsDecryptData")
e.printStackTrace()
}
Parameters
| keyId | java.util.UUID| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| kmsDecryptDataRequest | KmsDecryptDataRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
kmsDeleteKmsKey
kotlin.Any kmsDeleteKmsKey(keyId)
Delete a KMS key
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = KMSApi()
val keyId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID |
try {
val result : kotlin.Any = apiInstance.kmsDeleteKmsKey(keyId)
println(result)
} catch (e: ClientException) {
println("4xx response calling KMSApi#kmsDeleteKmsKey")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling KMSApi#kmsDeleteKmsKey")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| keyId | java.util.UUID |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
kmsEncryptData
KmsEncryptDataResponse kmsEncryptData(keyId, kmsEncryptDataRequest)
Encrypt data with a KMS key
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = KMSApi()
val keyId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID |
val kmsEncryptDataRequest : KmsEncryptDataRequest = // KmsEncryptDataRequest |
try {
val result : KmsEncryptDataResponse = apiInstance.kmsEncryptData(keyId, kmsEncryptDataRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling KMSApi#kmsEncryptData")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling KMSApi#kmsEncryptData")
e.printStackTrace()
}
Parameters
| keyId | java.util.UUID| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| kmsEncryptDataRequest | KmsEncryptDataRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
kmsListKmsKeys
KmsListKmsKeys200Response kmsListKmsKeys(projectId)
List KMS encryption keys
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = KMSApi()
val projectId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID |
try {
val result : KmsListKmsKeys200Response = apiInstance.kmsListKmsKeys(projectId)
println(result)
} catch (e: ClientException) {
println("4xx response calling KMSApi#kmsListKmsKeys")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling KMSApi#kmsListKmsKeys")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectId | java.util.UUID |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
kmsUpdateKmsKey
KmsCreateKmsKey200Response kmsUpdateKmsKey(keyId, kmsUpdateKmsKeyRequest)
Update a KMS key
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = KMSApi()
val keyId : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID |
val kmsUpdateKmsKeyRequest : KmsUpdateKmsKeyRequest = // KmsUpdateKmsKeyRequest |
try {
val result : KmsCreateKmsKey200Response = apiInstance.kmsUpdateKmsKey(keyId, kmsUpdateKmsKeyRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling KMSApi#kmsUpdateKmsKey")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling KMSApi#kmsUpdateKmsKey")
e.printStackTrace()
}
Parameters
| keyId | java.util.UUID| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| kmsUpdateKmsKeyRequest | KmsUpdateKmsKeyRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json