Class BetaResponseApplyPatchToolCall.Operation
-
- All Implemented Interfaces:
public final class BetaResponseApplyPatchToolCall.OperationOne of the create_file, delete_file, or update_file operations applied via apply_patch.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaResponseApplyPatchToolCall.Operation.VisitorAn interface that defines how to map each variant of Operation to a value of type T.
public final classBetaResponseApplyPatchToolCall.Operation.CreateFileInstruction describing how to create a file via the apply_patch tool.
public final classBetaResponseApplyPatchToolCall.Operation.DeleteFileInstruction describing how to delete a file via the apply_patch tool.
public final classBetaResponseApplyPatchToolCall.Operation.UpdateFileInstruction describing how to update a file via the apply_patch tool.
-
Method Summary
Modifier and Type Method Description final Optional<BetaResponseApplyPatchToolCall.Operation.CreateFile>createFile()Instruction describing how to create a file via the apply_patch tool. final Optional<BetaResponseApplyPatchToolCall.Operation.DeleteFile>deleteFile()Instruction describing how to delete a file via the apply_patch tool. final Optional<BetaResponseApplyPatchToolCall.Operation.UpdateFile>updateFile()Instruction describing how to update a file via the apply_patch tool. final BooleanisCreateFile()final BooleanisDeleteFile()final BooleanisUpdateFile()final BetaResponseApplyPatchToolCall.Operation.CreateFileasCreateFile()Instruction describing how to create a file via the apply_patch tool. final BetaResponseApplyPatchToolCall.Operation.DeleteFileasDeleteFile()Instruction describing how to delete a file via the apply_patch tool. final BetaResponseApplyPatchToolCall.Operation.UpdateFileasUpdateFile()Instruction describing how to update a file via the apply_patch tool. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaResponseApplyPatchToolCall.Operation.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaResponseApplyPatchToolCall.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 BetaResponseApplyPatchToolCall.OperationofCreateFile(BetaResponseApplyPatchToolCall.Operation.CreateFile createFile)Instruction describing how to create a file via the apply_patch tool. final static BetaResponseApplyPatchToolCall.OperationofDeleteFile(BetaResponseApplyPatchToolCall.Operation.DeleteFile deleteFile)Instruction describing how to delete a file via the apply_patch tool. final static BetaResponseApplyPatchToolCall.OperationofUpdateFile(BetaResponseApplyPatchToolCall.Operation.UpdateFile updateFile)Instruction describing how to update a file via the apply_patch tool. -
-
Method Detail
-
createFile
final Optional<BetaResponseApplyPatchToolCall.Operation.CreateFile> createFile()
Instruction describing how to create a file via the apply_patch tool.
-
deleteFile
final Optional<BetaResponseApplyPatchToolCall.Operation.DeleteFile> deleteFile()
Instruction describing how to delete a file via the apply_patch tool.
-
updateFile
final Optional<BetaResponseApplyPatchToolCall.Operation.UpdateFile> updateFile()
Instruction describing how to update a file via the apply_patch tool.
-
isCreateFile
final Boolean isCreateFile()
-
isDeleteFile
final Boolean isDeleteFile()
-
isUpdateFile
final Boolean isUpdateFile()
-
asCreateFile
final BetaResponseApplyPatchToolCall.Operation.CreateFile asCreateFile()
Instruction describing how to create a file via the apply_patch tool.
-
asDeleteFile
final BetaResponseApplyPatchToolCall.Operation.DeleteFile asDeleteFile()
Instruction describing how to delete a file via the apply_patch tool.
-
asUpdateFile
final BetaResponseApplyPatchToolCall.Operation.UpdateFile asUpdateFile()
Instruction describing how to update a file via the apply_patch tool.
-
accept
final <T extends Any> T accept(BetaResponseApplyPatchToolCall.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 BetaResponseApplyPatchToolCall.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 BetaResponseApplyPatchToolCall.Operation ofCreateFile(BetaResponseApplyPatchToolCall.Operation.CreateFile createFile)
Instruction describing how to create a file via the apply_patch tool.
-
ofDeleteFile
final static BetaResponseApplyPatchToolCall.Operation ofDeleteFile(BetaResponseApplyPatchToolCall.Operation.DeleteFile deleteFile)
Instruction describing how to delete a file via the apply_patch tool.
-
ofUpdateFile
final static BetaResponseApplyPatchToolCall.Operation ofUpdateFile(BetaResponseApplyPatchToolCall.Operation.UpdateFile updateFile)
Instruction describing how to update a file via the apply_patch tool.
-
-
-
-