"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
Copyright 2022 Lekko Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import builtins
import collections.abc
import google.protobuf.any_pb2
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import lekko_client.gen.lekko.rules.v1beta2.rules_pb2
import lekko_client.gen.lekko.rules.v1beta3.rules_pb2
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 _FeatureType:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _FeatureTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_FeatureType.ValueType], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    FEATURE_TYPE_UNSPECIFIED: _FeatureType.ValueType  # 0
    FEATURE_TYPE_BOOL: _FeatureType.ValueType  # 1
    FEATURE_TYPE_INT: _FeatureType.ValueType  # 2
    FEATURE_TYPE_FLOAT: _FeatureType.ValueType  # 3
    FEATURE_TYPE_STRING: _FeatureType.ValueType  # 4
    FEATURE_TYPE_JSON: _FeatureType.ValueType  # 5
    FEATURE_TYPE_PROTO: _FeatureType.ValueType  # 6

class FeatureType(_FeatureType, metaclass=_FeatureTypeEnumTypeWrapper):
    """Enumerates the canonical types that lekko supports"""

FEATURE_TYPE_UNSPECIFIED: FeatureType.ValueType  # 0
FEATURE_TYPE_BOOL: FeatureType.ValueType  # 1
FEATURE_TYPE_INT: FeatureType.ValueType  # 2
FEATURE_TYPE_FLOAT: FeatureType.ValueType  # 3
FEATURE_TYPE_STRING: FeatureType.ValueType  # 4
FEATURE_TYPE_JSON: FeatureType.ValueType  # 5
FEATURE_TYPE_PROTO: FeatureType.ValueType  # 6
global___FeatureType = FeatureType

@typing_extensions.final
class Feature(google.protobuf.message.Message):
    """A prototype of the wrapper type that will be used to house all feature flags for
    the 'homegrown' feature flagging solution:
    User-defined proto defintions, and a tree-based constraints system.
    A real-life example of this in practice is visualized here:
    https://lucid.app/lucidchart/f735298f-db2c-4207-8d14-28b375a25871/edit?view_items=bV8G0U69AJNc&invitationId=inv_d057a3b1-21d6-4290-9aea-5eb1c556a8ef#
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    KEY_FIELD_NUMBER: builtins.int
    DESCRIPTION_FIELD_NUMBER: builtins.int
    TREE_FIELD_NUMBER: builtins.int
    TYPE_FIELD_NUMBER: builtins.int
    key: builtins.str
    description: builtins.str
    @property
    def tree(self) -> global___Tree: ...
    type: global___FeatureType.ValueType
    def __init__(
        self,
        *,
        key: builtins.str = ...,
        description: builtins.str = ...,
        tree: global___Tree | None = ...,
        type: global___FeatureType.ValueType = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["tree", b"tree"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["description", b"description", "key", b"key", "tree", b"tree", "type", b"type"]) -> None: ...

global___Feature = Feature

@typing_extensions.final
class Tree(google.protobuf.message.Message):
    """When the rules evaluator is traversing the tree, it will keep a local variable
    'value' that is updated along the way and is finally returned. It is initially
    set to the default value of the root node.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    DEFAULT_FIELD_NUMBER: builtins.int
    CONSTRAINTS_FIELD_NUMBER: builtins.int
    DEFAULT_NEW_FIELD_NUMBER: builtins.int
    @property
    def default(self) -> google.protobuf.any_pb2.Any:
        """The default value to fall back to. If there are no constraints/rules
        defined, this is what gets returned.
        """
    @property
    def constraints(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Constraint]: ...
    @property
    def default_new(self) -> global___Any: ...
    def __init__(
        self,
        *,
        default: google.protobuf.any_pb2.Any | None = ...,
        constraints: collections.abc.Iterable[global___Constraint] | None = ...,
        default_new: global___Any | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["default", b"default", "default_new", b"default_new"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["constraints", b"constraints", "default", b"default", "default_new", b"default_new"]) -> None: ...

global___Tree = Tree

@typing_extensions.final
class Constraint(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    RULE_FIELD_NUMBER: builtins.int
    VALUE_FIELD_NUMBER: builtins.int
    CONSTRAINTS_FIELD_NUMBER: builtins.int
    RULE_AST_FIELD_NUMBER: builtins.int
    RULE_AST_NEW_FIELD_NUMBER: builtins.int
    VALUE_NEW_FIELD_NUMBER: builtins.int
    rule: builtins.str
    """RulesLang string. Purely for readability. All edits to ruleslang
    are made through rule_ast_new instead.
    """
    @property
    def value(self) -> google.protobuf.any_pb2.Any:
        """This can be empty. If non-empty, and the above rule evaluated to true,
        then the rules engine should set its return value to this value.
        """
    @property
    def constraints(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Constraint]:
        """If this list is empty, or none of the rules pass,
        return the most recent concrete value we traversed.
        """
    @property
    def rule_ast(self) -> lekko_client.gen.lekko.rules.v1beta2.rules_pb2.Rule:
        """Rules AST used for rules evaluation. It is a strict derivative of the
        string rule above.
        Deprecated: use rule_ast_new instead.
        """
    @property
    def rule_ast_new(self) -> lekko_client.gen.lekko.rules.v1beta3.rules_pb2.Rule:
        """Rules AST used for rules evaluation. It is an n-ary tree."""
    @property
    def value_new(self) -> global___Any: ...
    def __init__(
        self,
        *,
        rule: builtins.str = ...,
        value: google.protobuf.any_pb2.Any | None = ...,
        constraints: collections.abc.Iterable[global___Constraint] | None = ...,
        rule_ast: lekko_client.gen.lekko.rules.v1beta2.rules_pb2.Rule | None = ...,
        rule_ast_new: lekko_client.gen.lekko.rules.v1beta3.rules_pb2.Rule | None = ...,
        value_new: global___Any | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing_extensions.Literal["rule_ast", b"rule_ast", "rule_ast_new", b"rule_ast_new", "value", b"value", "value_new", b"value_new"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing_extensions.Literal["constraints", b"constraints", "rule", b"rule", "rule_ast", b"rule_ast", "rule_ast_new", b"rule_ast_new", "value", b"value", "value_new", b"value_new"]) -> None: ...

global___Constraint = Constraint

@typing_extensions.final
class Any(google.protobuf.message.Message):
    """New custom any type which allows us to manage dynamic types and values
    ourselves in application code.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TYPE_URL_FIELD_NUMBER: builtins.int
    VALUE_FIELD_NUMBER: builtins.int
    type_url: builtins.str
    value: builtins.bytes
    def __init__(
        self,
        *,
        type_url: builtins.str = ...,
        value: builtins.bytes = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing_extensions.Literal["type_url", b"type_url", "value", b"value"]) -> None: ...

global___Any = Any
