mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-20 23:07:33 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package admin
|
|
|
|
import (
|
|
member_grpc "github.com/zitadel/zitadel/internal/api/grpc/member"
|
|
"github.com/zitadel/zitadel/internal/api/grpc/object"
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
"github.com/zitadel/zitadel/internal/query"
|
|
admin_pb "github.com/zitadel/zitadel/pkg/grpc/admin"
|
|
)
|
|
|
|
func AddIAMMemberToDomain(req *admin_pb.AddIAMMemberRequest) *domain.Member {
|
|
return &domain.Member{
|
|
UserID: req.UserId,
|
|
Roles: req.Roles,
|
|
}
|
|
}
|
|
|
|
func UpdateIAMMemberToDomain(req *admin_pb.UpdateIAMMemberRequest) *domain.Member {
|
|
return &domain.Member{
|
|
UserID: req.UserId,
|
|
Roles: req.Roles,
|
|
}
|
|
}
|
|
|
|
func ListIAMMembersRequestToQuery(req *admin_pb.ListIAMMembersRequest) (*query.IAMMembersQuery, error) {
|
|
offset, limit, asc := object.ListQueryToModel(req.Query)
|
|
queries, err := member_grpc.MemberQueriesToQuery(req.Queries)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &query.IAMMembersQuery{
|
|
MembersQuery: query.MembersQuery{
|
|
SearchRequest: query.SearchRequest{
|
|
Offset: offset,
|
|
Limit: limit,
|
|
Asc: asc,
|
|
// SortingColumn: model.IAMMemberSearchKey, //TOOD: not implemented in proto
|
|
},
|
|
Queries: queries,
|
|
},
|
|
}, nil
|
|
}
|