v1alpha8
frequenz.client.common.grid.proto.v1alpha8 ¤
Conversion of grid objects from/to protobuf v1alpha8.
Functions:¤
frequenz.client.common.grid.proto.v1alpha8.delivery_area_from_proto ¤
delivery_area_from_proto(
message: DeliveryArea,
) -> DeliveryArea
Convert a protobuf message to a DeliveryArea object.
Deprecated
Use delivery_area_from_proto2
instead. The new converter distinguishes well-formed from
malformed data at the type level
(DeliveryArea | InvalidDeliveryArea) rather than silently
constructing a DeliveryArea with invalid content.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The protobuf message to convert.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DeliveryArea
|
The corresponding |
Source code in src/frequenz/client/common/grid/proto/v1alpha8/_delivery_area.py
frequenz.client.common.grid.proto.v1alpha8.delivery_area_from_proto2 ¤
delivery_area_from_proto2(
message: DeliveryArea,
) -> DeliveryArea | InvalidDeliveryArea
Convert a protobuf message to a delivery area object.
A well-formed message becomes a DeliveryArea; a
message that fails the DeliveryArea invariant becomes an
InvalidDeliveryArea carrying the raw wire
data so callers can inspect or report it.
Unknown int code_type values are treated as valid to
preserve forward compatibility with new protobuf enum values.
code_type of 0 will be considered invalid in the future
A 0 value for code_type means it is UNSPECIFIED, which should not
be a valid value, but currently this field is not always being set, and
we normally fall back to a well-known default, so considering it a
validation failure at the moment is not practical.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The protobuf message to convert.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DeliveryArea | InvalidDeliveryArea
|
A |
Source code in src/frequenz/client/common/grid/proto/v1alpha8/_delivery_area.py
frequenz.client.common.grid.proto.v1alpha8.energy_market_code_type_from_proto ¤
energy_market_code_type_from_proto(
message: ValueType,
) -> EnergyMarketCodeType | int
Convert a protobuf EnergyMarketCodeType value to an enum member.
| PARAMETER | DESCRIPTION |
|---|---|
message
|
The protobuf message to convert.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
EnergyMarketCodeType | int
|
The corresponding |
Source code in src/frequenz/client/common/grid/proto/v1alpha8/_delivery_area.py
frequenz.client.common.grid.proto.v1alpha8.energy_market_code_type_to_proto ¤
energy_market_code_type_to_proto(
code_type: EnergyMarketCodeType,
) -> ValueType
Convert a EnergyMarketCodeType enum member to a protobuf value.
| PARAMETER | DESCRIPTION |
|---|---|
code_type
|
The enum member to convert.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ValueType
|
The corresponding protobuf |