public GoogleBooksApiClient(ILogger <GoogleBooksApiClient> logger, GoogleApiKey apiKey) { _client = new HttpClient(); _client.BaseAddress = new Uri($"https://www.googleapis.com"); _logger = logger; _apiKey = apiKey; }
public AutocompleteRequest(string input, GoogleApiKey googleApiKey, SessionToken sessionToken = null, IpAddress ipAddress = null) { Input = input; GoogleApiKey = googleApiKey; SessionToken = sessionToken; IpAddress = ipAddress; }
public async Task GetPlaceDetails() { var apiKey = KeyHelper.GetApiKey(); var httpClient = new HttpClient(); httpClient.BaseAddress = UrlHelper.GetStagingUri(); var addressService = new AddressService(apiKey, httpClient); var googleApiKey = new GoogleApiKey(KeyHelper.GetGoogleApiKey()); var googlePlaceId = KeyHelper.GetGooglePlaceId(); var result = await addressService.PlaceDetails(new PlaceDetailsRequest(googlePlaceId, googleApiKey)); Assert.IsTrue(result.IsSuccess); }
public PlaceDetailsRequest(GooglePlaceId placeId, GoogleApiKey googleApiKey) { PlaceId = placeId; GoogleApiKey = googleApiKey; }
public LocationService(HttpClient client, IOptions <GoogleApiKey> options) { _client = client; _apiKey = options.Value; _client.BaseAddress = new Uri(_apiKey.Url); }