mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
54 lines
989 B
Go
54 lines
989 B
Go
|
package model
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/caos/zitadel/internal/model"
|
||
|
)
|
||
|
|
||
|
type MachineKeyView struct {
|
||
|
ID string
|
||
|
UserID string
|
||
|
Type MachineKeyType
|
||
|
Sequence uint64
|
||
|
CreationDate time.Time
|
||
|
ExpirationDate time.Time
|
||
|
}
|
||
|
|
||
|
type MachineKeySearchRequest struct {
|
||
|
Offset uint64
|
||
|
Limit uint64
|
||
|
SortingColumn MachineKeySearchKey
|
||
|
Asc bool
|
||
|
Queries []*MachineKeySearchQuery
|
||
|
}
|
||
|
|
||
|
type MachineKeySearchKey int32
|
||
|
|
||
|
const (
|
||
|
MachineKeyKeyUnspecified MachineKeySearchKey = iota
|
||
|
MachineKeyKeyID
|
||
|
MachineKeyKeyUserID
|
||
|
)
|
||
|
|
||
|
type MachineKeySearchQuery struct {
|
||
|
Key MachineKeySearchKey
|
||
|
Method model.SearchMethod
|
||
|
Value interface{}
|
||
|
}
|
||
|
|
||
|
type MachineKeySearchResponse struct {
|
||
|
Offset uint64
|
||
|
Limit uint64
|
||
|
TotalResult uint64
|
||
|
Result []*MachineKeyView
|
||
|
Sequence uint64
|
||
|
Timestamp time.Time
|
||
|
}
|
||
|
|
||
|
func (r *MachineKeySearchRequest) EnsureLimit(limit uint64) {
|
||
|
if r.Limit == 0 || r.Limit > limit {
|
||
|
r.Limit = limit
|
||
|
}
|
||
|
}
|