// <auto-generated/>

#nullable disable

using System;
using System.Collections.Generic;
using System.Linq;
using OpenAI;
using OpenAI.Internal;

namespace OpenAI.Chat
{
    public partial class StreamingChatCompletionUpdate
    {
        private protected IDictionary<string, BinaryData> _additionalBinaryDataProperties;

        internal StreamingChatCompletionUpdate(string model, string completionId, IEnumerable<InternalCreateChatCompletionStreamResponseChoice> choices, DateTimeOffset createdAt)
        {
            Model = model;
            CompletionId = completionId;
            Choices = choices.ToList();
            CreatedAt = createdAt;
        }

        internal StreamingChatCompletionUpdate(string model, string systemFingerprint, string @object, string completionId, InternalServiceTier? serviceTier, IReadOnlyList<InternalCreateChatCompletionStreamResponseChoice> choices, DateTimeOffset createdAt, ChatTokenUsage usage, IDictionary<string, BinaryData> additionalBinaryDataProperties)
        {
            // Plugin customization: ensure initialization of collections
            Model = model;
            SystemFingerprint = systemFingerprint;
            Object = @object;
            CompletionId = completionId;
            ServiceTier = serviceTier;
            Choices = choices ?? new ChangeTrackingList<InternalCreateChatCompletionStreamResponseChoice>();
            CreatedAt = createdAt;
            Usage = usage;
            _additionalBinaryDataProperties = additionalBinaryDataProperties;
        }

        public string Model { get; }

        public string SystemFingerprint { get; }

        internal IDictionary<string, BinaryData> SerializedAdditionalRawData
        {
            get => _additionalBinaryDataProperties;
            set => _additionalBinaryDataProperties = value;
        }
    }
}
