// <auto-generated/>

#nullable disable

using System;
using System.Collections.Generic;
using OpenAI;

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

        internal InternalChatCompletionStreamResponseDelta() : this(null, null, null, null, default, null, null)
        {
        }

        internal InternalChatCompletionStreamResponseDelta(StreamingChatOutputAudioUpdate audio, StreamingChatFunctionCallUpdate functionCall, IReadOnlyList<StreamingChatToolCallUpdate> toolCalls, string refusal, ChatMessageRole? role, ChatMessageContent content, IDictionary<string, BinaryData> additionalBinaryDataProperties)
        {
            // Plugin customization: ensure initialization of collections
            Audio = audio;
            FunctionCall = functionCall;
            ToolCalls = toolCalls ?? new ChangeTrackingList<StreamingChatToolCallUpdate>();
            Refusal = refusal;
            Role = role;
            Content = content ?? new ChatMessageContent();
            _additionalBinaryDataProperties = additionalBinaryDataProperties;
        }

        public StreamingChatOutputAudioUpdate Audio { get; }

        public StreamingChatFunctionCallUpdate FunctionCall { get; }

        public IReadOnlyList<StreamingChatToolCallUpdate> ToolCalls { get; }

        public string Refusal { get; }

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