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
file
byte[]The file content as a byte array.
fileName
stringThe original filename of the file being uploaded.
fileType
stringThe MIME type of the file.
Exceptions
- ArgumentNullException
Thrown when
file
is null.- ArgumentException
Thrown when
fileName
orfileType
is 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
stream
StreamThe stream containing the file content.
fileName
stringThe original filename of the file being uploaded.
fileType
stringThe MIME type of the file.
Exceptions
- ArgumentNullException
Thrown when
stream
is null.- ArgumentException
Thrown when
fileName
orfileType
is 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; }