go-sfdc: github.com/g8rswimmer/go-sfdc/sobject Index | Files | Directories

package sobject

import "github.com/g8rswimmer/go-sfdc/sobject"

Index

Package Files

describe.go dml.go framework.go metadata.go mock_session_formatter.go query.go

type ActionOverride Uses

type ActionOverride struct {
    IsAvailableInTouch bool   `json:"isAvailableInTouch"`
    FormFactor         string `json:"formFactor"`
    Name               string `json:"name"`
    PageID             string `json:"pageId"`
    URL                string `json:"url"`
}

ActionOverride describes the objects overrides.

type ChildRelationship Uses

type ChildRelationship struct {
    CascadeDelete       bool     `json:"cascadeDelete"`
    RestrictedDelete    bool     `json:"restrictedDelete"`
    DeprecatedAndHidden bool     `json:"deprecatedAndHidden"`
    ChildSObject        string   `json:"childSObject"`
    Field               string   `json:"field"`
    RelationshipName    string   `json:"relationshipName"`
    JunctionIDListNames []string `json:"junctionIdListNames"`
    JunctionReferenceTo []string `json:"junctionReferenceTo"`
}

ChildRelationship describes the child relationship of the SObject.

type ContentType Uses

type ContentType string

ContentType is indicator of the content type in Salesforce blob.

const (
    // AttachmentType is the content blob from the Salesforce Attachment record.
    AttachmentType ContentType = "Attachment"
    // DocumentType is the content blob from the Salesforce Document record.
    DocumentType ContentType = "Document"
)

type DeletedRecords Uses

type DeletedRecords struct {
    Records         []deletedRecord `json:"deletedRecords"`
    EarliestDateStr string          `json:"earliestDateAvailable"`
    LatestDateStr   string          `json:"latestDateCovered"`
    EarliestDate    time.Time       `json:"-"`
    LatestDate      time.Time       `json:"-"`
}

DeletedRecords is the return structure listing the deleted records.

type Deleter Uses

type Deleter interface {
    SObject() string
    ID() string
}

Deleter provides the parameters needed to delete a record.

SObject is the Salesforce table name. An example would be Account or Custom__c.

ID is the Salesforce ID to be deleted.

type DescribeValue Uses

type DescribeValue struct {
    Activateable         bool                `json:"activateable"`
    CompactLayoutable    bool                `json:"compactLayoutable"`
    Createable           bool                `json:"createable"`
    Custom               bool                `json:"custom"`
    CustomSetting        bool                `json:"customSetting"`
    Deletable            bool                `json:"deletable"`
    DeprecatedAndHidden  bool                `json:"deprecatedAndHidden"`
    FeedEnabled          bool                `json:"feedEnabled"`
    HasSubtypes          bool                `json:"hasSubtypes"`
    IsSubType            bool                `json:"isSubtype"`
    Layoutable           bool                `json:"layoutable"`
    Mergeable            bool                `json:"mergeable"`
    MRUEnabled           bool                `json:"mruEnabled"`
    Queryable            bool                `json:"queryable"`
    Replicateable        bool                `json:"replicateable"`
    Retrieveable         bool                `json:"retrieveable"`
    SearchLayoutable     bool                `json:"searchLayoutable"`
    Searchable           bool                `json:"searchable"`
    Triggerable          bool                `json:"triggerable"`
    Undeletable          bool                `json:"undeletable"`
    Updateable           bool                `json:"updateable"`
    KeyPrefix            string              `json:"keyPrefix"`
    Label                string              `json:"label"`
    LabelPural           string              `json:"labelPlural"`
    Name                 string              `json:"name"`
    NetworkScopeFielName string              `json:"networkScopeFieldName"`
    Listviewable         interface{}         `json:"listviewable"`
    LookupLayoutable     interface{}         `json:"lookupLayoutable"`
    URLs                 ObjectURLs          `json:"urls"`
    ActionOverrides      []ActionOverride    `json:"actionOverrides"`
    ChildRelationships   []ChildRelationship `json:"childRelationships"`
    Fields               []Field             `json:"fields"`
    RecordTypeInfos      []RecordTypeInfo    `json:"recordTypeInfos"`
    SupportedScopes      []SupportedScope    `json:"supportedScopes"`
    NamedLayoutInfos     []interface{}       `json:"namedLayoutInfos"`
}

