// <auto-generated/>

#nullable disable

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

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

        internal InternalChatCompletionMessageListDatum(string content, string refusal, string id, ChatMessageRole role)
        {
            Content = content;
            Refusal = refusal;
            ToolCalls = new ChangeTrackingList<ChatToolCall>();
            Annotations = new ChangeTrackingList<ChatMessageAnnotation>();
            Id = id;
            Role = role;
        }

        internal InternalChatCompletionMessageListDatum(string content, string refusal, IReadOnlyList<ChatToolCall> toolCalls, IList<ChatMessageAnnotation> annotations, InternalChatCompletionResponseMessageFunctionCall functionCall, ChatOutputAudio audio, string id, ChatMessageRole role, IDictionary<string, BinaryData> additionalBinaryDataProperties)
        {
            // Plugin customization: ensure initialization of collections
            Content = content;
            Refusal = refusal;
            ToolCalls = toolCalls ?? new ChangeTrackingList<ChatToolCall>();
            Annotations = annotations ?? new ChangeTrackingList<ChatMessageAnnotation>();
            FunctionCall = functionCall;
            Audio = audio;
            Id = id;
            Role = role;
            _additionalBinaryDataProperties = additionalBinaryDataProperties;
        }

        public string Content { get; }

        public string Refusal { get; }

        public IReadOnlyList<ChatToolCall> ToolCalls { get; }

        public IList<ChatMessageAnnotation> Annotations { get; }

        internal InternalChatCompletionResponseMessageFunctionCall FunctionCall { get; }

        public ChatOutputAudio Audio { get; }

        public string Id { get; }

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