zitadel/internal/iam/repository/view/model/privacy_policy_query.go
Fabi beb1c1604a
feat: Privacy policy (#1957)
* feat: command side privacy policy

* feat: add privacy policy to api

* feat: add privacy policy query side

* fix: add privacy policy to mgmt api

* fix: add privacy policy to auth and base data

* feat: use privacyPolicy in login gui

* feat: use privacyPolicy in login gui

* feat: test org fatures

* feat: typos

* feat: tos in register
2021-07-05 10:36:51 +02:00

60 lines
1.6 KiB
Go

package model
import (
"github.com/caos/zitadel/internal/domain"
iam_model "github.com/caos/zitadel/internal/iam/model"
"github.com/caos/zitadel/internal/view/repository"
)
type PrivacyPolicySearchRequest iam_model.PrivacyPolicySearchRequest
type PrivacyPolicySearchQuery iam_model.PrivacyPolicySearchQuery
type PrivacyPolicySearchKey iam_model.PrivacyPolicySearchKey
func (req PrivacyPolicySearchRequest) GetLimit() uint64 {
return req.Limit
}
func (req PrivacyPolicySearchRequest) GetOffset() uint64 {
return req.Offset
}
func (req PrivacyPolicySearchRequest) GetSortingColumn() repository.ColumnKey {
if req.SortingColumn == iam_model.PrivacyPolicySearchKeyUnspecified {
return nil
}
return PrivacyPolicySearchKey(req.SortingColumn)
}
func (req PrivacyPolicySearchRequest) GetAsc() bool {
return req.Asc
}
func (req PrivacyPolicySearchRequest) GetQueries() []repository.SearchQuery {
result := make([]repository.SearchQuery, len(req.Queries))
for i, q := range req.Queries {
result[i] = PrivacyPolicySearchQuery{Key: q.Key, Value: q.Value, Method: q.Method}
}
return result
}
func (req PrivacyPolicySearchQuery) GetKey() repository.ColumnKey {
return PrivacyPolicySearchKey(req.Key)
}
func (req PrivacyPolicySearchQuery) GetMethod() domain.SearchMethod {
return req.Method
}
func (req PrivacyPolicySearchQuery) GetValue() interface{} {
return req.Value
}
func (key PrivacyPolicySearchKey) ToColumnName() string {
switch iam_model.PrivacyPolicySearchKey(key) {
case iam_model.PrivacyPolicySearchKeyAggregateID:
return PrivacyKeyAggregateID
default:
return ""
}
}