DescribeValue is a structure that is returned from the from the Salesforce API SObject describe.

type ExternalQuerier Uses

type ExternalQuerier interface {
    Querier
    ExternalField() string
}

ExternalQuerier is the interface used to query a SObject from Salesforce using an external ID.

SObject is the table object in Salesforce, like Account.

ID is the external ID of the table object to retrieve.

Fields is the fields to be returned. If the field array is empty, the all of the fields will be returned.

ExternalField is the external field on the sobject.

type Field Uses

type Field struct {
    Aggregatable                 bool            `json:"aggregatable"`
    AIPredictionField            bool            `json:"aiPredictionField"`
    AutoNumber                   bool            `json:"autoNumber"`
    Calculated                   bool            `json:"calculated"`
    CascadeDelete                bool            `json:"cascadeDelete"`
    CaseSensitive                bool            `json:"caseSensitive"`
    Createable                   bool            `json:"createable"`
    Custom                       bool            `json:"custom"`
    DefaultedOnCreate            bool            `json:"defaultedOnCreate"`
    DependentPicklist            bool            `json:"dependentPicklist"`
    DeprecatedAndHidden          bool            `json:"deprecatedAndHidden"`
    DisplayLocationInDecimal     bool            `json:"displayLocationInDecimal"`
    Encrypted                    bool            `json:"encrypted"`
    ExternalID                   bool            `json:"externalId"`
    Filterable                   bool            `json:"filterable"`
    FormulaTreatNullNumberAsZero bool            `json:"formulaTreatNullNumberAsZero"`
    Groupable                    bool            `json:"groupable"`
    HighScaleNumber              bool            `json:"highScaleNumber"`
    HTMLFormatted                bool            `json:"htmlFormatted"`
    IDLookup                     bool            `json:"idLookup"`
    NameField                    bool            `json:"nameField"`
    NamePointing                 bool            `json:"namePointing"`
    Nillable                     bool            `json:"nillable"`
    Permissionable               bool            `json:"permissionable"`
    PolymorphicForeignKey        bool            `json:"polymorphicForeignKey"`
    QueryByDistance              bool            `json:"queryByDistance"`
    RestrictedDelete             bool            `json:"restrictedDelete"`
    RestrictedPicklist           bool            `json:"restrictedPicklist"`
    SearchPrefilterable          bool            `json:"searchPrefilterable"`
    Sortable                     bool            `json:"sortable"`
    Unique                       bool            `json:"unique"`
    Updateable                   bool            `json:"updateable"`
    WriteRequiredMasterRead      bool            `json:"writeRequiresMasterRead"`
    Digits                       int             `json:"digits"`
    Length                       int             `json:"length"`
    Precision                    int             `json:"precision"`
    ByteLength                   int             `json:"byteLength"`
    Scale                        int             `json:"scale"`
    InlineHelpText               string          `json:"inlineHelpText"`
    Label                        string          `json:"label"`
    Name                         string          `json:"name"`
    RelationshipName             string          `json:"relationshipName"`
    Type                         string          `json:"type"`
    SoapType                     string          `json:"soapType"`
    CompoundFieldName            string          `json:"compoundFieldName"`
    ControllerName               string          `json:"controllerName"`
    ReferenceTargetField         string          `json:"referenceTargetField"`
    ReferenceTo                  []string        `json:"referenceTo"`
    CalculatedFormula            interface{}     `json:"calculatedFormula"`
    DefaultValue                 interface{}     `json:"defaultValue"`
    DefaultValueFormula          interface{}     `json:"defaultValueFormula"`
    ExtraTypeInfo                interface{}     `json:"extraTypeInfo"`
    FilteredLookupInfo           interface{}     `json:"filteredLookupInfo"`
    Mask                         interface{}     `json:"mask"`
    MaskType                     interface{}     `json:"maskType"`
    RelationshipOrder            interface{}     `json:"relationshipOrder"`
    PicklistValues               []PickListValue `json:"picklistValues"`
}

