lib

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 32 Imported by: 5

Documentation

Index

Constants

View Source
const (
	EndpointProduction = iota
	EndpointTest       = iota
	EndpointPrerelease = iota
	EndpointMobile1    = iota
	EndpointCustom     = iota
)
View Source
const (
	RefreshUnavailable = iota
	RefreshOauth       = iota
	RefreshSFDX        = iota
)

Variables

View Source
var (
	ClientId    = "3MVG9ytVT1SanXDnX_hOa9Ys5NxVp5C26JlyQjwr.xTJtUqoKonXY.M8CcjoEknMrV4YUvPvXLiMyzI.Aw23C"
	RedirectUri = "http://localhost:3835/oauth/callback"
)
View Source
var APIDisabledForUser = errors.New("API disabled for user")
View Source
var APILimitExceededError = errors.New("API limit exceeded")
View Source
var BatchInfoTemplate = `
Id 			%s
JobId 			%s
State 			%s
CreatedDate 		%s
SystemModstamp 		%s
NumberRecordsProcessed  %d
`
View Source
var ClassNotFoundError = errors.New("class not found")
View Source
var CustomEndpoint = ``
View Source
var (
	DefaultApiVersionNumber = "45.0"
)
View Source
var DevHubOrgRequiredError = errors.New("Org must be a Dev Hub")
View Source
var InvalidBulkObject = errors.New("Object Does Not Support Bulk API")
View Source
var MetricsNotFoundError = errors.New("metrics not found")
View Source
var SessionExpiredError = errors.New("Session expired")
View Source
var SessionRefreshError = errors.New("Failed to refresh session.  Please run `force login`.")
View Source
var SessionRefreshUnavailable = errors.New("Unable to refresh.  Please run `force login`.")
View Source
var Timeout int64 = 0
View Source
var Version = "dev"

Functions

func ActiveLogin

func ActiveLogin() (account string, err error)

func ApiVersion

func ApiVersion() string

func ApiVersionNumber

func ApiVersionNumber() string

func DeployPackage

func DeployPackage(resourcepaths []string, opts *ForceDeployOptions)

Deploy a previously create package. This is used for "force push package". In this case the --path flag should be pointing to a zip file that may or may not have come from a different org altogether

func DisplayAutonumberFieldDetails

func DisplayAutonumberFieldDetails() (message string)

func DisplayBatchInfo

func DisplayBatchInfo(batchInfo BatchInfo, w io.Writer)

func DisplayBatchList

func DisplayBatchList(batchInfos []BatchInfo)

func DisplayCheckboxFieldDetails

func DisplayCheckboxFieldDetails() (message string)

func DisplayCurrencyFieldDetails

func DisplayCurrencyFieldDetails() (message string)

func DisplayDatetimeFieldDetails

func DisplayDatetimeFieldDetails() (message string)

func DisplayDoubleFieldDetails

func DisplayDoubleFieldDetails() (message string)

func DisplayFieldDetails

func DisplayFieldDetails(fieldType string)

func DisplayFieldTypes

func DisplayFieldTypes()

func DisplayForceRecord

func DisplayForceRecord(record ForceRecord)

func DisplayForceRecords

func DisplayForceRecords(result ForceQueryResult)

func DisplayForceRecordsf

func DisplayForceRecordsf(records <-chan ForceRecord, format string, done chan<- bool)

func DisplayForceSobject

func DisplayForceSobject(sobject ForceSobject)

func DisplayForceSobjectDescribe

func DisplayForceSobjectDescribe(sobject string)

func DisplayForceSobjects

func DisplayForceSobjects(sobjects []ForceSobject)

func DisplayForceSobjectsJson

func DisplayForceSobjectsJson(sobjects []ForceSobject)

func DisplayGeolocationFieldDetails

func DisplayGeolocationFieldDetails() (message string)

func DisplayInterfaceMap

func DisplayInterfaceMap(object map[string]interface{}, indent int)

func DisplayJobInfo

func DisplayJobInfo(jobInfo JobInfo, w io.Writer)

func DisplayListMetadataResponse

func DisplayListMetadataResponse(resp ListMetadataResponse)

func DisplayListMetadataResponseJson

func DisplayListMetadataResponseJson(resp ListMetadataResponse)

func DisplayLongTextAreaFieldDetails

func DisplayLongTextAreaFieldDetails() (message string)

func DisplayLookupFieldDetails

func DisplayLookupFieldDetails() (message string)

func DisplayMasterDetailFieldDetails

func DisplayMasterDetailFieldDetails() (message string)

func DisplayMetadataList

func DisplayMetadataList(metadataObjects []DescribeMetadataObject)

func DisplayMetadataListJson

func DisplayMetadataListJson(metadataObjects []DescribeMetadataObject)

func DisplayPicklistFieldDetails

func DisplayPicklistFieldDetails() (message string)

func DisplayRichTextAreaFieldDetails

func DisplayRichTextAreaFieldDetails() (message string)

func DisplayTextAreaFieldDetails

func DisplayTextAreaFieldDetails() (message string)

func DisplayTextFieldDetails

func DisplayTextFieldDetails() (message string)

func ForceLoginAndSave

func ForceLoginAndSave(endpoint ForceEndpoint, output *os.File) (username string, err error)

func ForceLoginAndSaveJWT added in v0.24.0

func ForceLoginAndSaveJWT(endpoint ForceEndpoint, assertion string, output *os.File) (username string, err error)

func ForceLoginAndSaveSoap

func ForceLoginAndSaveSoap(endpoint ForceEndpoint, user_name string, password string, output *os.File) (username string, err error)

func ForceLoginAtEndpointAndSave added in v0.26.5

func ForceLoginAtEndpointAndSave(endpoint string, output *os.File) (username string, err error)

func ForceLoginAtEndpointAndSaveJWT added in v0.26.5

func ForceLoginAtEndpointAndSaveJWT(endpoint string, assertion string, output *os.File) (username string, err error)

func ForceLoginAtEndpointAndSaveSoap added in v0.26.5

func ForceLoginAtEndpointAndSaveSoap(endpoint string, user_name string, password string, output *os.File) (username string, err error)

func ForceSaveLogin

func ForceSaveLogin(creds ForceSession, output *os.File) (sessionName string, err error)

Save the credentials as the active session with the UserInfo and with the default current API version.

func ForceScratchLoginAndSave added in v0.27.0

func ForceScratchLoginAndSave(output *os.File) (username string, err error)

Create a new scratch org, login, and make it active

func JwtAssertion added in v0.24.0

func JwtAssertion(endpoint ForceEndpoint, username string, keyfile string, clientId string) (signedToken string, err error)

func JwtAssertionForEndpoint added in v0.26.5

func JwtAssertionForEndpoint(endpoint string, username string, keyfile string, clientId string) (signedToken string, err error)

func MetaPathToSourcePath

func MetaPathToSourcePath(mpath string) (spath string)

Returns the source file path for a given metadata file path.

func PushByPaths

func PushByPaths(fpaths []string, byName bool, namePaths map[string]string, opts *ForceDeployOptions)

Creates a package that includes everything in the passed in string slice and then deploys the package to salesforce

func RenderForceRecords

func RenderForceRecords(records []ForceRecord) string

func RenderForceRecordsCSV

func RenderForceRecordsCSV(records <-chan ForceRecord, done chan<- bool)

func SaveLogin added in v0.22.79

func SaveLogin(creds ForceSession) (err error)

func SetActiveLogin

func SetActiveLogin(account string) (err error)

func SetActiveLoginDefault

func SetActiveLoginDefault() (account string)

func SetApiVersion

func SetApiVersion(version string)

func StringSliceContains

func StringSliceContains(slice []string, value string) bool

returns true if a slice contains given string

func StringSlicePos

func StringSlicePos(slice []string, value string) int

returns first index of a given string

func StringSliceToInterfaceSlice

