Class CreateFileRequest
- Namespace
- AnthropicClient.Models
- Assembly
- AnthropicClient.dll
Represents a request to create a file via the Anthropic Files API.
public class CreateFileRequest
- Inheritance
-
CreateFileRequest
- Inherited Members
Constructors
CreateFileRequest(byte[], string, string)
Initializes a new instance of the CreateFileRequest class.
public CreateFileRequest(byte[] file, string fileName, string fileType)
Parameters
filebyte[]The file content as a byte array.
fileNamestringThe original filename of the file being uploaded.
fileTypestringThe MIME type of the file.
Exceptions
- ArgumentNullException
Thrown when
fileis null.- ArgumentException
Thrown when
fileNameorfileTypeis null or whitespace.
CreateFileRequest(Stream, string, string)
Initializes a new instance of the CreateFileRequest class from a stream.
public CreateFileRequest(Stream stream, string fileName, string fileType)
Parameters
streamStreamThe stream containing the file content.
fileNamestringThe original filename of the file being uploaded.
fileTypestringThe MIME type of the file.
Exceptions
- ArgumentNullException
Thrown when
streamis null.- ArgumentException
Thrown when
fileNameorfileTypeis null or whitespace.
Properties
File
The file content as a byte array.
public byte[] File { get; init; }
Property Value
- byte[]
FileName
The original filename of the file being uploaded.
public string FileName { get; init; }
Property Value
FileType
The MIME type of the file.
public string FileType { get; init; }