Field describes the SOBject's fields.

type InsertValue Uses

type InsertValue struct {
    Success bool         `json:"success"`
    ID      string       `json:"id"`
    Errors  []sfdc.Error `json:"errors"`
}

InsertValue is the value that is returned when a record is inserted into Salesforce.

type Inserter Uses

type Inserter interface {
    SObject() string
    Fields() map[string]interface{}
}

Inserter provides the parameters needed insert a record.

SObject is the Salesforce table name. An example would be Account or Custom__c.

Fields are the fields of the record that are to be inserted. It is the callers responsbility to provide value fields and values.

type MetadataValue Uses

type MetadataValue struct {
    ObjectDescribe ObjectDescribe           `json:"objectDescribe"`
    RecentItems    []map[string]interface{} `json:"recentItems"`
}

MetadataValue is the response from the SObject metadata API.

type ObjectDescribe Uses

type ObjectDescribe struct {
    Activatable         bool       `json:"activateable"`
    Creatable           bool       `json:"createable"`
    Custom              bool       `json:"custom"`
    CustomSetting       bool       `json:"customSetting"`
    Deletable           bool       `json:"deletable"`
    DeprecatedAndHidden bool       `json:"deprecatedAndHidden"`
    FeedEnabled         bool       `json:"feedEnabled"`
    HasSubtype          bool       `json:"hasSubtypes"`
    IsSubtype           bool       `json:"isSubtype"`
    KeyPrefix           string     `json:"keyPrefix"`
    Label               string     `json:"label"`
    LabelPlural         string     `json:"labelPlural"`
    Layoutable          bool       `json:"layoutable"`
    Mergeable           bool       `json:"mergeable"`
    MruEnabled          bool       `json:"mruEnabled"`
    Name                string     `json:"name"`
    Queryable           bool       `json:"queryable"`
    Replicateable       bool       `json:"replicateable"`
    Retrieveable        bool       `json:"retrieveable"`
    Searchable          bool       `json:"searchable"`
    Triggerable         bool       `json:"triggerable"`
    Undeletable         bool       `json:"undeletable"`
    Updateable          bool       `json:"updateable"`
    URLs                ObjectURLs `json:"urls"`
}

ObjectDescribe is the SObject metadata describe.

type ObjectURLs Uses

type ObjectURLs struct {
    CompactLayouts   string `json:"compactLayouts"`
    RowTemplate      string `json:"rowTemplate"`
    ApprovalLayouts  string `json:"approvalLayouts"`
    DefaultValues    string `json:"defaultValues"`
    ListViews        string `json:"listviews"`
    Describe         string `json:"describe"`
    QuickActions     string `json:"quickActions"`
    Layouts          string `json:"layouts"`
    SObject          string `json:"sobject"`
    UIDetailTemplate string `json:"uiDetailTemplate"`
    UIEditTemplate   string `json:"uiEditTemplate"`
    UINewRecord      string `json:"uiNewRecord"`
}

ObjectURLs is the URL for the SObject metadata.

type PickListValue Uses

type PickListValue struct {
    Active       bool   `json:"active"`
    DefaultValue bool   `json:"defaultValue"`
    Label        string `json:"label"`
    ValidFor     string `json:"validFor"`
    Value        string `json:"value"`
}

PickListValue describes the SObject's field picklist values.

type Querier Uses

type Querier interface {
    SObject() string
    ID() string
    Fields() []string
}

Querier is the interface used to query a SObject from Salesforce.

SObject is the table object in Salesforce, like Account.

ID is the Salesforce ID of the table object to retrieve.

Fields is the fields to be returned. If the field array is empty, the all of the fields will be returned.

type RecordTypeInfo Uses

type RecordTypeInfo struct {
    Active                   bool          `json:"active"`
    Available                bool          `json:"available"`
    DefaultRecordTypeMapping bool          `json:"defaultRecordTypeMapping"`
    Master                   bool          `json:"master"`
    Name                     string        `json:"name"`
    RecordTypeID             string        `json:"recordTypeId"`
    DeveloperName            string        `json:"developerName"`
    URLs                     RecordTypeURL `json:"urls"`
}