func StringSliceToInterfaceSlice(s []string) (i []interface{})

func UseSFDXSession added in v0.22.79

func UseSFDXSession(authData SFDXAuth)

func ValidateOptionsAndDefaults

func ValidateOptionsAndDefaults(typ string, fields map[string]reflect.StructField, requiredDefaults reflect.Value, options map[string]string) (newOptions map[string]string, err error)

Types

type AuraDefinition

type AuraDefinition struct {
	Id                     string
	IsDeleted              bool
	CreatedDate            string
	CreatedById            string
	LastModifiedDate       string
	LastModifiedById       string
	SystemModstamp         string
	AuraDefinitionBundleId string
	DefType                string
	Format                 string
	Source                 string
}

type AuraDefinitionBundle

type AuraDefinitionBundle struct {
	Id               string
	IsDeleted        bool
	DeveloperName    string
	Language         string
	MasterLabel      string
	NamespacePrefix  string
	CreatedDate      string
	CreatedById      string
	LastModifiedDate string
	LastModifiedById string
	SystemModstamp   string
	ApiVersion       int
	Description      string
}

type AuraDefinitionBundleResult

type AuraDefinitionBundleResult struct {
	Done           bool
	Records        []ForceRecord
	TotalSize      int
	QueryLocator   string
	Size           int
	EntityTypeName string
	NextRecordsUrl string
}

type AuthCodeSession added in v0.27.0

type AuthCodeSession struct {
	ForceSession
	RefreshToken string `json:"refresh_token"`
}

type AutoNumberField

type AutoNumberField struct {
	Label          string `xml:"label"`
	StartingNumber int    `xml:"startingNumber"`
	DisplayFormat  string `xml:"displayFormat"`
	Description    string `xml:"description"`
	HelpText       string `xml:"helpText"`
	ExternalId     bool   `xml:"externalId"`
}

type AutoNumberFieldRequired

type AutoNumberFieldRequired struct {
	StartingNumber int    `xml:"startingNumber"`
	DisplayFormat  string `xml:"displayFormat"`
}

type BatchInfo

type BatchInfo struct {
	Id                     string `xml:"id" json:"id"`
	JobId                  string `xml:"jobId" json:"jobId"`
	State                  string `xml:"state" json:"state"`
	StateMessage           string `xml:"stateMessage" json:"stateMessage"`
	CreatedDate            string `xml:"createdDate" json:"createdDate"`
	SystemModstamp         string `xml:"systemModstamp" json:"systemModstamp"`
	NumberRecordsProcessed int    `xml:"numberRecordsProcessed" json:"numberRecordsProcessed"`
	NumberRecordsFailed    int    `xml:"numberRecordsFailed" json:"numberRecordsFailed"`
}

type BatchResult

type BatchResult struct {
	Results []Result
}

type BatchResultChunk added in v0.26.1

type BatchResultChunk struct {
	HasCSVHeader bool
	Data         []byte
}

type BigObject

type BigObject struct {
	DeploymentStatus string
	Label            string
	PluralLabel      string
	Fields           []BigObjectField
}

func (*BigObject) ToXml

func (bo *BigObject) ToXml() string

type BigObjectField

type BigObjectField struct {
	FullName         string
	Label            string
	Length           int
	ReferenceTo      string
	RelationshipName string
	Type             string
}

type BoolField

type BoolField struct {
	Label                string `xml:"label"`
	Description          string `xml:"description"`
	HelpText             string `xml:"helpText"`
	DefaultValue         bool   `xml:"defaultValue"`
	Formula              string `xml:"formula"`
	FormulaTreatBlanksAs string `xml:"formulaTreatBlanksAs"`
}

type BoolFieldRequired

type BoolFieldRequired struct {
	DefaultValue bool `xml:"defaultValue"`
}

type BundleManifest

type BundleManifest struct {
	Name  string
	Id    string
	Files []ComponentFile
}

type ByFullName

type ByFullName []MDFileProperties

func (ByFullName) Len

func (a ByFullName) Len() int

func (ByFullName) Less

func (a ByFullName) Less(i, j int) bool

func (ByFullName) Swap

func (a ByFullName) Swap(i, j int)

type ByXmlName

type ByXmlName []DescribeMetadataObject

func (ByXmlName) Len

func (a ByXmlName) Len() int

func (ByXmlName) Less

func (a ByXmlName) Less(i, j int) bool

func (ByXmlName) Swap

func (a ByXmlName) Swap(i, j int)

type CodeCoverageWarning

type CodeCoverageWarning struct {
	Name    string `xml:"name"`
	Message string `xml:"message"`
}

type ComponentDetails

type ComponentDetails struct {
	ComponentSuccesses []ComponentSuccess `xml:"componentSuccesses"`
	ComponentFailures  []ComponentFailure `xml:"componentFailures"`
	RunTestResult      RunTestResult      `xml:"runTestResult"`
}

type ComponentFailure

type ComponentFailure struct {
	Changed     bool   `xml:"changed"`
	Created     bool   `xml:"created"`
	Deleted     bool   `xml:"deleted"`
	FileName    string `xml:"fileName"`
	FullName    string `xml:"fullName"`
	LineNumber  int    `xml:"lineNumber"`
	Problem     string `xml:"problem"`
	ProblemType string `xml:"problemType"`
	Success     bool   `xml:"success"`
}

type ComponentFile

type ComponentFile struct {
	FileName    string
	ComponentId string
}

type ComponentSuccess

type ComponentSuccess struct {
	Changed  bool   `xml:"changed"`
	Created  bool   `xml:"created"`
	Deleted  bool   `xml:"deleted"`
	FileName string `xml:"fileName"`
	FullName string `xml:"fullName"`
	Id       string `xml:"id"`
	Success  bool   `xml:"success"`
}

type ContentType added in v0.30.0

type ContentType string
const (
	ContentTypeNone ContentType = ""
	ContentTypeJson ContentType = "application/json"
	ContentTypeXml  ContentType = "application/xml"
	ContentTypeCsv  ContentType = "text/csv"
)

type DatetimeField

type DatetimeField struct {
	Label                string    `xml:"label"`
	Description          string    `xml:"description"`
	HelpText             string    `xml:"helpText"`
	DefaultValue         time.Time `xml:"defaultValue"`
	Required             bool      `xml:"required"`
	Formula              string    `xml:"formula"`
	FormulaTreatBlanksAs string    `xml:"formulaTreatBlanksAs"`
}

type DatetimeFieldRequired

type DatetimeFieldRequired struct {
}

type DescribeMetadataObject

type DescribeMetadataObject struct {
	ChildXmlNames []string `xml:"childXmlNames"`
	DirectoryName string   `xml:"directoryName"`
	InFolder      bool     `xml:"inFolder"`
	MetaFile      bool     `xml:"metaFile"`
	Suffix        string   `xml:"suffix"`
	XmlName       string   `xml:"xmlName"`
}

type EmailField

type EmailField struct {
	Label string `xml:"label"`
}

type EmailFieldRequired

type EmailFieldRequired struct {
}

type EncryptedField

type EncryptedField struct {
	Label       string `xml:"label"`
	Name        string `xml:"fullName"`
	Required    bool   `xml:"required"`
	Length      int    `xml:"length"`
	Description string `xml:"description"`
	HelpText    string `xml:"helpText"`
	MaskType    string `xml:"maskType"`
	MaskChar    string `xml:"maskChar"`
}

type EncryptedFieldRequired

type EncryptedFieldRequired struct {
	Length   int    `xml:"length"`
	MaskType string `xml:"maskType"`
	MaskChar string `xml:"maskChar"`
}

type FieldName

type FieldName struct {
	FieldName string
	IsObject  bool
}

type FloatField

