// <auto-generated/>

#nullable disable

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

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

        internal AudioTranslation(string language, string text, TimeSpan? duration)
        {
            Language = language;
            Text = text;
            Segments = new ChangeTrackingList<TranscribedSegment>();
            Duration = duration;
        }

        internal AudioTranslation(string language, string text, IReadOnlyList<TranscribedSegment> segments, string task, TimeSpan? duration, IDictionary<string, BinaryData> additionalBinaryDataProperties)
        {
            // Plugin customization: ensure initialization of collections
            Language = language;
            Text = text;
            Segments = segments ?? new ChangeTrackingList<TranscribedSegment>();
            Task = task;
            Duration = duration;
            _additionalBinaryDataProperties = additionalBinaryDataProperties;
        }

        public string Language { get; }

        public string Text { get; }

        public IReadOnlyList<TranscribedSegment> Segments { get; }

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