RecordTypeInfo describes the SObjects record types assocaited with it.

type RecordTypeURL Uses

type RecordTypeURL struct {
    Layout string `json:"layout"`
}

RecordTypeURL contains the record type's URLs.

type Resources Uses

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

Resources is the structure for the Salesforce APIs for SObjects.

func NewResources Uses

func NewResources(session session.ServiceFormatter) (*Resources, error)

NewResources forms the Salesforce SObject resource structure. The session formatter is required to form the proper URLs and authorization header.

func (*Resources) Delete Uses

func (r *Resources) Delete(deleter Deleter) error

Delete will delete an existing Salesforce record.

func (*Resources) DeletedRecords Uses

func (r *Resources) DeletedRecords(sobject string, startDate, endDate time.Time) (DeletedRecords, error)

DeletedRecords returns a list of records that have been deleted from a date range.

func (*Resources) Describe Uses

func (r *Resources) Describe(sobject string) (DescribeValue, error)

Describe retrieves the SObject's describe.

func (*Resources) ExternalQuery Uses

func (r *Resources) ExternalQuery(querier ExternalQuerier) (*sfdc.Record, error)

ExternalQuery returns a SObject record using an external ID field.

func (*Resources) GetContent Uses

func (r *Resources) GetContent(id string, content ContentType) ([]byte, error)

GetContent returns the blob from a content SObject.

func (*Resources) Insert Uses

func (r *Resources) Insert(inserter Inserter) (InsertValue, error)

Insert will create a new Salesforce record.

func (*Resources) Metadata Uses

func (r *Resources) Metadata(sobject string) (MetadataValue, error)

Metadata retrieves the SObject's metadata.

func (*Resources) Query Uses

func (r *Resources) Query(querier Querier) (*sfdc.Record, error)

Query returns a SObject record using the Salesforce ID.

func (*Resources) Update Uses

func (r *Resources) Update(updater Updater) error

Update will update an existing Salesforce record.

func (*Resources) UpdatedRecords Uses

func (r *Resources) UpdatedRecords(sobject string, startDate, endDate time.Time) (UpdatedRecords, error)

UpdatedRecords returns a list of records that have been updated from a date range.

func (*Resources) Upsert Uses

func (r *Resources) Upsert(upserter Upserter) (UpsertValue, error)

Upsert will upsert an existing or new Salesforce record.

type SupportedScope Uses

type SupportedScope struct {
    Label string `json:"label"`
    Name  string `json:"name"`
}

SupportedScope describes the supported scope.

type UpdatedRecords Uses

type UpdatedRecords struct {
    Records       []string  `json:"ids"`
    LatestDateStr string    `json:"latestDateCovered"`
    LatestDate    time.Time `json:"-"`
}

UpdatedRecords is the return structure listing the updated records.

type Updater Uses

type Updater interface {
    Inserter
    ID() string
}

Updater provides the parameters needed to update a record.

SObject is the Salesforce table name. An example would be Account or Custom__c.

ID is the Salesforce ID that will be updated.

Fields are the fields of the record that are to be inserted. It is the callers responsbility to provide value fields and values.

type UpsertValue Uses

type UpsertValue struct {
    Inserted bool
    InsertValue
}

UpsertValue is the value that is return when a record as been upserted into Salesforce.

Upsert will return two types of values, which are indicated by Inserted. If Inserted is true, then the InsertValue is popluted.

type Upserter Uses

type Upserter interface {
    Updater
    ExternalField() string
}

Upserter provides the parameters needed to upsert a record.

SObject is the Salesforce table name. An example would be Account or Custom__c.

ID is the External ID that will be updated.

ExternalField is the external ID field.

Fields are the fields of the record that are to be inserted. It is the callers responsbility to provide value fields and values.

Directories

PathSynopsis
collectionsPackage collections is the implementation of the SObject Collections API.
tree

Package sobject imports 12 packages (graph) and is imported by 2 packages. Updated 2019-05-11. Refresh now. Tools for package owners.