ParseStreamingEndPointId() public static method

Validate and parse the streaming endpoint Id to Guid format.
public static ParseStreamingEndPointId ( string streamingEndpointId ) : System.Guid
streamingEndpointId string The streaming endpoint Id.
return System.Guid
        /// <summary>
        /// Get metrics for a Media Services Streaming EndPoint.
        /// </summary>
        /// <param name="endpointAddress">The Telemetry endpoint address</param>
        /// <param name="storageAccountKey">The Storage account key.</param>
        /// <param name="mediaServicesAccountId">The Media Services account Id.</param>
        /// <param name="streamingEndPointId">The Streaming EndPoint ID</param>
        /// <param name="start">The start time.</param>
        /// <param name="end">The end time.</param>
        /// <returns>The Streaming EndPoint metrics for the given channel within the given time range.</returns>
        public Task <ICollection <IStreamingEndPointRequestLog> > GetStreamingEndPointMetricsAsync(
            string endpointAddress,
            string storageAccountKey,
            string mediaServicesAccountId,
            string streamingEndPointId,
            DateTime start,
            DateTime end)
        {
            if (endpointAddress == null)
            {
                throw new ArgumentNullException("endpointAddress");
            }

            if (storageAccountKey == null)
            {
                throw new ArgumentNullException("storageAccountKey");
            }

            if (mediaServicesAccountId == null)
            {
                throw new ArgumentNullException("mediaServicesAccountId");
            }

            Guid accountId;

            if (!Guid.TryParse(mediaServicesAccountId, out accountId))
            {
                throw new ArgumentException(StringTable.InvalidMediaServicesAccountIdInput);
            }

            var streamingEndPointGuid = TelemetryUtilities.ParseStreamingEndPointId(streamingEndPointId);

            if (start.Kind != DateTimeKind.Utc)
            {
                throw new ArgumentException(StringTable.NonUtcDateTime, "start");
            }

            if (end.Kind != DateTimeKind.Utc)
            {
                throw new ArgumentException(StringTable.NonUtcDateTime, "end");
            }

            if (start >= end)
            {
                throw new ArgumentException(StringTable.InvalidTimeRange, "start");
            }

            var storageAccount = TelemetryUtilities.GetStorageAccountName(endpointAddress);

            if (MediaContext.StorageAccounts.Where(c => c.Name == storageAccount).FirstOrDefault() == null)
            {
                throw new ArgumentException(StringTable.InvalidStorageAccount);
            }

            return(Task.Factory.StartNew(() =>
            {
                var telemetryStorage = new TelemetryStorage(new StorageCredentials(storageAccount, storageAccountKey), new Uri(endpointAddress));

                return telemetryStorage.GetStreamingEndPointMetrics(
                    accountId,
                    streamingEndPointGuid,
                    start,
                    end);
            }));
        }