/// <summary> /// Enables cleaning any temporary or partial download files first. /// </summary> /// <param name="settings">The settings</param> /// <param name="clean">Whether to clean first. Defaults to true.</param> /// <returns>The updated settings object</returns> public static VagrantBoxAddSettings CleanFirst(this VagrantBoxAddSettings settings, bool clean = true) { settings.Clean = clean; return(settings); }
/// <summary> /// Requests a specific provider as per the <see cref="VagrantBoxAddSettings.Provider" /> property /// </summary> /// <param name="settings">The settings</param> /// <param name="provider">The requested provider</param> /// <returns>The updated settings object</returns> public static VagrantBoxAddSettings UseProvider(this VagrantBoxAddSettings settings, string provider) { settings.Provider = provider; return(settings); }
/// <summary> /// Forces downloading and overwriting any box with the same name /// </summary> /// <param name="settings">The settings</param> /// <param name="force">Whether to force the download. Defaults to true.</param> /// <returns>The updated settings object</returns> public static VagrantBoxAddSettings Force(this VagrantBoxAddSettings settings, bool force = true) { settings.Force = force; return(settings); }
/// <summary> /// Enables unverified/untrusted SSL certificates when using HTTPS URLs. /// </summary> /// <param name="settings">The settings</param> /// <param name="allow">Whether to allow insecure certs. Defaults to true</param> /// <returns>The updated settings object</returns> public static VagrantBoxAddSettings AllowInsecure(this VagrantBoxAddSettings settings, bool allow = true) { settings.Insecure = allow; return(settings); }
/// <summary> /// Sets the <see cref="VagrantBoxAddSettings.CertificatePath" /> property for a client certificate to use when /// downloading the box, if necessary. /// </summary> /// <param name="settings">The settings</param> /// <param name="certFile">Path to the cert file to use</param> /// <returns>The updated settings object</returns> public static VagrantBoxAddSettings WithClientCertificate(this VagrantBoxAddSettings settings, FilePath certFile) { settings.CertificatePath = certFile.FullPath; return(settings); }
/// <summary> /// Sets the <see cref="VagrantBoxAddSettings.CACertificate" /> property for the CA certificate used to verify the peer /// </summary> /// <param name="settings">The settings</param> /// <param name="certPath">The certificate file to use</param> /// <returns>The updated settings object</returns> public static VagrantBoxAddSettings UseCertificateAuthority(this VagrantBoxAddSettings settings, FilePath certPath) { settings.CACertificate = certPath.FullPath; return(settings); }
/// <summary> /// Sets the <see cref="VagrantBoxAddSettings.CAPath" /> property for the CA used to verify the peer /// </summary> /// <param name="settings">The settings</param> /// <param name="caPath">The certificate directory to use</param> /// <returns>The updated settings object</returns> public static VagrantBoxAddSettings UseCertificateAuthority(this VagrantBoxAddSettings settings, IDirectory caPath) { settings.CAPath = caPath.Path.FullPath; return(settings); }
/// <summary> /// Sets the version or version constraint to use when downloading the box /// </summary> /// <param name="settings">The settings</param> /// <param name="version">A version constraint to use (see <see cref="VagrantBoxAddSettings.Version" />)</param> /// <returns>The updated settings object</returns> public static VagrantBoxAddSettings ConstrainVersion(this VagrantBoxAddSettings settings, string version) { settings.Version = version; return(settings); }