public MerakiClient(MerakiClientSettings settings) { _client = new HttpClient(new HttpClientHandler()) { BaseAddress = new Uri(settings.Address) }; _client.DefaultRequestHeaders.Add("X-Cisco-Meraki-API-Key", settings.Key); _client.DefaultRequestHeaders.Add("Accept-Type", "application/json"); }
public static MerakiClient Create(Action <MerakiClientSettings> configure) { var settings = new MerakiClientSettings(); var options = Options.Create(settings); var setup = new MerakiClientSettingsSetup(); setup.Configure(settings); configure?.Invoke(settings); return(new MerakiClient(settings)); }