code: public Variable updateVariable(Object projectIdOrPath, String key, String value, Boolean isProtected, String environmentScope) throws GitLabApiException {
  
          GitLabApiForm formData = new GitLabApiForm()
                  .withParam("value", value, true)
                  .withParam("protected", isProtected)
                  .withParam("environment_scope",  environmentScope);
          Response response = putWithFormData(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "variables", key);
          return (response.readEntity(Variable.class));
      }
docs: Update a project variable.
  
  <p>NOTE: Updating the environmentScope is only available on GitLab EE.</p>
  
  <pre><code>GitLab Endpoint: PUT /projects/:id/variables/:key</code></pre>
  
  @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
  @param key the key of an existing variable, required
  @param value the value for the variable, required
  @param isProtected whether the variable is protected, optional
  @param environmentScope the environment_scope of the variable, optional.
  @return a Variable instance with the updated variable
  @throws GitLabApiException if any exception occurs during execution