Files

22 KiB
Raw Permalink Blame History

\FlagAPI

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

Method HTTP request Description
DeleteFlagDefsByKey Delete /v1/flag/defs/{key} Removes one flag definition by key and records the deletion in the change log.
GetFlagActivity Get /v1/flag/activity Returns the caller's flag change log newest-first: every create, update and delete, with the actor and the time.
GetFlagDefs Get /v1/flag/defs Returns every flag definition in the caller's (org, project) store, by key, with its version and who last changed it.
GetFlagDefsByKey Get /v1/flag/defs/{key} Returns one flag definition by key, or 404 when the caller's store has none under that key.
GetFlagHealth Get /v1/flag/health Reports that the flag engine is serving.
GetFlagOptin Get /v1/flag/optin Answers the signed-in caller's opt-in to public betas: whether they opted in, whether the org they act in blocked it, and which betas are public.
GetFlagPlatform Get /v1/flag/platform Answers the platform switches that are decided per caller — `beta`, whether the caller sees what is not yet generally available — as they apply to the signed-in caller: its validated org and user, never anything the request states.
PostFlag Post /v1/flag Runs the caller's flag definitions for one identity and returns the flag verdict: which flags are on (or which variant), their payloads, and whether any definition failed to compute.
PostFlagDecide Post /v1/flag/decide Runs the caller's flag definitions for one identity and returns the flag verdict: which flags are on (or which variant), their payloads, and whether any definition failed to compute.
PutFlagDefsByKey Put /v1/flag/defs/{key} Creates or replaces the flag definition at the path's key and returns the stored row.
PutFlagOptin Put /v1/flag/optin Sets the signed-in caller's OWN opt-in to public betas: on, every public beta and each one promoted later is on for them; off, none is.
PutFlagOptinOrg Put /v1/flag/optin/org Blocks or unblocks the opt-in to public betas for every member of the org the caller acts in.

DeleteFlagDefsByKey

FlagDeletedOut DeleteFlagDefsByKey(ctx, key).Execute()

Removes one flag definition by key and records the deletion in the change log.

Example

package main

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

func main() {
	key := "key_example" // string | Key is the flag key to act on, from the path.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
key string Key is the flag key to act on, from the path.

Other Parameters

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

Name Type Description Notes

Return type

FlagDeletedOut

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]

GetFlagActivity

FlagActivityOut GetFlagActivity(ctx).Limit(limit).Execute()

Returns the caller's flag change log newest-first: every create, update and delete, with the actor and the time.

Example

package main

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

func main() {
	limit := int64(789) // int64 | Limit caps the rows returned. 1–500; anything else takes the default 100. (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
limit int64 Limit caps the rows returned. 1–500; anything else takes the default 100.

Return type

FlagActivityOut

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]

GetFlagDefs

FlagDefsOut GetFlagDefs(ctx).Execute()

Returns every flag definition in the caller's (org, project) store, by key, with its version and who last changed it.

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.FlagAPI.GetFlagDefs(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FlagAPI.GetFlagDefs``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetFlagDefs`: FlagDefsOut
	fmt.Fprintf(os.Stdout, "Response from `FlagAPI.GetFlagDefs`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

FlagDefsOut

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]

GetFlagDefsByKey

FlagDefRow GetFlagDefsByKey(ctx, key).Execute()

Returns one flag definition by key, or 404 when the caller's store has none under that key.

Example

package main

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

func main() {
	key := "key_example" // string | Key is the flag key to act on, from the path.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
key string Key is the flag key to act on, from the path.

Other Parameters

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

Name Type Description Notes

Return type

FlagDefRow

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]

GetFlagHealth

FlagHealthOut GetFlagHealth(ctx).Execute()

Reports that the flag engine is serving.

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.FlagAPI.GetFlagHealth(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FlagAPI.GetFlagHealth``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetFlagHealth`: FlagHealthOut
	fmt.Fprintf(os.Stdout, "Response from `FlagAPI.GetFlagHealth`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

FlagHealthOut

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]

GetFlagOptin

FlagOptinOut GetFlagOptin(ctx).Execute()

Answers the signed-in caller's opt-in to public betas: whether they opted in, whether the org they act in blocked it, and which betas are public.

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.FlagAPI.GetFlagOptin(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FlagAPI.GetFlagOptin``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetFlagOptin`: FlagOptinOut
	fmt.Fprintf(os.Stdout, "Response from `FlagAPI.GetFlagOptin`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

FlagOptinOut

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]

GetFlagPlatform

FlagPlatformOut GetFlagPlatform(ctx).Execute()

Answers the platform switches that are decided per caller — beta, whether the caller sees what is not yet generally available — as they apply to the signed-in caller: its validated org and user, never anything the request states.

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.FlagAPI.GetFlagPlatform(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FlagAPI.GetFlagPlatform``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetFlagPlatform`: FlagPlatformOut
	fmt.Fprintf(os.Stdout, "Response from `FlagAPI.GetFlagPlatform`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

FlagPlatformOut

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]

PostFlag

interface{} PostFlag(ctx).FlagEvaluateIn(flagEvaluateIn).Execute()

Runs the caller's flag definitions for one identity and returns the flag verdict: which flags are on (or which variant), their payloads, and whether any definition failed to compute.

Example

package main

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

func main() {
	flagEvaluateIn := *openapiclient.NewFlagEvaluateIn() // FlagEvaluateIn | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
flagEvaluateIn FlagEvaluateIn

Return type

interface{}

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]

PostFlagDecide

interface{} PostFlagDecide(ctx).FlagEvaluateIn(flagEvaluateIn).Execute()

Runs the caller's flag definitions for one identity and returns the flag verdict: which flags are on (or which variant), their payloads, and whether any definition failed to compute.

Example

package main

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

func main() {
	flagEvaluateIn := *openapiclient.NewFlagEvaluateIn() // FlagEvaluateIn | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
flagEvaluateIn FlagEvaluateIn

Return type

interface{}

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]

PutFlagDefsByKey

FlagDefRow PutFlagDefsByKey(ctx, key).Body(body).Execute()

Creates or replaces the flag definition at the path's key and returns the stored row.

Example

package main

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

func main() {
	key := "new-editor" // string | Key is the flag key to write, from the path.
	body := interface{}({"active":true,"filters":{"groups":[{"rollout_percentage":25}]},"key":"new-editor"}) // interface{} | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
key string Key is the flag key to write, from the path.

Other Parameters

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

Name Type Description Notes

body | interface{} | |

Return type

FlagDefRow

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]

PutFlagOptin

FlagOptinOut PutFlagOptin(ctx).FlagOptinIn(flagOptinIn).Execute()

Sets the signed-in caller's OWN opt-in to public betas: on, every public beta and each one promoted later is on for them; off, none is.

Example

package main

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

func main() {
	flagOptinIn := *openapiclient.NewFlagOptinIn() // FlagOptinIn | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
flagOptinIn FlagOptinIn

Return type

FlagOptinOut

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]

PutFlagOptinOrg

FlagOrgOptinOut PutFlagOptinOrg(ctx).FlagOrgOptinIn(flagOrgOptinIn).Execute()

Blocks or unblocks the opt-in to public betas for every member of the org the caller acts in.

Example

package main

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

func main() {
	flagOrgOptinIn := *openapiclient.NewFlagOrgOptinIn() // FlagOrgOptinIn | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
flagOrgOptinIn FlagOrgOptinIn

Return type

FlagOrgOptinOut

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]