type FloatField struct {
	Label                string `xml:"label"`
	Description          string `xml:"description"`
	HelpText             string `xml:"helpText"`
	Unique               bool   `xml:"unique"`
	ExternalId           bool   `xml:"externalId"`
	DefaultValue         uint   `xml:"defaultValue"`
	Precision            int    `xml:"precision"`
	Scale                int    `xml:"scale"`
	Formula              string `xml:"formula"`
	FormulaTreatBlanksAs string `xml:"formulaTreatBlanksAs"`
}

type FloatFieldRequired

type FloatFieldRequired struct {
	Precision int `xml:"precision"`
	Scale     int `xml:"scale"`
}

type FolderId added in v0.22.84

type FolderId string

type FolderName added in v0.22.84

type FolderName string

type FolderType added in v0.22.84

type FolderType string

type FolderedMetadata added in v0.22.84

type FolderedMetadata map[FolderType]Folders

type Folders added in v0.22.84

type Folders map[FolderId]FolderName

type Force

type Force struct {
	Credentials *ForceSession
	Metadata    *ForceMetadata
	Partner     *ForcePartner
}

func ActiveForce

func ActiveForce() (force *Force, err error)

func GetForce added in v0.24.0

func GetForce(accountName string) (force *Force, err error)

func NewForce

func NewForce(creds *ForceSession) (force *Force)

func (*Force) AddBatchToJob

func (f *Force) AddBatchToJob(content string, job JobInfo) (BatchInfo, error)

func (*Force) BulkQuery

func (f *Force) BulkQuery(soql string, jobId string, contentType string, requestOptions ...func(*http.Request)) (BatchInfo, error)

func (*Force) ChangePassword

func (f *Force) ChangePassword(id string, attrs map[string]string) (result string, err error, emessages []ForceError)

func (*Force) CloseBulkJob

func (f *Force) CloseBulkJob(jobId string) (JobInfo, error)

func (*Force) CopyCredentialAuthFields added in v0.33.0

func (f *Force) CopyCredentialAuthFields(creds *ForceSession)

CopyCredentialAuthFields copies auth fields from creds into the receiver's Credentials.

func (*Force) CreateAuraBundle

func (f *Force) CreateAuraBundle(bundleName string) (result ForceCreateRecordResult, err error, emessages []ForceError)

func (*Force) CreateAuraComponent

func (f *Force) CreateAuraComponent(attrs map[string]string) (result ForceCreateRecordResult, err error, emessages []ForceError)

func (*Force) CreateBulkJob

func (f *Force) CreateBulkJob(jobInfo JobInfo, requestOptions ...func(*http.Request)) (JobInfo, error)

func (*Force) CreateDataPipeline

func (f *Force) CreateDataPipeline(name string, masterLabel string, apiVersionNumber string, scriptContent string, scriptType string) (result ForceCreateRecordResult, err error, emessages []ForceError)

func (*Force) CreateDataPipelineJob

func (f *Force) CreateDataPipelineJob(id string) (result ForceCreateRecordResult, err error, emessages []ForceError)

func (*Force) CreateRecord

func (f *Force) CreateRecord(sobject string, attrs map[string]string) (id string, err error, emessages []ForceError)

func (*Force) CreateScratchOrg added in v0.27.0

func (f *Force) CreateScratchOrg() (id string, err error)

Create a new Scratch Org from a Dev Hub Org

func (*Force) CreateToolingRecord

func (f *Force) CreateToolingRecord(objecttype string, attrs map[string]string) (result ForceCreateRecordResult, err error)

func (*Force) DefaultDebugLevel

func (f *Force) DefaultDebugLevel() (id string, err error, emessages []ForceError)

func (*Force) DeleteDataPipeline

func (f *Force) DeleteDataPipeline(id string) (err error)

func (*Force) DeleteRecord

func (f *Force) DeleteRecord(sobject string, id string) (err error)

func (*Force) DeleteToolingRecord

func (f *Force) DeleteToolingRecord(objecttype string, id string) (err error)

func (*Force) DescribeSObject

func (f *Force) DescribeSObject(objecttype string) (result string, err error)

func (*Force) DisplayAllForceRecords added in v0.22.79

func (f *Force) DisplayAllForceRecords(result ForceQueryResult)

func (*Force) DisplayAllForceRecordsf added in v0.23.2

func (f *Force) DisplayAllForceRecordsf(result ForceQueryResult, format string)

func (*Force) ExecuteRequest added in v0.31.0

func (f *Force) ExecuteRequest(r *Request) (*Response, error)

ExecuteRequest executes an HTTP request based on Request, processes the HTTP response in the configured way, and returns the Response.

ExecuteRequest will retry once on a SessionExpired error (future versions may allow configurable retry behavior).

func (*Force) ForceLoginNewScratch added in v0.27.0

func (f *Force) ForceLoginNewScratch(scratchOrgId string) (session ForceSession, err error)

Log into a Scratch Org

func (*Force) Get

func (f *Force) Get(url string) (object ForceRecord, err error)

func (*Force) GetAbsolute added in v0.23.0

func (f *Force) GetAbsolute(url string) (string, error)

func (*Force) GetAbsoluteBytes added in v0.26.3

func (f *Force) GetAbsoluteBytes(url string) (result []byte, err error)

func (*Force) GetAllFolders added in v0.22.84

func (force *Force) GetAllFolders() (folders FolderedMetadata, err error)

func (*Force) GetAuraBundle

func (f *Force) GetAuraBundle(bundleName string) (bundles AuraDefinitionBundleResult, definitions AuraDefinitionBundleResult, err error)

func (*Force) GetAuraBundleByName

func (f *Force) GetAuraBundleByName(bundleName string) (bundles AuraDefinitionBundleResult, err error)

func (*Force) GetAuraBundleDefinition

func (f *Force) GetAuraBundleDefinition(id string) (definitions AuraDefinitionBundleResult, err error)

func (*Force) GetAuraBundleDefinitions

func (f *Force) GetAuraBundleDefinitions() (definitions AuraDefinitionBundleResult, err error)

func (*Force) GetAuraBundles

func (f *Force) GetAuraBundles() (bundles AuraDefinitionBundleResult, definitions AuraDefinitionBundleResult, err error)

func (*Force) GetAuraBundlesList

func (f *Force) GetAuraBundlesList() (bundles AuraDefinitionBundleResult, err error)

func (*Force) GetBatchInfo

func (f *Force) GetBatchInfo(jobId string, batchId string) (BatchInfo, error)

func (*Force) GetBatches

func (f *Force) GetBatches(jobId string) (result []BatchInfo, err error)

func (*Force) GetBulkJobs

func (f *Force) GetBulkJobs() ([]JobInfo, error)

func (*Force) GetCodeCoverage

func (f *Force) GetCodeCoverage(classId string, className string) (err error)

func (*Force) GetCredentials added in v0.28.0

func (force *Force) GetCredentials() *ForceSession

func (*Force) GetDataPipeline

func (f *Force) GetDataPipeline(name string) (results ForceQueryResult, err error)

func (*Force) GetJobInfo

func (f *Force) GetJobInfo(jobId string) (JobInfo, error)

func (*Force) GetLimits

func (f *Force) GetLimits() (result map[string]ForceLimit, err error)

func (*Force) GetMetadata added in v0.28.0

func (force *Force) GetMetadata() *ForceMetadata

func (*Force) GetMetadataInFolders added in v0.22.84

func (force *Force) GetMetadataInFolders(metadataType FolderType, folders Folders) (metadataItems []string, err error)

func (*Force) GetMoreAuraBundleDefinitions

func (f *Force) GetMoreAuraBundleDefinitions(definitions *AuraDefinitionBundleResult) (err error)

func (*Force) GetPartner added in v0.28.0

func (force *Force) GetPartner() *ForcePartner

func (*Force) GetPasswordStatus

func (f *Force) GetPasswordStatus(id string) (result ForcePasswordStatusResult, err error)

func (*Force) GetREST

func (f *Force) GetREST(url string) (result string, err error)

func (*Force) GetRecord

