// <auto-generated/>

#nullable disable

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

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

        internal InternalRealtimeResponseSession(string id, string model, IEnumerable<InternalRealtimeRequestSessionModality> modalities, string instructions, RealtimeAudioFormat inputAudioFormat, RealtimeAudioFormat outputAudioFormat, InputTranscriptionOptions inputAudioTranscription, TurnDetectionOptions turnDetection, InputNoiseReductionOptions inputAudioNoiseReduction, IEnumerable<ConversationTool> tools, BinaryData toolChoice, float temperature, ConversationVoice voice, BinaryData maxResponseOutputTokens)
        {
            Id = id;
            Model = model;
            Modalities = modalities.ToList();
            Instructions = instructions;
            InputAudioFormat = inputAudioFormat;
            OutputAudioFormat = outputAudioFormat;
            InputAudioTranscription = inputAudioTranscription;
            TurnDetection = turnDetection;
            InputAudioNoiseReduction = inputAudioNoiseReduction;
            Tools = tools.ToList();
            ToolChoice = toolChoice;
            Temperature = temperature;
            Voice = voice;
            _maxResponseOutputTokens = maxResponseOutputTokens;
        }

        internal InternalRealtimeResponseSession(string @object, string id, string model, IList<InternalRealtimeRequestSessionModality> modalities, string instructions, RealtimeAudioFormat inputAudioFormat, RealtimeAudioFormat outputAudioFormat, InputTranscriptionOptions inputAudioTranscription, TurnDetectionOptions turnDetection, InputNoiseReductionOptions inputAudioNoiseReduction, IList<ConversationTool> tools, BinaryData toolChoice, float temperature, ConversationVoice voice, BinaryData maxResponseOutputTokens, IDictionary<string, BinaryData> additionalBinaryDataProperties)
        {
            // Plugin customization: ensure initialization of collections
            Object = @object;
            Id = id;
            Model = model;
            Modalities = modalities ?? new ChangeTrackingList<InternalRealtimeRequestSessionModality>();
            Instructions = instructions;
            InputAudioFormat = inputAudioFormat;
            OutputAudioFormat = outputAudioFormat;
            InputAudioTranscription = inputAudioTranscription;
            TurnDetection = turnDetection;
            InputAudioNoiseReduction = inputAudioNoiseReduction;
            Tools = tools ?? new ChangeTrackingList<ConversationTool>();
            ToolChoice = toolChoice;
            Temperature = temperature;
            Voice = voice;
            _maxResponseOutputTokens = maxResponseOutputTokens;
            _additionalBinaryDataProperties = additionalBinaryDataProperties;
        }

        public string Object { get; } = "realtime.session";

        public string Id { get; }

        public string Model { get; }

        internal IList<InternalRealtimeRequestSessionModality> Modalities { get; }

        public string Instructions { get; }

        public RealtimeAudioFormat InputAudioFormat { get; }

        public RealtimeAudioFormat OutputAudioFormat { get; }

        public InputTranscriptionOptions InputAudioTranscription { get; }

        public TurnDetectionOptions TurnDetection { get; }

        public InputNoiseReductionOptions InputAudioNoiseReduction { get; }

        public IList<ConversationTool> Tools { get; }

        public BinaryData ToolChoice { get; }

        public float Temperature { get; }

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