// <auto-generated/>

#nullable disable

using System.ClientModel;
using System.ClientModel.Primitives;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using Sample.Models;

namespace Sample
{
    public partial class MultipartClient
    {
        public virtual global::System.ClientModel.ClientResult Upload(global::System.ClientModel.BinaryContent content, string contentType, global::System.ClientModel.Primitives.RequestOptions options = null)
        {
            global::Sample.Argument.AssertNotNull(content, nameof(content));
            global::Sample.Argument.AssertNotNullOrEmpty(contentType, nameof(contentType));

            using global::System.ClientModel.Primitives.PipelineMessage message = this.CreateUploadRequest(content, contentType, options);
            return global::System.ClientModel.ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async global::System.Threading.Tasks.Task<global::System.ClientModel.ClientResult> UploadAsync(global::System.ClientModel.BinaryContent content, string contentType, global::System.ClientModel.Primitives.RequestOptions options = null)
        {
            global::Sample.Argument.AssertNotNull(content, nameof(content));
            global::Sample.Argument.AssertNotNullOrEmpty(contentType, nameof(contentType));

            using global::System.ClientModel.Primitives.PipelineMessage message = this.CreateUploadRequest(content, contentType, options);
            return global::System.ClientModel.ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }

        [global::System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SCME0004")]
        public virtual global::System.ClientModel.ClientResult Upload(global::Sample.Models.OptionalFileRequest body, global::System.Threading.CancellationToken cancellationToken = default)
        {
            global::Sample.Argument.AssertNotNull(body, nameof(body));

            using global::System.ClientModel.MultiPartFormContent content = body.ToMultipartFormContent();
            return this.Upload(content, content.MediaType, cancellationToken.ToRequestOptions());
        }

        [global::System.Diagnostics.CodeAnalysis.ExperimentalAttribute("SCME0004")]
        public virtual async global::System.Threading.Tasks.Task<global::System.ClientModel.ClientResult> UploadAsync(global::Sample.Models.OptionalFileRequest body, global::System.Threading.CancellationToken cancellationToken = default)
        {
            global::Sample.Argument.AssertNotNull(body, nameof(body));

            using global::System.ClientModel.MultiPartFormContent content = body.ToMultipartFormContent();
            return await this.UploadAsync(content, content.MediaType, cancellationToken.ToRequestOptions()).ConfigureAwait(false);
        }
    }
}
