marketo

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(miniconfig minimarketo.ClientConfig) (minimarketo.Client, error)

Client defines client

func Miniconfig

func Miniconfig(config Config) minimarketo.ClientConfig

Miniconfig handles the connection to the client through mini marketo

Types

type Config

type Config struct {
	// ID: Marketo client ID
	ID string
	// Secret: Marketo client secret
	Secret string
	// Endpoint: https://xxx-xxx-xxx.mktorest.com
	URL         string
	ClinicRole  string
	PatientRole string
	Timeout     uint
}

Config is the env config

func (*Config) Validate

func (c *Config) Validate() error

Validate used to validate in marketo_test.go

type Connector

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

Connector manages the connection to the client

func (*Connector) CreateListMembershipForUser

func (m *Connector) CreateListMembershipForUser(newUser User)

CreateListMembershipForUser is an asynchronous function that creates a user

func (*Connector) FindLead

func (m *Connector) FindLead(listEmail string) (int, bool, error)

FindLead is used to find a lead in Marketo

func (*Connector) IsAvailable

func (m *Connector) IsAvailable() bool

IsAvailable is a function used to test if the Parameters in connector are there and that you have a connection to marketo ready

func (*Connector) TypeForUser

func (m *Connector) TypeForUser(user User) string

TypeForUser Identifies if the user is a clinic or patient

func (*Connector) UpdateListMembershipForUser

func (m *Connector) UpdateListMembershipForUser(oldUser User, newUser User)

UpdateListMembershipForUser is an asynchronous function that updates a user

func (*Connector) UpsertListMember

func (m *Connector) UpsertListMember(role string, listEmail string, newEmail string) error

UpsertListMember creates or updates lead based on if lead already exists

func (*Connector) UpsertListMembership

func (m *Connector) UpsertListMembership(oldUser User, newUser User) error

UpsertListMembership creates or updates a user depending on if the user already exists or not

type CreateData

type CreateData struct {
	Action      string  `json:"action"`
	LookupField string  `json:"lookupField"`
	Input       []Input `json:"input"`
}

CreateData is the full marketo request format

type Input

type Input struct {
	ID       int    `json:"id,omitempty"`
	Email    string `json:"email"`
	UserType string `json:"userType"`
}

Input type is the request user information format sent to marketo

type LeadResult

type LeadResult struct {
	ID        int    `json:"id"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	UserType  string `json:"userType"`
	Created   string `json:"createdAt"`
	Updated   string `json:"updatedAt"`
}

LeadResult Find lead returns "result" in this format

type Manager

type Manager interface {
	CreateListMembershipForUser(newUser User)
	UpdateListMembershipForUser(oldUser User, newUser User)
	IsAvailable() bool
}

Manager interface for managing leads

func NewManager

func NewManager(logger *log.Logger, config Config) (Manager, error)

NewManager creates a new manager based off of input arguments

type RecordResult

type RecordResult struct {
	ID      int    `json:"id"`
	Status  string `json:"status"`
	Reasons []struct {
		Code    string `json:"code"`
		Message string `json:"message"`
	} `json:"reasons,omitempty"`
}

RecordResult Create/update lead uses this format

type User

type User interface {
	Email() string
	IsClinic() bool
}

User interface for Identifying user type. function located in user.go

Jump to

Keyboard shortcuts

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