コード例 #1
0
        public static MessageBuildResult Build(
            string token,
            IEnumerable <ObjectProperty> superProperties,
            decimal amount,
            DateTime time,
            object distinctId,
            MixpanelConfig config)
        {
            MessageBuildResult messageBuildResult = PeopleMessageBuilderBase.CreateMessage(
                token,
                superProperties,
                null,
                distinctId,
                config,
                "$append",
                rawValue => throw new InvalidOperationException());

            if (!messageBuildResult.Success)
            {
                return(messageBuildResult);
            }

            messageBuildResult.Message["$append"] = new Dictionary <string, object>(1)
            {
                {
                    "$transactions", new Dictionary <string, object>(2)
                    {
                        { "$time", TimeParser.ParseMixpanelFormat(time).Value },
                        { "$amount", amount }
                    }
                }
            };

            return(messageBuildResult);
        }
コード例 #2
0
 public static MessageBuildResult Build(
     string token,
     IEnumerable <ObjectProperty> superProperties,
     object rawProperties,
     object distinctId,
     MixpanelConfig config)
 {
     return(PeopleMessageBuilderBase.CreateMessage(
                token,
                superProperties,
                rawProperties,
                distinctId,
                config,
                "$add",
                NumberParser.Parse));
 }
コード例 #3
0
 public static MessageBuildResult Build(
     string token,
     IEnumerable <ObjectProperty> superProperties,
     object rawProperties,
     object distinctId,
     MixpanelConfig config)
 {
     return(PeopleMessageBuilderBase.CreateMessage(
                token,
                superProperties,
                rawProperties,
                distinctId,
                config,
                "$union",
                rawValue => CollectionParser.Parse(rawValue, _ => GenericPropertyParser.Parse(_, allowCollections: false))));
 }
コード例 #4
0
        public static MessageBuildResult Build(
            string token,
            IEnumerable <ObjectProperty> superProperties,
            object distinctId,
            MixpanelConfig config)
        {
            MessageBuildResult messageBuildResult = PeopleMessageBuilderBase.CreateMessage(
                token,
                superProperties,
                null,
                distinctId,
                config,
                "$delete",
                rawValue => throw new InvalidOperationException());

            if (!messageBuildResult.Success)
            {
                return(messageBuildResult);
            }

            messageBuildResult.Message["$delete"] = Empty;
            return(messageBuildResult);
        }