package com.creatubbles.api.model.upload;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.jasminb.jsonapi.annotations.Id;
import com.github.jasminb.jsonapi.annotations.Type;

import java.util.Date;

@Type("uploads")
public class Upload {

    @Id
    private String id;

    private String url;

    @JsonProperty("content_type")
    private String contentType;

    @JsonProperty("ping_url")
    private String pingUrl;

    @JsonProperty("created_at")
    private Date createdAt;

    public String getId() {
        return id;
    }

    public String getUrl() {
        return url;
    }

    public String getContentType() {
        return contentType;
    }

    public String getPingUrl() {
        return pingUrl;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    @Override
    public String toString() {
        return "Upload{" +
                "id='" + id + '\'' +
                ", url='" + url + '\'' +
                ", contentType='" + contentType + '\'' +
                ", pingUrl='" + pingUrl + '\'' +
                ", createdAt=" + createdAt +
                '}';
    }
}

@@ -36,16 +36,61 @@
 pload;%0A%0A
+import android.support.annotation.Nullable;%0A%0A
 import c
@@ -554,57 +554,552 @@
     
-public String getId() %7B%0A        return id;%0A    %7D%0A
+@JsonProperty(%22updated_at%22)%0A    private Date updatedAt;%0A%0A    @JsonProperty(%22completed_at%22)%0A    private Date completedAt;%0A%0A    private Boolean aborted;%0A%0A    @JsonProperty(%22aborted_with%22)%0A    private String abortedWith;%0A%0A    @JsonProperty(%22processing_completed%22)%0A    private Boolean processingCompleted;%0A%0A    @JsonProperty(%22processing_details%22)%0A    private Object processingDetails;%0A%0A    public String getId() %7B%0A        return id;%0A    %7D%0A%0A    /**%0A     * @return URL to use for file uploads. Null if upload has been completed.%0A     */%0A    @Nullable
 %0A   
@@ -1215,32 +1215,108 @@
 entType;%0A    %7D%0A%0A
+    /**%0A     * @return URL to ping after upload completed or failed%0A     */%0A
     public Strin
@@ -1437,302 +1437,1455 @@
     
-@Override%0A    public String toString() %7B%0A        return %22Upload%7B%22 +%0A                %22id='%22 + id + '%5C'' +%0A                %22, url='%22 + url + '%5C'' +%0A                %22, contentType='%22 + contentType + '%5C'' +%0A                %22, pingUrl='%22 + pingUrl + '%5C'' +%0A                %22, createdAt=%22 + createdAt
+public Date getUpdatedAt() %7B%0A        return updatedAt;%0A    %7D%0A%0A    /**%0A     * @return datetime set when ping URL was called%0A     */%0A    @Nullable%0A    public Date getCompletedAt() %7B%0A        return completedAt;%0A    %7D%0A%0A%0A    /**%0A     * @return true if upload or processing failed%0A     */%0A    public Boolean getAborted() %7B%0A        return aborted;%0A    %7D%0A%0A    /**%0A     * @return string indicating why upload/processing failed%0A     */%0A    @Nullable%0A    public String getAbortedWith() %7B%0A        return abortedWith;%0A    %7D%0A%0A    /**%0A     * @return true after processing finished%0A     */%0A    public Boolean getProcessingCompleted() %7B%0A        return processingCompleted;%0A    %7D%0A%0A    /**%0A     * @return details on processing, e.g. on failure%0A     */%0A    @Nullable%0A    public Object getProcessingDetails() %7B%0A        return processingDetails;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return %22Upload%7B%22 +%0A                %22id='%22 + id + '%5C'' +%0A                %22, url='%22 + url + '%5C'' +%0A                %22, contentType='%22 + contentType + '%5C'' +%0A                %22, pingUrl='%22 + pingUrl + '%5C'' +%0A                %22, createdAt=%22 + createdAt +%0A                %22, updatedAt=%22 + updatedAt +%0A                %22, completedAt=%22 + completedAt +%0A                %22, aborted=%22 + aborted +%0A                %22, abortedWith='%22 + abortedWith + '%5C'' +%0A                %22, processingCompleted=%22 + processingCompleted +%0A                %22, processingDetails=%22 + processingDetails
  +%0A 

Update upload model