func (f *Force) GetRecord(sobject, id string) (object ForceRecord, err error)

func (*Force) GetSobject

func (f *Force) GetSobject(name string) (sobject ForceSobject, err error)

func (*Force) ListSobjects

func (f *Force) ListSobjects() (sobjects []ForceSobject, err error)

func (*Force) PatchAbsolute added in v0.23.0

func (f *Force) PatchAbsolute(url string, content string) (result string, err error)

func (*Force) PatchREST

func (f *Force) PatchREST(url string, content string) (result string, err error)

func (*Force) PostAbsolute added in v0.23.0

func (f *Force) PostAbsolute(url string, content string) (string, error)

func (*Force) PostPatchAbsolute added in v0.23.0

func (f *Force) PostPatchAbsolute(url string, content string, method string) (result string, err error)

func (*Force) PostPatchREST

func (f *Force) PostPatchREST(url string, content string, method string) (result string, err error)

func (*Force) PostREST

func (f *Force) PostREST(url string, content string) (result string, err error)

func (*Force) Query

func (f *Force) Query(qs string, options ...func(*QueryOptions)) (ForceQueryResult, error)

func (*Force) QueryAndSend added in v0.23.0

func (f *Force) QueryAndSend(qs string, processor chan<- ForceRecord, options ...func(*QueryOptions)) error

func (*Force) QueryDataPipeline

func (f *Force) QueryDataPipeline(soql string) (results ForceQueryResult, err error)

func (*Force) QueryDataPipelineJob

func (f *Force) QueryDataPipelineJob(soql string) (results ForceQueryResult, err error)

func (*Force) QueryDefaultDebugLevel

func (f *Force) QueryDefaultDebugLevel() (id string, err error)

func (*Force) QueryEventLogFiles

func (f *Force) QueryEventLogFiles() (results ForceQueryResult, err error)

func (*Force) QueryLogs

func (f *Force) QueryLogs() (results ForceQueryResult, err error)

func (*Force) QueryOptions added in v0.28.0

func (f *Force) QueryOptions() []query.Option

func (*Force) QueryProfile

func (f *Force) QueryProfile(fields ...string) (results ForceQueryResult, err error)

func (*Force) QueryTraceFlags

func (f *Force) QueryTraceFlags() (results ForceQueryResult, err error)

func (*Force) RefreshSession

func (f *Force) RefreshSession() error

func (*Force) RefreshSessionOrExit added in v0.22.79

func (f *Force) RefreshSessionOrExit()

func (*Force) ResetPassword

func (f *Force) ResetPassword(id string) (result ForcePasswordResetResult, err error)

func (*Force) RetrieveBulkBatchResults

func (f *Force) RetrieveBulkBatchResults(jobId string, batchId string) (BatchResult, error)

func (*Force) RetrieveBulkJobQueryResults added in v0.24.0

func (f *Force) RetrieveBulkJobQueryResults(job JobInfo, batchId string, resultId string) ([]byte, error)

func (*Force) RetrieveBulkJobQueryResultsAndSend deprecated added in v0.26.1

func (f *Force) RetrieveBulkJobQueryResultsAndSend(job JobInfo, batchId string, resultId string, results chan<- BatchResultChunk) error

Deprecated: Use RetrieveBulkJobQueryResultsWithCallback

func (*Force) RetrieveBulkJobQueryResultsWithCallback added in v0.30.0

func (f *Force) RetrieveBulkJobQueryResultsWithCallback(job JobInfo, batchId string, resultId string, callback HttpCallback) error

func (*Force) RetrieveBulkQuery

func (f *Force) RetrieveBulkQuery(jobId string, batchId string) ([]byte, error)

func (*Force) RetrieveBulkQueryResultList added in v0.24.0

func (f *Force) RetrieveBulkQueryResultList(job JobInfo, batchId string) ([]byte, error)

func (*Force) RetrieveBulkQueryResults

func (f *Force) RetrieveBulkQueryResults(jobId string, batchId string, resultId string) ([]byte, error)

func (*Force) RetrieveEventLogFile

func (f *Force) RetrieveEventLogFile(elfId string) (result string, err error)

func (*Force) RetrieveLog

func (f *Force) RetrieveLog(logId string) (result string, err error)

func (*Force) SetFLS

func (f *Force) SetFLS(profileId string, objectName string, fieldName string)

func (*Force) StartTrace

func (f *Force) StartTrace(userId ...string) (result ForceCreateRecordResult, err error, emessages []ForceError)

func (*Force) UpdateApiVersion added in v0.22.79

func (f *Force) UpdateApiVersion(version string) (err error)

func (*Force) UpdateAuraComponent

func (f *Force) UpdateAuraComponent(source map[string]string, id string) (err error)

func (*Force) UpdateCredentials

func (f *Force) UpdateCredentials(creds ForceSession)

UpdateCredentials calls CopyCredentialAuthFields and persists the new credentials in config.

func (*Force) UpdateDataPipeline

func (f *Force) UpdateDataPipeline(id string, masterLabel string, scriptContent string) (err error)

func (*Force) UpdateRecord

func (f *Force) UpdateRecord(sobject string, id string, attrs map[string]string) (err error)

func (*Force) Whoami

func (f *Force) Whoami() (me ForceRecord, err error)

type ForceCheckDeploymentStatusResult

type ForceCheckDeploymentStatusResult struct {
	CheckOnly                bool             `xml:"checkOnly"`
	CompletedDate            time.Time        `xml:"completedDate"`
	CreatedDate              time.Time        `xml:"createdDate"`
	Details                  ComponentDetails `xml:"details"`
	Done                     bool             `xml:"done"`
	Id                       string           `xml:"id"`
	ErrorMessage             string           `xml:"errorMessage"`
	ErrorStatusCode          string           `xml:"errorStatusCode"`
	NumberComponentErrors    int              `xml:"numberComponentErrors"`
	NumberComponentsDeployed int              `xml:"numberComponentsDeployed"`
	NumberComponentsTotal    int              `xml:"numberComponentsTotal"`
	NumberTestErrors         int              `xml:"numberTestErrors"`
	NumberTestsCompleted     int              `xml:"numberTestsCompleted"`
	NumberTestsTotal         int              `xml:"numberTestsTotal"`
	RollbackOnError          bool             `xml:"rollbackOnError"`
	Status                   string           `xml:"status"`
	StateDetail              string           `xml:"stateDetail"`
	Success                  bool             `xml:"success"`
}

func (ForceCheckDeploymentStatusResult) String added in v0.23.0

func (results ForceCheckDeploymentStatusResult) String() string

type ForceConnectedApp

type ForceConnectedApp struct {
	Name string `xml:"fullName"`
	Id   string `xml:"id"`
	Type string `xml:"type"`
}

type ForceConnectedApps

type ForceConnectedApps []ForceConnectedApp

func (ForceConnectedApps) Len

func (apps ForceConnectedApps) Len() int

func (ForceConnectedApps) Less

func (apps ForceConnectedApps) Less(i, j int) bool

func (ForceConnectedApps) Swap

func (apps ForceConnectedApps) Swap(i, j int)

type ForceCreateRecordResult

type ForceCreateRecordResult struct {
	Errors  []string
	Id      string
	Success bool
}

type ForceDeployOptions

type ForceDeployOptions struct {
	XMLName           xml.Name `xml:"deployOptions"`
	AllowMissingFiles bool     `xml:"allowMissingFiles"`
	AutoUpdatePackage bool     `xml:"autoUpdatePackage"`
	CheckOnly         bool     `xml:"checkOnly"`
	IgnoreWarnings    bool     `xml:"ignoreWarnings"`
	PerformRetrieve   bool     `xml:"performRetrieve"`
	PurgeOnDelete     bool     `xml:"purgeOnDelete"`
	RollbackOnError   bool     `xml:"rollbackOnError"`
	TestLevel         string   `xml:"testLevel,omitempty"`
	RunTests          []string `xml:"runTests"`
	SinglePackage     bool     `xml:"singlePackage"`
}

