package uk.org.gss_data.pmd_drafter.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Graph; import java.util.UUID; import java.util.List; import java.time.OffsetDateTime; @Canonical class Draftset { Draftset(Map map) { map?.each { k, v -> def prop = k.replaceAll("-([A-Za-z0-9])", {Object [] it -> it[1].toUpperCase()}) def mpType = this.getMetaClass().getMetaProperty(prop).getType() if (mpType == OffsetDateTime.class) { this[prop] = OffsetDateTime.parse(v) } else if (mpType == UUID) { this[prop] = UUID.fromString(v) } else { this[prop] = v } } } /* Unique identifier representing this draftset */ UUID id = null /* The user who created this Draftset */ String createdBy = null Map<String, Graph> changes = new HashMap<String, Graph>() /* Display name of the Draftset */ String displayName = null /* The current owner of this Draftset */ String currentOwner = null /* The owner who submitted this Draftset for review */ String submittedBy = null /* The required role for users who can claim this Draftset */ String claimRole = null /* The user who can claim this Draftset */ String claimUser = null /* A description of the Draftset */ String description = null /* IS0 8601 DateTime representing the time the draftsets metadata was last updated */ OffsetDateTime updatedAt = null /* IS0 8601 DateTime representing the time the draftset was created */ OffsetDateTime createdAt = null }