/// <summary> /// Returns the <see cref="GeocodingHttpClient"/> of the specified Google OAuth <paramref name="client"/>. /// </summary> /// <param name="client">The Google OAuth client.</param> /// <returns>An instance of <see cref="GeocodingHttpClient"/>.</returns> /// <remarks> /// The <see cref="GeocodingHttpClient"/> instance keeps an internal registry ensuring that calling this method /// multiple times for the same <paramref name="client"/> will result in the same instance of /// <see cref="GeocodingHttpClient"/>. /// /// Specifically the <see cref="GeocodingHttpClient"/> instance will be created the first time this method is /// called, while any subsequent calls to this method will result in the instance saved registry being /// returned. /// </remarks> public static GeocodingHttpClient Geocoding(this GoogleOAuthClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } return(client.GetApiClient(() => new GeocodingHttpClient(client))); }
/// <summary> /// Returns the <see cref="PlacesHttpClient"/> of the specified Google OAuth <paramref name="client"/>. /// </summary> /// <param name="client">The Google OAuth client.</param> /// <returns>An instance of <see cref="PlacesHttpClient"/>.</returns> /// <remarks> /// The <see cref="PlacesHttpClient"/> instance keeps an internal registry ensuring that calling this method /// multiple times for the same <paramref name="client"/> will result in the same instance of /// <see cref="PlacesHttpClient"/>. /// /// Specifically the <see cref="PlacesHttpClient"/> instance will be created the first time this method is /// called, while any subsequent calls to this method will result in the instance saved registry being /// returned. /// </remarks> public static PlacesHttpClient Places(this GoogleOAuthClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } return(client.GetApiClient(() => new PlacesHttpClient(client))); }