2015-02-27 00:23:28 +08:00
|
|
|
package dtos
|
|
|
|
|
|
2022-04-29 21:30:24 +08:00
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
2022-08-10 17:56:48 +08:00
|
|
|
"github.com/grafana/grafana/pkg/services/org"
|
2022-04-29 21:30:24 +08:00
|
|
|
)
|
|
|
|
|
|
2022-07-19 17:52:51 +08:00
|
|
|
// swagger:model
|
2015-02-27 00:23:28 +08:00
|
|
|
type NewApiKeyResult struct {
|
2022-07-19 17:52:51 +08:00
|
|
|
// example: 1
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
// example: grafana
|
2015-02-27 00:23:28 +08:00
|
|
|
Name string `json:"name"`
|
2022-07-19 17:52:51 +08:00
|
|
|
// example: glsa_yscW25imSKJIuav8zF37RZmnbiDvB05G_fcaaf58a
|
|
|
|
|
Key string `json:"key"`
|
2015-02-27 00:23:28 +08:00
|
|
|
}
|
2022-04-29 21:30:24 +08:00
|
|
|
|
|
|
|
|
type ApiKeyDTO struct {
|
2023-02-04 00:23:09 +08:00
|
|
|
ID int64 `json:"id"`
|
2022-04-29 21:30:24 +08:00
|
|
|
Name string `json:"name"`
|
2022-08-10 17:56:48 +08:00
|
|
|
Role org.RoleType `json:"role"`
|
2022-04-29 21:30:24 +08:00
|
|
|
Expiration *time.Time `json:"expiration,omitempty"`
|
|
|
|
|
AccessControl accesscontrol.Metadata `json:"accessControl,omitempty"`
|
|
|
|
|
}
|