connector

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSendgridClientNotProvided = errors.New("sendgrid client not provided")
)
View Source
var SendGridScopes = []Scope{}/* 197 elements not displayed */

SendGridScopes is a list of scopes that can be used with SendGrid. Sendgrid does not provide an api to list scopes, so this list is manually https://www.twilio.com/docs/sendgrid/api-reference/api-key-permissions

Functions

This section is empty.

Types

type Connector

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

func New

func New(ctx context.Context, client SendGridClient, ignoreSubusers bool) (*Connector, error)

New returns a new instance of the connector.

func (*Connector) Asset

func (d *Connector) Asset(ctx context.Context, asset *v2.AssetRef) (string, io.ReadCloser, error)

Asset takes an input AssetRef and attempts to fetch it using the connector's.json authenticated http client It streams a response, always starting with a metadata object, following by chunked payloads for the asset.

func (*Connector) Metadata

func (d *Connector) Metadata(ctx context.Context) (*v2.ConnectorMetadata, error)

Metadata returns metadata about the connector.

func (*Connector) ResourceSyncers

func (d *Connector) ResourceSyncers(ctx context.Context) []connectorbuilder.ResourceSyncer

ResourceSyncers returns a ResourceSyncer for each resource type that should be synced from the upstream service.

func (*Connector) Validate

func (d *Connector) Validate(ctx context.Context) (annotations.Annotations, error)

Validate is called to ensure that the connector is properly configured. It should exercise any API credentials to be sure that they are valid.

type Scope

type Scope string

type SendGridClient

type SendGridClient interface {
	InviteTeammate(ctx context.Context, email string, scopes []string, isAdmin bool) error
	DeleteTeammate(ctx context.Context, username string) error

	GetSpecificTeammate(ctx context.Context, username string) (*models.TeammateScope, error)
	GetTeammates(ctx context.Context, pToken *pagination.Token) ([]models.Teammate, string, error)
	GetTeammatesSubAccess(ctx context.Context, username string, pToken *pagination.Token) ([]models.TeammateSubuser, string, error)
	GetPendingTeammates(ctx context.Context, pToken *pagination.Token) ([]models.PendingUserAccess, string, error)
	SetTeammateScopes(ctx context.Context, username string, scopes []string, isAdmin bool) error

	GetSubusers(ctx context.Context, pToken *pagination.Token) ([]models.Subuser, string, error)
	CreateSubuser(ctx context.Context, subuser models.SubuserCreate) error
	DeleteSubuser(ctx context.Context, username string) error
	SetSubuserDisabled(ctx context.Context, username string, disabled bool) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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