public IPetOwnerApiClient GetApiClient(ApiClientType apiClientType) { var apiClient = apiClients.FirstOrDefault(x => x.Key == apiClientType); if (!apiClient.Equals(default(KeyValuePair <ApiClientType, IPetOwnerApiClient>))) { return(apiClient.Value); } else { return(null); } }
public GeoCoderV2(string apiKey, ApiClientType geocodioClientType) { this._apiKey = apiKey; if (geocodioClientType == ApiClientType.RegularApi) { ClientGeocodioApiUrl = System.IO.Path.Combine(regularApiBase, ClientGeocodioApiVersionPrefix); ClientType = geocodioClientType; } else { ClientGeocodioApiUrl = System.IO.Path.Combine(hippaApiBase, ClientGeocodioApiVersionPrefix); ClientType = geocodioClientType; } this._httpClient = new HttpClient(); this._httpClient.BaseAddress = new Uri(ClientGeocodioApiUrl); }
public static IApiClient GetApiClient(ApiClientType type) { switch (type) { case ApiClientType.DebugApiClient: return(new DebugApiClient()); case ApiClientType.OnlineApiClient: return(null); case ApiClientType.OfflineApiClient: return(null); default: return(new DebugApiClient()); } }
public void RegisterApiClient(ApiClientType apiClientType, IPetOwnerApiClient apiClient) { apiClients.Add(new KeyValuePair <ApiClientType, IPetOwnerApiClient>(apiClientType, apiClient)); }