/// <summary> /// Gets the name of the operation. /// Source: https://mixpanel.com/help/reference/http#people-analytics-updates /// </summary> /// <param name="operation">The operation.</param> /// <returns></returns> public static string GetOperationName(ProfileUpdateOperation operation) { switch (operation) { case ProfileUpdateOperation.Set: return("$set"); case ProfileUpdateOperation.SetOnce: return("$set_once"); case ProfileUpdateOperation.Add: return("$add"); case ProfileUpdateOperation.Append: return("$append"); case ProfileUpdateOperation.Union: return("$union"); case ProfileUpdateOperation.Unset: return("$unset"); case ProfileUpdateOperation.Delete: return("$delete"); default: return(null); } }
/// <summary> /// Initializes a new instance of the <see cref="ProfileUpdate"/> class. /// </summary> /// <param name="token">The token.</param> /// <param name="distinctId">The distinct id.</param> /// <param name="operation">The operation.</param> /// <exception cref="System.ArgumentException"> /// String cannot be null or empty.;token /// or /// String cannot be null or empty.;distinctId /// </exception> public ProfileUpdate(string token, string distinctId, ProfileUpdateOperation operation) { if (string.IsNullOrEmpty(token)) throw new ArgumentException("String cannot be null or empty.", "token"); if (string.IsNullOrEmpty(distinctId)) throw new ArgumentException("String cannot be null or empty.", "distinctId"); Token = token; DistinctId = distinctId; Operation = operation; }
/// <summary> /// Initializes a new instance of the <see cref="ProfileUpdate"/> class. /// </summary> /// <param name="token">The token.</param> /// <param name="distinctId">The distinct id.</param> /// <param name="operation">The operation.</param> /// <exception cref="System.ArgumentException"> /// String cannot be null or empty.;token /// or /// String cannot be null or empty.;distinctId /// </exception> public ProfileUpdate(string token, string distinctId, ProfileUpdateOperation operation) { if (string.IsNullOrEmpty(token)) { throw new ArgumentException("String cannot be null or empty.", "token"); } if (string.IsNullOrEmpty(distinctId)) { throw new ArgumentException("String cannot be null or empty.", "distinctId"); } Token = token; DistinctId = distinctId; Operation = operation; }
/// <summary> /// Gets the name of the operation. /// Source: https://mixpanel.com/help/reference/http#people-analytics-updates /// </summary> /// <param name="operation">The operation.</param> /// <returns></returns> public static string GetOperationName(ProfileUpdateOperation operation) { switch (operation) { case ProfileUpdateOperation.Set: return "$set"; case ProfileUpdateOperation.SetOnce: return "$set_once"; case ProfileUpdateOperation.Add: return "$add"; case ProfileUpdateOperation.Append: return "$append"; case ProfileUpdateOperation.Union: return "$union"; case ProfileUpdateOperation.Unset: return "$unset"; case ProfileUpdateOperation.Delete: return "$delete"; default: return null; } }