// <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, ChatMessageRole role, ChatMessageContent content)
        {
            // Plugin customization: ensure initialization of collections
            Refusal = refusal;
            ToolCalls = new ChangeTrackingList<ChatToolCall>();
            Annotations = new ChangeTrackingList<ChatMessageAnnotation>();
            Role = role;
            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)
        {
            // Plugin customization: ensure initialization of collections
            Refusal = refusal;
            ToolCalls = toolCalls ?? new ChangeTrackingList<ChatToolCall>();
            Annotations = annotations ?? new ChangeTrackingList<ChatMessageAnnotation>();
            Audio = audio;
            Role = role;
            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;
        }
    }
}
