// <auto-generated/>

#nullable disable

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

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

        internal InternalCreateCompletionResponse(string id, IEnumerable<InternalCreateCompletionResponseChoice> choices, DateTimeOffset created, string model)
        {
            Id = id;
            Choices = choices.ToList();
            Created = created;
            Model = model;
        }

        internal InternalCreateCompletionResponse(string id, IList<InternalCreateCompletionResponseChoice> choices, DateTimeOffset created, string model, string systemFingerprint, string @object, ChatTokenUsage usage, IDictionary<string, BinaryData> additionalBinaryDataProperties)
        {
            // Plugin customization: ensure initialization of collections
            Id = id;
            Choices = choices ?? new ChangeTrackingList<InternalCreateCompletionResponseChoice>();
            Created = created;
            Model = model;
            SystemFingerprint = systemFingerprint;
            Object = @object;
            Usage = usage;
            _additionalBinaryDataProperties = additionalBinaryDataProperties;
        }

        public string Id { get; }

        internal IList<InternalCreateCompletionResponseChoice> Choices { get; }

        public DateTimeOffset Created { get; }

        public string Model { get; }

        public string SystemFingerprint { get; }

        public string Object { get; } = "text_completion";

        public ChatTokenUsage Usage { get; }

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