mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
24 lines
540 B
Go
24 lines
540 B
Go
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/zitadel/logging"
|
|
es_models "github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
|
)
|
|
|
|
type IAMMember struct {
|
|
es_models.ObjectRoot
|
|
UserID string `json:"userId,omitempty"`
|
|
Roles []string `json:"roles,omitempty"`
|
|
}
|
|
|
|
func (m *IAMMember) SetData(event *es_models.Event) error {
|
|
m.ObjectRoot.AppendEvent(event)
|
|
if err := json.Unmarshal(event.Data, m); err != nil {
|
|
logging.Log("EVEN-e4dkp").WithError(err).Error("could not unmarshal event data")
|
|
return err
|
|
}
|
|
return nil
|
|
}
|