/// <summary> /// Fire is used to fire a new user event. Only the Name, Payload and Filters are respected. This returns the ID or an associated error. Cross DC requests are supported. /// </summary> /// <param name="ue">A User Event definition</param> /// <param name="q">Customized write options</param> /// <returns></returns> public WriteResult<string> Fire(UserEvent ue, WriteOptions q) { var req = _client.CreateWrite<byte[], EventCreationResult>(string.Format("/v1/event/fire/{0}", ue.Name), ue.Payload, q); if (!string.IsNullOrEmpty(ue.NodeFilter)) { req.Params["node"] = ue.NodeFilter; } if (!string.IsNullOrEmpty(ue.ServiceFilter)) { req.Params["service"] = ue.ServiceFilter; } if (!string.IsNullOrEmpty(ue.TagFilter)) { req.Params["tag"] = ue.TagFilter; } var res = req.Execute(); var ret = new WriteResult<string>() { RequestTime = res.RequestTime, Response = res.Response.ID }; return ret; }
/// <summary> /// Fire is used to fire a new user event. Only the Name, Payload and Filters are respected. This returns the ID or an associated error. Cross DC requests are supported. /// </summary> /// <param name="ue">A User Event definition</param> /// <param name="q">Customized write options</param> /// <returns></returns> public async Task<WriteResult<string>> Fire(UserEvent ue, WriteOptions q) { var req = _client.Put<byte[], EventCreationResult>(string.Format("/v1/event/fire/{0}", ue.Name), ue.Payload, q); if (!string.IsNullOrEmpty(ue.NodeFilter)) { req.Params["node"] = ue.NodeFilter; } if (!string.IsNullOrEmpty(ue.ServiceFilter)) { req.Params["service"] = ue.ServiceFilter; } if (!string.IsNullOrEmpty(ue.TagFilter)) { req.Params["tag"] = ue.TagFilter; } var res = await req.Execute().ConfigureAwait(false); return new WriteResult<string>(res, res.Response.ID); }
public WriteResult<string> Fire(UserEvent ue) { return Fire(ue, WriteOptions.Empty); }
public Task <WriteResult <string> > Fire(UserEvent ue, CancellationToken ct = default(CancellationToken)) { return(Fire(ue, WriteOptions.Default, ct)); }
public async Task<WriteResult<string>> Fire(UserEvent ue) { return await Fire(ue, WriteOptions.Default).ConfigureAwait(false); }
public Task<WriteResult<string>> Fire(UserEvent ue) { return Fire(ue, WriteOptions.Default); }
public WriteResult <string> Fire(UserEvent ue) { return(Fire(ue, WriteOptions.Empty)); }
public Task <WriteResult <string> > Fire(UserEvent ue) { return(Fire(ue, WriteOptions.Default)); }