20c700dd52
* Chore: reduce barrel files * chore: fixes unit test * Chore: reduces barrel files part II * chore: fix import sorting
97 lines
2.1 KiB
Go
97 lines
2.1 KiB
Go
//
|
|
// This file is generated by grafana-app-sdk
|
|
// DO NOT EDIT
|
|
//
|
|
|
|
package apis
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/grafana/grafana-app-sdk/app"
|
|
"github.com/grafana/grafana-app-sdk/resource"
|
|
|
|
v0alpha1 "github.com/grafana/grafana/apps/alerting/notifications/pkg/apis/alerting/v0alpha1"
|
|
)
|
|
|
|
var appManifestData = app.ManifestData{
|
|
AppName: "alerting",
|
|
Group: "notifications.alerting.grafana.app",
|
|
Kinds: []app.ManifestKind{
|
|
{
|
|
Kind: "Receiver",
|
|
Scope: "Namespaced",
|
|
Conversion: false,
|
|
Versions: []app.ManifestKindVersion{
|
|
{
|
|
Name: "v0alpha1",
|
|
SelectableFields: []string{
|
|
"spec.title",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
{
|
|
Kind: "RoutingTree",
|
|
Scope: "Namespaced",
|
|
Conversion: false,
|
|
Versions: []app.ManifestKindVersion{
|
|
{
|
|
Name: "v0alpha1",
|
|
},
|
|
},
|
|
},
|
|
|
|
{
|
|
Kind: "TemplateGroup",
|
|
Scope: "Namespaced",
|
|
Conversion: false,
|
|
Versions: []app.ManifestKindVersion{
|
|
{
|
|
Name: "v0alpha1",
|
|
SelectableFields: []string{
|
|
"spec.title",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
{
|
|
Kind: "TimeInterval",
|
|
Scope: "Namespaced",
|
|
Conversion: false,
|
|
Versions: []app.ManifestKindVersion{
|
|
{
|
|
Name: "v0alpha1",
|
|
SelectableFields: []string{
|
|
"spec.name",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
func LocalManifest() app.Manifest {
|
|
return app.NewEmbeddedManifest(appManifestData)
|
|
}
|
|
|
|
func RemoteManifest() app.Manifest {
|
|
return app.NewAPIServerManifest("alerting")
|
|
}
|
|
|
|
var kindVersionToGoType = map[string]resource.Kind{
|
|
"Receiver/v0alpha1": v0alpha1.ReceiverKind(),
|
|
"RoutingTree/v0alpha1": v0alpha1.RoutingTreeKind(),
|
|
"TemplateGroup/v0alpha1": v0alpha1.TemplateGroupKind(),
|
|
"TimeInterval/v0alpha1": v0alpha1.TimeIntervalKind(),
|
|
}
|
|
|
|
// ManifestGoTypeAssociator returns the associated resource.Kind instance for a given Kind and Version, if one exists.
|
|
// If there is no association for the provided Kind and Version, exists will return false.
|
|
func ManifestGoTypeAssociator(kind, version string) (goType resource.Kind, exists bool) {
|
|
goType, exists = kindVersionToGoType[fmt.Sprintf("%s/%s", kind, version)]
|
|
return goType, exists
|
|
}
|