restapi

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const AuthTypeBasic = "basic"
View Source
const AuthTypeBearer = "bearer"
View Source
const AuthTypeSalesforceOauth = "SalesforceOauth"
View Source
const DefaultBatchDelaySeconds = 3
View Source
const DefaultBatchSize = 10

Variables

This section is empty.

Functions

func NewRestAPIDestination

func NewRestAPIDestination(destinationConfig psync.DestinationConfig) (psync.Destination, error)

NewRestAPIDestination unmarshals the destinationConfig's ExtraJson into a RestApi struct

func NewRestAPISource

func NewRestAPISource(sourceConfig psync.SourceConfig) (psync.Source, error)

NewRestAPISource unmarshals the sourceConfig's ExtraJson into a RestApi struct

Types

type RestAPI

type RestAPI struct {
	Method               string // DEPRECATED
	ListMethod           string
	CreateMethod         string
	BaseURL              string
	ResultsJSONContainer string
	AuthType             string
	Username             string
	Password             string
	ClientID             string
	ClientSecret         string
	CompareAttribute     string
	UserAgent            string
	BatchSize            int
	BatchDelaySeconds    int
	// contains filtered or unexported fields
}

func (*RestAPI) ApplyChangeSet

func (r *RestAPI) ApplyChangeSet(changes psync.ChangeSet, eventLog chan<- psync.EventLogItem) psync.ChangeResults

func (*RestAPI) ForSet

func (r *RestAPI) ForSet(syncSetJson json.RawMessage) error

ForSet sets this RestAPI structs Path value to the one in the umarshalled syncSetJson. It ensures the resulting Path attribute includes an initial "/"

func (*RestAPI) ListUsers

func (r *RestAPI) ListUsers(desiredAttrs []string) ([]psync.Person, error)

ListUsers makes an http request and uses the response to populate and return a slice of Person instances

type SalesforceAuthResponse

type SalesforceAuthResponse struct {
	ID          string `json:"id"`
	IssuedAt    string `json:"issued_at"`
	InstanceURL string `json:"instance_url"`
	Signature   string `json:"signature"`
	AccessToken string `json:"access_token"`
}

type SetConfig

type SetConfig struct {
	Paths      []string
	CreatePath string
}

Jump to

Keyboard shortcuts

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