Documentation ¶
Index ¶
- type ActionOverride
- type ChildRelationship
- type ContentType
- type DeletedRecords
- type Deleter
- type DescribeValue
- type ExternalQuerier
- type Field
- type InsertValue
- type Inserter
- type ListValue
- type MetadataValue
- type ObjectDescribe
- type ObjectURLs
- type PickListValue
- type Querier
- type RecordTypeInfo
- type RecordTypeURL
- type Resources
- func (r *Resources) Delete(deleter Deleter) error
- func (r *Resources) DeletedRecords(sobject string, startDate, endDate time.Time) (DeletedRecords, error)
- func (r *Resources) Describe(sobject string) (DescribeValue, error)
- func (r *Resources) ExternalQuery(querier ExternalQuerier) (*sfdc.Record, error)
- func (r *Resources) GetContent(id string, content ContentType) ([]byte, error)
- func (r *Resources) Insert(inserter Inserter) (InsertValue, error)
- func (r *Resources) List() (ListValue, error)
- func (r *Resources) Metadata(sobject string) (MetadataValue, error)
- func (r *Resources) Query(querier Querier) (*sfdc.Record, error)
- func (r *Resources) Update(updater Updater) error
- func (r *Resources) UpdatedRecords(sobject string, startDate, endDate time.Time) (UpdatedRecords, error)
- func (r *Resources) Upsert(upserter Upserter) (UpsertValue, error)
- type SupportedScope
- type UpdatedRecords
- type Updater
- type UpsertValue
- type Upserter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionOverride ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 responsibility to provide value fields and values.
type ListValue ¶
type ListValue struct {
SObjects []DescribeValue `json:"sobjects"`
}
ListValue is a structure that is returned from Salesforce SObject list calls
type MetadataValue ¶
type MetadataValue struct { ObjectDescribe ObjectDescribe `json:"objectDescribe"` RecentItems []map[string]interface{} `json:"recentItems"` }
MetadataValue is the response from the SObject metadata API.
type ObjectDescribe ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
type RecordTypeURL struct {
Layout string `json:"layout"`
}
RecordTypeURL contains the record type's URLs.
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
Resources is the structure for the Salesforce APIs for SObjects.
func NewResources ¶
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) DeletedRecords ¶
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 ¶
func (r *Resources) Describe(sobject string) (DescribeValue, error)
Describe retrieves the SObject's describe.
func (*Resources) ExternalQuery ¶
func (r *Resources) ExternalQuery(querier ExternalQuerier) (*sfdc.Record, error)
ExternalQuery returns a SObject record using an external ID field.
func (*Resources) GetContent ¶
func (r *Resources) GetContent(id string, content ContentType) ([]byte, error)
GetContent returns the blob from a content SObject.
func (*Resources) Insert ¶
func (r *Resources) Insert(inserter Inserter) (InsertValue, error)
Insert will create a new Salesforce record.
func (*Resources) Metadata ¶
func (r *Resources) Metadata(sobject string) (MetadataValue, error)
Metadata retrieves the SObject's metadata.
func (*Resources) UpdatedRecords ¶
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.
type SupportedScope ¶
SupportedScope describes the supported scope.
type UpdatedRecords ¶
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 ¶
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 responsibility to provide value fields and values.
type UpsertValue ¶
type UpsertValue struct { Created bool `json:"created"` 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 Created is true, then the InsertValue is populated.
type Upserter ¶
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 responsibility to provide value fields and values.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package collections is the implementation of the SObject Collections API.
|
Package collections is the implementation of the SObject Collections API. |