type ForceEndpoint

type ForceEndpoint int

type ForceError

type ForceError struct {
	Message   string
	ErrorCode string
}

type ForceErrors added in v0.32.0

type ForceErrors []ForceError

func (ForceErrors) Error added in v0.32.0

func (fs ForceErrors) Error() string

type ForceLimit

type ForceLimit struct {
	Name      string
	Remaining int64
	Max       int64
}

type ForceLimits

type ForceLimits map[string]ForceLimit

type ForceMetadata

type ForceMetadata struct {
	ApiVersion string
	Force      *Force
}

func NewForceMetadata

func NewForceMetadata(force *Force) (fm *ForceMetadata)

func (*ForceMetadata) CheckDeployStatus

func (fm *ForceMetadata) CheckDeployStatus(id string) (results ForceCheckDeploymentStatusResult, err error)

func (*ForceMetadata) CheckRetrieveStatus

func (fm *ForceMetadata) CheckRetrieveStatus(id string) (files ForceMetadataFiles, problems []string, err error)

func (*ForceMetadata) CheckStatus

func (fm *ForceMetadata) CheckStatus(id string) error

func (*ForceMetadata) CreateBigObject

func (fm *ForceMetadata) CreateBigObject(object BigObject) (err error)

func (*ForceMetadata) CreateConnectedApp

func (fm *ForceMetadata) CreateConnectedApp(name, callback string) (err error)

func (*ForceMetadata) CreateCustomField

func (fm *ForceMetadata) CreateCustomField(object, field, typ string, options map[string]string) (err error)

func (*ForceMetadata) CreateCustomObject

func (fm *ForceMetadata) CreateCustomObject(object string) (err error)

func (*ForceMetadata) DeleteCustomField

func (fm *ForceMetadata) DeleteCustomField(object, field string) (err error)

func (*ForceMetadata) DeleteCustomObject

func (fm *ForceMetadata) DeleteCustomObject(object string) (err error)

func (*ForceMetadata) Deploy

func (*ForceMetadata) DeployRecentValidation added in v0.24.2

func (fm *ForceMetadata) DeployRecentValidation(validationId string) (results ForceCheckDeploymentStatusResult, err error)

func (*ForceMetadata) DeployWithTempFile

func (fm *ForceMetadata) DeployWithTempFile(soap string, filename string)

func (*ForceMetadata) DeployZipFile

func (fm *ForceMetadata) DeployZipFile(soap string, zipfile []byte) (results ForceCheckDeploymentStatusResult, err error)

func (*ForceMetadata) DescribeMetadata

func (fm *ForceMetadata) DescribeMetadata() (describe MetadataDescribeResult, err error)

func (*ForceMetadata) GetFLSUpdateXML

func (fm *ForceMetadata) GetFLSUpdateXML(objectName string, fieldName string) (result string)

func (*ForceMetadata) GetStatus added in v0.26.7

func (fm *ForceMetadata) GetStatus(id string) (status MetadataDeployStatus, err error)

func (*ForceMetadata) InstallPackage added in v0.24.2

func (fm *ForceMetadata) InstallPackage(namespace, version, password string) (err error)

func (*ForceMetadata) InstallPackageByNamespaceAndVersion added in v0.26.7

func (fm *ForceMetadata) InstallPackageByNamespaceAndVersion(namespace, version, password string, activateRemoteSiteSettings bool) (id string, err error)

func (*ForceMetadata) InstallPackageWithRSS added in v0.25.0

func (fm *ForceMetadata) InstallPackageWithRSS(namespace, version, password string, activateRemoteSiteSettings bool) (err error)

func (*ForceMetadata) ListAllMetadata

func (fm *ForceMetadata) ListAllMetadata() (describe MetadataDescribeResult, err error)

func (*ForceMetadata) ListConnectedApps

func (fm *ForceMetadata) ListConnectedApps() (apps ForceConnectedApps, err error)

func (*ForceMetadata) ListMetadata

func (fm *ForceMetadata) ListMetadata(query string) (res []byte, err error)

func (*ForceMetadata) MakeDeploySoap

func (fm *ForceMetadata) MakeDeploySoap(options ForceDeployOptions) (soap string)

func (*ForceMetadata) MakeZip

func (fm *ForceMetadata) MakeZip(files ForceMetadataFiles) (zipdata []byte, err error)

func (*ForceMetadata) Retrieve

func (fm *ForceMetadata) Retrieve(query ForceMetadataQuery) (files ForceMetadataFiles, problems []string, err error)

func (*ForceMetadata) RetrieveByPackageXml

func (fm *ForceMetadata) RetrieveByPackageXml(package_xml string) (files ForceMetadataFiles, problems []string, err error)

func (*ForceMetadata) RetrievePackage

func (fm *ForceMetadata) RetrievePackage(packageName string) (files ForceMetadataFiles, problems []string, err error)

func (*ForceMetadata) UpdateFLSOnProfile

func (fm *ForceMetadata) UpdateFLSOnProfile(objectName string, fieldName string) (err error)

func (*ForceMetadata) ValidateFieldOptions

func (fm *ForceMetadata) ValidateFieldOptions(typ string, options map[string]string) (newOptions map[string]string, err error)

type ForceMetadataDeployProblem

type ForceMetadataDeployProblem struct {
	Changed     bool   `xml:"changed"`
	Created     bool   `xml:"created"`
	Deleted     bool   `xml:"deleted"`
	Filename    string `xml:"fileName"`
	Name        string `xml:"fullName"`
	Problem     string `xml:"problem"`
	ProblemType string `xml:"problemType"`
	Success     bool   `xml:"success"`
}

type ForceMetadataFiles

type ForceMetadataFiles map[string][]byte

type ForceMetadataQuery

type ForceMetadataQuery []ForceMetadataQueryElement

type ForceMetadataQueryElement

type ForceMetadataQueryElement struct {
	Name    []string
	Members []string
}

type ForcePartner

type ForcePartner struct {
	Force *Force
}

func NewForcePartner

func NewForcePartner(force *Force) (partner *ForcePartner)

func (*ForcePartner) CheckStatus

func (partner *ForcePartner) CheckStatus(id string) (err error)

func (*ForcePartner) ExecuteAnonymous

func (partner *ForcePartner) ExecuteAnonymous(apex string) (output string, err error)

func (*ForcePartner) ExecuteAnonymousTest added in v0.22.81

func (partner *ForcePartner) ExecuteAnonymousTest(apex string) (output string, err error)

func (*ForcePartner) Merge added in v0.30.0

func (partner *ForcePartner) Merge(sobjectType string, masterId string, duplicateId string) (err error)

func (*ForcePartner) MergeMany added in v0.30.0

func (partner *ForcePartner) MergeMany(sobjectType string, dupMap map[string]string) (results []soap.MergeResult, err error)

Merge multiple records using map of duplicate ids to master ids

func (*ForcePartner) RunTests

func (partner *ForcePartner) RunTests(tests []string, namespace string) (output TestCoverage, err error)

func (*ForcePartner) SoapExecuteCore

func (partner *ForcePartner) SoapExecuteCore(action, query string) (response []byte, err error)

func (*ForcePartner) Undelete added in v0.30.0

func (partner *ForcePartner) Undelete(id string) (err error)

func (*ForcePartner) UndeleteMany added in v0.30.0

func (partner *ForcePartner) UndeleteMany(deleted []string) (results []soap.UndeleteResult, err error)

type ForcePasswordResetResult

type ForcePasswordResetResult struct {
	NewPassword string
}

type ForcePasswordStatusResult

type ForcePasswordStatusResult struct {
	IsExpired bool
}

type ForceQueryResult

type ForceQueryResult struct {
	Done           bool
	Records        []ForceRecord
	TotalSize      int
	NextRecordsUrl string
}

