mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 03:54:21 +00:00
30 lines
806 B
Go
30 lines
806 B
Go
|
package auth
|
||
|
|
||
|
import (
|
||
|
"github.com/caos/zitadel/internal/api/grpc/metadata"
|
||
|
"github.com/caos/zitadel/internal/api/grpc/object"
|
||
|
"github.com/caos/zitadel/internal/domain"
|
||
|
"github.com/caos/zitadel/pkg/grpc/auth"
|
||
|
)
|
||
|
|
||
|
func BulkSetMetadataToDomain(req *auth.BulkSetMyMetadataRequest) []*domain.Metadata {
|
||
|
metadata := make([]*domain.Metadata, len(req.Metadata))
|
||
|
for i, data := range req.Metadata {
|
||
|
metadata[i] = &domain.Metadata{
|
||
|
Key: data.Key,
|
||
|
Value: data.Value,
|
||
|
}
|
||
|
}
|
||
|
return metadata
|
||
|
}
|
||
|
|
||
|
func ListUserMetadataToDomain(req *auth.ListMyMetadataRequest) *domain.MetadataSearchRequest {
|
||
|
offset, limit, asc := object.ListQueryToModel(req.Query)
|
||
|
return &domain.MetadataSearchRequest{
|
||
|
Offset: offset,
|
||
|
Limit: limit,
|
||
|
Asc: asc,
|
||
|
Queries: metadata.MetadataQueriesToModel(req.Queries),
|
||
|
}
|
||
|
}
|