GoodAnalytics.Connectors.EventMappings (GoodAnalytics v0.1.1)

Copy Markdown View Source

Context for workspace-scoped custom event connector mappings.

Summary

Functions

Creates a connector event mapping.

Deletes a connector event mapping.

Lists enabled custom event names mapped for a workspace and connector.

Returns an enabled mapping for a custom event and connector.

Gets a mapping by id, scoped to a workspace.

Gets a workspace mapping by event name and connector type.

Lists the enabled mapping structs for a workspace and connector.

Lists mappings for a workspace, optionally scoped to one connector type.

Updates a connector event mapping's delivery configuration.

Functions

create_mapping(attrs)

Creates a connector event mapping.

delete_mapping(mapping)

Deletes a connector event mapping.

enabled_event_names(workspace_id, connector_type)

Lists enabled custom event names mapped for a workspace and connector.

enabled_mapping_for_event(workspace_id, event_name, connector_type)

Returns an enabled mapping for a custom event and connector.

get_mapping(workspace_id, id)

Gets a mapping by id, scoped to a workspace.

Returns nil when the mapping does not exist or belongs to another workspace. Callers must always pass their own workspace_id so a leaked mapping id can never be read, updated, or deleted across a tenant boundary.

get_mapping(workspace_id, event_name, connector_type)

Gets a workspace mapping by event name and connector type.

list_enabled_mappings(workspace_id, connector_type)

Lists the enabled mapping structs for a workspace and connector.

Reconciliation loads these once per connector and indexes them by event name, so it can gate eligibility and build snapshots without a per-event query.

list_mappings(workspace_id, connector_type \\ nil)

Lists mappings for a workspace, optionally scoped to one connector type.

update_mapping(mapping, attrs)

Updates a connector event mapping's delivery configuration.

Only connector_event_name, config, and enabled are mutable — the workspace and identity of the mapping are frozen at creation.