// <auto-generated/>

#nullable disable

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

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

        internal ChatCompletion(string id, string model, IEnumerable<InternalCreateChatCompletionResponseChoice> choices, DateTimeOffset createdAt)
        {
            Id = id;
            Model = model;
            Choices = choices.ToList();
            CreatedAt = createdAt;
        }

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

        public string Id { get; }

        public string Model { get; }

        public string SystemFingerprint { get; }

        public ChatTokenUsage Usage { get; }

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