// <auto-generated/>

#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Threading;
using OpenAI.Responses;

namespace OpenAI
{
    public partial class OpenAIClient
    {
        private readonly Uri _endpoint;
        private readonly ApiKeyCredential _keyCredential;
        private const string AuthorizationHeader = "Authorization";
        private const string AuthorizationApiKeyPrefix = "Bearer";
        private OpenAIResponseClient _cachedOpenAIResponseClient;

        protected OpenAIClient()
        {
        }

        public ClientPipeline Pipeline { get; }

        public virtual OpenAIResponseClient GetOpenAIResponseClient()
        {
            return Volatile.Read(ref _cachedOpenAIResponseClient) ?? Interlocked.CompareExchange(ref _cachedOpenAIResponseClient, new OpenAIResponseClient(Pipeline, _endpoint), null) ?? _cachedOpenAIResponseClient;
        }
    }
}
