package com.metacodestudio.hotsuploader.versions;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.time.LocalDateTime;

public class GitHubRelease {

    @JsonProperty
    private String id;

    @JsonProperty("tag_name")
    private String tagName;

    @JsonProperty("html_url")
    private String htmlUrl;

    @JsonProperty
    private Boolean prerelease;
    @JsonProperty("published_at")
    private LocalDateTime publishedAt;

    public GitHubRelease() {
    }

    public GitHubRelease(final String tagName, final String htmlUrl) {
        this.tagName = tagName;
        this.htmlUrl = htmlUrl;
    }

    public LocalDateTime getPublishedAt() {
        return publishedAt;
    }

    public void setPublishedAt(final LocalDateTime publishedAt) {
        this.publishedAt = publishedAt;
    }

    public String getId() {
        return id;
    }

    public void setId(final String id) {
        this.id = id;
    }

    public String getTagName() {
        return tagName;
    }

    public void setTagName(final String tagName) {
        this.tagName = tagName;
    }

    public String getHtmlUrl() {
        return htmlUrl;
    }

    public void setHtmlUrl(final String htmlUrl) {
        this.htmlUrl = htmlUrl;
    }

    public boolean isPrerelease() {
        if (prerelease == null) {
            return true;
        }
        return prerelease;
    }

    public void setPrerelease(final boolean prerelease) {
        this.prerelease = prerelease;
    }
}

@@ -92,26 +92,85 @@
 Json
+Format;%0Aimport com.fasterxml.jackson.annotation.JsonIgnore
 Propert
-y;%0A
+ies;
 %0Aimport 
 java
@@ -169,33 +169,130 @@
 ort 
-java.time.LocalDateTime;%0A
+com.fasterxml.jackson.annotation.JsonProperty;%0Aimport org.joda.time.DateTime;%0A%0A@JsonIgnoreProperties(ignoreUnknown = true)
 %0Apub
@@ -524,24 +524,109 @@
 prerelease;%0A
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = %22yyyy-MM-dd'T'HH:mm:ssZ%22)%0A
     @JsonPro
@@ -659,21 +659,16 @@
 private 
-Local
 DateTime
@@ -868,20 +868,353 @@
     
+@Override%0A    public String toString() %7B%0A        return %22GitHubRelease%7B%22 +%0A                %22id='%22 + id + '%5C'' +%0A                %22, tagName='%22 + tagName + '%5C'' +%0A                %22, htmlUrl='%22 + htmlUrl + '%5C'' +%0A                %22, prerelease=%22 + prerelease +%0A                %22, publishedAt=%22 + publishedAt +%0A                '%7D';%0A    %7D%0A%0A    
 public 
-Local
 Date
@@ -1313,13 +1313,8 @@
 nal 
-Local
 Date

fix jackson mapping for githubrelease