func (*ForceQueryResult) Update

func (result *ForceQueryResult) Update(other ForceQueryResult, force *Force)

type ForceRecord

type ForceRecord map[string]interface{}

type ForceSession added in v0.22.79

type ForceSession struct {
	AccessToken    string `json:"access_token"`
	InstanceUrl    string `json:"instance_url"`
	IssuedAt       string `json:"issued_at"`
	Scope          string `json:"scope"`
	ClientId       string
	RefreshToken   string
	ForceEndpoint  ForceEndpoint
	EndpointUrl    string `json:"endpoint_url"`
	UserInfo       *UserInfo
	SessionOptions *SessionOptions
}

func ActiveCredentials

func ActiveCredentials(requireCredentials bool) (creds ForceSession, err error)

func ForceLogin

func ForceLogin(endpoint ForceEndpoint) (creds ForceSession, err error)

func ForceLoginAtEndpoint added in v0.26.5

func ForceLoginAtEndpoint(endpoint string) (creds ForceSession, err error)

func ForceSoapLogin

func ForceSoapLogin(endpoint ForceEndpoint, username string, password string) (creds ForceSession, err error)

func ForceSoapLoginAtEndpoint added in v0.26.5

func ForceSoapLoginAtEndpoint(endpoint string, username string, password string) (creds ForceSession, err error)

func GetAccountCredentials added in v0.24.0

func GetAccountCredentials(accountName string) (creds ForceSession, err error)

func JWTLogin added in v0.24.0

func JWTLogin(endpoint ForceEndpoint, assertion string) (creds ForceSession, err error)

func JWTLoginAtEndpoint added in v0.26.5

func JWTLoginAtEndpoint(endpoint string, assertion string) (creds ForceSession, err error)

func (*ForceSession) SessionName added in v0.22.79

func (creds *ForceSession) SessionName() string

type ForceSobject

type ForceSobject map[string]interface{}

type ForceSobjectFields

type ForceSobjectFields []interface{}

func (ForceSobjectFields) Len

func (f ForceSobjectFields) Len() int

func (ForceSobjectFields) Less

func (f ForceSobjectFields) Less(i, j int) bool

func (ForceSobjectFields) Swap

func (f ForceSobjectFields) Swap(i, j int)

type ForceSobjectsResult

type ForceSobjectsResult struct {
	Encoding     string
	MaxBatchSize int
	Sobjects     []ForceSobject
}

type GenericForceError

type GenericForceError struct {
	Error_Description string
	Error             string
}

type GeolocationField

type GeolocationField struct {
	DsiplayLocationInDecimal bool   `xml:"displayLocationInDecimal"`
	Required                 bool   `xml:"required"`
	Scale                    int    `xml:"scale"`
	Description              string `xml:"description"`
	HelpText                 string `xml:"helpText"`
}

type GeolocationFieldRequired

type GeolocationFieldRequired struct {
	DisplayLocationInDecimal bool `xml:"displayLocationInDecimal"`
	Scale                    int  `xml:"scale"`
}

These structs define which options are available and which are

required for the various field types you can create. Reflection
is used to leverage these structs in validating options when creating
a custom field.

type HttpCallback added in v0.30.0

type HttpCallback func(*http.Response) error

HttpCallback is called after a successful HTTP request. The caller is responsible for closing the response body when it's finished.

func NewBatchResultChannelHttpCallback added in v0.30.0

func NewBatchResultChannelHttpCallback(results chan<- BatchResultChunk, bufferSize int) HttpCallback

NewBatchResultChannelHttpCallback returns a new reporter that will send chunks of a read body into the results channel. You can control the size of the chunks via bufferSize (defaults to 50mb).

type HttpMethod added in v0.32.0

type HttpMethod string
const (
	HttpMethodPost  HttpMethod = http.MethodPost
	HttpMethodPatch HttpMethod = http.MethodPatch
)

type JobContentType added in v0.30.0

type JobContentType string
const (
	JobContentTypeCsv  JobContentType = "CSV"
	JobContentTypeXml  JobContentType = "XML"
	JobContentTypeJson JobContentType = "JSON"
)

type JobInfo

type JobInfo struct {
	XMLName                 xml.Name `xml:"http://www.force.com/2009/06/asyncapi/dataload jobInfo"`
	Id                      string   `xml:"id,omitempty"`
	Operation               string   `xml:"operation,omitempty"`
	Object                  string   `xml:"object,omitempty"`
	ExternalIdFieldName     string   `xml:"externalIdFieldName,omitempty"`
	CreatedById             string   `xml:"createdById,omitempty"`
	CreatedDate             string   `xml:"createdDate,omitempty"`
	SystemModStamp          string   `xml:"systemModstamp,omitempty"`
	State                   string   `xml:"state,omitempty"`
	ConcurrencyMode         string   `xml:"concurrencyMode,omitempty"`
	ContentType             string   `xml:"contentType,omitempty"`
	NumberBatchesQueued     int      `xml:"numberBatchesQueued,omitempty"`
	NumberBatchesInProgress int      `xml:"numberBatchesInProgress,omitempty"`
	NumberBatchesCompleted  int      `xml:"numberBatchesCompleted,omitempty"`
	NumberBatchesFailed     int      `xml:"numberBatchesFailed,omitempty"`
	NumberBatchesTotal      int      `xml:"numberBatchesTotal,omitempty"`
	NumberRecordsProcessed  int      `xml:"numberRecordsProcessed,omitempty"`
	NumberRetries           int      `xml:"numberRetries,omitempty"`
	ApiVersion              string   `xml:"apiVersion,omitempty"`
	NumberRecordsFailed     int      `xml:"numberRecordsFailed,omitempty"`
	TotalProcessingTime     int      `xml:"totalProcessingTime,omitempty"`
	ApiActiveProcessingTime int      `xml:"apiActiveProcessingTime,omitempty"`
	ApexProcessingTime      int      `xml:"apexProcessingTime,omitempty"`
}

func (JobInfo) HttpContentType added in v0.30.0

func (ji JobInfo) HttpContentType() (ContentType, error)

func (JobInfo) JobContentType added in v0.30.0

func (ji JobInfo) JobContentType() (JobContentType, error)

type ListMetadataResponse

type ListMetadataResponse struct {
	Result []MDFileProperties `xml:"result"`
}

type Logger added in v0.26.2

type Logger interface {
	Info(...interface{})
}
var Log Logger

type LoginFault

type LoginFault struct {
	ExceptionCode    string `xml:"exceptionCode" json:"exceptionCode"`
	ExceptionMessage string `xml:"exceptionMessage" json:"exceptionMessage"`
}

func (LoginFault) Error added in v0.32.0

func (lf LoginFault) Error() string

type LongTextAreaField

type LongTextAreaField struct {
	Label        string `xml:"label"`
	Name         string `xml:"fullName"`
	Required     bool   `xml:"required"`
	Description  string `xml:"description"`
	HelpText     string `xml:"helpText"`
	DefaultValue string `xml:"defaultValue"`
	Length       int    `xml:"length"`
	VisibleLines int    `xml:"visibleLines"`
}

type LongTextAreaFieldRequired

type LongTextAreaFieldRequired struct {
	Length       int `xml:"length"`
	VisibleLines int `xml:"visibleLines"`
}

type LookupField

type LookupField struct {
	Label             string `xml:"label"`
	ReferenceTo       string `xml:"referenceTo"`
	RelationshipLabel string `xml:"relationshipLabel"`
	RelationshipName  string `xml:"relationshipName"`
}

type LookupFieldRequired

type LookupFieldRequired struct{}

type MDFileProperties

