"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
*
DEPRECATED; use flagd.sync.v1
Flag definition sync API

This proto defines a simple API to synchronize a feature flag definition.
It supports establishing a stream for getting notifications about changes in a flag definition.
"""

import builtins
import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import sys
import typing

if sys.version_info >= (3, 10):
    import typing as typing_extensions
else:
    import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _SyncState:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _SyncStateEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SyncState.ValueType], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    SYNC_STATE_UNSPECIFIED: _SyncState.ValueType  # 0
    """Value is ignored by the listening flagd"""
    SYNC_STATE_ALL: _SyncState.ValueType  # 1
    """All the flags matching the request. This is the default response and other states can be ignored
    by the implementation. Flagd internally replaces all existing flags for this response state.
    """
    SYNC_STATE_ADD: _SyncState.ValueType  # 2
    """Convey an addition of a flag. Flagd internally handles this by combining new flags with existing ones"""
    SYNC_STATE_UPDATE: _SyncState.ValueType  # 3
    """Convey an update of a flag. Flagd internally attempts to update if the updated flag already exist OR if it does not,
    it will get added
    """
    SYNC_STATE_DELETE: _SyncState.ValueType  # 4
    """Convey a deletion of a flag. Flagd internally removes the flag"""
    SYNC_STATE_PING: _SyncState.ValueType  # 5
    """Optional server ping to check client connectivity. Handling is ignored by flagd and is to merely support live check"""

class SyncState(_SyncState, metaclass=_SyncStateEnumTypeWrapper):
    """SyncState conveys the state of the payload. These states are related to flagd isync.go type definitions but
    contains extras to optimize grpc use case. Refer - https://github.com/open-feature/flagd/blob/main/pkg/sync/isync.go
    """

SYNC_STATE_UNSPECIFIED: SyncState.ValueType  # 0
"""Value is ignored by the listening flagd"""
SYNC_STATE_ALL: SyncState.ValueType  # 1
"""All the flags matching the request. This is the default response and other states can be ignored
by the implementation. Flagd internally replaces all existing flags for this response state.
"""
SYNC_STATE_ADD: SyncState.ValueType  # 2
"""Convey an addition of a flag. Flagd internally handles this by combining new flags with existing ones"""
SYNC_STATE_UPDATE: SyncState.ValueType  # 3
"""Convey an update of a flag. Flagd internally attempts to update if the updated flag already exist OR if it does not,
it will get added
"""
SYNC_STATE_DELETE: SyncState.ValueType  # 4
"""Convey a deletion of a flag. Flagd internally removes the flag"""
SYNC_STATE_PING: SyncState.ValueType  # 5
"""Optional server ping to check client connectivity. Handling is ignored by flagd and is to merely support live check"""
global___SyncState = SyncState

@typing.final
class SyncFlagsRequest(google.protobuf.message.Message):
    """SyncFlagsRequest is the request initiating the sever-streaming rpc. Flagd sends this request, acting as the client"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    PROVIDER_ID_FIELD_NUMBER: builtins.int
    SELECTOR_FIELD_NUMBER: builtins.int
    provider_id: builtins.str
    """Optional: A unique identifier for flagd(grpc client) initiating the request. The server implementations may
    utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter
    flag configurations that it can expose to this request. This field is intended to be optional. However server
    implementations may enforce it.
       ex:- provider_id: flagd-weatherapp-sidecar
    """
    selector: builtins.str
    """Optional: A selector for the flag configuration request. The server implementation may utilize this to select
    flag configurations from a collection, select the source of the flag or combine this to any desired underlying
    filtering mechanism.
       ex:- selector: 'source=database,app=weatherapp'
    """
    def __init__(
        self,
        *,
        provider_id: builtins.str = ...,
        selector: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["provider_id", b"provider_id", "selector", b"selector"]) -> None: ...

global___SyncFlagsRequest = SyncFlagsRequest

@typing.final
class SyncFlagsResponse(google.protobuf.message.Message):
    """SyncFlagsResponse is the server response containing feature flag configurations and the state"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    FLAG_CONFIGURATION_FIELD_NUMBER: builtins.int
    STATE_FIELD_NUMBER: builtins.int
    flag_configuration: builtins.str
    """flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json"""
    state: global___SyncState.ValueType
    """State conveying the operation to be performed by flagd. See the descriptions of SyncState for an explanation of
    supported values
    """
    def __init__(
        self,
        *,
        flag_configuration: builtins.str = ...,
        state: global___SyncState.ValueType = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["flag_configuration", b"flag_configuration", "state", b"state"]) -> None: ...

global___SyncFlagsResponse = SyncFlagsResponse

@typing.final
class FetchAllFlagsRequest(google.protobuf.message.Message):
    """FetchAllFlagsRequest is the request to fetch all flags. Flagd sends this request as the client in order to resync its internal state"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    PROVIDER_ID_FIELD_NUMBER: builtins.int
    SELECTOR_FIELD_NUMBER: builtins.int
    provider_id: builtins.str
    """Optional: A unique identifier for flagd(grpc client) initiating the request. The server implementations may
    utilize this identifier to uniquely identify, validate(ex:- enforce authentication/authorization) and filter
    flag configurations that it can expose to this request. This field is intended to be optional. However server
    implementations may enforce it.
       ex:- provider_id: flagd-weatherapp-sidecar
    """
    selector: builtins.str
    """Optional: A selector for the flag configuration request. The server implementation may utilize this to select
    flag configurations from a collection, select the source of the flag or combine this to any desired underlying
    filtering mechanism.
       ex:- selector: 'source=database,app=weatherapp'
    """
    def __init__(
        self,
        *,
        provider_id: builtins.str = ...,
        selector: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["provider_id", b"provider_id", "selector", b"selector"]) -> None: ...

global___FetchAllFlagsRequest = FetchAllFlagsRequest

@typing.final
class FetchAllFlagsResponse(google.protobuf.message.Message):
    """ FetchAllFlagsResponse is the server response containing feature flag configurations"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    FLAG_CONFIGURATION_FIELD_NUMBER: builtins.int
    flag_configuration: builtins.str
    """flagd feature flag configuration. Must be validated to schema - https://raw.githubusercontent.com/open-feature/schemas/main/json/flagd-definitions.json"""
    def __init__(
        self,
        *,
        flag_configuration: builtins.str = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["flag_configuration", b"flag_configuration"]) -> None: ...

global___FetchAllFlagsResponse = FetchAllFlagsResponse
