FeatureProtocol
PROTOCOL
FeatureProtocol
public protocol FeatureProtocol: AnyObject
Describes a feature generated from the Causal SDK.
Properties
name
static var name: String
The name of the feature.
args
var args: Args
The arguments associated with this instance of the feature.
status
var status: FeatureStatus<Outputs>
Indicates the current status of the feature
Methods
update(request:)
func update(request: FeatureUpdateRequest) throws
Update the instance of this feature
- Warning This method is intended for
CausalClient
use only.
event(_:)
func event(_ event: Event) -> FeatureEventPayload?
Generates a FeatureEventPayload
from the instance of the feature
which will correctly associate the event with the feature's impression id.
- Parameter event: The
Event
to signal - Returns: Payload object with the correct
Event
andImpressionId
to use when signaling. This will returnnil
if the feature has not been successfully requested from theCausalClient
.
Parameters
Name | Description |
---|---|
event | The Event to signal |
clone()
func clone() -> Self
Returns a new instance of the feature copying over all necessary data.