code: private static ServiceAccount getInstanceByEnvVars() {
          Map<String, String> env = System.getenv();
          String url = env.get(GP_URL);
          String instanceId = env.get(GP_INSTANCE_ID);
          String userId = env.get(GP_USER_ID);
          String password = env.get(GP_PASSWORD);
          String apiKey = env.get(GP_IAM_API_KEY);
          String iamBearerToken=env.get(GP_IAM_BEARER_TOKEN);
          String iamEndpoint=env.get(GP_IAM_ENDPOINT);
          
          return getInstance(url, instanceId, userId, password, apiKey,
                  iamBearerToken, iamEndpoint);
          
      }
docs: Returns an instance of ServiceAccount from the environment variables -
  GP_URL, GP_INSTANCE_ID, GP_USER_ID and GP_PASSWORD.
  <p>
  If any of these are not defined, this method returns null.
  
  @return  An instance of ServiceAccount initialized by the environment
  variables, or null if any of these are not defined.