-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path_evaluation_event.py
More file actions
29 lines (25 loc) · 998 Bytes
/
_evaluation_event.py
File metadata and controls
29 lines (25 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
"""Evaluation event model for feature flag telemetry."""
from dataclasses import dataclass
from typing import Optional
from ._feature_flag import FeatureFlag
from ._variant_assignment_reason import VariantAssignmentReason
from ._variant import Variant
@dataclass
class EvaluationEvent:
"""
Represents a feature flag evaluation event.
"""
def __init__(self, feature_flag: Optional[FeatureFlag]):
"""
Initialize the EvaluationEvent.
"""
self.feature = feature_flag
self.user = ""
self.enabled = False
self.variant: Optional[Variant] = None
self.reason: VariantAssignmentReason = VariantAssignmentReason.NONE