code: func ConvertCodebase(request *http.Request, codebase codebase.Codebase, options ...CodebaseConvertFunc) *app.Codebase {
  	relatedURL := rest.AbsoluteURL(request, app.CodebaseHref(codebase.ID))
  	spaceRelatedURL := rest.AbsoluteURL(request, app.SpaceHref(codebase.SpaceID))
  	workspacesRelatedURL := rest.AbsoluteURL(request, app.CodebaseHref(codebase.ID)+"/workspaces")
  
  	result := &app.Codebase{
  		Type: APIStringTypeCodebase,
  		ID:   &codebase.ID,
  		Attributes: &app.CodebaseAttributes{
  			CreatedAt:         &codebase.CreatedAt,
  			Type:              &codebase.Type,
  			URL:               &codebase.URL,
  			StackID:           codebase.StackID,
  			LastUsedWorkspace: &codebase.LastUsedWorkspace,
  			CveScan:           &codebase.CVEScan,
  		},
  		Relationships: &app.CodebaseRelations{
  			Space: &app.RelationGeneric{
  				Data: &app.GenericData{
  					Type: ptr.String(APIStringTypeSpace),
  					ID:   ptr.String(codebase.SpaceID.String()),
  				},
  				Links: &app.GenericLinks{
  					Self:    &spaceRelatedURL,
  					Related: &spaceRelatedURL,
  				},
  			},
  			Workspaces: &app.RelationGeneric{
  				Links: &app.GenericLinks{
  					Self:    &workspacesRelatedURL,
  					Related: &workspacesRelatedURL,
  				},
  			},
  		},
  		Links: &app.CodebaseLinks{
  			Self:    &relatedURL,
  			Related: &relatedURL,
  			// Deprecated: use 'Workspaces' links instead
  			Edit: ptr.String(rest.AbsoluteURL(request, app.CodebaseHref(codebase.ID)+"/edit")),
  		},
  	}
  	for _, option := range options {
  		option(request, codebase, result)
  	}
  	return result
  }
docs: // ConvertCodebase converts between internal and external REST representation