/// <summary>
        /// Invokes places detail webservice to download detail info about a place identified by <paramref name="prediction"/>.PlaceId
        /// <param name="prediction">Search prediction</param>
        /// <returns>The place details</returns>
        /// </summary>
        public async Task <OperationResult <DetailsResponse> > GetPlaceDetails(Prediction prediction)
        {
            if (string.IsNullOrWhiteSpace(prediction.PlaceId))
            {
                return(OperationResult <DetailsResponse> .AsFailure("PlaceId cannot be empty"));
            }

            var url = _urlFactory.BuildDetailsUrl(prediction.PlaceId);

            using (var client = new HttpClient())
            {
                AcceptJsonResponse(client);

                var response = await client.GetAsync(url).ConfigureAwait(false);

                if (!response.IsSuccessStatusCode)
                {
                    return(OperationResult <DetailsResponse> .AsFailure(response.ReasonPhrase));
                }

                var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

                var detailsResult = JsonConvert.DeserializeObject <DetailsResponse>(content);

                if (detailsResult.Status == GoogleApiResponseStatus.Ok && detailsResult.Result.Prediction != null)
                {
                    detailsResult.Result.Prediction = prediction.Description;
                }


                return(OperationResult <DetailsResponse> .AsSuccess(detailsResult));
            }
        }
        /// <summary>
        /// Invokes places detail webservice to download detail info about a place identified by <paramref name="prediction"/>.PlaceId
        /// <param name="prediction">Search prediction</param>
        /// <returns>The place details</returns>
        /// </summary>
        public Task <OperationResult <DetailsResponse> > GetPlaceDetails(Prediction prediction)
        {
            if (string.IsNullOrWhiteSpace(prediction.PlaceId))
            {
                Task.Run(() =>
                {
                    return(OperationResult <DetailsResponse> .AsFailure("PlaceId cannot be empty"));
                });
            }

            var url = _urlFactory.BuildDetailsUrl(prediction.PlaceId);

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Add("Content-Type", "application/json;charset=utf-8");

                return(client.GetStringAsync(url)
                       .ContinueWith(response =>
                {
                    var detailsResult = JsonConvert.DeserializeObject <DetailsResponse>(response.Result);

                    if (detailsResult.Result.Prediction != null)
                    {
                        detailsResult.Result.Prediction = prediction.Description;
                    }
                    return OperationResult <DetailsResponse> .AsSuccess(detailsResult);
                }));
            }
        }