internal static CdnCertificateSourceParameters DeserializeCdnCertificateSourceParameters(JsonElement element) { CdnCertificateSourceParametersTypeName typeName = default; CertificateType certificateType = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("typeName")) { typeName = new CdnCertificateSourceParametersTypeName(property.Value.GetString()); continue; } if (property.NameEquals("certificateType")) { certificateType = new CertificateType(property.Value.GetString()); continue; } } return(new CdnCertificateSourceParameters(typeName, certificateType)); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("certificateType"); writer.WriteStringValue(CertificateType.ToString()); if (Optional.IsDefined(MinimumTlsVersion)) { writer.WritePropertyName("minimumTlsVersion"); writer.WriteStringValue(MinimumTlsVersion.Value.ToSerialString()); } if (Optional.IsDefined(Secret)) { if (Secret != null) { writer.WritePropertyName("secret"); writer.WriteObjectValue(Secret); } else { writer.WriteNull("secret"); } } writer.WriteEndObject(); }