This function can be used to add or update a resource.
For example, to add a desired composed bucket (assuming the "bucket"
resource doesn't yet exist):
```python
resource.update(rsp.desired.resources["bucket"], bucket)
```
Or to update the desired XR:
```python
resource.update(rsp.desired.composite.resource, partial_xr)
```
The source resource can be a dictionary, a protobuf struct, or a
Pydantic model.
Signed-off-by: Nic Cope <nicc@rk0n.org>