/// <summary> /// Create a <see cref="MerakiDashboardClient"/> based off the given <see cref="MerakiDashboardClientSettings"/> object. /// </summary> /// <param name="configure"> /// An optional configuration step on the <see cref="MerakiDashboardClientSettings"/> object being created. /// </param> /// <returns> /// A configured <see cref="MerakiDashboardClient"/> object. /// </returns> public static MerakiDashboardClient Create(Action <MerakiDashboardClientSettings> configure = null) { MerakiDashboardClientSettings settings = new MerakiDashboardClientSettings(); MerakiDashboardClientSettingsSetup setup = new MerakiDashboardClientSettingsSetup(); setup.Configure(settings); configure?.Invoke(settings); return(new MerakiDashboardClient(settings)); }
/// <summary> /// Create a new <see cref="MerakiDashboardClient"/>. /// </summary> /// <param name="settings"> /// The <see cref="MerakiDashboardClientSettings"/> to use. This cannot be null. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="settings"/> nor <paramref name="settings.Address"/> can be null. /// </exception> /// <exception cref="ArgumentException"> /// The <see cref="MerakiDashboardClientSettings.ApiKey"/> field cannot be null, empty or whitespace. /// </exception> public MerakiDashboardClient(MerakiDashboardClientSettings settings) : this(new MerakiHttpApiClient(settings?.ApiKey, settings?.BaseAddress)) { // Do nothing }