Files
bridge/internal/metal/models/projects.go
2023-07-17 19:02:55 +00:00

21 lines
612 B
Go

package models
import "go.infratographer.com/x/gidx"
// ProjectDetails contains project and membership information.
type ProjectDetails struct {
ID string `json:"id"`
Name string `json:"name"`
Memberships []*Membership[ProjectDetails] `json:"memberships"`
Organization *OrganizationDetails `json:"organization"`
}
// PrefixedID returns the prefixed id for the project.
func (d *ProjectDetails) PrefixedID() gidx.PrefixedID {
if d.ID == "" {
return gidx.NullPrefixedID
}
return gidx.PrefixedID(IDPrefixProject + "-" + d.ID)
}