/*
 * Copyright (C) 2020 by 52 North Initiative for Geospatial Open Source Software GmbH
 *
 * Contact: Andreas Wytzisk
 * 52 North Initiative for Geospatial Open Source Software GmbH
 * Martin-Luther-King-Weg 24
 * 48155 Muenster, Germany
 * info@52north.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.n52.javaps.rest.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * StatusInfo
 */
@Validated
@JsonInclude(Include.NON_NULL)
public class StatusInfo {

    @JsonProperty("status")
    private StatusEnum status;

    @JsonProperty("message")
    private String message;

    @JsonProperty("progress")
    private Integer progress;

    @JsonProperty("links")
    @Valid
    private List<Link> links = new ArrayList<Link>();

    public StatusInfo status(StatusEnum status) {
        this.status = status;
        return this;
    }

    /**
     * Get status
     *
     * @return status
     **/
    @NotNull
    public StatusEnum getStatus() {
        return status;
    }

    public void setStatus(StatusEnum status) {
        this.status = status;
    }

    public StatusInfo message(String message) {
        this.message = message;
        return this;
    }

    /**
     * Get message
     *
     * @return message
     **/
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public StatusInfo progress(Integer progress) {
        this.progress = progress;
        return this;
    }

    /**
     * Get progress minimum: 0 maximum: 100
     *
     * @return progress
     **/
    @Min(0)
    @Max(100)
    public Integer getProgress() {
        return progress;
    }

    public void setProgress(Integer progress) {
        this.progress = progress;
    }

    public StatusInfo links(List<Link> links) {
        this.links = links;
        return this;
    }

    public StatusInfo addLinksItem(Link linksItem) {
        this.links.add(linksItem);
        return this;
    }

    /**
     * Get links
     *
     * @return links
     **/
    @NotNull
    @Valid
    public List<Link> getLinks() {
        return links;
    }

    public void setLinks(List<Link> links) {
        this.links = links;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        StatusInfo statusInfo = (StatusInfo) o;
        return Objects.equals(this.status, statusInfo.status) &&
               Objects.equals(this.message, statusInfo.message) &&
               Objects.equals(this.progress, statusInfo.progress) &&
               Objects.equals(this.links, statusInfo.links);
    }

    @Override
    public int hashCode() {
        return Objects.hash(status, message, progress, links);
    }

    @Override
    public String toString() {
        return String.format("StatusInfo{status: %s, message: %s, progress: %s, links: %s}",
                             status, message, progress, links);
    }
}

@@ -1078,16 +1078,64 @@
 lidated;
+%0Aimport io.swagger.annotations.ApiModelProperty;
 %0A%0Aimport
@@ -1630,24 +1630,85 @@
  progress;%0A%0A
+    @JsonProperty(%22jobID%22)%0A    private String jobID = null;%0A%0A
     @JsonPro
@@ -3044,32 +3044,384 @@
 rn this;%0A    %7D%0A%0A
+    public StatusInfo jobID(String jobID) %7B%0A        this.jobID = jobID;%0A        return this;%0A    %7D%0A%0A    /**%0A     * Get jobID%0A     * @return jobID%0A    **/%0A    @ApiModelProperty(required = true, value = %22%22)%0A    @NotNull%0A%0A    public String getJobID() %7B%0A    %09return jobID;%0A    %7D%0A%0A    public void setJobID(String jobID) %7B%0A        this.jobID = jobID;%0A    %7D%0A%0A
     /**%0A     * G
@@ -4092,24 +4092,87 @@
 rogress) &&%0A
+               Objects.equals(this.jobID, statusInfo.jobID) &&%0A
             
@@ -4315,32 +4315,39 @@
 ssage, progress,
+ jobID,
  links);%0A    %7D%0A%0A
@@ -4470,16 +4470,27 @@
 ess: %25s,
+ jobID: %25s,
  links: 
@@ -4550,16 +4550,23 @@
 rogress,
+ jobID,
  links);

Add jobID to StatusInfo