soap

package
v0.0.0-...-50a981d Latest Latest
Warning

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

Go to latest
Published: May 28, 2015 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DURATION string = "api.soap.duration"
	REQUEST  string = "api.soap.request"
	RESPONSE string = "api.soap.response"
	ERRORS   string = "api.soap.errors"
)
View Source
const (
	API_VERSION       string = "33.0"
	SOAP_API_SERVICES        = "/services/Soap/u/" + API_VERSION
	NS_XSI                   = "http://www.w3.org/2001/XMLSchema-instance"
	NS_PARTNER               = "urn:partner.soap.sforce.com"
	NS_OBJECT                = "urn:sobject.partner.soap.sforce.com"
)

Variables

This section is empty.

Functions

func Call

func Call(co Connection, reqp *XE, result interface{}, headers ...*XE) error

func Logout

func Logout(lr *LoginResponse)

func Post

func Post(url string, soapBody []byte, result interface{}, headers ...*XE) error

func SplitOffFirstName

func SplitOffFirstName(name string) (this, next string)

Types

type ActionOverride

type ActionOverride struct {
	IsAvailableInTouch bool   `xml:"isAvailableInTouch"`
	Name               string `xml:"name"`
	PageId             string `xml:"pageId"`
	Url                string `xml:"url"`
}

type Buffer

type Buffer struct{ bytes.Buffer }

type ChildRelationship

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

type Connection

type Connection interface {
	GetServerUrl() string
	GetToken() string
	GetUserId() string
	GetOrgId() string
}

type DescribeGlobalResult

type DescribeGlobalResult struct {
	Encoding     string                         `xml:"encoding"`
	MaxBatchSize int                            `xml:"maxBatchSize"`
	SObjects     []*DescribeGlobalSObjectResult `xml:"sobjects"`
}

func DescribeGlobal

func DescribeGlobal(co Connection) (*DescribeGlobalResult, error)

type DescribeGlobalSObjectResult

type DescribeGlobalSObjectResult struct {
	Activateable        bool   `xml:"activateable"`
	Createable          bool   `xml:"createable"`
	Custom              bool   `xml:"custom"`
	CustomSetting       bool   `xml:"customSetting"`
	Deletable           bool   `xml:"deletable"`
	DeprecatedAndHidden bool   `xml:"deprecatedAndHidden"`
	FeedEnabled         bool   `xml:"feedEnabled"`
	KeyPrefix           string `xml:"keyPrefix"`
	Label               string `xml:"label"`
	LabelPlural         string `xml:"labelPlural"`
	Layoutable          bool   `xml:"layoutable"`
	Mergeable           bool   `xml:"mergeable"`
	Name                string `xml:"name"`
	Queryable           bool   `xml:"queryable"`
	Replicateable       bool   `xml:"replicateable"`
	Retrieveable        bool   `xml:"retrieveable"`
	Searchable          bool   `xml:"searchable"`
	Triggerable         bool   `xml:"triggerable"`
	Undeletable         bool   `xml:"undeletable"`
	Updateable          bool   `xml:"updateable"`
}

type DescribeSObjectResult

type DescribeSObjectResult struct {
	ActionOverrides     []*ActionOverride    `xml:"actionOverrides"`
	Activateable        bool                 `xml:"activateable"`
	ChildRelationships  []*ChildRelationship `xml:"childRelationships"`
	CompactLayoutable   bool                 `xml:"compactLayoutable"`
	Createable          bool                 `xml:"createable"`
	Custom              bool                 `xml:"custom"`
	CustomSetting       bool                 `xml:"customSetting"`
	Deletable           bool                 `xml:"deletable"`
	DeprecatedAndHidden bool                 `xml:"deprecatedAndHidden"`
	FeedEnabled         bool                 `xml:"feedEnabled"`
	Fields              []*Field             `xml:"fields"`
	KeyPrefix           string               `xml:"keyPrefix"`
	Label               string               `xml:"label"`
	LabelPlural         string               `xml:"labelPlural"`
	Layoutable          bool                 `xml:"layoutable"`
	Mergeable           bool                 `xml:"mergeable"`
	Name                string               `xml:"name"`
	NamedLayoutInfos    []*NamedLayoutInfo   `xml:"namedLayoutInfos"`
	Queryable           bool                 `xml:"queryable"`
	RecordTypeInfos     []*RecordTypeInfo    `xml:"recordTypeInfos"`
	Replicateable       bool                 `xml:"replicateable"`
	Retrieveable        bool                 `xml:"retrieveable"`
	SearchLayoutable    bool                 `xml:"searchLayoutable"`
	Searchable          bool                 `xml:"searchable"`
	Triggerable         bool                 `xml:"triggerable"`
	Undeletable         bool                 `xml:"undeletable"`
	Updateable          bool                 `xml:"updateable"`
	UrlDetail           string               `xml:"urlDetail"`
	UrlEdit             string               `xml:"urlEdit"`
	UrlNew              string               `xml:"urlNew"`
}

