Class BetaResponseInputItem.ApplyPatchCall.Operation
-
- All Implemented Interfaces:
public final class BetaResponseInputItem.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 interfaceBetaResponseInputItem.ApplyPatchCall.Operation.VisitorAn interface that defines how to map each variant of Operation to a value of type T.
public final classBetaResponseInputItem.ApplyPatchCall.Operation.CreateFileInstruction for creating a new file via the apply_patch tool.
public final classBetaResponseInputItem.ApplyPatchCall.Operation.DeleteFileInstruction for deleting an existing file via the apply_patch tool.
public final classBetaResponseInputItem.ApplyPatchCall.Operation.UpdateFileInstruction for updating an existing file via the apply_patch tool.
-
Method Summary
Modifier and Type Method Description final Optional<BetaResponseInputItem.ApplyPatchCall.Operation.CreateFile>createFile()Instruction for creating a new file via the apply_patch tool. final Optional<BetaResponseInputItem.ApplyPatchCall.Operation.DeleteFile>deleteFile()Instruction for deleting an existing file via the apply_patch tool. final Optional<BetaResponseInputItem.ApplyPatchCall.Operation.UpdateFile>updateFile()Instruction for updating an existing file via the apply_patch tool. final BooleanisCreateFile()final BooleanisDeleteFile()final BooleanisUpdateFile()final BetaResponseInputItem.ApplyPatchCall.Operation.CreateFileasCreateFile()Instruction for creating a new file via the apply_patch tool. final BetaResponseInputItem.ApplyPatchCall.Operation.DeleteFileasDeleteFile()Instruction for deleting an existing file via the apply_patch tool. final BetaResponseInputItem.ApplyPatchCall.Operation.UpdateFileasUpdateFile()Instruction for updating an existing file via the apply_patch tool. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaResponseInputItem.ApplyPatchCall.Operation.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaResponseInputItem.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 BetaResponseInputItem.ApplyPatchCall.OperationofCreateFile(BetaResponseInputItem.ApplyPatchCall.Operation.CreateFile createFile)Instruction for creating a new file via the apply_patch tool. final static BetaResponseInputItem.ApplyPatchCall.OperationofDeleteFile(BetaResponseInputItem.ApplyPatchCall.Operation.DeleteFile deleteFile)Instruction for deleting an existing file via the apply_patch tool. final static BetaResponseInputItem.ApplyPatchCall.OperationofUpdateFile(BetaResponseInputItem.ApplyPatchCall.Operation.UpdateFile updateFile)Instruction for updating an existing file via the apply_patch tool. -
-
Method Detail
-
createFile
final Optional<BetaResponseInputItem.ApplyPatchCall.Operation.CreateFile> createFile()
Instruction for creating a new file via the apply_patch tool.
-
deleteFile
final Optional<BetaResponseInputItem.ApplyPatchCall.Operation.DeleteFile> deleteFile()
Instruction for deleting an existing file via the apply_patch tool.
-
updateFile
final Optional<BetaResponseInputItem.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 BetaResponseInputItem.ApplyPatchCall.Operation.CreateFile asCreateFile()
Instruction for creating a new file via the apply_patch tool.
-
asDeleteFile
final BetaResponseInputItem.ApplyPatchCall.Operation.DeleteFile asDeleteFile()
Instruction for deleting an existing file via the apply_patch tool.
-
asUpdateFile
final BetaResponseInputItem.ApplyPatchCall.Operation.UpdateFile asUpdateFile()
Instruction for updating an existing file via the apply_patch tool.
-
accept
final <T extends Any> T accept(BetaResponseInputItem.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 BetaResponseInputItem.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 BetaResponseInputItem.ApplyPatchCall.Operation ofCreateFile(BetaResponseInputItem.ApplyPatchCall.Operation.CreateFile createFile)
Instruction for creating a new file via the apply_patch tool.
-
ofDeleteFile
final static BetaResponseInputItem.ApplyPatchCall.Operation ofDeleteFile(BetaResponseInputItem.ApplyPatchCall.Operation.DeleteFile deleteFile)
Instruction for deleting an existing file via the apply_patch tool.
-
ofUpdateFile
final static BetaResponseInputItem.ApplyPatchCall.Operation ofUpdateFile(BetaResponseInputItem.ApplyPatchCall.Operation.UpdateFile updateFile)
Instruction for updating an existing file via the apply_patch tool.
-
-
-
-