What is the proper way to modify a project resource via the SDK?

In the GatewayContext, what are the steps necessary to modify a json config? I've tried creating a ProjectResourceBuilder from the project resource I want to modify, and use its putData() function with the data key and new bytes, but when I retrieve it again afterwards to check, I don't see my changes made. I see RuntimeProjectBuilder class has a setResources function and RuntimeProject having an applyChanges function, should these be used instead or is there a better way?

From the gateway, the only supported way is by pushing ChangeOperations.

See this thread for some inspiration: