class BigQueryResourceNaming {

  static String createJobIdPrefix(String jobName, String stepUuid, JobType type, String random) {
    jobName = jobName.replaceAll("-", "");
    String result =
        BIGQUERY_JOB_TEMPLATE
            .replaceFirst("\\{TYPE}", type.toString())
            .replaceFirst("\\{JOB_ID}", jobName)
            .replaceFirst("\\{STEP}", stepUuid);

    if (random != null) {
      return result.replaceFirst("\\{RANDOM}", random);
    } else {
      return result.replaceFirst("_\\{RANDOM}", "");
    }
  }

}