Documentation
¶
Index ¶
- Constants
- func ConvertFieldNames(obj interface{}, jsonFields string) string
- type Account
- type BaseQuery
- type BaseSObject
- type Lead
- type LeadQueryResponse
- type Opportunity
- type OpportunityQueryResponse
- type Profile
- type ProfileQueryResponse
- type SFBool
- type SObjectAttributes
- type Time
- type User
- type UserQueryResponse
Constants ¶
const SFTIMEFORMAT1 = "2006-01-02T15:04:05.000-0700"
const SFTIMEFORMAT2 = "2006-01-02T15:04:05.999Z"
const SFTIMEFORMAT3 = "2006-01-02"
Variables ¶
This section is empty.
Functions ¶
func ConvertFieldNames ¶
ConvertFieldNames takes in any interface that inplements SObject and a comma separated list of json field names. It converts the json field names to the force struct tag stated equivalent.
Types ¶
type Account ¶
type BaseQuery ¶
type BaseQuery struct { Done bool `json:"Done" force:"done"` TotalSize float64 `json:"TotalSize" force:"totalSize"` NextRecordsUri string `json:"NextRecordsUrl" force:"nextRecordsUrl"` }
Fields that are returned in every query response. Use this to build custom structs.
type MyCustomQueryResponse struct { BaseQuery Records []sobjects.Account `json:"records" force:"records"` }
type BaseSObject ¶
type BaseSObject struct { Attributes SObjectAttributes `force:"attributes,omitempty" json:"-"` Id string `force:",omitempty" json:",omitempty"` IsDeleted bool `force:",omitempty" json:",omitempty"` Name string `force:",omitempty" json:",omitempty"` CreatedDate *Time `force:",omitempty" json:",omitempty"` CreatedById string `force:",omitempty" json:",omitempty"` LastModifiedDate *Time `force:",omitempty" json:",omitempty"` LastModifiedById string `force:",omitempty" json:",omitempty"` SystemModstamp string `force:",omitempty" json:",omitempty"` }
Base struct that contains fields that all objects, standard and custom, include.
type Lead ¶
type Lead struct { BaseSObject Company string `force:",omitempty"` ConvertedDate *Time `force:",omitempty"` Email string `force:",omitempty"` FirstName string `force:",omitempty"` IsConverted bool `force:",omitempty"` IsDeleted bool `force:",omitempty"` LastName string `force:",omitempty"` OwnerId string `force:",omitempty"` Status string `force:",omitempty"` }
type LeadQueryResponse ¶
type Opportunity ¶
type Opportunity struct { BaseSObject AccountId string `force:",omitempty"` Amount float64 `force:",omitempty"` CloseDate *Time `force:",omitempty"` CurrencyIsoCode string `force:",omitempty"` Description string `force:",omitempty"` ExpectedRevenue string `force:",omitempty"` IsClosed bool `force:",omitempty"` IsDeleted bool `force:",omitempty"` IsSplit bool `force:",omitempty"` IsWon bool `force:",omitempty"` Name string `force:",omitempty"` OwnerId string `force:",omitempty"` StageName string `force:",omitempty"` }
func (*Opportunity) ApiName ¶
func (t *Opportunity) ApiName() string
type OpportunityQueryResponse ¶
type OpportunityQueryResponse struct { BaseQuery Records []Opportunity `json:"Records" force:"records"` }
type Profile ¶
type Profile struct { BaseSObject Description string `force:",omitempty"` IsSsoEnabled bool `force:",omitempty"` LastReferencedDate *Time `force:",omitempty"` LastViewedDate *Time `force:",omitempty"` Name string `force:",omitempty"` PermissionsPermissionName bool `force:",omitempty"` UserLicenseId string `force:",omitempty"` UserType string `force:",omitempty"` }
type ProfileQueryResponse ¶
type SFBool ¶
type SFBool int
Don't use this! It was an interesting effort but in reality all you need is a ptr to a bool. *bool will solve all your problems. :) Used to represent empty bools. Go types are always instantiated with a default value, for bool the default value is false. This makes it difficult to update an SObject without overwriting any boolean field to false. This package solves the issue by representing a bool as an int and implementing the marshal/unmarshal json interface. It is a drop in replacement for the bool type. 1 is true 0 is nil -1 is false Unmarshalling: false will be unmarshalled to -1, true will be unmarshalled to 1 If no value is set the unmarshaller will skip the field and the int will default to 0. Marshalling: -1 will be marshaled to false, 1 will be marshaled to true, and 0 will be marshaled to nothing (assuming the field has the omitempty json tag `json:",omitempty"`)
func (*SFBool) MarshalJSON ¶
func (*SFBool) UnmarshalJSON ¶
type SObjectAttributes ¶
type Time ¶
Represents a SFDC Date. Implements marshaling / unmarshaling as a Go Time.
func (Time) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface. The time is a quoted string in Salesforce time format.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. The time is expected to be a quoted string in Salesforce time format.
type User ¶
type User struct { BaseSObject Alias string `force:",omitempty"` CommunityNickname string `force:",omitempty"` Email string `force:",omitempty"` EmailEncodingKey string `force:",omitempty"` FirstName string `force:",omitempty"` FullPhotoUrl string `force:",omitempty"` LanguageLocaleKey string `force:",omitempty"` LastName string `force:",omitempty"` LocaleSidKey string `force:",omitempty"` ProfileId string `force:",omitempty"` SmallPhotoUrl string `force:",omitempty"` TimeZoneSidKey string `force:",omitempty"` Username string `force:",omitempty"` }