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.0 KiB
AuthorsApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| authorsConnectAuthor | POST /v1/authors/connect | Connect GitHub |
| authorsGetMyAuthors | GET /v1/authors | Get my author program |
| authorsVerifyRepo | POST /v1/authors/repos/verify | Verify a repo |
authorsConnectAuthor
AuthorsConnectResponse authorsConnectAuthor(authorsConnectRequest)
Connect GitHub
Enrolls the caller's org as an author at status `connected`, idempotently. Links a GitHub login — from IAM's linked account (identity verified) when present, else the supplied `githubLogin` — and mints a stable verify code. Returns 201 when newly created, 200 when already connected.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = AuthorsApi()
val authorsConnectRequest : AuthorsConnectRequest = // AuthorsConnectRequest |
try {
val result : AuthorsConnectResponse = apiInstance.authorsConnectAuthor(authorsConnectRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling AuthorsApi#authorsConnectAuthor")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AuthorsApi#authorsConnectAuthor")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authorsConnectRequest | AuthorsConnectRequest | [optional] |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
authorsGetMyAuthors
AuthorsGetMyAuthors200Response authorsGetMyAuthors()
Get my author program
Returns the caller org's author dashboard. If the org has not connected, a "not enrolled" shape is returned (`isAuthor: false`) so the console shows the connect form. For an APPROVED author, an opportunistic accrual sweep runs first so the dashboard is self-updating.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = AuthorsApi()
try {
val result : AuthorsGetMyAuthors200Response = apiInstance.authorsGetMyAuthors()
println(result)
} catch (e: ClientException) {
println("4xx response calling AuthorsApi#authorsGetMyAuthors")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AuthorsApi#authorsGetMyAuthors")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
AuthorsGetMyAuthors200Response
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
authorsVerifyRepo
AuthorsVerifyRepoResponse authorsVerifyRepo(authorsVerifyRepoRequest)
Verify a repo
Verifies the caller owns a repo and records it as a verified author repo. Ownership is proven by an IAM-linked GitHub token (admin/push) OR a `hanzo.json` on the default branch carrying the author's verify code. The author must have connected first. Returns 201 when newly verified, 200 when already recorded.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = AuthorsApi()
val authorsVerifyRepoRequest : AuthorsVerifyRepoRequest = // AuthorsVerifyRepoRequest |
try {
val result : AuthorsVerifyRepoResponse = apiInstance.authorsVerifyRepo(authorsVerifyRepoRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling AuthorsApi#authorsVerifyRepo")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AuthorsApi#authorsVerifyRepo")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| authorsVerifyRepoRequest | AuthorsVerifyRepoRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json