func DescribeSObject

func DescribeSObject(co Connection, name string) (*DescribeSObjectResult, error)

func DescribeSObjects

func DescribeSObjects(co Connection, names []string) ([]*DescribeSObjectResult, error)

type DmlError

type DmlError struct {
	Fields     []string `xml:"fields"`
	Message    string   `xml:"message"`
	StatusCode string   `xml:"statusCode"`
}

type DmlResult

type DmlResult struct {
	Created bool       `xml:"created"`
	Errors  []DmlError `xml:"errors"`
	Id      string     `xml:"id"`
	Success bool       `xml:"success"`
}

func Delete

func Delete(co Connection, records []Record, headers ...*XE) ([]DmlResult, error)

func Insert

func Insert(co Connection, records []Record, headers ...*XE) ([]DmlResult, error)

func Update

func Update(co Connection, records []Record, headers ...*XE) ([]DmlResult, error)

func Upsert

func Upsert(co Connection, records []Record, externalId string, headers ...*XE) ([]DmlResult, error)

type Field

type Field struct {
	AutoNumber               bool                `xml:"autoNumber"`
	ByteLength               int                 `xml:"byteLength"`
	Calculated               bool                `xml:"calculated"`
	CalculatedFormula        string              `xml:"calculatedFormula"`
	CascadeDelete            bool                `xml:"cascadeDelete"`
	CaseSensitive            bool                `xml:"caseSensitive"`
	ControllerName           string              `xml:"controllerName"`
	Createable               bool                `xml:"createable"`
	Custom                   bool                `xml:"custom"`
	DefaultValueFormula      string              `xml:"defaultValueFormula"`
	DefaultedOnCreate        bool                `xml:"defaultedOnCreate"`
	DependentPicklist        bool                `xml:"dependentPicklist"`
	DeprecatedAndHidden      bool                `xml:"deprecatedAndHidden"`
	Digits                   int                 `xml:"digits"`
	DisplayLocationInDecimal bool                `xml:"displayLocationInDecimal"`
	ExternalId               bool                `xml:"externalId"`
	ExtraTypeInfo            string              `xml:"extraTypeInfo"`
	Filterable               bool                `xml:"filterable"`
	FilteredLookupInfo       *FilteredLookupInfo `xml:"filteredLookupInfo"`
	Groupable                bool                `xml:"groupable"`
	HighScaleNumber          bool                `xml:"highScaleNumber"`
	HtmlFormatted            bool                `xml:"htmlFormatted"`
	IdLookup                 bool                `xml:"idLookup"`
	InlineHelpText           string              `xml:"inlineHelpText"`
	Label                    string              `xml:"label"`
	Length                   int                 `xml:"length"`
	Mask                     string              `xml:"mask"`
	MaskType                 string              `xml:"maskType"`
	Name                     string              `xml:"name"`
	NameField                bool                `xml:"nameField"`
	NamePointing             bool                `xml:"namePointing"`
	Nillable                 bool                `xml:"nillable"`
	Permissionable           bool                `xml:"permissionable"`
	PicklistValues           []*PicklistEntry    `xml:"picklistValues"`
	Precision                int                 `xml:"precision"`
	QueryByDistance          bool                `xml:"queryByDistance"`
	ReferenceTargetField     string              `xml:"referenceTargetField"`
	ReferenceTo              []string            `xml:"referenceTo"`
	RelationshipName         string              `xml:"relationshipName"`
	RelationshipOrder        int                 `xml:"relationshipOrder"`
	RestrictedDelete         bool                `xml:"restrictedDelete"`
	RestrictedPicklist       bool                `xml:"restrictedPicklist"`
	Scale                    int                 `xml:"scale"`
	SoapType                 string              `xml:"soapType"`
	Sortable                 bool                `xml:"sortable"`
	Type                     string              `xml:"type"`
	Unique                   bool                `xml:"unique"`
	Updateable               bool                `xml:"updateable"`
	WriteRequiresMasterRead  bool                `xml:"writeRequiresMasterRead"`
}

type FilteredLookupInfo

type FilteredLookupInfo struct {
	ControllingFields []string `xml:"controllingFields"`
	Dependent         bool     `xml:"dependent"`
	OptionalFilter    bool     `xml:"optionalFilter"`
}

type GetUserInfoResult

