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

import betterproto
import grpclib


@dataclass(eq=False, repr=False)
class GetXAppConnectionsRequest(betterproto.Message):
    xapp_id: str = betterproto.string_field(1)

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


@dataclass(eq=False, repr=False)
class GetXAppConnectionResponse(betterproto.Message):
    xapp_id: str = betterproto.string_field(1)
    supported_a1_service: str = betterproto.string_field(2)
    supported_a1_service_type_id: str = betterproto.string_field(3)
    xapp_a1_endpoint: str = betterproto.string_field(4)

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


@dataclass(eq=False, repr=False)
class GetPolicyTypeObjectRequest(betterproto.Message):
    policy_type_id: str = betterproto.string_field(1)

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


@dataclass(eq=False, repr=False)
class GetPolicyTypeObjectResponse(betterproto.Message):
    policy_type_id: str = betterproto.string_field(1)
    policy_ids: List[str] = betterproto.string_field(2)
    policy_type_object: str = betterproto.string_field(3)

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


@dataclass(eq=False, repr=False)
class GetPolicyObjectRequest(betterproto.Message):
    policy_type_id: str = betterproto.string_field(1)
    policy_object_id: str = betterproto.string_field(2)

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


@dataclass(eq=False, repr=False)
class GetPolicyObjectResponse(betterproto.Message):
    policy_type_id: str = betterproto.string_field(1)
    policy_object_id: str = betterproto.string_field(2)
    policy_object: str = betterproto.string_field(3)

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


@dataclass(eq=False, repr=False)
class GetPolicyObjectStatusRequest(betterproto.Message):
    policy_type_id: str = betterproto.string_field(1)
    policy_object_id: str = betterproto.string_field(2)

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


@dataclass(eq=False, repr=False)
class GetPolicyObjectStatusResponse(betterproto.Message):
    policy_type_id: str = betterproto.string_field(1)
    policy_object_id: str = betterproto.string_field(2)
    policy_object_status: str = betterproto.string_field(3)

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


class A1TAdminServiceStub(betterproto.ServiceStub):
    async def get_x_app_connections(
        self, *, xapp_id: str = ""
    ) -> AsyncIterator["GetXAppConnectionResponse"]:
        """GetXAppConnections"""

        request = GetXAppConnectionsRequest()
        request.xapp_id = xapp_id

        async for response in self._unary_stream(
            "/onos.a1t.admin.A1TAdminService/GetXAppConnections",
            request,
            GetXAppConnectionResponse,
        ):
            yield response

    async def get_policy_type_object(
        self, *, policy_type_id: str = ""
    ) -> AsyncIterator["GetPolicyTypeObjectResponse"]:
        """GetPolicyTypeObject"""

        request = GetPolicyTypeObjectRequest()
        request.policy_type_id = policy_type_id

        async for response in self._unary_stream(
            "/onos.a1t.admin.A1TAdminService/GetPolicyTypeObject",
            request,
            GetPolicyTypeObjectResponse,
        ):
            yield response

    async def get_policy_object(
        self, *, policy_type_id: str = "", policy_object_id: str = ""
    ) -> AsyncIterator["GetPolicyObjectResponse"]:
        """GetPolicyObject"""

        request = GetPolicyObjectRequest()
        request.policy_type_id = policy_type_id
        request.policy_object_id = policy_object_id

        async for response in self._unary_stream(
            "/onos.a1t.admin.A1TAdminService/GetPolicyObject",
            request,
            GetPolicyObjectResponse,
        ):
            yield response

    async def get_policy_object_status(
        self, *, policy_type_id: str = "", policy_object_id: str = ""
    ) -> AsyncIterator["GetPolicyObjectStatusResponse"]:
        """GetPolicyObjectStatus"""

        request = GetPolicyObjectStatusRequest()
        request.policy_type_id = policy_type_id
        request.policy_object_id = policy_object_id

        async for response in self._unary_stream(
            "/onos.a1t.admin.A1TAdminService/GetPolicyObjectStatus",
            request,
            GetPolicyObjectStatusResponse,
        ):
            yield response
