> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter-d02e98a0-mintlify-5b6e02fd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ApplyPatchCallOperation - Go SDK

> ApplyPatchCallOperation type definition

<Warning>
  The Go SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/go-sdk/issues).
</Warning>

The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it.

## Supported Types

### ApplyPatchCreateFileOperation

```go lines theme={null}
applyPatchCallOperation := components.CreateApplyPatchCallOperationCreateFile(components.ApplyPatchCreateFileOperation{/* values here */})
```

### ApplyPatchDeleteFileOperation

```go lines theme={null}
applyPatchCallOperation := components.CreateApplyPatchCallOperationDeleteFile(components.ApplyPatchDeleteFileOperation{/* values here */})
```

### ApplyPatchUpdateFileOperation

```go lines theme={null}
applyPatchCallOperation := components.CreateApplyPatchCallOperationUpdateFile(components.ApplyPatchUpdateFileOperation{/* values here */})
```

## Union Discrimination

Use the `Type` field to determine which variant is active, then access the corresponding field:

```go lines theme={null}
switch applyPatchCallOperation.Type {
	case components.ApplyPatchCallOperationTypeCreateFile:
		// applyPatchCallOperation.ApplyPatchCreateFileOperation is populated
	case components.ApplyPatchCallOperationTypeDeleteFile:
		// applyPatchCallOperation.ApplyPatchDeleteFileOperation is populated
	case components.ApplyPatchCallOperationTypeUpdateFile:
		// applyPatchCallOperation.ApplyPatchUpdateFileOperation is populated
	default:
		// Unknown type - use applyPatchCallOperation.GetUnknownRaw() for raw JSON
}
```
