ApplyPatchCallOperation - Go SDK

ApplyPatchCallOperation type definition

The Go SDK and docs are currently in beta. Report issues on GitHub.

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

1applyPatchCallOperation := components.CreateApplyPatchCallOperationCreateFile(components.ApplyPatchCreateFileOperation{/* values here */})

ApplyPatchDeleteFileOperation

1applyPatchCallOperation := components.CreateApplyPatchCallOperationDeleteFile(components.ApplyPatchDeleteFileOperation{/* values here */})

ApplyPatchUpdateFileOperation

1applyPatchCallOperation := components.CreateApplyPatchCallOperationUpdateFile(components.ApplyPatchUpdateFileOperation{/* values here */})

Union Discrimination

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

1switch applyPatchCallOperation.Type {
2 case components.ApplyPatchCallOperationTypeCreateFile:
3 // applyPatchCallOperation.ApplyPatchCreateFileOperation is populated
4 case components.ApplyPatchCallOperationTypeDeleteFile:
5 // applyPatchCallOperation.ApplyPatchDeleteFileOperation is populated
6 case components.ApplyPatchCallOperationTypeUpdateFile:
7 // applyPatchCallOperation.ApplyPatchUpdateFileOperation is populated
8 default:
9 // Unknown type - use applyPatchCallOperation.GetUnknownRaw() for raw JSON
10}