zitadel/internal/domain/org.go
Fabi 9d4f296c62
fix: rename iam to instance (#3345)
* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename iam command side to instance

* fix: rename orgiampolicy to domain policy

* fix: merge conflicts

* fix: protos

* fix: md files

* implement deprecated org iam policy again

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
2022-03-24 16:21:34 +00:00

33 lines
550 B
Go

package domain
import (
"github.com/caos/zitadel/internal/eventstore/v1/models"
)
type Org struct {
models.ObjectRoot
State OrgState
Name string
PrimaryDomain string
Domains []*OrgDomain
}
func (o *Org) IsValid() bool {
return o.Name != ""
}
func (o *Org) AddIAMDomain(iamDomain string) {
o.Domains = append(o.Domains, &OrgDomain{Domain: NewIAMDomainName(o.Name, iamDomain), Verified: true, Primary: true})
}
type OrgState int32
const (
OrgStateUnspecified OrgState = iota
OrgStateActive
OrgStateInactive
OrgStateRemoved
)