---
title: IGoogleMapsApiServiceProxy
summary: API reference for IGoogleMapsApiServiceProxy.
status: draft
owner: SAIF.Core Documentation Team
last_reviewed: 2026-09-24
library: SAIF.Services.Web.Proxies
reference_type: package
---

# IGoogleMapsApiServiceProxy

`IGoogleMapsApiServiceProxy` is the constructor-injection seam that lets `SAIF.Services.Legal.Subpoenas.SubpoenaService` request driving distances without depending on `GoogleMapsApiServiceProxy`'s concrete `WebRequest`-based implementation. It exposes four distance-computation shapes with different error-tolerance behaviors.

## Purpose
- Define the distance-query contract consumed via dependency injection: single-pair, one-to-many, many-to-one, and full-matrix pairwise queries ([OP-WP-09](../../operations/compute-driving-distances.md)).

## Context
- Namespace: `SAIF.Services.Web.Proxies`
- Assembly/package: `SAIF.Services.Web.Proxies` (packaged in `SAIF.SAIFCode.Core`)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `GetMilesBetweenTwoAddresses` | `decimal GetMilesBetweenTwoAddresses(string origin, string destination)` | Returns the driving distance in miles between one origin and one destination; any failure throws a generic mileage-error exception |
| `GetMilesFromManyToOneAddress` | `IList<decimal> GetMilesFromManyToOneAddress(IList<string> origins, string destination)` | Returns miles from each origin to a single destination; a failing element yields 0 rather than throwing ([WP-BR-024](../../business-rules.md#wp-br-024-a-failing-element-contributes-zero-miles)) |
| `GetMilesFromOneToManyAddresses` | `IList<decimal> GetMilesFromOneToManyAddresses(string origin, IList<string> destinations)` | Returns miles from a single origin to each destination; a failing element yields 0 rather than throwing ([WP-BR-024](../../business-rules.md#wp-br-024-a-failing-element-contributes-zero-miles)) |
| `GetMilesBetweenMultipleAddresses` | `IList<decimal> GetMilesBetweenMultipleAddresses(IList<string> origins, IList<string> destinations)` | Returns pairwise miles for equal-length origin/destination lists, throwing if the counts differ ([WP-BR-025](../../business-rules.md#wp-br-025-pairwise-distance-queries-require-equal-counts)) |

## Behavioral notes
- The sole implementation in this library, `GoogleMapsApiServiceProxy`, additionally exposes `GetDataBetweenTwoAddresses`, which is not part of this interface and returns a structured `DistanceResults` with an `ErrorMessage` field instead of throwing on a non-OK status ([WP-BR-023](../../business-rules.md#wp-br-023-a-non-ok-element-status-sets-an-error-message-without-throwing)).

## Constraints and usage notes
- No Autofac registration for this interface exists anywhere in this repository; the composition root that wires it for `SubpoenaService` is external**.

> **Note:** Statements marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `Services/SAIF.Services.Web.Proxies/GoogleMapsApiServiceProxy.cs`
