Files
sdk/docs/SettingsAPI.md

4.9 KiB

\SettingsAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
GetSettingsByProduct Get /v1/settings/{product} Reads the caller org's configuration for one product, with every secret field MASKED — only the names of the set secrets come back, never their values, which live in KMS.
PutSettingsByProduct Put /v1/settings/{product} Writes the caller org's configuration for one product and answers the stored result, secrets masked.

GetSettingsByProduct

SettingsView GetSettingsByProduct(ctx, product).Execute()

Reads the caller org's configuration for one product, with every secret field MASKED — only the names of the set secrets come back, never their values, which live in KMS.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	product := "product_example" // string | Product is the catalog slug, from the path. Must match ^[a-z0-9][a-z0-9._-]{0,62}$.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SettingsAPI.GetSettingsByProduct(context.Background(), product).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SettingsAPI.GetSettingsByProduct``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSettingsByProduct`: SettingsView
	fmt.Fprintf(os.Stdout, "Response from `SettingsAPI.GetSettingsByProduct`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
product string Product is the catalog slug, from the path. Must match ^[a-z0-9][a-z0-9._-]{0,62}$.

Other Parameters

Other parameters are passed through a pointer to a apiGetSettingsByProductRequest struct via the builder pattern

Name Type Description Notes

Return type

SettingsView

Authorization

bearer

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]

PutSettingsByProduct

SettingsView PutSettingsByProduct(ctx, product).SettingsSettingsReq(settingsSettingsReq).Execute()

Writes the caller org's configuration for one product and answers the stored result, secrets masked.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	product := "product_example" // string | Product is the catalog slug, from the PATH. zip binds the path last, so the URL names the product being written whatever a body field claims.
	settingsSettingsReq := *openapiclient.NewSettingsSettingsReq() // SettingsSettingsReq | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SettingsAPI.PutSettingsByProduct(context.Background(), product).SettingsSettingsReq(settingsSettingsReq).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SettingsAPI.PutSettingsByProduct``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PutSettingsByProduct`: SettingsView
	fmt.Fprintf(os.Stdout, "Response from `SettingsAPI.PutSettingsByProduct`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
product string Product is the catalog slug, from the PATH. zip binds the path last, so the URL names the product being written whatever a body field claims.

Other Parameters

Other parameters are passed through a pointer to a apiPutSettingsByProductRequest struct via the builder pattern

Name Type Description Notes

settingsSettingsReq | SettingsSettingsReq | |

Return type

SettingsView

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]