Documentation
¶
Index ¶
- type CreateResponse
- type Handler
- func (h *Handler) Create(ctx context.Context, req SettingsObjectCreate) (*SettingsObjectResponse, error)
- func (h *Handler) Delete(ctx context.Context, objectID, schemaVersion string) error
- func (h *Handler) Get(ctx context.Context, objectID string) (*SettingsObject, error)
- func (h *Handler) GetSchema(ctx context.Context, schemaID string) (map[string]any, error)
- func (h *Handler) ListObjects(ctx context.Context, schemaID, scope string, chunkSize int64) (*SettingsObjectsList, error)
- func (h *Handler) ListSchemas(ctx context.Context) (*SchemaList, error)
- func (h *Handler) Update(ctx context.Context, objectID, schemaVersion string, value map[string]any) error
- func (h *Handler) ValidateCreate(ctx context.Context, req SettingsObjectCreate) error
- func (h *Handler) ValidateUpdate(ctx context.Context, objectID, schemaVersion string, value map[string]any) error
- type ModificationInfo
- type Schema
- type SchemaList
- type SettingsObject
- type SettingsObjectCreate
- type SettingsObjectResponse
- type SettingsObjectsList
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 ¶
func (h *Handler) Create(ctx context.Context, req SettingsObjectCreate) (*SettingsObjectResponse, error)
Create creates a new settings object.
func (*Handler) Delete ¶
Delete deletes a settings object. The schemaVersion is used for the If-Match header (obtain it from Get).
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.
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 ¶
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.