func ConvertArea(appl application.Application, request *goa.RequestData, ar area.Area, additional ...AreaConvertFunc) *app.Area {
	areaType := area.APIStringTypeAreas
	spaceID := ar.SpaceID.String()
	selfURL := rest.AbsoluteURL(request, app.AreaHref(ar.ID))
	childURL := rest.AbsoluteURL(request, app.AreaHref(ar.ID)+"/children")
	spaceSelfURL := rest.AbsoluteURL(request, app.SpaceHref(spaceID))
	pathToTopMostParent := ar.Path.String() // /uuid1/uuid2/uuid3s
	i := &app.Area{
		Type: areaType,
		ID:   &ar.ID,
		Attributes: &app.AreaAttributes{
			Name:       &ar.Name,
			CreatedAt:  &ar.CreatedAt,
			UpdatedAt:  &ar.UpdatedAt,
			Version:    &ar.Version,
			ParentPath: &pathToTopMostParent,
		},
		Relationships: &app.AreaRelations{
			Space: &app.RelationGeneric{
				Data: &app.GenericData{
					Type: &space.SpaceType,
					ID:   &spaceID,
				},
				Links: &app.GenericLinks{
					Self: &spaceSelfURL,
				},
			},
			Children: &app.RelationGeneric{
				Links: &app.GenericLinks{
					Self: &childURL,
				},
			},
		},
		Links: &app.GenericLinks{
			Self: &selfURL,
		},
	}

	// Now check the path, if the path is empty, then this is the topmost area
	// in a specific space.
	if ar.Path.IsEmpty() == false {
		parent := ar.Path.This().String()
		// Only the immediate parent's URL.
		parentSelfURL := rest.AbsoluteURL(request, app.AreaHref(parent))

		i.Relationships.Parent = &app.RelationGeneric{
			Data: &app.GenericData{
				Type: &areaType,
				ID:   &parent,
			},
			Links: &app.GenericLinks{
				Self: &parentSelfURL,
			},
		}
	}
	for _, add := range additional {
		add(appl, request, &ar, i)
	}
	return i
}
// ConvertArea converts between internal and external REST representation
ConvertArea converts between internal and external REST representation
// ConvertArea converts between internal and external REST representation
func ConvertArea(appl application.Application, request *goa.RequestData, ar area.Area, additional ...AreaConvertFunc) *app.Area {
	areaType := area.APIStringTypeAreas
	spaceID := ar.SpaceID.String()
	selfURL := rest.AbsoluteURL(request, app.AreaHref(ar.ID))
	childURL := rest.AbsoluteURL(request, app.AreaHref(ar.ID)+"/children")
	spaceSelfURL := rest.AbsoluteURL(request, app.SpaceHref(spaceID))
	pathToTopMostParent := ar.Path.String() 
	i := &app.Area{
		Type: areaType,
		ID:   &ar.ID,
		Attributes: &app.AreaAttributes{
			Name:       &ar.Name,
			CreatedAt:  &ar.CreatedAt,
			UpdatedAt:  &ar.UpdatedAt,
			Version:    &ar.Version,
			ParentPath: &pathToTopMostParent,
		},
		Relationships: &app.AreaRelations{
			Space: &app.RelationGeneric{
				Data: &app.GenericData{
					Type: &space.SpaceType,
					ID:   &spaceID,
				},
				Links: &app.GenericLinks{
					Self: &spaceSelfURL,
				},
			},
			Children: &app.RelationGeneric{
				Links: &app.GenericLinks{
					Self: &childURL,
				},
			},
		},
		Links: &app.GenericLinks{
			Self: &selfURL,
		},
	}
	if ar.Path.IsEmpty() == false {
		parent := ar.Path.This().String()
		parentSelfURL := rest.AbsoluteURL(request, app.AreaHref(parent))
		i.Relationships.Parent = &app.RelationGeneric{
			Data: &app.GenericData{
				Type: &areaType,
				ID:   &parent,
			},
			Links: &app.GenericLinks{
				Self: &parentSelfURL,
			},
		}
	}
	for _, add := range additional {
		add(appl, request, &ar, i)
	}
	return i
}
func ConvertArea ( appl application . Application , request * goa . RequestData , ar area . Area , additional ... AreaConvertFunc ) * app . Area { areaType := area . APIStringTypeAreas spaceID := ar . SpaceID . String ( ) selfURL := rest . AbsoluteURL ( request , app . AreaHref ( ar . ID ) ) childURL := rest . AbsoluteURL ( request , app . AreaHref ( ar . ID ) + " " ) spaceSelfURL := rest . AbsoluteURL ( request , app . SpaceHref ( spaceID ) ) pathToTopMostParent := ar . Path . String ( ) i := & app . Area { Type : areaType , ID : & ar . ID , Attributes : & app . AreaAttributes { Name : & ar . Name , CreatedAt : & ar . CreatedAt , UpdatedAt : & ar . UpdatedAt , Version : & ar . Version , ParentPath : & pathToTopMostParent , } , Relationships : & app . AreaRelations { Space : & app . RelationGeneric { Data : & app . GenericData { Type : & space . SpaceType , ID : & spaceID , } , Links : & app . GenericLinks { Self : & spaceSelfURL , } , } , Children : & app . RelationGeneric { Links : & app . GenericLinks { Self : & childURL , } , } , } , Links : & app . GenericLinks { Self : & selfURL , } , } if ar . Path . IsEmpty ( ) == false { parent := ar . Path . This ( ) . String ( ) parentSelfURL := rest . AbsoluteURL ( request , app . AreaHref ( parent ) ) i . Relationships . Parent = & app . RelationGeneric { Data : & app . GenericData { Type : & areaType , ID : & parent , } , Links : & app . GenericLinks { Self : & parentSelfURL , } , } } for _ , add := range additional { add ( appl , request , & ar , i ) } return i }
ConvertArea converts between internal and external REST representation
ConvertArea converts between internal and external REST representation
// /uuid1/uuid2/uuid3s // Now check the path, if the path is empty, then this is the topmost area // in a specific space. // Only the immediate parent's URL.