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.4 KiB
ObjectsApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| s3DeleteObject | DELETE /v1/s3/{bucket}/{key} | Delete an object |
| s3GetObject | GET /v1/s3/{bucket}/{key} | Download an object |
| s3HeadObject | HEAD /v1/s3/{bucket}/{key} | Get object metadata |
| s3ListObjectsV2 | GET /v1/s3/{bucket} | List objects in bucket |
| s3PutObject | PUT /v1/s3/{bucket}/{key} | Upload an object |
s3DeleteObject
s3DeleteObject(bucket, key, versionId)
Delete an object
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ObjectsApi()
val bucket : kotlin.String = bucket_example // kotlin.String |
val key : kotlin.String = key_example // kotlin.String |
val versionId : kotlin.String = versionId_example // kotlin.String | Specific version to delete
try {
apiInstance.s3DeleteObject(bucket, key, versionId)
} catch (e: ClientException) {
println("4xx response calling ObjectsApi#s3DeleteObject")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ObjectsApi#s3DeleteObject")
e.printStackTrace()
}
Parameters
| bucket | kotlin.String| | | | key | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| versionId | kotlin.String | Specific version to delete | [optional] |
Return type
null (empty response body)
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
s3GetObject
java.io.File s3GetObject(bucket, key, versionId, range)
Download an object
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ObjectsApi()
val bucket : kotlin.String = bucket_example // kotlin.String |
val key : kotlin.String = key_example // kotlin.String |
val versionId : kotlin.String = versionId_example // kotlin.String | Specific version to retrieve
val range : kotlin.String = range_example // kotlin.String | Byte range (e.g. bytes=0-1023)
try {
val result : java.io.File = apiInstance.s3GetObject(bucket, key, versionId, range)
println(result)
} catch (e: ClientException) {
println("4xx response calling ObjectsApi#s3GetObject")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ObjectsApi#s3GetObject")
e.printStackTrace()
}
Parameters
| bucket | kotlin.String| | | | key | kotlin.String| | | | versionId | kotlin.String| Specific version to retrieve | [optional] |
| Name | Type | Description | Notes |
|---|---|---|---|
| range | kotlin.String | Byte range (e.g. bytes=0-1023) | [optional] |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream
s3HeadObject
s3HeadObject(bucket, key)
Get object metadata
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ObjectsApi()
val bucket : kotlin.String = bucket_example // kotlin.String |
val key : kotlin.String = key_example // kotlin.String |
try {
apiInstance.s3HeadObject(bucket, key)
} catch (e: ClientException) {
println("4xx response calling ObjectsApi#s3HeadObject")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ObjectsApi#s3HeadObject")
e.printStackTrace()
}
Parameters
| bucket | kotlin.String| | |
| Name | Type | Description | Notes |
|---|---|---|---|
| key | kotlin.String |
Return type
null (empty response body)
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
s3ListObjectsV2
S3ListObjectsV2200Response s3ListObjectsV2(bucket, prefix, delimiter, maxKeys, continuationToken)
List objects in bucket
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ObjectsApi()
val bucket : kotlin.String = bucket_example // kotlin.String |
val prefix : kotlin.String = prefix_example // kotlin.String | Filter by key prefix
val delimiter : kotlin.String = delimiter_example // kotlin.String | Grouping delimiter (e.g. /)
val maxKeys : kotlin.Int = 56 // kotlin.Int |
val continuationToken : kotlin.String = continuationToken_example // kotlin.String | Pagination token from previous response
try {
val result : S3ListObjectsV2200Response = apiInstance.s3ListObjectsV2(bucket, prefix, delimiter, maxKeys, continuationToken)
println(result)
} catch (e: ClientException) {
println("4xx response calling ObjectsApi#s3ListObjectsV2")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ObjectsApi#s3ListObjectsV2")
e.printStackTrace()
}
Parameters
| bucket | kotlin.String| | | | prefix | kotlin.String| Filter by key prefix | [optional] | | delimiter | kotlin.String| Grouping delimiter (e.g. /) | [optional] | | maxKeys | kotlin.Int| | [optional] [default to 1000] |
| Name | Type | Description | Notes |
|---|---|---|---|
| continuationToken | kotlin.String | Pagination token from previous response | [optional] |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
s3PutObject
s3PutObject(bucket, key, body, contentType, xAmzServerSideEncryption)
Upload an object
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ObjectsApi()
val bucket : kotlin.String = bucket_example // kotlin.String |
val key : kotlin.String = key_example // kotlin.String |
val body : java.io.File = BINARY_DATA_HERE // java.io.File |
val contentType : kotlin.String = contentType_example // kotlin.String |
val xAmzServerSideEncryption : kotlin.String = xAmzServerSideEncryption_example // kotlin.String | Server-side encryption algorithm
try {
apiInstance.s3PutObject(bucket, key, body, contentType, xAmzServerSideEncryption)
} catch (e: ClientException) {
println("4xx response calling ObjectsApi#s3PutObject")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ObjectsApi#s3PutObject")
e.printStackTrace()
}
Parameters
| bucket | kotlin.String| | | | key | kotlin.String| | | | body | java.io.File| | | | contentType | kotlin.String| | [optional] [default to "application/octet-stream"] |
| Name | Type | Description | Notes |
|---|---|---|---|
| xAmzServerSideEncryption | kotlin.String | Server-side encryption algorithm | [optional] [enum: AES256, aws:kms] |
Return type
null (empty response body)
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/octet-stream
- Accept: Not defined