restapi

package
v5.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func NewRestAPIDestination

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

NewRestAPIDestination unmarshals the destinationConfig's ExtraJson into a RestApi struct

func NewRestAPISource

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

NewRestAPISource unmarshals the sourceConfig's ExtraJson into a RestApi struct

Types

type Pagination added in v5.5.0

type Pagination struct {
	Scheme        string // if specified, must be 'query'
	PageNumberKey string // query string key for the page number
	PageSizeKey   string // number of items per page, default is 100
	FirstPage     int    // number of the first page, default is 1
	PageLimit     int    // maximum number of pages to request, default is 1000
	PageSize      int    // page size, default is 100
}

type RestAPI

type RestAPI struct {
	Method               string // DEPRECATED
	ListMethod           string
	CreateMethod         string
	UpdateMethod         string
	DeleteMethod         string
	IDAttribute          string
	BaseURL              string
	ResultsJSONContainer string
	AuthType             string
	Username             string
	Password             string
	ClientID             string
	ClientSecret         string
	CompareAttribute     string
	UserAgent            string
	BatchSize            int
	BatchDelaySeconds    int

	Pagination Pagination
	// contains filtered or unexported fields
}

func New added in v5.5.0

func New() RestAPI

func (*RestAPI) ApplyChangeSet

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

func (*RestAPI) ForSet

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

ForSet sets this RestAPI struct's Path values to those in the umarshalled syncSetJson. It ensures the resulting Path attributes include an initial "/"

func (*RestAPI) ListUsers

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

ListUsers makes http requests and uses the responses 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 SalesforceErrorResponse added in v5.5.0

type SalesforceErrorResponse struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

type SetConfig

type SetConfig struct {
	Paths      []string
	CreatePath string
	UpdatePath string
	DeletePath string
}

Jump to

Keyboard shortcuts

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