package com.google.graphgeckos.dashboard.fetchers;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Map;

@JsonIgnoreProperties(ignoreUnknown = true)
public class CommitData {
  
  @JsonProperty("after")
  private final String commitHash;

  private String timestamp;

  @JsonProperty("ref")
  private final String branch;

  @JsonProperty("repository")
  private void unpackTimestamp(Map<String, Object> repository) {
    timestamp = repository.get("updated-at").toString();
  }

  CommitData(String commitHash, String branch) {
    this.commitHash = commitHash;
    this.branch = branch;
  }

  public String getBranch() {
    return branch;
  }

  public String getCommitHash() {
    return commitHash;
  }

  public String getTimestamp() {
    return timestamp;
  }

  @Override
  public String toString() {
    return String.format("branch: %s, comitHash: %s, timestamp, %s", branch, commitHash, timestamp);
  }
}

@@ -255,18 +255,16 @@
 tData %7B%0A
-  
 %0A  @Json
@@ -852,152 +852,6 @@
  %7D%0A%0A
-  @Override%0A  public String toString() %7B%0A    return String.format(%22branch: %25s, comitHash: %25s, timestamp, %25s%22, branch, commitHash, timestamp);%0A  %7D%0A
 %7D%0A

remove toString function