public IList <T> GetItemsOfType <T>(string instrumentationKey)
        {
            if (true == string.IsNullOrWhiteSpace(instrumentationKey))
            {
                throw new ArgumentNullException("instrumentationKey");
            }

            var telemetryItems     = new List <T>();
            var itemData           = this.GetItem(instrumentationKey);
            var allTelemetryItems  = TelemetryItemFactory.GetTelemetryItems(itemData);
            var requestedTypeItems = allTelemetryItems.Where(it => it.GetType() == typeof(T)).Cast <T>().ToArray();

            telemetryItems.AddRange(requestedTypeItems);

            return(telemetryItems);
        }
        public IList <Envelope> ListItems(string instrumentationKey)
        {
            if (true == string.IsNullOrWhiteSpace(instrumentationKey))
            {
                throw new ArgumentNullException("instrumentationKey");
            }

            var telemetryItems = new List <Envelope>();

            foreach (var uploadedItemId in ListItemIds(instrumentationKey))
            {
                var itemData = this.GetItem(uploadedItemId);

                Trace.TraceInformation(
                    "Received data item content saved at data endpoint, uploadedItemId:{0}, data:{1}",
                    uploadedItemId,
                    itemData);

                telemetryItems.AddRange(TelemetryItemFactory.GetTelemetryItems(itemData));
            }

            return(telemetryItems);
        }