// <auto-generated/>

#nullable disable

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

namespace OpenAI.Containers
{
    [Experimental("OPENAI001")]
    public partial class ContainerClient
    {
        private readonly Uri _endpoint;

        protected ContainerClient()
        {
        }

        public ClientPipeline Pipeline { get; }

        public virtual ClientResult GetContainers(int? limit = default, string order = default, string after = default, RequestOptions options = null)
        {
            using PipelineMessage message = CreateGetContainersRequest(limit, order, after, options);
            return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async Task<ClientResult> GetContainersAsync(int? limit = default, string order = default, string after = default, RequestOptions options = null)
        {
            using PipelineMessage message = CreateGetContainersRequest(limit, order, after, options);
            return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }

        public virtual ClientResult CreateContainer(BinaryContent content, RequestOptions options = null)
        {
            Argument.AssertNotNull(content, nameof(content));

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

        public virtual async Task<ClientResult> CreateContainerAsync(BinaryContent content, RequestOptions options = null)
        {
            Argument.AssertNotNull(content, nameof(content));

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

        public virtual ClientResult GetContainer(string containerId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));

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

        public virtual async Task<ClientResult> GetContainerAsync(string containerId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));

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

        public virtual ClientResult DeleteContainer(string containerId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));

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

        public virtual async Task<ClientResult> DeleteContainerAsync(string containerId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));

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

        public virtual ClientResult CreateContainerFile(string containerId, BinaryContent content, string contentType, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));
            Argument.AssertNotNull(content, nameof(content));

            using PipelineMessage message = CreateCreateContainerFileRequest(containerId, content, contentType, options);
            return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async Task<ClientResult> CreateContainerFileAsync(string containerId, BinaryContent content, string contentType, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));
            Argument.AssertNotNull(content, nameof(content));

            using PipelineMessage message = CreateCreateContainerFileRequest(containerId, content, contentType, options);
            return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }

        public virtual ClientResult GetContainerFiles(string containerId, int? limit = default, string order = default, string after = default, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));

            using PipelineMessage message = CreateGetContainerFilesRequest(containerId, limit, order, after, options);
            return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async Task<ClientResult> GetContainerFilesAsync(string containerId, int? limit = default, string order = default, string after = default, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));

            using PipelineMessage message = CreateGetContainerFilesRequest(containerId, limit, order, after, options);
            return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }

        public virtual ClientResult GetContainerFile(string containerId, string fileId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));
            Argument.AssertNotNullOrEmpty(fileId, nameof(fileId));

            using PipelineMessage message = CreateGetContainerFileRequest(containerId, fileId, options);
            return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async Task<ClientResult> GetContainerFileAsync(string containerId, string fileId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));
            Argument.AssertNotNullOrEmpty(fileId, nameof(fileId));

            using PipelineMessage message = CreateGetContainerFileRequest(containerId, fileId, options);
            return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }

        public virtual ClientResult DeleteContainerFile(string containerId, string fileId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));
            Argument.AssertNotNullOrEmpty(fileId, nameof(fileId));

            using PipelineMessage message = CreateDeleteContainerFileRequest(containerId, fileId, options);
            return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async Task<ClientResult> DeleteContainerFileAsync(string containerId, string fileId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));
            Argument.AssertNotNullOrEmpty(fileId, nameof(fileId));

            using PipelineMessage message = CreateDeleteContainerFileRequest(containerId, fileId, options);
            return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }

        public virtual ClientResult GetContainerFileContent(string containerId, string fileId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));
            Argument.AssertNotNullOrEmpty(fileId, nameof(fileId));

            using PipelineMessage message = CreateGetContainerFileContentRequest(containerId, fileId, options);
            return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async Task<ClientResult> GetContainerFileContentAsync(string containerId, string fileId, RequestOptions options = null)
        {
            Argument.AssertNotNullOrEmpty(containerId, nameof(containerId));
            Argument.AssertNotNullOrEmpty(fileId, nameof(fileId));

            using PipelineMessage message = CreateGetContainerFileContentRequest(containerId, fileId, options);
            return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }
    }
}
