package com.todoist.model;

public class BaseFileAttachment {
    /**
     * Merely indicative. There's no guarantee the actual small thumbnail will have this size.
     * */
    public static final int THUMBNAIL_SMALL_SIZE = 96;
    /**
     * Merely indicative. There's no guarantee the actual medium thumbnail will have this size.
     * */
    public static final int THUMBNAIL_MEDIUM_SIZE = 288;
    /**
     * Merely indicative. There's no guarantee the actual large thumbnail will have this size.
     * */
    public static final int THUMBNAIL_LARGE_SIZE = 528;

    /**
     * The upload is currently pending, meaning it's waiting for upload, currently being uploaded, or the upload failed
     * but the user hasn't chosen to retry or cancel.
     */
    public static final String UPLOAD_STATE_PENDING = "pending";
    /**
     * The upload has been successfully completed.
     * */
    public static final String UPLOAD_STATE_COMPLETED = "completed";
    /**
     * The upload has failed and the user chose to cancel it.
     */
    public static final String UPLOAD_STATE_CANCELED = "canceled";

    private String fileUrl;
    private String fileName;
    private String fileType;
    private String fileUnderlyingType;
    private Long fileSize;
    private String uploadState;
    private BaseThumbnail thumbnailSmall;
    private BaseThumbnail thumbnailMedium;
    private BaseThumbnail thumbnailLarge;

    public BaseFileAttachment(String fileUrl, String fileName, String fileType, String fileUnderlyingType, Long fileSize,
                              String uploadState, BaseThumbnail thumbnailSmall,
                              BaseThumbnail thumbnailMedium, BaseThumbnail thumbnailLarge) {
        this.fileUrl = fileUrl;
        this.fileName = fileName;
        this.fileType = fileType;
        this.fileUnderlyingType = fileUnderlyingType;
        this.fileSize = fileSize;
        this.uploadState = uploadState;
        this.thumbnailSmall = thumbnailSmall;
        this.thumbnailMedium = thumbnailMedium;
        this.thumbnailLarge = thumbnailLarge;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getFileUnderlyingType() {
        return fileUnderlyingType;
    }

    public void setFileUnderlyingType(String fileUnderlyingType) {
        this.fileUnderlyingType = fileUnderlyingType;
    }

    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    public String getUploadState() {
        return uploadState;
    }

    public boolean isUploadCompleted() {
        return Utils.equals(uploadState, UPLOAD_STATE_COMPLETED);
    }

    public boolean isUploadCanceled() {
        return Utils.equals(uploadState, UPLOAD_STATE_CANCELED);
    }

    public boolean isUploadPending() {
        return Utils.equals(uploadState, UPLOAD_STATE_PENDING);
    }

    public void setUploadState(String uploadState) {
        this.uploadState = uploadState;
    }

    public BaseThumbnail getThumbnailSmall() {
        return thumbnailSmall;
    }

    public void setThumbnailSmall(BaseThumbnail thumbnailSmall) {
        this.thumbnailSmall = thumbnailSmall;
    }

    public BaseThumbnail getThumbnailMedium() {
        return thumbnailMedium;
    }

    public void setThumbnailMedium(BaseThumbnail thumbnailMedium) {
        this.thumbnailMedium = thumbnailMedium;
    }

    public BaseThumbnail getThumbnailLarge() {
        return thumbnailLarge;
    }

    public void setThumbnailLarge(BaseThumbnail thumbnailLarge) {
        this.thumbnailLarge = thumbnailLarge;
    }

    public boolean hasThumbnail() {
        return thumbnailSmall != null || thumbnailMedium != null || thumbnailLarge != null;
    }
}

@@ -1314,29 +1314,18 @@
 mbnail t
-humbnailSmall
+nS
 ;%0A    pr
@@ -1345,30 +1345,18 @@
 mbnail t
-humbnailMedium
+nM
 ;%0A    pr
@@ -1376,29 +1376,18 @@
 mbnail t
-humbnailLarge
+nL
 ;%0A%0A    p
@@ -1568,29 +1568,18 @@
 mbnail t
-humbnailSmall
+nS
 ,%0A      
@@ -1617,30 +1617,18 @@
 mbnail t
-humbnailMedium
+nM
 , BaseTh
@@ -1632,37 +1632,26 @@
 eThumbnail t
-humbnailLarge
+nL
 ) %7B%0A        
@@ -1888,132 +1888,64 @@
 is.t
-humbnailSmall = thumbnailSmall;%0A        this.thumbnailMedium = thumbnailMedium;%0A        this.thumbnailLarge = thumbnailLarge
+nS = tnS;%0A        this.tnM = tnM;%0A        this.tnL = tnL
 ;%0A  
@@ -3306,29 +3306,18 @@
 ail getT
-humbnailSmall
+nS
 () %7B%0A   
@@ -3329,29 +3329,18 @@
 return t
-humbnailSmall
+nS
 ;%0A    %7D%0A
@@ -3360,29 +3360,18 @@
 oid setT
-humbnailSmall
+nS
 (BaseThu
@@ -3378,29 +3378,18 @@
 mbnail t
-humbnailSmall
+nS
 ) %7B%0A    
@@ -3402,38 +3402,16 @@
 is.t
-humbnailSmall = thumbnailSmall
+nS = tnS
 ;%0A  
@@ -3444,30 +3444,18 @@
 ail getT
-humbnailMedium
+nM
 () %7B%0A   
@@ -3467,30 +3467,18 @@
 return t
-humbnailMedium
+nM
 ;%0A    %7D%0A
@@ -3498,30 +3498,18 @@
 oid setT
-humbnailMedium
+nM
 (BaseThu
@@ -3516,30 +3516,18 @@
 mbnail t
-humbnailMedium
+nM
 ) %7B%0A    
@@ -3540,40 +3540,16 @@
 is.t
-humbnailMedium = thumbnailMedium
+nM = tnM
 ;%0A  
@@ -3582,29 +3582,18 @@
 ail getT
-humbnailLarge
+nL
 () %7B%0A   
@@ -3605,29 +3605,18 @@
 return t
-humbnailLarge
+nL
 ;%0A    %7D%0A
@@ -3636,29 +3636,18 @@
 oid setT
-humbnailLarge
+nL
 (BaseThu
@@ -3654,29 +3654,18 @@
 mbnail t
-humbnailLarge
+nL
 ) %7B%0A    
@@ -3678,38 +3678,16 @@
 is.t
-humbnailLarge = thumbnailLarge
+nL = tnL
 ;%0A  
@@ -3747,74 +3747,40 @@
 rn t
-humbnailSmall != null %7C%7C thumbnailMedium != null %7C%7C thumbnailLarge
+nS != null %7C%7C tnM != null %7C%7C tnL
  != 

Rename FileAttachment’s thumbnail fields