type MDFileProperties struct {
	CreatedById        string    `xml:"createdById"`
	CreateByName       string    `xml:"createdByName"`
	CreateDate         time.Time `xml:"createdDate"`
	FileName           string    `xml:"fileName"`
	FullName           string    `xml:"fullName"`
	Id                 string    `xml:"id"`
	LastModifiedById   string    `xml:"lastModifiedById"`
	LastModifiedByName string    `xml:"lastModifiedByName"`
	LastModifedDate    time.Time `xml:"lastModifiedDate"`
	ManageableState    string    `xml:"manageableState"`
	NamespacePrefix    string    `xml:"namespacePrefix"`
	Type               string    `xml:"type"`
}

type MasterDetail

type MasterDetail struct {
	Label             string `xml:"label"`
	ReferenceTo       string `xml:"referenceTo"`
	RelationshipLabel string `xml:"relationshipLabel"`
	RelationshipName  string `xml:"relationshipName"`
}

type MasterDetailRequired

type MasterDetailRequired struct{}

type MetaType

type MetaType struct {
	Members []string `xml:"members"`
	Name    string   `xml:"name"`
}

type MetadataDeployStatus added in v0.26.7

type MetadataDeployStatus struct {
	Done    bool   `xml:"Body>checkStatusResponse>result>done"`
	State   string `xml:"Body>checkStatusResponse>result>state"`
	Message string `xml:"Body>checkStatusResponse>result>message"`
}

type MetadataDescribeResult

type MetadataDescribeResult struct {
	NamespacePrefix    string                   `xml:"organizationNamespace"`
	PartialSaveAllowed bool                     `xml:"partialSaveAllowed"`
	TestRequired       bool                     `xml:"testRequired"`
	MetadataObjects    []DescribeMetadataObject `xml:"metadataObjects"`
}

type MetadataDescribeValueTypeResult

type MetadataDescribeValueTypeResult struct {
	ValueTypeFields []MetadataValueTypeField `xml:"result"`
}

type MetadataValueTypeField

type MetadataValueTypeField struct {
	//Fields 						MetadataValueTypeField
	ForeignKeyDomain string
	IsForeignKey     bool
	IsNameField      bool
	MinOccurs        int
	Name             string
	SoapType         string
}

type NamespacePrefix added in v0.22.84

type NamespacePrefix string

type NumberField

type NumberField struct {
	Label                string `xml:"label"`
	Description          string `xml:"description"`
	HelpText             string `xml:"helpText"`
	Unique               bool   `xml:"unique"`
	ExternalId           bool   `xml:"externalId"`
	DefaultValue         uint   `xml:"defaultValue"`
	Formula              string `xml:"formula"`
	FormulaTreatBlanksAs string `xml:"formulaTreatBlanksAs"`
	Precision            int    `xml:"precision"`
	Scale                int    `xml:"scale"`
}

type NumberFieldRequired

type NumberFieldRequired struct {
	Precision int `xml:"precision"`
	Scale     int `xml:"scale"`
}

type OAuthError added in v0.24.0

type OAuthError struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

type Package

type Package struct {
	Xmlns   string     `xml:"xmlns,attr"`
	Types   []MetaType `xml:"types"`
	Version string     `xml:"version"`
}

Structs for XML building

type PackageBuilder

type PackageBuilder struct {
	IsPush   bool
	Metadata map[string]MetaType
	Files    ForceMetadataFiles
}

func NewFetchBuilder

func NewFetchBuilder() PackageBuilder

func NewPushBuilder

func NewPushBuilder() PackageBuilder

func (*PackageBuilder) AddDirectory added in v0.24.0

func (pb *PackageBuilder) AddDirectory(fpath string) (namePaths map[string]string, badPaths []string, err error)

AddDirectory Recursively add files contained in provided directory

func (*PackageBuilder) AddFile

func (pb *PackageBuilder) AddFile(fpath string) (fname string, err error)

Add a file to the builder

func (*PackageBuilder) AddMetaToPackage

func (pb *PackageBuilder) AddMetaToPackage(metaName string, name string)

Adds a metadata name to the pending package

func (*PackageBuilder) ForceMetadataFiles

func (pb *PackageBuilder) ForceMetadataFiles() ForceMetadataFiles

Returns the full ForceMetadataFiles container

func (PackageBuilder) PackageXml

func (pb PackageBuilder) PackageXml() []byte

Build and return package.xml

type PhoneField

type PhoneField struct {
	Label        string `xml:"label"`
	Name         string `xml:"fullName"`
	Required     bool   `xml:"required"`
	Description  string `xml:"description"`
	HelpText     string `xml:"helpText"`
	DefaultValue string `xml:"defaultValue"`
}

type PhoneFieldRequired

type PhoneFieldRequired struct {
}

type PicklistField

type PicklistField struct {
	Label    string          `xml:"label"`
	Picklist []PicklistValue `xml:"picklist>picklistValues"`
}

type PicklistFieldRequired

type PicklistFieldRequired struct {
	Picklist []PicklistValue `xml:"picklist>picklistValues"`
}

type PicklistValue

type PicklistValue struct {
	FullName string `xml:"fullName"`
	Default  bool   `xml:"default"`
}

type QueryOptions added in v0.22.84

type QueryOptions struct {
	IsTooling bool
	QueryAll  bool
}

type RefreshMethod added in v0.22.79

type RefreshMethod int

type Request added in v0.31.0

type Request struct {
	Headers map[string]string
	// contains filtered or unexported fields
}

Request configures a Salesforce API request. Use Force.NewRequest to create a new request.

By default, Force does not process the HTTP response body in the case of success (it may parse it in the case of an error). In this case, you are responsible for closing (and optionally reading) the response body.

If you want the body to be read synchronously, use ReadResponseBody(). You should not use Response.HttpResponse's Body in this case.

func NewRequest added in v0.31.0

func NewRequest(httpMethod string) *Request

func (*Request) AbsoluteUrl added in v0.31.0

func (r *Request) AbsoluteUrl(url string) *Request

AbsoluteUrl is used when the url specifies the absolute url, such as "https://me.salesforce.com/services/async/42.0/job".

func (*Request) ReadResponseBody added in v0.31.0

func (r *Request) ReadResponseBody() *Request

ReadResponseBody specifies that the request should read and close the response body. Use when you want a synchronous read of the response. Be careful with large response bodies.

func (*Request) RestUrl added in v0.31.0

func (r *Request) RestUrl(url string) *Request

RestUrl is used when the url specifies the "Apex REST" portion of the url. For example, the url of "/MyApexRestClass" would use a full URL of https://me.salesforce.com/services/data/41.0/MyApexRESTClass.

func (*Request) RootUrl added in v0.31.0

func (r *Request) RootUrl(url string) *Request

RestUrl is used when the url specifies the root-based relative URL of a resource. For example, the url of "/services/async/42.0/job" would use a full URL of https://me.salesforce.com/services/async/42.0/job.

func (*Request) Unauthed added in v0.31.0

func (r *Request) Unauthed() *Request

Unauthed will send the request without authentication headers.

func (*Request) WithBody added in v0.31.0

func (r *Request) WithBody(rdr io.Reader) *Request

WithBody sets the HTTP request body.

func (*Request) WithContent added in v0.31.0

func (r *Request) WithContent(ct ContentType) *Request

WithContent sets the Content-Type header.

func (*Request) WithHeader added in v0.31.0

func (r *Request) WithHeader(k, v string) *Request

WithHeader sets the given header.

func (*Request) WithResponseCallback added in v0.31.0

func (r *Request) WithResponseCallback(cb HttpCallback) *Request

WithResponseCallback specifies a callback invoked with the *http.Response of a request. Most callers will not need this when invoking Request.ExecuteRequest directly, since they have access to the *http.Response from the Response. However when a method does not deal with Request and Response, WithResponseCallback can be useful to allow access to the response, usually to access the HTTP response body stream.

type Response added in v0.31.0

