# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: onos/kpimon/kpimon.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncIterator, Dict, List

import betterproto
import grpclib


@dataclass(eq=False, repr=False)
class GetRequest(betterproto.Message):
    pass

    def __post_init__(self) -> None:
        super().__post_init__()


@dataclass(eq=False, repr=False)
class GetResponse(betterproto.Message):
    measurements: Dict[str, "MeasurementItems"] = betterproto.map_field(
        1, betterproto.TYPE_STRING, betterproto.TYPE_MESSAGE
    )

    def __post_init__(self) -> None:
        super().__post_init__()


@dataclass(eq=False, repr=False)
class MeasurementItems(betterproto.Message):
    measurement_items: List["MeasurementItem"] = betterproto.message_field(1)

    def __post_init__(self) -> None:
        super().__post_init__()


@dataclass(eq=False, repr=False)
class MeasurementItem(betterproto.Message):
    measurement_records: List["MeasurementRecord"] = betterproto.message_field(1)

    def __post_init__(self) -> None:
        super().__post_init__()


@dataclass(eq=False, repr=False)
class IntegerValue(betterproto.Message):
    value: int = betterproto.int64_field(1)

    def __post_init__(self) -> None:
        super().__post_init__()


@dataclass(eq=False, repr=False)
class RealValue(betterproto.Message):
    value: float = betterproto.double_field(1)

    def __post_init__(self) -> None:
        super().__post_init__()


@dataclass(eq=False, repr=False)
class NoValue(betterproto.Message):
    value: int = betterproto.int32_field(1)

    def __post_init__(self) -> None:
        super().__post_init__()


@dataclass(eq=False, repr=False)
class MeasurementRecord(betterproto.Message):
    timestamp: int = betterproto.uint64_field(2)
    measurement_name: str = betterproto.string_field(3)
    measurement_value: "betterproto_lib_google_protobuf.Any" = (
        betterproto.message_field(4)
    )

    def __post_init__(self) -> None:
        super().__post_init__()


class KpimonStub(betterproto.ServiceStub):
    async def list_measurements(self) -> "GetResponse":

        request = GetRequest()

        return await self._unary_unary(
            "/onos.kpimon.Kpimon/ListMeasurements", request, GetResponse
        )

    async def watch_measurements(self) -> AsyncIterator["GetResponse"]:

        request = GetRequest()

        async for response in self._unary_stream(
            "/onos.kpimon.Kpimon/WatchMeasurements",
            request,
            GetResponse,
        ):
            yield response


import betterproto.lib.google.protobuf as betterproto_lib_google_protobuf
