Documentation
¶
Index ¶
- Variables
- func NewLambdaConnector(ctx context.Context, cfg *config.Sendgrid, _ *cli.ConnectorOpts) (connectorbuilder.ConnectorBuilderV2, []connectorbuilder.Opt, error)
- type Connector
- func (d *Connector) Asset(ctx context.Context, asset *v2.AssetRef) (string, io.ReadCloser, error)
- func (d *Connector) Metadata(ctx context.Context) (*v2.ConnectorMetadata, error)
- func (d *Connector) ResourceSyncers(ctx context.Context) []connectorbuilder.ResourceSyncerV2
- func (d *Connector) Validate(ctx context.Context) (annotations.Annotations, error)
- type Scope
- type SendGridClient
Constants ¶
This section is empty.
Variables ¶
var DefaultTeammateIsAdmin = false
DefaultTeammateIsAdmin is the default admin status for new teammates. By default, teammates are not admins and require explicit scopes.
var DefaultTeammateScopes = []string{"user.profile.read"}
DefaultTeammateScopes is the default scope assigned to non-admin teammates when no scopes are specified. user.profile.read is the most restrictive read-only scope, allowing only viewing of profile information.
var (
ErrSendgridClientNotProvided = errors.New("sendgrid client not provided")
)
var SendGridScopes = map[Scope]struct{}{}/* 197 elements not displayed */
SendGridScopes is the set of known scopes for SendGrid. Sendgrid does not provide an api to list scopes, so this list is manually maintained from https://www.twilio.com/docs/sendgrid/api-reference/api-key-permissions
Functions ¶
func NewLambdaConnector ¶ added in v0.1.0
func NewLambdaConnector(ctx context.Context, cfg *config.Sendgrid, _ *cli.ConnectorOpts) (connectorbuilder.ConnectorBuilderV2, []connectorbuilder.Opt, error)
NewLambdaConnector creates a new connector from config for lambda/containerized deployment.
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func (*Connector) Asset ¶
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) ResourceSyncers ¶
func (d *Connector) ResourceSyncers(ctx context.Context) []connectorbuilder.ResourceSyncerV2
ResourceSyncers returns a ResourceSyncerV2 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 SendGridClient ¶
type SendGridClient interface {
InviteTeammate(ctx context.Context, email string, scopes []string, isAdmin bool) (*models.TeammateInvitation, error)
GetSpecificTeammate(ctx context.Context, username string) (*models.TeammateScope, error)
GetTeammates(ctx context.Context, pToken *pagination.Token) ([]models.Teammate, string, error)
DeleteTeammate(ctx context.Context, username string) error
GetTeammatesSubAccess(ctx context.Context, username string, pToken *pagination.Token) ([]models.TeammateSubuser, string, error)
GetPendingTeammates(ctx context.Context, pToken *pagination.Token) ([]*models.TeammateInvitation, string, error)
DeletePendingTeammate(ctx context.Context, token 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
}