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