// <auto-generated/>

#nullable disable

using System.ClientModel.Primitives;
using System.Xml.Linq;
using Sample.Models;

namespace Sample
{
    public partial class Pet
    {
        internal static global::Sample.Models.Pet DeserializePet(global::System.Xml.Linq.XElement element, global::System.ClientModel.Primitives.ModelReaderWriterOptions options)
        {
            if ((element == null))
            {
                return null;
            }

            global::System.Xml.Linq.XElement discriminatorElement = element.Element("kind");
            if ((discriminatorElement != null))
            {
                switch (((string)discriminatorElement))
                {
                    case "cat":
                        return global::Sample.Models.Cat.DeserializeCat(element, options);
                }
            }
            return global::Sample.Models.UnknownPet.DeserializeUnknownPet(element, options);
        }
    }
}
