uiapi

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package uiapi provides User Interface API operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldInfo

type FieldInfo struct {
	APIName    string `json:"apiName"`
	Label      string `json:"label"`
	DataType   string `json:"dataType"`
	Createable bool   `json:"createable"`
	Updateable bool   `json:"updateable"`
	Required   bool   `json:"required"`
}

FieldInfo contains field metadata.

type FieldValue

type FieldValue struct {
	DisplayValue string      `json:"displayValue"`
	Value        interface{} `json:"value"`
}

FieldValue represents a field value.

type HTTPClient

type HTTPClient interface {
	Get(ctx context.Context, path string) ([]byte, error)
	Post(ctx context.Context, path string, body interface{}) ([]byte, error)
	Patch(ctx context.Context, path string, body interface{}) ([]byte, error)
	Delete(ctx context.Context, path string) ([]byte, error)
}

HTTPClient interface for dependency injection.

type LayoutItem

type LayoutItem struct {
	Field       string `json:"field,omitempty"`
	Label       string `json:"label"`
	Editability string `json:"editability"`
}

LayoutItem represents a layout item.

type LayoutRepresentation

type LayoutRepresentation struct {
	ID         string          `json:"id"`
	Sections   []LayoutSection `json:"sections"`
	LayoutType string          `json:"layoutType"`
	Mode       string          `json:"mode"`
}

LayoutRepresentation contains layout information.

type LayoutRow

type LayoutRow struct {
	LayoutItems []LayoutItem `json:"layoutItems"`
}

LayoutRow represents a layout row.

type LayoutSection

type LayoutSection struct {
	Heading    string      `json:"heading"`
	Columns    int         `json:"columns"`
	UseHeading bool        `json:"useHeading"`
	LayoutRows []LayoutRow `json:"layoutRows"`
}

LayoutSection represents a layout section.

type ObjectInfo

type ObjectInfo struct {
	APIName     string               `json:"apiName"`
	Label       string               `json:"label"`
	LabelPlural string               `json:"labelPlural"`
	KeyPrefix   string               `json:"keyPrefix"`
	Fields      map[string]FieldInfo `json:"fields"`
	Createable  bool                 `json:"createable"`
	Updateable  bool                 `json:"updateable"`
	Deletable   bool                 `json:"deletable"`
}

ObjectInfo contains object metadata.

type PicklistFieldValue

type PicklistFieldValue struct {
	DefaultValue *PicklistValue  `json:"defaultValue"`
	Values       []PicklistValue `json:"values"`
}

PicklistFieldValue contains values for a picklist field.

type PicklistValue

type PicklistValue struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

PicklistValue represents a picklist option.

type PicklistValues

type PicklistValues struct {
	ETag                string                        `json:"eTag"`
	PicklistFieldValues map[string]PicklistFieldValue `json:"picklistFieldValues"`
}

PicklistValues contains picklist values.

type RecordRepresentation

type RecordRepresentation struct {
	ID             string                `json:"id"`
	APIName        string                `json:"apiName"`
	Fields         map[string]FieldValue `json:"fields"`
	RecordTypeId   string                `json:"recordTypeId,omitempty"`
	SystemModstamp string                `json:"systemModstamp"`
}

RecordRepresentation represents a record.

type RecordUI

type RecordUI struct {
	Layouts     map[string]LayoutRepresentation `json:"layouts"`
	ObjectInfos map[string]ObjectInfo           `json:"objectInfos"`
	Records     map[string]RecordRepresentation `json:"records"`
}

RecordUI contains full record UI information.

type Service

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

Service provides User Interface API operations.

func NewService

func NewService(client HTTPClient, apiVersion string) *Service

NewService creates a new UI API service.

func (*Service) CreateRecord

func (s *Service) CreateRecord(ctx context.Context, objectAPIName string, fields map[string]interface{}) (*RecordRepresentation, error)

CreateRecord creates a new record.

func (*Service) DeleteRecord

func (s *Service) DeleteRecord(ctx context.Context, recordId string) error

DeleteRecord deletes a record.

func (*Service) GetLayout

func (s *Service) GetLayout(ctx context.Context, objectAPIName, layoutType, mode string) (*LayoutRepresentation, error)

GetLayout retrieves layout information.

func (*Service) GetObjectInfo

func (s *Service) GetObjectInfo(ctx context.Context, objectAPIName string) (*ObjectInfo, error)

GetObjectInfo retrieves object metadata.

func (*Service) GetPicklistValues

func (s *Service) GetPicklistValues(ctx context.Context, objectAPIName, recordTypeId string) (*PicklistValues, error)

GetPicklistValues retrieves picklist values.

func (*Service) GetRecord

func (s *Service) GetRecord(ctx context.Context, recordId string, fields []string) (*RecordRepresentation, error)

GetRecord retrieves a single record.

func (*Service) GetRecordUI

func (s *Service) GetRecordUI(ctx context.Context, recordIds []string) (*RecordUI, error)

GetRecordUI retrieves record UI data.

func (*Service) UpdateRecord

func (s *Service) UpdateRecord(ctx context.Context, recordId string, fields map[string]interface{}) (*RecordRepresentation, error)

UpdateRecord updates a record.

Jump to

Keyboard shortcuts

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