func ConvertWorkItemTypeFromModel(request *goa.RequestData, t *workitem.WorkItemType) app.WorkItemTypeData {
	spaceSelfURL := rest.AbsoluteURL(request, app.SpaceHref(t.SpaceID.String()))
	id := t.ID
	createdAt := t.CreatedAt.UTC()
	updatedAt := t.UpdatedAt.UTC()
	var converted = app.WorkItemTypeData{
		Type: "workitemtypes",
		ID:   &id,
		Attributes: &app.WorkItemTypeAttributes{
			CreatedAt:   &createdAt,
			UpdatedAt:   &updatedAt,
			Version:     &t.Version,
			Description: t.Description,
			Icon:        t.Icon,
			Name:        t.Name,
			Fields:      map[string]*app.FieldDefinition{},
		},
		Relationships: &app.WorkItemTypeRelationships{
			Space: app.NewSpaceRelation(t.SpaceID, spaceSelfURL),
		},
	}
	for name, def := range t.Fields {
		ct := convertFieldTypeFromModel(def.Type)
		converted.Attributes.Fields[name] = &app.FieldDefinition{
			Required:    def.Required,
			Label:       def.Label,
			Description: def.Description,
			Type:        &ct,
		}
	}
	return converted
}
// converts from models to app representation
converts from models to app representation
// converts from models to app representation
func ConvertWorkItemTypeFromModel(request *goa.RequestData, t *workitem.WorkItemType) app.WorkItemTypeData {
	spaceSelfURL := rest.AbsoluteURL(request, app.SpaceHref(t.SpaceID.String()))
	id := t.ID
	createdAt := t.CreatedAt.UTC()
	updatedAt := t.UpdatedAt.UTC()
	var converted = app.WorkItemTypeData{
		Type: "workitemtypes",
		ID:   &id,
		Attributes: &app.WorkItemTypeAttributes{
			CreatedAt:   &createdAt,
			UpdatedAt:   &updatedAt,
			Version:     &t.Version,
			Description: t.Description,
			Icon:        t.Icon,
			Name:        t.Name,
			Fields:      map[string]*app.FieldDefinition{},
		},
		Relationships: &app.WorkItemTypeRelationships{
			Space: app.NewSpaceRelation(t.SpaceID, spaceSelfURL),
		},
	}
	for name, def := range t.Fields {
		ct := convertFieldTypeFromModel(def.Type)
		converted.Attributes.Fields[name] = &app.FieldDefinition{
			Required:    def.Required,
			Label:       def.Label,
			Description: def.Description,
			Type:        &ct,
		}
	}
	return converted
}
func ConvertWorkItemTypeFromModel ( request * goa . RequestData , t * workitem . WorkItemType ) app . WorkItemTypeData { spaceSelfURL := rest . AbsoluteURL ( request , app . SpaceHref ( t . SpaceID . String ( ) ) ) id := t . ID createdAt := t . CreatedAt . UTC ( ) updatedAt := t . UpdatedAt . UTC ( ) var converted = app . WorkItemTypeData { Type : " " , ID : & id , Attributes : & app . WorkItemTypeAttributes { CreatedAt : & createdAt , UpdatedAt : & updatedAt , Version : & t . Version , Description : t . Description , Icon : t . Icon , Name : t . Name , Fields : map [ string ] * app . FieldDefinition { } , } , Relationships : & app . WorkItemTypeRelationships { Space : app . NewSpaceRelation ( t . SpaceID , spaceSelfURL ) , } , } for name , def := range t . Fields { ct := convertFieldTypeFromModel ( def . Type ) converted . Attributes . Fields [ name ] = & app . FieldDefinition { Required : def . Required , Label : def . Label , Description : def . Description , Type : & ct , } } return converted }
converts from models to app representation
converts from models to app representation