Skip to content

EventSourceConfig

Sub classes

Name Children Inherits
FileWatchConfig
evented_config.configs
File watching event source.
    WebhookConfig
    evented_config.configs
    Webhook event source.
      TimeEventConfig
      evented_config.configs
      Time-based event source configuration.
        EmailConfig
        evented_config.configs
        Email event source configuration.

          Base classes

          Name Children Inherits
          Schema
          schemez.schema
          Base class for configuration models.

          ⋔ Inheritance diagram

          graph TD
            711273161["configs.EventSourceConfig"]
            330168112["schema.Schema"]
            3879467795["main.BaseModel"]
            2751680898["builtins.object"]
            330168112 --> 711273161
            3879467795 --> 330168112
            2751680898 --> 3879467795

          🛈 DocStrings

          Bases: Schema

          Base configuration for event sources.

          Source code in src/evented_config/configs.py
          class EventSourceConfig(Schema):
              """Base configuration for event sources."""
          
              type: str = Field(init=False, title="Event source type")
              """Discriminator field for event source types."""
          
              name: str = Field(
                  examples=["file_watcher", "api_webhook", "scheduler"],
                  title="Event source name",
              )
              """Unique identifier for this event source."""
          
              enabled: bool = Field(default=True, title="Source enabled")
              """Whether this event source is active."""
          
              template: str = Field(
                  default=DEFAULT_TEMPLATE,
                  examples=[DEFAULT_TEMPLATE, "New event: {{ content }}", "{{ timestamp }}: {{ source }}"],
                  title="Event template",
              )
              """Jinja2 template for formatting events."""
          
              include_metadata: bool = Field(default=True, title="Include metadata")
              """Control metadata visibility in template."""
          
              include_timestamp: bool = Field(default=True, title="Include timestamp")
              """Control timestamp visibility in template."""
          
              model_config = ConfigDict(json_schema_extra={"x-doc-title": "Event source"})
          
              def get_event_source(
                  self,
              ) -> FileSystemEventSource | WebhookEventSource | EmailEventSource | TimeEventSource:
                  """Create the event source instance.
          
                  Returns:
                      The configured event source instance.
                  """
                  raise NotImplementedError
          

          enabled class-attribute instance-attribute

          enabled: bool = Field(default=True, title='Source enabled')
          

          Whether this event source is active.

          include_metadata class-attribute instance-attribute

          include_metadata: bool = Field(default=True, title='Include metadata')
          

          Control metadata visibility in template.

          include_timestamp class-attribute instance-attribute

          include_timestamp: bool = Field(default=True, title='Include timestamp')
          

          Control timestamp visibility in template.

          name class-attribute instance-attribute

          name: str = Field(examples=['file_watcher', 'api_webhook', 'scheduler'], title='Event source name')
          

          Unique identifier for this event source.

          template class-attribute instance-attribute

          template: str = Field(
              default=DEFAULT_TEMPLATE,
              examples=[DEFAULT_TEMPLATE, "New event: {{ content }}", "{{ timestamp }}: {{ source }}"],
              title="Event template",
          )
          

          Jinja2 template for formatting events.

          type class-attribute instance-attribute

          type: str = Field(init=False, title='Event source type')
          

          Discriminator field for event source types.

          get_event_source

          Create the event source instance.

          Returns:

          Type Description
          FileSystemEventSource | WebhookEventSource | EmailEventSource | TimeEventSource

          The configured event source instance.

          Source code in src/evented_config/configs.py
          def get_event_source(
              self,
          ) -> FileSystemEventSource | WebhookEventSource | EmailEventSource | TimeEventSource:
              """Create the event source instance.
          
              Returns:
                  The configured event source instance.
              """
              raise NotImplementedError
          

          :fa-brands-github: Show source on GitHub