code: public CMAApiKey update(CMAApiKey key) {
      assertNotNull(key, "key");
      final String keyId = getResourceIdOrThrow(key, "key");
      final String spaceId = getSpaceIdOrThrow(key, "key");
      final Integer version = getVersionOrThrow(key, "update");
  
      final CMASystem system = key.getSystem();
      key.setSystem(null);
  
      final String token = key.getAccessToken();
      key.setAccessToken(null);
  
      final CMALink previewKey = key.getPreviewApiKey();
      key.setPreviewApiKey(null);
  
      try {
        return service.update(version, spaceId, keyId, key).blockingFirst();
      } finally {
        key.setPreviewApiKey(previewKey);
        key.setAccessToken(token);
        key.setSystem(system);
      }
    }
docs: Updates a delivery api key from the configured space.
  
  @param key the key to be updated.
  @return the just updated key.
  @throws IllegalArgumentException if key is null.
  @throws IllegalArgumentException if keys id is null.
  @throws IllegalArgumentException if keys spaceId is null.