// The modelUpdates parameter needs to be changed from IEnumerable<object> to IEnumerable<string>
        // and not parsed like a json object.
        internal async Task <Response <IReadOnlyList <DigitalTwinsModelData> > > AddAsync(
            IEnumerable <string> models = null,
            CreateModelsOptions digitalTwinModelsAddOptions = null,
            CancellationToken cancellationToken             = default)
        {
            using HttpMessage message = CreateAddRequest(models, digitalTwinModelsAddOptions);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            case 201:
            {
                IReadOnlyList <DigitalTwinsModelData> value = default;
                using JsonDocument document = await JsonDocument
                                              .ParseAsync(message.Response.ContentStream, default, cancellationToken)
                                              .ConfigureAwait(false);

                List <DigitalTwinsModelData> array = new List <DigitalTwinsModelData>(document.RootElement.GetArrayLength());
                foreach (JsonElement item in document.RootElement.EnumerateArray())
                {
                    array.Add(DigitalTwinsModelData.DeserializeDigitalTwinsModelData(item));
                }
                value = array;
                return(Response.FromValue(value, message.Response));
            }
        internal static PagedDigitalTwinsModelDataCollection DeserializePagedDigitalTwinsModelDataCollection(JsonElement element)
        {
            Optional <IReadOnlyList <DigitalTwinsModelData> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <DigitalTwinsModelData> array = new List <DigitalTwinsModelData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DigitalTwinsModelData.DeserializeDigitalTwinsModelData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new PagedDigitalTwinsModelDataCollection(Optional.ToList(value), nextLink.Value));
        }