Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This release introduces the `v1alpha8` module to support a new API version.
## New Features

- Provide access to new API using new `v1alpha8` module.
<!-- Here goes the main new features and examples or instructions on how to use them -->
- Mapping for the new `Event` message has been added.

## Bug Fixes

Expand Down
26 changes: 26 additions & 0 deletions src/frequenz/client/common/v1alpha8/streaming/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# License: MIT
# Copyright © 2025 Frequenz Energy-as-a-Service GmbH

"""Type wrappers for the generated protobuf messages."""


from enum import Enum

# pylint: disable-next=no-name-in-module
from frequenz.api.common.v1alpha8.streaming import event_pb2 as PBEvent


class Event(Enum):
"""Enum representing the type of streaming event."""

EVENT_UNSPECIFIED = PBEvent.EVENT_UNSPECIFIED
"""Unspecified event type."""

EVENT_CREATED = PBEvent.EVENT_CREATED
"""Event when a new resource is created."""

EVENT_UPDATED = PBEvent.EVENT_UPDATED
"""Event when an existing resource is updated."""

EVENT_DELETED = PBEvent.EVENT_DELETED
"""Event when a resource is deleted."""
13 changes: 13 additions & 0 deletions tests/test_streaming.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# License: MIT
# Copyright © 2025 Frequenz Energy-as-a-Service GmbH

"""Tests for the frequenz.client.common.v1alpha8.streaming package."""

from frequenz.client.common.enum_proto import enum_from_proto
from frequenz.client.common.v1alpha8.streaming import Event


def test_event_enum() -> None:
"""Test the Event enum."""
for event in Event:
assert enum_from_proto(event.value, Event) == event
Loading