// <auto-generated/>

#nullable disable

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

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

            string kind = "cat";
            string name = default;
            global::System.Collections.Generic.IDictionary<string, global::System.BinaryData> additionalBinaryDataProperties = new global::Sample.ChangeTrackingDictionary<string, global::System.BinaryData>();
            bool meows = default;

            foreach (var child in element.Elements())
            {
                string localName = child.Name.LocalName;
                if ((localName == "kind"))
                {
                    kind = ((string)child);
                    continue;
                }
                if ((localName == "name"))
                {
                    name = ((string)child);
                    continue;
                }
                if ((localName == "meows"))
                {
                    meows = ((bool)child);
                    continue;
                }
            }
            return new global::Sample.Models.Cat(kind, name, additionalBinaryDataProperties, meows);
        }
    }
}
