/// <summary>
        /// Appends the values from the <see cref="CallERJob"/> to the <see cref="UriBuilder"/>.
        /// </summary>
        /// <param name="uri"></param>
        /// <param name="job"></param>
        void AppendJobArgs(UriBuilder uri, CallERJob job)
        {
            Contract.Requires <ArgumentNullException>(uri != null);
            Contract.Requires <ArgumentNullException>(job != null);

            // serialize job as JSON and append as query args
            foreach (var arg in JObject.FromObject(job).Properties())
            {
                if (arg.Value != null)
                {
                    uri.AppendQuery(arg.Name, JTokenToQueryArgValue(arg.Value));
                }
            }
        }
        /// <summary>
        /// Sends a new caller request with a URL for data.
        /// </summary>
        /// <param name="url"></param>
        /// <param name="job"></param>
        /// <returns></returns>
        public async Task <CallERProcessInfo> PostJobAsync(Uri url, CallERJob job)
        {
            Contract.Requires <ArgumentNullException>(url != null);
            Contract.Requires <ArgumentNullException>(job != null);

            // build submission URI
            var uri = new UriBuilder(Uri.Combine("client", clientId, "process", "url"));

            uri.AppendQuery("url", url);
            AppendJobArgs(uri, job);

            // submit request
            using (var message = new HttpRequestMessage(HttpMethod.Post, uri.Uri))
                return(await SendAsync <CallERProcessInfo>(message));
        }
        /// <summary>
        /// Sends a new caller request with an audio file upload.
        /// </summary>
        /// <param name="media"></param>
        /// <param name="mediaType"></param>
        /// <param name="job"></param>
        /// <returns></returns>
        public async Task <CallERProcessInfo> PostJobAsync(Stream media, string mediaType, CallERJob job)
        {
            Contract.Requires <ArgumentNullException>(media != null);
            Contract.Requires <ArgumentNullException>(mediaType != null);
            Contract.Requires <ArgumentNullException>(job != null);

            // build submission URI
            var uri = new UriBuilder(Uri.Combine("client", clientId, "process", "audio"));

            AppendJobArgs(uri, job);

            // submit request
            using (var message = new HttpRequestMessage(HttpMethod.Post, uri.Uri))
            {
                message.Content = new StreamContent(media);
                message.Content.Headers.ContentType = new MediaTypeHeaderValue(mediaType);
                return(await SendAsync <CallERProcessInfo>(message));
            }
        }