public UserManagedHttpsContent(ProtocolType protocolType, KeyVaultCertificateSource certificateSourceParameters) : base(protocolType) { if (certificateSourceParameters == null) { throw new ArgumentNullException(nameof(certificateSourceParameters)); } CertificateSourceParameters = certificateSourceParameters; CertificateSource = CertificateSource.AzureKeyVault; }
internal static UserManagedHttpsContent DeserializeUserManagedHttpsContent(JsonElement element) { KeyVaultCertificateSource certificateSourceParameters = default; CertificateSource certificateSource = default; ProtocolType protocolType = default; Optional <MinimumTlsVersion> minimumTlsVersion = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("certificateSourceParameters")) { certificateSourceParameters = KeyVaultCertificateSource.DeserializeKeyVaultCertificateSource(property.Value); continue; } if (property.NameEquals("certificateSource")) { certificateSource = new CertificateSource(property.Value.GetString()); continue; } if (property.NameEquals("protocolType")) { protocolType = new ProtocolType(property.Value.GetString()); continue; } if (property.NameEquals("minimumTlsVersion")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } minimumTlsVersion = property.Value.GetString().ToMinimumTlsVersion(); continue; } } return(new UserManagedHttpsContent(certificateSource, protocolType, Optional.ToNullable(minimumTlsVersion), certificateSourceParameters)); }
internal UserManagedHttpsContent(CertificateSource certificateSource, ProtocolType protocolType, MinimumTlsVersion?minimumTlsVersion, KeyVaultCertificateSource certificateSourceParameters) : base(certificateSource, protocolType, minimumTlsVersion) { CertificateSourceParameters = certificateSourceParameters; CertificateSource = certificateSource; }