static Recordset toModel(DnsZone domain, DnsRecordset recordset, boolean details) {
Recordset model = new Recordset();
// zone.id = domain.getData().getDomain();
DnsRecordsetData data = recordset.getData();
model.id = "" + data.getId();
model.type = data.getType();
model.zone_id = "" + domain.getData().getId();
model.name = recordset.getFqdn();
if (data.hasTtl()) {
model.ttl = data.getTtl();
}
if (data.hasWeight()) {
model.weight = data.getWeight();
}
model.status = "ACTIVE";
model.version = 1L;
if (data.hasState()) {
model.created_at = Clock.toDate(data.getState().getCreatedAt());
model.updated_at = Clock.toDate(data.getState().getUpdatedAt());
model.deleted_at = Clock.toDate(data.getState().getDeletedAt());
}
if (details) {
model.records = Lists.newArrayList();
for (DnsRecord record : recordset.getRecords()) {