public void Write(TProtocol oprot) { oprot.IncrementRecursionDepth(); try { TStruct struc = new TStruct("THAnalyticsEvent"); oprot.WriteStructBegin(struc); TField field = new TField(); if (SuperProperties != null && __isset.superProperties) { field.Name = "superProperties"; field.Type = TType.Struct; field.ID = 1; oprot.WriteFieldBegin(field); SuperProperties.Write(oprot); oprot.WriteFieldEnd(); } if (CustomProperties != null && __isset.customProperties) { field.Name = "customProperties"; field.Type = TType.Map; field.ID = 2; oprot.WriteFieldBegin(field); { oprot.WriteMapBegin(new TMap(TType.String, TType.String, CustomProperties.Count)); foreach (string _iter4 in CustomProperties.Keys) { oprot.WriteString(_iter4); oprot.WriteString(CustomProperties[_iter4]); } oprot.WriteMapEnd(); } oprot.WriteFieldEnd(); } if (__isset.deviceTime) { field.Name = "deviceTime"; field.Type = TType.I64; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteI64(DeviceTime); oprot.WriteFieldEnd(); } if (Name != null && __isset.name) { field.Name = "name"; field.Type = TType.String; field.ID = 4; oprot.WriteFieldBegin(field); oprot.WriteString(Name); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); } finally { oprot.DecrementRecursionDepth(); } }
/// <summary> /// Returns a super property by name if exists. If not will return empty Value object /// </summary> /// <param name="name">Name of property to get value</param> /// <returns>Super property registered with specified key</returns> public static Value GetSuperProperty(string name) { if (SuperProperties.TryGetValue(name, out var value)) { return(value); } if (OnceProperties.TryGetValue(name, out value)) { return(value); } return(new Value()); }
public override string ToString() { StringBuilder __sb = new StringBuilder("THAnalyticsEvent("); bool __first = true; if (SuperProperties != null && __isset.superProperties) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("SuperProperties: "); __sb.Append(SuperProperties == null ? "<null>" : SuperProperties.ToString()); } if (CustomProperties != null && __isset.customProperties) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("CustomProperties: "); __sb.Append(CustomProperties.ToDebugString()); } if (__isset.deviceTime) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("DeviceTime: "); __sb.Append(DeviceTime); } if (Name != null && __isset.name) { if (!__first) { __sb.Append(", "); } __first = false; __sb.Append("Name: "); __sb.Append(Name); } __sb.Append(")"); return(__sb.ToString()); }
/// <summary> /// Removes a single superProperty. /// </summary> /// <param name="key">name of the property to unregister</param> public static void Unregister(string key) => SuperProperties.Remove(key);