package de.hftstuttgart.models;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import de.hftstuttgart.utils.BuildState;

import java.util.List;

@JsonInclude
public class JenkinsJobData {

    public JenkinsJobData() {
    }

    public String getClassData() {
        return classData;
    }

    public List<Job> getJobs() {
        return jobs;
    }

    @JsonProperty("_class")
    private String classData;

    private List<Job> jobs;

    @JsonProperty("jobs")
    public void unpackingJobs(List<Job> jobs) {
        this.jobs = jobs;
    }

    public static class Job {

        @JsonProperty("_class")
        private String jobClassData;
        @JsonProperty("name")
        private String name;
        @JsonProperty("color")
        private BuildState color;

        public String getJobClassData() {
            return jobClassData;
        }

        public void setJobClassData(String jobClassData) {
            this.jobClassData = jobClassData;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public BuildState getColor() {
            return color;
        }

        public void setColor(BuildState color) {
            this.color = color;
        }
    }
}
