/*
   Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
   SPDX-License-Identifier: Apache-2.0
*/

package com.aws.rest;

import software.amazon.awssdk.services.redshiftdata.model.Field;

import java.util.List;

public class WorkItem {
    private String id;
    private String name;
    private String guide;
    private String date;
    private String description;
    private String status;

    public static WorkItem from(List<Field> fields) {
        var item = new WorkItem();
        for (int i = 0; i <= 5; i++) {
            String value = fields.get(i).stringValue();
            switch (i) {
                case 0:
                    item.setId(value);
                    break;
                case 1:
                    item.setDate(value);
                    break;
                case 2:
                    item.setDescription(value);
                    break;
                case 3:
                    item.setGuide(value);
                    break;
                case 4:
                    item.setStatus(value);
                    break;
                case 5:
                    item.setName(value);
                    break;
            }
        }
        return item;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return this.id;
    }

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

    public String getStatus() {
        return this.status;
    }

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

    public String getDescription() {
        return this.description;
    }


    public void setDate(String date) {
        this.date = date;
    }

    public String getDate() {
        return this.date;
    }

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

    public String getName() {
        return this.name;
    }

    public void setGuide(String guide) {
        this.guide = guide;
    }

    public String getGuide() {
        return this.guide;
    }
}
@@ -421,16 +421,48 @@
 status;%0D
+%0A    private boolean archived ;%0D
 %0A%0D%0A    p
@@ -576,17 +576,17 @@
 0; i %3C= 
-5
+6
 ; i++) %7B
@@ -615,39 +615,176 @@
 alue
- = fields.get(i).stringValue();
+=%22%22;%0D%0A            boolean val = false;%0D%0A            value = fields.get(i).stringValue();%0D%0A            if (i == 6)%0D%0A                val = fields.get(i).booleanValue();%0D%0A
 %0D%0A  
@@ -1401,41 +1401,307 @@
     
-%7D%0D%0A        %7D%0D%0A        return item
+    case 6:%0D%0A                    item.setArchived(val);%0D%0A                    break;%0D%0A            %7D%0D%0A        %7D%0D%0A        return item;%0D%0A    %7D%0D%0A%0D%0A    public boolean getArchived() %7B%0D%0A        return this.archived;%0D%0A    %7D%0D%0A%0D%0A    public void setArchived(boolean archived) %7B%0D%0A        this.archived = archived
 ;%0D%0A 
@@ -2615,8 +2615,10 @@
     %7D%0D%0A%7D
+%0D%0A

Update WorkItem.java