Skip to content

Commit 887bbfc

Browse files
committed
Add streaming.Event bindings to the top-level
This can be added in a backwards-compatible way, so we can add it to the top-level. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 7fc4d15 commit 887bbfc

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# License: MIT
2+
# Copyright © 2025 Frequenz Energy-as-a-Service GmbH
3+
4+
"""Type wrappers for the generated protobuf messages."""
5+
6+
7+
from enum import Enum
8+
9+
# pylint: disable-next=no-name-in-module
10+
from frequenz.api.common.v1alpha8.streaming import event_pb2 as PBEvent
11+
12+
13+
class Event(Enum):
14+
"""Enum representing the type of streaming event."""
15+
16+
EVENT_UNSPECIFIED = PBEvent.EVENT_UNSPECIFIED
17+
"""Unspecified event type."""
18+
19+
EVENT_CREATED = PBEvent.EVENT_CREATED
20+
"""Event when a new resource is created."""
21+
22+
EVENT_UPDATED = PBEvent.EVENT_UPDATED
23+
"""Event when an existing resource is updated."""
24+
25+
EVENT_DELETED = PBEvent.EVENT_DELETED
26+
"""Event when a resource is deleted."""

tests/test_streaming.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# License: MIT
22
# Copyright © 2025 Frequenz Energy-as-a-Service GmbH
33

4-
"""Tests for the frequenz.client.common.v1alpha8.streaming package."""
4+
"""Tests for the frequenz.client.common.streaming package."""
55

66
from frequenz.client.common.enum_proto import enum_from_proto
7-
from frequenz.client.common.v1alpha8.streaming import Event
7+
from frequenz.client.common.streaming import Event
88

99

1010
def test_event_enum() -> None:

0 commit comments

Comments
 (0)