Ejemplo n.º 1
0
        public CdnManagedHttpsOptions(ProtocolType protocolType, CdnCertificateSourceParameters certificateSourceParameters) : base(protocolType)
        {
            if (certificateSourceParameters == null)
            {
                throw new ArgumentNullException(nameof(certificateSourceParameters));
            }

            CertificateSourceParameters = certificateSourceParameters;
            CertificateSource           = CertificateSource.Cdn;
        }
        internal static CdnManagedHttpsOptions DeserializeCdnManagedHttpsOptions(JsonElement element)
        {
            CdnCertificateSourceParameters certificateSourceParameters = default;
            CertificateSource            certificateSource             = default;
            ProtocolType                 protocolType      = default;
            Optional <MinimumTlsVersion> minimumTlsVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("certificateSourceParameters"))
                {
                    certificateSourceParameters = CdnCertificateSourceParameters.DeserializeCdnCertificateSourceParameters(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 CdnManagedHttpsOptions(certificateSource, protocolType, Optional.ToNullable(minimumTlsVersion), certificateSourceParameters));
        }
Ejemplo n.º 3
0
 internal CdnManagedHttpsOptions(CertificateSource certificateSource, ProtocolType protocolType, MinimumTlsVersion?minimumTlsVersion, CdnCertificateSourceParameters certificateSourceParameters) : base(certificateSource, protocolType, minimumTlsVersion)
 {
     CertificateSourceParameters = certificateSourceParameters;
     CertificateSource           = certificateSource;
 }