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