public static bool TryLoadConfigurationFromJson(string json, out Configuration config, ApiStatus apiStatus = null) { config = new Configuration(); int result = LoadConfigurationFromJson(json, config.NativeHandle, apiStatus.ToNativeHandleOrNullptr()); return(result == NativeMethods.SuccessStatus); }
public bool TryReportOutcome(string actionId, string outcomeJson, ApiStatus apiStatus = null) { int result = LiveModelReportOutcomeJson(this.NativeHandle, actionId, outcomeJson, apiStatus.ToNativeHandleOrNullptr()); return(result == NativeMethods.SuccessStatus); }
public bool TryChooseRank(string actionId, string contextJson, RankingResponse response, ApiStatus apiStatus = null) { int result = LiveModelChooseRank(this.NativeHandle, actionId, contextJson, response.NativeHandle, apiStatus.ToNativeHandleOrNullptr()); return(result == NativeMethods.SuccessStatus); }
public bool TryInit(ApiStatus apiStatus = null) { int result = LiveModelInit(this.NativeHandle, apiStatus.ToNativeHandleOrNullptr()); return(result == NativeMethods.SuccessStatus); }
// TODO: Why does this method call, which seems like a "get" of a value, have an API status? public bool TryGetChosenAction(out long action, ApiStatus status = null) { action = -1; UIntPtr chosenAction; int result = GetRankingChosenAction(this.NativeHandle, out chosenAction, status.ToNativeHandleOrNullptr()); if (result != NativeMethods.SuccessStatus) { return(false); } action = (long)(chosenAction.ToUInt64()); return(true); }
public bool TryQueueOutcomeEvent(string eventId, float outcome, ApiStatus apiStatus = null) { int result = LiveModelReportOutcomeF(this.NativeHandle, eventId, outcome, apiStatus.ToNativeHandleOrNullptr()); return(result == NativeMethods.SuccessStatus); }
public bool TryQueueActionTakenEvent(string eventId, ApiStatus apiStatus = null) { int result = LiveModelReportActionTaken(this.NativeHandle, eventId, apiStatus.ToNativeHandleOrNullptr()); return(result == NativeMethods.SuccessStatus); }
public bool TryChooseRank(string eventId, string contextJson, ActionFlags flags, RankingResponse response, ApiStatus apiStatus = null) { int result = LiveModelChooseRankWithFlags(this.NativeHandle, eventId, contextJson, (uint)flags, response.NativeHandle, apiStatus.ToNativeHandleOrNullptr()); return(result == NativeMethods.SuccessStatus); }