marketo

package
v0.0.0-...-5f21bb7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 18 Imported by: 0

README

Marketo Connector

The connector currently supports Leads API only.

Supported Objects

Object Resource Method
Companies companies Write
Leads leads Write
Named Account Lists namedAccountLists Write
Named Accounts namedaccounts Write
Opportunities opportunities Write
Sales Person salespersons Write
Campaigns campaigns Read
Custom Objects customobjects Read
Lists lists Read

Documentation

Index

Constants

View Source
const (
	// ModuleEmpty is used for proxying requests through.
	ModuleEmpty common.ModuleID = ""
	// ModuleAssets is the module/API used for accessing assets objects.
	ModuleAssets common.ModuleID = "assets"
	// ModuleLeads is the module/API used for accessing leads objects.
	ModuleLeads common.ModuleID = "leads"
)

Variables

View Source
var IdResponseObjects = []string{"leads", "companies", "salespersons"} //nolint:gochecknoglobals

IdResponseObjects represents a list of objects that uses `id` as a unique field in the response.

Functions

This section is empty.

Types

type Connector

type Connector struct {
	BaseURL string
	Client  *common.JSONHTTPClient
	Module  common.Module
}

func NewConnector

func NewConnector(opts ...Option) (conn *Connector, outErr error)

func (*Connector) HTTPClient

func (c *Connector) HTTPClient() *common.HTTPClient

func (*Connector) JSONHTTPClient

func (c *Connector) JSONHTTPClient() *common.JSONHTTPClient

JSONHTTPClient returns the underlying JSON HTTP client.

func (*Connector) ListObjectMetadata

func (c *Connector) ListObjectMetadata(ctx context.Context,
	objectNames []string,
) (*common.ListObjectMetadataResult, error)

ListObjectMetadata returns metadata for an object by sampling an object from Marketo's API. If that fails, it generates object metadata by parsing Marketo's OpenAPI files.

func (*Connector) Provider

func (c *Connector) Provider() providers.Provider

Provider returns the connector provider.

func (*Connector) Read

func (c *Connector) Read(ctx context.Context, config common.ReadParams) (*common.ReadResult, error)

Read retrieves data based on the provided common.ReadParams configuration parameters.

func (*Connector) String

func (c *Connector) String() string

func (*Connector) Write

func (c *Connector) Write(ctx context.Context, config common.WriteParams) (*common.WriteResult, error)

Write creates/updates records in marketo. Write currently supports operations to the leads API only.

type Error

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Option

type Option = func(params *parameters)

func WithAuthenticatedClient

func WithAuthenticatedClient(client common.AuthenticatedHTTPClient) Option

func WithClient

func WithClient(ctx context.Context, client *http.Client,
	config *clientcredentials.Config,
) Option

func WithModule

func WithModule(module common.ModuleID) Option

WithModule sets the marketo API module to use for the connector. It's required.

func WithWorkspace

func WithWorkspace(workspace string) Option

WithWorkspace sets the marketo API instance to use for the connector. It's required.

type Response

type Response struct {
	Errors    []Error          `json:"errors"`
	Result    []map[string]any `json:"result"`
	RequestID string           `json:"requestId"`
	Success   bool             `json:"success"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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