// <auto-generated/>

#nullable disable

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

namespace OpenAI.Responses
{
    public partial class OpenAIResponseClient
    {
        private readonly Uri _endpoint;

        protected OpenAIResponseClient()
        {
        }

        internal OpenAIResponseClient(ClientPipeline pipeline, Uri endpoint)
        {
            _endpoint = endpoint;
            Pipeline = pipeline;
        }

        public ClientPipeline Pipeline { get; }

        public virtual ClientResult CancelResponse(string responseId, RequestOptions options)
        {
            Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

            using PipelineMessage message = CreateCancelResponseRequest(responseId, options);
            return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async Task<ClientResult> CancelResponseAsync(string responseId, RequestOptions options)
        {
            Argument.AssertNotNullOrEmpty(responseId, nameof(responseId));

            using PipelineMessage message = CreateCancelResponseRequest(responseId, options);
            return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }
    }
}
