Back to godoc.org
github.com/g8rswimmer/go-sfdc

Package sfdc

v2.0.1+incompatible
Latest Go to latest
Published: Oct 1, 2019 | License: MIT | Module: github.com/g8rswimmer/go-sfdc

Index

Package Files

Constants

const (
	// RecordAttributes is the attribute map from the record JSON
	RecordAttributes = "attributes"
)
const SalesforceDate = "2006-01-02"

SalesforceDate is the format returned by the Salesforce Date field type.

const SalesforceDateTime = "2006-01-02T15:04:05.000+0000"

SalesforceDateTime is the format returned by Salesforce TimeDate field type.

func ParseTime

func ParseTime(salesforceTime string) (time.Time, error)

ParseTime attempts to parse a JSON time string from Salesforce. It will attempt to parse the time using RFC 3339, then Salesforce DateTime format and lastly Salesforce Date format.

type Configuration

type Configuration struct {
	Credentials *credentials.Credentials
	Client      *http.Client
	Version     int
}

Configuration is the structure for goforce sessions.

Credentials is the credentials that will be used to form a session.

Client is the HTTP client that will be used.

Version is the Salesforce version for the APIs.

type Error

type Error struct {
	ErrorCode string   `json:"errorCode"`
	Message   string   `json:"message"`
	Fields    []string `json:"fields"`
}

Error is the error structure defined by the Salesforce API.

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON will unmarshal a JSON byte array.

type Record

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

Record is a representation of a Salesforce record.

func RecordFromJSONMap

func RecordFromJSONMap(jsonMap map[string]interface{}) (*Record, error)

RecordFromJSONMap creates a recrod from a JSON map.

func (*Record) FieldValue

func (r *Record) FieldValue(field string) (interface{}, bool)

FieldValue returns the field's value. If there is no field for the field name, then false will be returned.

func (*Record) Fields

func (r *Record) Fields() map[string]interface{}

Fields returns the map of field name to value relationships.

func (*Record) LookUp

func (r *Record) LookUp(lookUp string) (*Record, bool)

LookUp returns the look up record

func (*Record) LookUps

func (r *Record) LookUps() []*Record

LookUps returns all of the record's look ups

func (*Record) SObject

func (r *Record) SObject() string

SObject returns attribute's Salesforce object name.

func (*Record) URL

func (r *Record) URL() string

URL returns the record attribute's URL.

func (*Record) UnmarshalJSON

func (r *Record) UnmarshalJSON(data []byte) error

UnmarshalJSON provides a custom unmarshaling of a JSON byte array.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier