code: public CMASpaceMembership update(CMASpaceMembership membership) {
      assertNotNull(membership, "membership");
  
      final String id = getResourceIdOrThrow(membership, "membership");
      final String spaceId = getSpaceIdOrThrow(membership, "membership");
      final Integer version = getVersionOrThrow(membership, "update");
  
      final CMASystem sys = membership.getSystem();
      membership.setSystem(null);
  
      try {
        return service.update(spaceId, id, membership, version).blockingFirst();
      } finally {
        membership.setSystem(sys);
      }
    }
docs: Update the given membership instance on Contentful.
  <p>
  Please make sure that the instance provided is fetched from Contentful. Otherwise you will
  get an exception thrown.
  
  @param membership the membership fetched from Contentful, updated by caller, to be updated.
  @return the updated membership.
  @throws IllegalArgumentException if space id is null.
  @throws IllegalArgumentException if membership is null.
  @throws IllegalArgumentException if membership id is null.
  @throws IllegalArgumentException if membership does not have a version attached.