package com.rdkr.tide_display.backend.gcp;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.time.OffsetDateTime;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public class Firmware {

  @JsonIgnore
  private int major;

  @JsonIgnore
  private int minor;

  @JsonIgnore
  private int patch;

  private String url;

  private String eTag;

  private OffsetDateTime lastModified;

  private FirmwareMeta meta;

  public String getVersion() {
    return String.format("%d.%d.%d", major, minor, patch);
  }

  @Getter
  @AllArgsConstructor
  public static class FirmwareMeta {

    private String projectName;

    private int flashSize;

    private String espIdf;

    private String compiled;
  }
}
