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.8 KiB
SitesApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| projectsBuildSite | POST /v1/sites | Build a site from a brief and deploy it |
| projectsDeploySite | POST /v1/sites/deploy | Deploy a raw file manifest |
| projectsListSites | GET /v1/sites | List the org's live sites |
projectsBuildSite
ProjectsSiteDeployResult projectsBuildSite(projectsBuildSiteRequest)
Build a site from a brief and deploy it
Generate a self-contained, mobile-responsive static site from a natural-language `brief` (one inference call), then deploy it through the one publish core. Writes into the SAME org-scoped projects store as `/v1/projects`: it ensures a `project` (framework `static`) for the resolved slug and records a `deployment`. `/v1/sites` is the brief-build/raw-manifest entrypoint; `/v1/projects/{slug}/deploy` is the artifact/git entrypoint — one store, one publish core, not a second copy of project state. The brief is capped at 8 KiB. Responds `200` with the published-site result.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = SitesApi()
val projectsBuildSiteRequest : ProjectsBuildSiteRequest = // ProjectsBuildSiteRequest |
try {
val result : ProjectsSiteDeployResult = apiInstance.projectsBuildSite(projectsBuildSiteRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling SitesApi#projectsBuildSite")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling SitesApi#projectsBuildSite")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectsBuildSiteRequest | ProjectsBuildSiteRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
projectsDeploySite
ProjectsSiteDeployResult projectsDeploySite(projectsDeploySiteRequest)
Deploy a raw file manifest
Deploy a caller-supplied file manifest (the same `{path, content}` shape the brief build emits) through the one publish core. Every file passes the same guards as the brief build: index.html required at the root; absolute and traversal paths rejected; a mobile viewport tag injected into HTML when absent. Writes into the SAME org-scoped projects store as `/v1/projects`: it ensures a `project` (framework `static`) for the resolved slug and records a `deployment`. `/v1/sites` is the brief-build/raw-manifest entrypoint; `/v1/projects/{slug}/deploy` is the artifact/git entrypoint — one store, one publish core, not a second copy of project state. Responds `200` with the published-site result.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = SitesApi()
val projectsDeploySiteRequest : ProjectsDeploySiteRequest = // ProjectsDeploySiteRequest |
try {
val result : ProjectsSiteDeployResult = apiInstance.projectsDeploySite(projectsDeploySiteRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling SitesApi#projectsDeploySite")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling SitesApi#projectsDeploySite")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| projectsDeploySiteRequest | ProjectsDeploySiteRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json
projectsListSites
kotlin.collections.List<ProjectsSite> projectsListSites()
List the org's live sites
List the org's `live` projects as sites at their canonical live URL `https://<slug>.<apex>`. Reads the SAME org-scoped projects store as `/v1/projects`; a project that is not `live` is omitted.
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = SitesApi()
try {
val result : kotlin.collections.List<ProjectsSite> = apiInstance.projectsListSites()
println(result)
} catch (e: ClientException) {
println("4xx response calling SitesApi#projectsListSites")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling SitesApi#projectsListSites")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
kotlin.collections.List<ProjectsSite>
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: Not defined
- Accept: application/json