code: public CMAEnvironment update(CMAEnvironment environment) {
      assertNotNull(environment, "environment");
      assertNotNull(environment.getName(), "environment.name");
  
      final String environmentId = getResourceIdOrThrow(environment, "environment id");
      final Integer version = getVersionOrThrow(environment, "update");
      final String spaceId = getSpaceIdOrThrow(environment, "environment");
  
      final CMASystem system = environment.getSystem();
      environment.setSystem(null);
  
      try {
        return service.update(
            version,
            spaceId,
            environmentId,
            environment
        ).blockingFirst();
      } finally {
        environment.setSystem(system);
      }
    }
docs: Update an environment.
  
  @param environment environment
  @return {@link CMAEnvironment} result instance
  @throws IllegalArgumentException if environment is null.
  @throws IllegalArgumentException if environment's name is null.
  @throws IllegalArgumentException if environment's space id is null.
  @throws IllegalArgumentException if environment's environment id is null.
  @throws IllegalArgumentException if environment's version is null.