go-sfdc: github.com/g8rswimmer/go-sfdc/sobject/tree Index | Files

package tree

import "github.com/g8rswimmer/go-sfdc/sobject/tree"

Index

Package Files

builder.go mock_session_formatter.go record.go tree.go

type Attributes Uses

type Attributes struct {
    Type        string `json:"type"`
    ReferenceID string `json:"referenceId"`
}

Attributes are the attributes of the composite tree.

type Builder Uses

type Builder interface {
    sobject.Inserter
    ReferenceID() string
}

Builder is the SObject Tree builder for the composite SObject Tree API.

type InsertValue Uses

type InsertValue struct {
    ReferenceID string       `json:"referenceId"`
    ID          string       `json:"id"`
    Errors      []sfdc.Error `json:"errors"`
}

InsertValue is the return value for each record.

type Inserter Uses

type Inserter interface {
    SObject() string
    Records() []*Record
}

Inserter is used to define the SObject and it's records for the composite tree API.

type Record Uses

type Record struct {
    Attributes Attributes
    Fields     map[string]interface{}
    Records    map[string][]*Record
}

Record is the composite tree SObject.

func (*Record) MarshalJSON Uses

func (r *Record) MarshalJSON() ([]byte, error)

MarshalJSON will create the JSON byte array.

type RecordBuilder Uses

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

RecordBuilder is record builder for the composite SObject Tree API.

func NewRecordBuilder Uses

func NewRecordBuilder(builder Builder) (*RecordBuilder, error)

NewRecordBuilder will create a new builder. If the SObject is not value or the reference ID is empyt, an error will be returned.

func (*RecordBuilder) Build Uses

func (rb *RecordBuilder) Build() *Record

Build will create the composite tree record.

func (*RecordBuilder) SubRecords Uses

func (rb *RecordBuilder) SubRecords(sobjects string, records ...*Record)

SubRecords will add subrecords to the object.

type Resource Uses

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

Resource is the composite tree API resource.

func NewResource Uses

func NewResource(session session.ServiceFormatter) (*Resource, error)

NewResource creates a new composite tree resource from the session.

func (*Resource) Insert Uses

func (r *Resource) Insert(inserter Inserter) (*Value, error)

Insert will call the composite tree API.

type Value Uses

type Value struct {
    HasErrors bool          `json:"hasErrors"`
    Results   []InsertValue `json:"results"`
}

Value is the return value from the API call.

Package tree imports 9 packages (graph). Updated 2019-05-11. Refresh now. Tools for package owners.