class UpdateAction implements Runnable {

  @Override public void run() {
    String secretName = config.name;

    if (secretName == null || !validName(secretName)) {
      throw new IllegalArgumentException(format("Invalid name, must match %s", VALID_NAME_PATTERN));
    }

    byte[] content = {};
    if (config.contentProvided) {
      content = readSecretContent();
      if (content.length == 0) {
        throw new IllegalArgumentException("Secret content must be provided if --content flag is present; check inputs");
      }
    }
    partialUpdateSecret(secretName, content, config);

    // If it appears that content was piped in but --content was not specified, print a warning
    if (!config.contentProvided) {
      try {
        InputStreamReader reader = new InputStreamReader(stream, "UTF-8");
        if (reader.ready()) {
          System.out.println("\nWarning: Specify the --content flag to update a secret's content.");
          System.out.println("The secret has not been updated with any provided content.");
        }
      } catch (IOException e) {
        logger.warn("Unexpected error trying to create an InputStreamReader for stdin: '{}'", e.getMessage());
      }
    }
  }

  public  UpdateAction(UpdateActionConfig config, KeywhizClient client,
      ObjectMapper mapper);

}