File tree Expand file tree Collapse file tree 3 files changed +40
-11
lines changed
src/frequenz/client/common/streaming Expand file tree Collapse file tree 3 files changed +40
-11
lines changed Original file line number Diff line number Diff line change 22
33## Summary
44
5- <!-- Here goes a general summary of what this release is about -->
6-
7- ## Upgrading
8-
9- <!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
10-
115## New Features
126
13- <!-- Here goes the main new features and examples or instructions on how to use them -->
14-
15- ## Bug Fixes
16-
17- <!-- Here goes notable bug fixes that are worth a special mention or explanation -->
7+ - Mapping for the new ` Event ` message has been added.
Original file line number Diff line number Diff line change 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."""
Original file line number Diff line number Diff line change 1+ # License: MIT
2+ # Copyright © 2025 Frequenz Energy-as-a-Service GmbH
3+
4+ """Tests for the frequenz.client.common.v1alpha8.streaming package."""
5+
6+ from frequenz .client .common .enum_proto import enum_from_proto
7+ from frequenz .client .common .streaming import Event
8+
9+
10+ def test_event_enum () -> None :
11+ """Test the Event enum."""
12+ for event in Event :
13+ assert enum_from_proto (event .value , Event ) == event
You can’t perform that action at this time.
0 commit comments