Documentation
¶
Overview ¶
Package uiapi provides User Interface API operations.
Index ¶
- type FieldInfo
- type FieldValue
- type HTTPClient
- type LayoutItem
- type LayoutRepresentation
- type LayoutRow
- type LayoutSection
- type ObjectInfo
- type PicklistFieldValue
- type PicklistValue
- type PicklistValues
- type RecordRepresentation
- type RecordUI
- type Service
- func (s *Service) CreateRecord(ctx context.Context, objectAPIName string, fields map[string]interface{}) (*RecordRepresentation, error)
- func (s *Service) DeleteRecord(ctx context.Context, recordId string) error
- func (s *Service) GetLayout(ctx context.Context, objectAPIName, layoutType, mode string) (*LayoutRepresentation, error)
- func (s *Service) GetObjectInfo(ctx context.Context, objectAPIName string) (*ObjectInfo, error)
- func (s *Service) GetPicklistValues(ctx context.Context, objectAPIName, recordTypeId string) (*PicklistValues, error)
- func (s *Service) GetRecord(ctx context.Context, recordId string, fields []string) (*RecordRepresentation, error)
- func (s *Service) GetRecordUI(ctx context.Context, recordIds []string) (*RecordUI, error)
- func (s *Service) UpdateRecord(ctx context.Context, recordId string, fields map[string]interface{}) (*RecordRepresentation, error)
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 ¶
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 ¶
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 ¶
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 ¶
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.