// <auto-generated/>

#nullable disable

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

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

        internal InternalChatCompletionResponseMessage(string refusal, ChatMessageContent content)
        {
            Refusal = refusal;
            ToolCalls = new ChangeTrackingList<ChatToolCall>();
            Annotations = new ChangeTrackingList<ChatMessageAnnotation>();
            // Plugin customization: ensure initialization of collection
            Content = content ?? new ChatMessageContent();
        }

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

        public string Refusal { get; }

        public IReadOnlyList<ChatToolCall> ToolCalls { get; }

        public IList<ChatMessageAnnotation> Annotations { get; }

        public ChatOutputAudio Audio { get; }

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