settings

package
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateResponse

type CreateResponse struct {
	Items []SettingsObjectResponse `json:"items"`
}

CreateResponse represents the response from batch create.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles settings resources.

func NewHandler

func NewHandler(c *httpclient.Client) *Handler

NewHandler creates a new settings handler.

func (*Handler) Create

Create creates a new settings object.

func (*Handler) Delete

func (h *Handler) Delete(ctx context.Context, objectID, schemaVersion string) error

Delete deletes a settings object. The schemaVersion is used for the If-Match header (obtain it from Get).

func (*Handler) Get

func (h *Handler) Get(ctx context.Context, objectID string) (*SettingsObject, error)

Get gets a specific settings object by objectId.

func (*Handler) GetSchema

func (h *Handler) GetSchema(ctx context.Context, schemaID string) (map[string]any, error)

GetSchema gets a specific schema definition.

func (*Handler) ListObjects

func (h *Handler) ListObjects(ctx context.Context, schemaID, scope string, chunkSize int64) (*SettingsObjectsList, error)

ListObjects lists settings objects for a schema with automatic pagination.

func (*Handler) ListSchemas

func (h *Handler) ListSchemas(ctx context.Context) (*SchemaList, error)

ListSchemas lists all available settings schemas.

func (*Handler) Update

func (h *Handler) Update(ctx context.Context, objectID, schemaVersion string, value map[string]any) error

Update updates an existing settings object. The schemaVersion is used for the If-Match header (obtain it from Get).

func (*Handler) ValidateCreate

func (h *Handler) ValidateCreate(ctx context.Context, req SettingsObjectCreate) error

ValidateCreate validates a settings object without creating it.

func (*Handler) ValidateUpdate

func (h *Handler) ValidateUpdate(ctx context.Context, objectID, schemaVersion string, value map[string]any) error

ValidateUpdate validates a settings object update without applying it. The schemaVersion is used for the If-Match header (obtain it from Get).

type ModificationInfo

type ModificationInfo struct {
	CreatedBy        string `json:"createdBy,omitempty"`
	CreatedTime      string `json:"createdTime,omitempty"`
	LastModifiedBy   string `json:"lastModifiedBy,omitempty"`
	LastModifiedTime string `json:"lastModifiedTime,omitempty"`
}

ModificationInfo contains modification timestamps.

type Schema

type Schema struct {
	SchemaID    string         `json:"schemaId"`
	DisplayName string         `json:"displayName"`
	Description string         `json:"description,omitempty"`
	Version     string         `json:"version"`
	MultiObject bool           `json:"multiObject,omitempty"`
	Ordered     bool           `json:"ordered,omitempty"`
	Properties  map[string]any `json:"properties,omitempty"`
	Scopes      []string       `json:"scopes,omitempty"`
}

Schema represents a settings schema.

type SchemaList

type SchemaList struct {
	Items      []Schema `json:"items"`
	TotalCount int      `json:"totalCount"`
}

SchemaList represents a list of schemas.

type SettingsObject

type SettingsObject struct {
	ObjectID         string            `json:"objectId"`
	SchemaID         string            `json:"schemaId"`
	SchemaVersion    string            `json:"schemaVersion,omitempty"`
	Scope            string            `json:"scope"`
	ExternalID       string            `json:"externalId,omitempty"`
	Summary          string            `json:"summary,omitempty"`
	Value            map[string]any    `json:"value,omitempty"`
	ModificationInfo *ModificationInfo `json:"modificationInfo,omitempty"`
}

SettingsObject represents a settings object.

type SettingsObjectCreate

type SettingsObjectCreate struct {
	SchemaID      string         `json:"schemaId"`
	Scope         string         `json:"scope"`
	Value         map[string]any `json:"value"`
	SchemaVersion string         `json:"schemaVersion,omitempty"`
	ExternalID    string         `json:"externalId,omitempty"`
}

SettingsObjectCreate represents the request body for creating a settings object.

type SettingsObjectResponse

type SettingsObjectResponse struct {
	ObjectID string `json:"objectId"`
	Code     int    `json:"code,omitempty"`
	Error    *struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
	} `json:"error,omitempty"`
}

SettingsObjectResponse represents the response from creating/updating a settings object.

type SettingsObjectsList

type SettingsObjectsList struct {
	Items       []SettingsObject `json:"items"`
	TotalCount  int              `json:"totalCount"`
	NextPageKey string           `json:"nextPageKey,omitempty"`
}

SettingsObjectsList represents a list of settings objects.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL