Exemplo n.º 1
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public override List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (To != null)
            {
                p.Add(new KeyValuePair <string, string>("To", To.ToString()));
            }

            if (From != null)
            {
                p.Add(new KeyValuePair <string, string>("From", From.ToString()));
            }

            if (ParentCallSid != null)
            {
                p.Add(new KeyValuePair <string, string>("ParentCallSid", ParentCallSid.ToString()));
            }

            if (Status != null)
            {
                p.Add(new KeyValuePair <string, string>("Status", Status.ToString()));
            }

            if (StartTime != null)
            {
                p.Add(new KeyValuePair <string, string>("StartTime", Serializers.DateTimeIso8601(StartTime)));
            }
            else
            {
                if (StartTimeBefore != null)
                {
                    p.Add(new KeyValuePair <string, string>("StartTime<", Serializers.DateTimeIso8601(StartTimeBefore)));
                }

                if (StartTimeAfter != null)
                {
                    p.Add(new KeyValuePair <string, string>("StartTime>", Serializers.DateTimeIso8601(StartTimeAfter)));
                }
            }

            if (EndTime != null)
            {
                p.Add(new KeyValuePair <string, string>("EndTime", Serializers.DateTimeIso8601(EndTime)));
            }
            else
            {
                if (EndTimeBefore != null)
                {
                    p.Add(new KeyValuePair <string, string>("EndTime<", Serializers.DateTimeIso8601(EndTimeBefore)));
                }

                if (EndTimeAfter != null)
                {
                    p.Add(new KeyValuePair <string, string>("EndTime>", Serializers.DateTimeIso8601(EndTimeAfter)));
                }
            }

            if (PageSize != null)
            {
                p.Add(new KeyValuePair <string, string>("PageSize", PageSize.ToString()));
            }

            return(p);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public override List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (To != null)
            {
                p.Add(new KeyValuePair <string, string>("To", To.ToString()));
            }

            if (From != null)
            {
                p.Add(new KeyValuePair <string, string>("From", From.ToString()));
            }

            if (ParentCallSid != null)
            {
                p.Add(new KeyValuePair <string, string>("ParentCallSid", ParentCallSid.ToString()));
            }

            if (Status != null)
            {
                p.Add(new KeyValuePair <string, string>("Status", Status.ToString()));
            }

            if (StartTime != null)
            {
                p.Add(new KeyValuePair <string, string>("StartTime", StartTime.Value.ToString("yyyy-MM-dd'T'HH:mm:ss")));
            }
            else
            {
                if (StartTimeBefore != null)
                {
                    p.Add(new KeyValuePair <string, string>("StartTime<", StartTimeBefore.Value.ToString("yyyy-MM-dd'T'HH:mm:ss")));
                }

                if (StartTimeAfter != null)
                {
                    p.Add(new KeyValuePair <string, string>("StartTime>", StartTimeAfter.Value.ToString("yyyy-MM-dd'T'HH:mm:ss")));
                }
            }

            if (EndTime != null)
            {
                p.Add(new KeyValuePair <string, string>("EndTime", EndTime.Value.ToString("yyyy-MM-dd'T'HH:mm:ss")));
            }
            else
            {
                if (EndTimeBefore != null)
                {
                    p.Add(new KeyValuePair <string, string>("EndTime<", EndTimeBefore.Value.ToString("yyyy-MM-dd'T'HH:mm:ss")));
                }

                if (EndTimeAfter != null)
                {
                    p.Add(new KeyValuePair <string, string>("EndTime>", EndTimeAfter.Value.ToString("yyyy-MM-dd'T'HH:mm:ss")));
                }
            }

            if (PageSize != null)
            {
                p.Add(new KeyValuePair <string, string>("PageSize", PageSize.ToString()));
            }

            return(p);
        }