Class ResponseInputItem.ApplyPatchCall.Operation
-
- All Implemented Interfaces:
public final class ResponseInputItem.ApplyPatchCall.OperationThe specific create, delete, or update instruction for the apply_patch tool call.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResponseInputItem.ApplyPatchCall.Operation.VisitorAn interface that defines how to map each variant of Operation to a value of type T.
public final classResponseInputItem.ApplyPatchCall.Operation.CreateFileInstruction for creating a new file via the apply_patch tool.
public final classResponseInputItem.ApplyPatchCall.Operation.DeleteFileInstruction for deleting an existing file via the apply_patch tool.
public final classResponseInputItem.ApplyPatchCall.Operation.UpdateFileInstruction for updating an existing file via the apply_patch tool.
-
Method Summary
Modifier and Type Method Description final Optional<ResponseInputItem.ApplyPatchCall.Operation.CreateFile>createFile()Instruction for creating a new file via the apply_patch tool. final Optional<ResponseInputItem.ApplyPatchCall.Operation.DeleteFile>deleteFile()Instruction for deleting an existing file via the apply_patch tool. final Optional<ResponseInputItem.ApplyPatchCall.Operation.UpdateFile>updateFile()Instruction for updating an existing file via the apply_patch tool. final BooleanisCreateFile()final BooleanisDeleteFile()final BooleanisUpdateFile()final ResponseInputItem.ApplyPatchCall.Operation.CreateFileasCreateFile()Instruction for creating a new file via the apply_patch tool. final ResponseInputItem.ApplyPatchCall.Operation.DeleteFileasDeleteFile()Instruction for deleting an existing file via the apply_patch tool. final ResponseInputItem.ApplyPatchCall.Operation.UpdateFileasUpdateFile()Instruction for updating an existing file via the apply_patch tool. final Optional<JsonValue>_json()final <T extends Any> Taccept(ResponseInputItem.ApplyPatchCall.Operation.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ResponseInputItem.ApplyPatchCall.Operationvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ResponseInputItem.ApplyPatchCall.OperationofCreateFile(ResponseInputItem.ApplyPatchCall.Operation.CreateFile createFile)Instruction for creating a new file via the apply_patch tool. final static ResponseInputItem.ApplyPatchCall.OperationofDeleteFile(ResponseInputItem.ApplyPatchCall.Operation.DeleteFile deleteFile)Instruction for deleting an existing file via the apply_patch tool. final static ResponseInputItem.ApplyPatchCall.OperationofUpdateFile(ResponseInputItem.ApplyPatchCall.Operation.UpdateFile updateFile)Instruction for updating an existing file via the apply_patch tool. -
-
Method Detail
-
createFile
final Optional<ResponseInputItem.ApplyPatchCall.Operation.CreateFile> createFile()
Instruction for creating a new file via the apply_patch tool.
-
deleteFile
final Optional<ResponseInputItem.ApplyPatchCall.Operation.DeleteFile> deleteFile()
Instruction for deleting an existing file via the apply_patch tool.
-
updateFile
final Optional<ResponseInputItem.ApplyPatchCall.Operation.UpdateFile> updateFile()
Instruction for updating an existing file via the apply_patch tool.
-
isCreateFile
final Boolean isCreateFile()
-
isDeleteFile
final Boolean isDeleteFile()
-
isUpdateFile
final Boolean isUpdateFile()
-
asCreateFile
final ResponseInputItem.ApplyPatchCall.Operation.CreateFile asCreateFile()
Instruction for creating a new file via the apply_patch tool.
-
asDeleteFile
final ResponseInputItem.ApplyPatchCall.Operation.DeleteFile asDeleteFile()
Instruction for deleting an existing file via the apply_patch tool.
-
asUpdateFile
final ResponseInputItem.ApplyPatchCall.Operation.UpdateFile asUpdateFile()
Instruction for updating an existing file via the apply_patch tool.
-
accept
final <T extends Any> T accept(ResponseInputItem.ApplyPatchCall.Operation.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = operation.accept(new Operation.Visitor<Optional<String>>() { @Override public Optional<String> visitCreateFile(CreateFile createFile) { return Optional.of(createFile.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ResponseInputItem.ApplyPatchCall.Operation validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofCreateFile
final static ResponseInputItem.ApplyPatchCall.Operation ofCreateFile(ResponseInputItem.ApplyPatchCall.Operation.CreateFile createFile)
Instruction for creating a new file via the apply_patch tool.
-
ofDeleteFile
final static ResponseInputItem.ApplyPatchCall.Operation ofDeleteFile(ResponseInputItem.ApplyPatchCall.Operation.DeleteFile deleteFile)
Instruction for deleting an existing file via the apply_patch tool.
-
ofUpdateFile
final static ResponseInputItem.ApplyPatchCall.Operation ofUpdateFile(ResponseInputItem.ApplyPatchCall.Operation.UpdateFile updateFile)
Instruction for updating an existing file via the apply_patch tool.
-
-
-
-