package com.writeoff.module.ocr.dto;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;

public class DocumentExtractTaskSubmitRequest {
    private String objectKey;
    private String fileName;

    @Size(max = 1, message = "fileUrls supports only one url")
    private List<@NotBlank(message = "file url must not be blank") String> fileUrls;

    private String manifestVersionId;

    @Valid
    @Size(max = 100, message = "manifest supports at most 100 fields")
    private List<ManifestField> manifest;

    private Boolean removeDuplicates;
    private String pageRange;
    private Boolean extractSeal;
    private Boolean eraseWatermark;

    public String getObjectKey() {
        return objectKey;
    }

    public void setObjectKey(String objectKey) {
        this.objectKey = objectKey;
    }

    public String getFileName() {
        return fileName;
    }

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

    public List<String> getFileUrls() {
        return fileUrls;
    }

    public void setFileUrls(List<String> fileUrls) {
        this.fileUrls = fileUrls;
    }

    public String getManifestVersionId() {
        return manifestVersionId;
    }

    public void setManifestVersionId(String manifestVersionId) {
        this.manifestVersionId = manifestVersionId;
    }

    public List<ManifestField> getManifest() {
        return manifest;
    }

    public void setManifest(List<ManifestField> manifest) {
        this.manifest = manifest;
    }

    public Boolean getRemoveDuplicates() {
        return removeDuplicates;
    }

    public void setRemoveDuplicates(Boolean removeDuplicates) {
        this.removeDuplicates = removeDuplicates;
    }

    public String getPageRange() {
        return pageRange;
    }

    public void setPageRange(String pageRange) {
        this.pageRange = pageRange;
    }

    public Boolean getExtractSeal() {
        return extractSeal;
    }

    public void setExtractSeal(Boolean extractSeal) {
        this.extractSeal = extractSeal;
    }

    public Boolean getEraseWatermark() {
        return eraseWatermark;
    }

    public void setEraseWatermark(Boolean eraseWatermark) {
        this.eraseWatermark = eraseWatermark;
    }

    public static class ManifestField {
        @NotBlank(message = "manifest key must not be blank")
        @Size(max = 30, message = "manifest key length must be <= 30")
        private String key;

        @Size(max = 30, message = "manifest parentKey length must be <= 30")
        private String parentKey;

        @Size(max = 100, message = "manifest description length must be <= 100")
        private String description;

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getParentKey() {
            return parentKey;
        }

        public void setParentKey(String parentKey) {
            this.parentKey = parentKey;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }
    }
}
