composite

package
v0.0.1-alpha.0...-700cb3a Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Base ...

Functions

This section is empty.

Types

type Attributes

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

Attributes are metadata properties used in certain APIs such as the composite API

type Builder

type Builder builder.Builder

Builder ..

func AllOrNone

func AllOrNone(allOrNone bool) Builder

AllOrNone ...

func Client

func Client(client client) Builder

Client ...

func CollateSubrequests

func CollateSubrequests(collateSubrequests bool) Builder

CollateSubrequests ...

func Delete

func Delete(objectName string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Delete ...

func Get

func Get(objectName string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Get ...

func Patch

func Patch(objectName string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Patch ...

func Post

func Post(objectName string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Post ...

func (Builder) Add

func (b Builder) Add(method string, URL string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Add creates a new Subrequest instance from the given parameters and appends the instance to builder.CompositeRequest ([]Subrequest)

func (Builder) AllOrNone

func (b Builder) AllOrNone(allOrNone bool) Builder

AllOrNone ...

func (Builder) Client

func (b Builder) Client(client client) Builder

Client ...

func (Builder) CollateSubrequests

func (b Builder) CollateSubrequests(collateSubrequests bool) Builder

CollateSubrequests ...

func (Builder) Delete

func (b Builder) Delete(objectName string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Delete ...

func (Builder) Get

func (b Builder) Get(objectName string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Get ...

func (Builder) JSON

func (b Builder) JSON(dst interface{}) (body []byte, err error)

JSON ...

func (Builder) Patch

func (b Builder) Patch(objectName string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Patch ...

func (Builder) Post

func (b Builder) Post(objectName string, referenceID string, headers map[string]string, body map[string]interface{}) Builder

Post ...

func (Builder) Request

func (b Builder) Request() (*http.Request, error)

Request marshals the given Builder into an http.Request object

func (Builder) Response

func (b Builder) Response() (*http.Response, error)

Response ...

func (Builder) Send

func (b Builder) Send() (*Response, error)

Send ...

type Error

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

Error ...

type Errors

type Errors []Error

Errors ...

func (Errors) Error

func (e Errors) Error() string

type Output

type Output struct {
	ID        string `json:"id,omitempty"`
	Success   bool   `json:"success,omitempty"`
	ErrorCode string `json:"errorCode,omitempty"`
	Message   string `json:"message,omitempty"`
}

Output ...

type Request

type Request struct {
	Client             client       `json:"-"`
	AllOrNone          bool         `json:"allOrNone"`
	CollateSubrequests bool         `json:"collateSubrequests"`
	CompositeRequest   []Subrequest `json:"compositeRequest"`
}

Request ...

type Response

type Response struct {
	Items []*ResponseItem `json:"compositeResponse"`
}

Response ...

func (Response) Err

func (r Response) Err() error

Err returns an error if one or more Response.Items contains a HTTPStatusCode > 299

type ResponseItem

type ResponseItem struct {
	Outputs        []*Output
	HTTPHeaders    map[string]interface{} `json:"httpHeaders,omitempty"`
	HTTPStatusCode int                    `json:"httpStatusCode"`
	ReferenceID    string                 `json:"referenceId"`
	Body           map[string]interface{} `json:"body"`
}

ResponseItem https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/responses_composite.htm

func (*ResponseItem) UnmarshalJSON

func (item *ResponseItem) UnmarshalJSON(data []byte) error

UnmarshalJSON ...

type SQLizer

type SQLizer interface {
	ToSQL() (soql string, err error)
}

SQLizer defines a component which can be converted to SQL.

type Subrequest

type Subrequest struct {
	Method      string                 `json:"method"`
	URL         string                 `json:"url"`
	ReferenceID string                 `json:"referenceId"`
	Body        map[string]interface{} `json:"body,omitempty"`
	HTTPHeaders map[string]string      `json:"httpHeaders,omitempty"`
}

Subrequest ...

Jump to

Keyboard shortcuts

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