class ListVersionsAction implements Runnable {

  @Override public void run() {
    if (listVersionsActionConfig.name == null || !validName(listVersionsActionConfig.name)) {
      throw new IllegalArgumentException(format("Invalid name, must match %s", VALID_NAME_PATTERN));
    }

    try {
      SanitizedSecret sanitizedSecret =
          keywhizClient.getSanitizedSecretByName(listVersionsActionConfig.name);

      List<SanitizedSecret> versions =
          keywhizClient.listSecretVersions(sanitizedSecret.name(),
              listVersionsActionConfig.idx, listVersionsActionConfig.number);
      printing.printSecretVersions(versions, sanitizedSecret.version());
    } catch (NotFoundException e) {
      throw new AssertionError("Secret does not exist: " + listVersionsActionConfig.name);
    } catch (IOException e) {
      throw Throwables.propagate(e);
    }
  }

  public  ListVersionsAction(ListVersionsActionConfig listVersionsActionConfig, KeywhizClient client, Printing printing);

}