public static PsApiManagementHostnameType MapHostnameType(HostnameType hostnameType) { switch (hostnameType) { case HostnameType.Proxy: return(PsApiManagementHostnameType.Proxy); case HostnameType.Portal: return(PsApiManagementHostnameType.Portal); case HostnameType.Management: return(PsApiManagementHostnameType.Management); case HostnameType.Scm: return(PsApiManagementHostnameType.Scm); default: throw new ArgumentException("Unrecognized Hostname Type."); } }
/// <summary> /// Initializes a new instance of the HostnameConfiguration class with /// required arguments. /// </summary> public HostnameConfiguration(HostnameType type, string hostname, CertificateInformation certificate) : this() { if (hostname == null) { throw new ArgumentNullException("hostname"); } if (certificate == null) { throw new ArgumentNullException("certificate"); } this.Type = type; this.Hostname = hostname; this.Certificate = certificate; }
/// <summary> /// Initializes a new instance of the /// ApiServiceUploadCertificateParameters class with required /// arguments. /// </summary> public ApiServiceUploadCertificateParameters(HostnameType type, string encodedCertificate, string certificatePassword) : this() { if (encodedCertificate == null) { throw new ArgumentNullException("encodedCertificate"); } if (certificatePassword == null) { throw new ArgumentNullException("certificatePassword"); } this.Type = type; this.EncodedCertificate = encodedCertificate; this.CertificatePassword = certificatePassword; }