2.9 KiB
\PrefAPI
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| GetPref | Get /v1/pref | Returns the signed-in caller's OWN preference document — the theme, density and pinned nav that follow them across every Hanzo surface. |
| PatchPref | Patch /v1/pref | Save the preference keys your surface owns, leaving every other key alone |
GetPref
PrefPrefsView GetPref(ctx).Execute()
Returns the signed-in caller's OWN preference document — the theme, density and pinned nav that follow them across every Hanzo surface.
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.PrefAPI.GetPref(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PrefAPI.GetPref``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetPref`: PrefPrefsView
fmt.Fprintf(os.Stdout, "Response from `PrefAPI.GetPref`: %v\n", resp)
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiGetPrefRequest struct via the builder pattern
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, application/problem+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PatchPref
PatchPref(ctx).Execute()
Save the preference keys your surface owns, leaving every other key alone
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/hanzoai/go-sdk/v8"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.PrefAPI.PatchPref(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PrefAPI.PatchPref``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Path Parameters
This endpoint does not need any parameter.
Other Parameters
Other parameters are passed through a pointer to a apiPatchPrefRequest struct via the builder pattern
Return type
(empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]