Example #1
0
        /// <summary>
        /// Create a <see cref="MerakiDashboardClient"/> based off the given <see cref="MerakiDashboardClientOptions"/> object.
        /// </summary>
        /// <param name="configure">
        /// An optional configuration step on the <see cref="MerakiDashboardClientOptions"/> object being created.
        /// </param>
        /// <returns>
        /// A configured <see cref="MerakiDashboardClient"/> object.
        /// </returns>
        public static MerakiDashboardClient Create(Action <MerakiDashboardClientOptions> configure = null)
        {
            MerakiDashboardClientOptions settings = new MerakiDashboardClientOptions();

            configure?.Invoke(settings);

            return(new MerakiDashboardClient(settings));
        }
 /// <summary>
 /// Create a new <see cref="MerakiDashboardClient"/>.
 /// </summary>
 /// <param name="settings">
 /// The <see cref="MerakiDashboardClientOptions"/> 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="MerakiDashboardClientOptions.ApiKey"/> field cannot be null, empty or whitespace.
 /// </exception>
 public MerakiDashboardClient(MerakiDashboardClientOptions settings)
     : this(new MerakiHttpApiClient(settings?.ApiKey, settings?.BaseAddress))
 {
     // Do nothing
 }