type Response struct {
	// If Request.ReadResponseBody is used,
	// the HTTP response body is read into Response.ReadResponseBody.
	// This covers a common use case where the caller wants
	// to read the entire body synchronously,
	// rather than having to worry about managing the stream.
	ReadResponseBody []byte
	// The raw http.Response returned by the HTTP request.
	HttpResponse *http.Response
	// The coerced ContentType from the Content-Type header.
	ContentType ContentType
}

Response is the result of a Salesforce API call.

type Result

type Result struct {
	Id      string
	Success bool
	Created bool
	Message string
}

type RichTextAreaField

type RichTextAreaField struct {
	Label        string `xml:"label"`
	Name         string `xml:"fullName"`
	Required     bool   `xml:"required"`
	Description  string `xml:"description"`
	HelpText     string `xml:"helpText"`
	Length       int    `xml:"length"`
	VisibleLines int    `xml:"visibleLines"`
}

type RichTextAreaFieldRequired

type RichTextAreaFieldRequired struct {
	Length       int `xml:"length"`
	VisibleLines int `xml:"visibleLines"`
}

type RunTestResult

type RunTestResult struct {
	NumberOfFailures     int                   `xml:"numFailures"`
	NumberOfTestsRun     int                   `xml:"numTestsRun"`
	TotalTime            float32               `xml:"totalTime"`
	TestFailures         []TestFailure         `xml:"failures"`
	TestSuccesses        []TestSuccess         `xml:"successes"`
	CodeCoverageWarnings []CodeCoverageWarning `xml:"codeCoverageWarnings"`
}

type RunTestsRequest added in v0.22.82

type RunTestsRequest struct {
	AllTests       bool       `xml:"allTests"`
	Classes        []string   `xml:"classes"`
	Namespace      string     `xml:"namespace"`
	MaxFailedTests int        `xml:"maxFailedTests"`
	Tests          []TestNode `xml:"tests,omitEmpty"`
}

func NewRunTestsRequest added in v0.22.82

func NewRunTestsRequest(tests []string, namespace string) (request RunTestsRequest, err error)

type SFDXAuth added in v0.22.79

type SFDXAuth struct {
	AccessToken string
	Alias       string
	ClientId    string
	CreatedBy   string
	DevHubId    string
	Edition     string
	Id          string
	InstanceUrl string
	OrgName     string
	Password    string
	Status      string
	Username    string
}

func GetSFDXAuth added in v0.22.79

func GetSFDXAuth(user string) (auth SFDXAuth, err error)

type ScratchOrg added in v0.27.0

type ScratchOrg struct {
	UserName    string
	InstanceUrl string
	AuthCode    string
}

type SelectStruct

type SelectStruct struct {
	ObjectName string
	FieldNames []FieldName
}

type SessionOptions added in v0.22.79

type SessionOptions struct {
	ApiVersion    string
	Alias         string
	RefreshMethod RefreshMethod
	// RefreshFunc can be set to support refreshing of additional session/refresh types than
	// available in RefreshMethod. It should return an error on failure.
	// On success, it is responsible for updating the given Force's credentials.
	// Usually this is done by calling Force.UpdateCredentials (which persist the changes)
	// or Force.CopyCredentialAuthFields (which modifies memory only).
	//
	// Note that RefreshMethod implementations use Force.UpdateCredentials.
	RefreshFunc func(*Force) error `json:"-"`
}

type Soap

type Soap struct {
	AccessToken string
	Endpoint    string
	Header      string
	Namespace   string
}

func NewSoap

func NewSoap(endpoint, namespace, accessToken string) (s *Soap)

func (*Soap) Execute

func (s *Soap) Execute(action, query string) (response []byte, err error)

func (*Soap) ExecuteLogin

func (s *Soap) ExecuteLogin(username, password string) (response []byte, err error)

type SoapError

type SoapError struct {
	FaultCode   string `xml:"Body>Fault>faultcode"`
	FaultString string `xml:"Body>Fault>faultstring"`
}

type SoapFault

type SoapFault struct {
	FaultCode   string     `xml:"Body>Fault>faultcode"`
	FaultString string     `xml:"Body>Fault>faultstring"`
	Detail      LoginFault `xml:"Body>Fault>detail>LoginFault"`
}

type StringField

type StringField struct {
	Label                string `xml:"label"`
	Name                 string `xml:"fullName"`
	Required             bool   `xml:"required"`
	Length               int    `xml:"length"`
	Description          string `xml:"description"`
	HelpText             string `xml:"helpText"`
	Unique               bool   `xml:"unique"`
	CaseSensitive        bool   `xml:"caseSensitive"`
	ExternalId           bool   `xml:"externalId"`
	DefaultValue         string `xml:"defaultValue"`
	Formula              string `xml:"formula"`
	FormulaTreatBlanksAs string `xml:"formulaTreatBlanksAs"`
}

type StringFieldRequired

type StringFieldRequired struct {
	Length int `xml:"length"`
}

type TestCoverage

type TestCoverage struct {
	Log                       string   `xml:"Header>DebuggingInfo>debugLog"`
	NumberRun                 int      `xml:"Body>runTestsResponse>result>numTestsRun"`
	NumberFailures            int      `xml:"Body>runTestsResponse>result>numFailures"`
	NumberLocations           []int    `xml:"Body>runTestsResponse>result>codeCoverage>numLocations"`
	NumberLocationsNotCovered []int    `xml:"Body>runTestsResponse>result>codeCoverage>numLocationsNotCovered"`
	Name                      []string `xml:"Body>runTestsResponse>result>codeCoverage>name"`
	SMethodNames              []string `xml:"Body>runTestsResponse>result>successes>methodName"`
	SClassNames               []string `xml:"Body>runTestsResponse>result>successes>name"`
	FMethodNames              []string `xml:"Body>runTestsResponse>result>failures>methodName"`
	FClassNames               []string `xml:"Body>runTestsResponse>result>failures>name"`
	FMessage                  []string `xml:"Body>runTestsResponse>result>failures>message"`
	FStackTrace               []string `xml:"Body>runTestsResponse>result>failures>stackTrace"`
}

type TestFailure

type TestFailure struct {
	Message    string  `xml:"message"`
	Name       string  `xml:"name"`
	MethodName string  `xml:"methodName"`
	StackTrace string  `xml:"stackTrace"`
	Time       float32 `xml:"time"`
}

type TestNode added in v0.22.82

type TestNode struct {
	ClassName   string   `xml:"className"`
	TestMethods []string `xml:"testMethods"`
}

type TestRunner

type TestRunner interface {
	RunTests(tests []string, namespace string) (output TestCoverage, err error)
}

type TestSuccess

type TestSuccess struct {
	Name       string  `xml:"name"`
	MethodName string  `xml:"methodName"`
	Time       float32 `xml:"time"`
}

type TextAreaField

type TextAreaField struct {
	Label        string `xml:"label"`
	Name         string `xml:"fullName"`
	Required     bool   `xml:"required"`
	Description  string `xml:"description"`
	HelpText     string `xml:"helpText"`
	DefaultValue string `xml:"defaultValue"`
}

type TextAreaFieldRequired

type TextAreaFieldRequired struct {
}

type UrlField

type UrlField struct {
	Label                string `xml:"label"`
	Name                 string `xml:"fullName"`
	Required             bool   `xml:"required"`
	Description          string `xml:"description"`
	HelpText             string `xml:"helpText"`
	DefaultValue         string `xml:"defaultValue"`
	Formula              string `xml:"formula"`
	FormulaTreatBlanksAs string `xml:"formulaTreatBlanksAs"`
}

type UrlFieldRequired

type UrlFieldRequired struct {
}

type UserInfo added in v0.22.79

type UserInfo struct {
	UserName     string `json:"preferred_username"`
	OrgId        string `json:"organization_id"`
	UserId       string `json:"user_id"`
	ProfileId    string
	OrgNamespace string
}

Directories

Path Synopsis
Package query implements querying through the Salesforce data service.
Package query implements querying through the Salesforce data service.

Jump to

Keyboard shortcuts

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