type GetUserInfoResult struct {
	AccessibilityMode          bool   `xml:"accessibilityMode"`
	CurrencySymbol             string `xml:"currencySymbol"`
	OrgAttachmentFileSizeLimit int    `xml:"orgAttachmentFileSizeLimit"`
	OrgDefaultCurrencyIsoCode  string `xml:"orgDefaultCurrencyIsoCode"`
	OrgDisallowHtmlAttachments bool   `xml:"orgDisallowHtmlAttachments"`
	OrgHasPersonAccounts       bool   `xml:"orgHasPersonAccounts"`
	OrganizationId             string `xml:"organizationId"`
	OrganizationMultiCurrency  bool   `xml:"organizationMultiCurrency"`
	OrganizationName           string `xml:"organizationName"`
	ProfileId                  string `xml:"profileId"`
	RoleId                     string `xml:"roleId"`
	SessionSecondsValid        int    `xml:"sessionSecondsValid"`
	UserDefaultCurrencyIsoCode string `xml:"userDefaultCurrencyIsoCode"`
	UserEmail                  string `xml:"userEmail"`
	UserFullName               string `xml:"userFullName"`
	UserId                     string `xml:"userId"`
	UserLanguage               string `xml:"userLanguage"`
	UserLocale                 string `xml:"userLocale"`
	UserName                   string `xml:"userName"`
	UserTimeZone               string `xml:"userTimeZone"`
	UserType                   string `xml:"userType"`
	UserUiSkin                 string `xml:"userUiSkin"`
}

type LoginResponse

type LoginResponse struct {
	MetadataServerUrl string             `xml:"metadataServerUrl"`
	PasswordExpired   bool               `xml:"passwordExpired"`
	Sandbox           bool               `xml:"sandbox"`
	ServerUrl         string             `xml:"serverUrl"`
	SessionId         string             `xml:"sessionId"`
	UserId            string             `xml:"userId"`
	UserInfo          *GetUserInfoResult `xml:"userInfo"`
}

func Login

func Login(host string, username string, password string) (*LoginResponse, error)

func (*LoginResponse) GetOrgId

func (lr *LoginResponse) GetOrgId() string

func (*LoginResponse) GetServerUrl

func (lr *LoginResponse) GetServerUrl() string

func (*LoginResponse) GetToken

func (lr *LoginResponse) GetToken() string

func (*LoginResponse) GetUserId

func (lr *LoginResponse) GetUserId() string

type NamedLayoutInfo

type NamedLayoutInfo struct {
	Name string `xml:"name"`
}

type PicklistEntry

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

type QueryResult

type QueryResult struct {
	Done         bool
	QueryLocator string
	Records      []Record
	Size         int
	// contains filtered or unexported fields
}

QueryResult is parsed result in queryResponse. SObjectTypes for upper level QueryResult only will contain all the SObject types parsed.

func Query

func Query(co Connection, query string, headers ...*XE) (*QueryResult, error)

func QueryMore

func QueryMore(co Connection, queryLocator string, headers ...*XE) (*QueryResult, error)

func QueryNext

func QueryNext(co Connection, qr *QueryResult, headers ...*XE) (*QueryResult, error)

QueryNext does QueryMore API call and appends results to QueryResult passed.

func (*QueryResult) Append

func (qr *QueryResult) Append(r Record)

Append growths QueryResult Records linearly by 1000 records

func (*QueryResult) SObjectTypes

func (qr *QueryResult) SObjectTypes() []string

func (*QueryResult) UnmarshalXML

func (qr *QueryResult) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Reader

type Reader interface {
	Read() (Record, error)
	Unread() bool
	ExpectedLength() int
	SObjectTypes() []string
}

func NewReader

func NewReader(co Connection, query string, headers ...*XE) (Reader, error)

type Record

type Record interface {
	SObjectType() string
	Get(field string) (interface{}, bool)
	MustGet(field string) interface{}
	Set(field string, value interface{}) (interface{}, error)
	MustSet(field string, value interface{}) interface{}
	Remove(field string) (interface{}, bool)
	Fields() []string
}

func NewRecord

func NewRecord(sObjectType string, values ...map[string]interface{}) Record

type RecordTypeInfo

type RecordTypeInfo struct {
	Available                bool   `xml:"available"`
	DefaultRecordTypeMapping bool   `xml:"defaultRecordTypeMapping"`
	Name                     string `xml:"name"`
	RecordTypeId             string `xml:"recordTypeId"`
}

type Row

type Row map[string]interface{}

func NewRow

func NewRow(sObjectType string) Row

func (Row) Fields

func (r Row) Fields() []string

func (Row) Get

func (r Row) Get(name string) (interface{}, bool)

func (Row) MustGet

func (r Row) MustGet(name string) interface{}

func (Row) MustSet

func (r Row) MustSet(name string, value interface{}) interface{}

func (Row) Remove

func (r Row) Remove(name string) (interface{}, bool)

func (Row) SObjectType

func (r Row) SObjectType() string

func (Row) Set

func (r Row) Set(name string, value interface{}) (interface{}, error)

Set value of the field name. Returns same value and error if value contains unsupported type. Supported value types are: string, bool, *time.Time, *big.Rat, Record, *QueryResult. int and float64 are converted to *big.Rat for convinience. Set does not support setting values to nested subselects.

type XE

type XE struct {
	Tag   string
	Value interface{}
}

Jump to

Keyboard shortcuts

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