outreach

package
v0.0.0-...-812ae16 Latest Latest
Warning

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

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

README

Outreach connector

Read

Read is used to list all records of a given type. For example, if you want to list all users, you would use the Read method with the users object.

Example Usage

// Create the outreach connector instance 
conn, err := outreach.NewConnector(
		outreach.WithClient(ctx, http.DefaultClient, cfg, tok),
)

// Call Read to list records in a users object
res, err := conn.Read(context.TODO(),common.ReadParams{
		ObjectName: "users",
})
if err != nil {
	log.Fatal(err)
}

Write

Write is used to create/update objects in outreach connector. For an instance creating an emailAddress object, you use the Write method and emailAddress object

Example usage

type Attribute struct {
	Email     string `json:"email"`
	EmailType string `json:"emailType"`
	Order     int    `json:"order"`
	Status    string `json:"status"`
}

type EmailAddress struct {
	Attributes Attribute `json:"attributes"`
	Type       string    `json:"type"`
}

// Create an outreach connector instance 
conn, err := outreach.NewConnector(
		outreach.WithClient(ctx, http.DefaultClient, cfg, tok),
)

attribute := Attribute{
		Email:     gofakeit.Email(),
		EmailType: "email",
		Order:     0,
		Status:    "null",
	}

	config := common.WriteParams{
		ObjectName: "emailAddresses",
		RecordData: EmailAddress{
			Attributes: attribute,
			Type:       "emailAddress",
		},
	}

result, err := conn.Write(ctx, config)
if err != nil {
	log.Fatal(err)
}

Supported Objects

Below is an exhaustive list of the supported Objects in the Outreach deep connector with their endpoint resources(ObjectName).

Outreach API version : v2

Object Resource Method
Account accounts Read, Write
Audit audits Read
Audit Logs auditLogs Read
Call calls Read, Write
Call Disposition callDispositions Read, Write
Call Purpose callPurpose Read, Write
Compliance Request complianceRequest Read, Write
Content Category contentCategories Read, Write
Content Category Membership contentCategoryMemberships Read, Write
Content Category Ownership contentCategoryOwnerships Read, Write
Custom Duty customDuties write
Duty duties Read
Email Address emailAddress Read, Write
Event events/:id(by id only) Read
Favorite favorites Read, Write
Mail Alias mailAliases Read
Mailbox mailboxes Read, Write
Mailing mailings Read, Write
Opportunity opportunities Read, Write
Opportunity Prospect Role opportunityProspectRoles Read, Write
Opportunity Stage opportunityStages Read, Write
Org Setting orgSettings/:id (by id only) Read, Write(Patch by id ony)
Persona personas Read, Write
Phone Number phoneNumbers Read, Write
Profile profiles Read, Write
Prospect prospects Read, Write
Recipient recipients Read, Write
Role roles Read, Write
Ruleset rulesets Read, Write
Sequence sequences Read, Write
Sequence State sequenceStates Read, Write
Sequence Step sequenceSteps Read, Write
Sequence Template sequenceTemplates Read, Write
Snippet snippets Read, Write
Stage stages Read, Write
Task tasks Read, Write
Task Disposition taskDispositions Read, Write
Task Priority taskPriorities Read
Task Purpose taskPurposes Read, Write
Team teams Read, Write
Template templates Read, Write
templates users Read, Write
Webhook webhooks Read, Write

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIdMustInt = errors.New("provided record ID must be convertable to integer")
View Source
var JSONAPIContentTypeHeader = common.Header{
	Key:   "Content-Type",
	Value: "application/vnd.api+json",
}

Functions

This section is empty.

Types

type Connector

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

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)

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 configuration parameters.

This function executes a read operation using the given context and configuration parameters. It returns the nested Attributes values read results or an error if the operation fails.

func (*Connector) String

func (c *Connector) String() string

func (*Connector) Write

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

type Data

type Data struct {
	Data []DataItem `json:"data"`
}

type DataItem

type DataItem struct {
	Type          string         `json:"type"`
	ID            int            `json:"id"`
	Relationships map[string]any `json:"relationships"`
	Attributes    map[string]any `json:"attributes"`
}

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 *oauth2.Config, token *oauth2.Token, opts ...common.OAuthOption,
) Option

type WriteResponse

type WriteResponse struct {
	Data map[string]any `json:"data"`
}

Jump to

Keyboard shortcuts

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