2025-05-21 20:47:44 +08:00
//
// This file is generated by grafana-app-sdk
// DO NOT EDIT
//
package apis
import (
2025-05-28 17:35:44 +08:00
"fmt"
2025-07-22 01:32:15 +08:00
"strings"
2025-05-21 20:47:44 +08:00
"github.com/grafana/grafana-app-sdk/app"
2025-05-28 17:35:44 +08:00
"github.com/grafana/grafana-app-sdk/resource"
v0alpha1 "github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1"
2025-05-21 20:47:44 +08:00
)
var appManifestData = app . ManifestData {
AppName : "iam" ,
Group : "iam.grafana.app" ,
2025-07-22 01:32:15 +08:00
Versions : [ ] app . ManifestVersion {
2025-05-21 20:47:44 +08:00
{
2025-07-22 01:32:15 +08:00
Name : "v0alpha1" ,
Served : true ,
Kinds : [ ] app . ManifestVersionKind {
2025-05-21 20:47:44 +08:00
{
2025-07-22 01:32:15 +08:00
Kind : "GlobalRole" ,
Plural : "GlobalRoles" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-05-21 20:47:44 +08:00
} ,
{
2025-07-22 01:32:15 +08:00
Kind : "GlobalRoleBinding" ,
Plural : "GlobalRoleBindings" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-05-21 20:47:44 +08:00
} ,
{
2025-07-22 01:32:15 +08:00
Kind : "CoreRole" ,
Plural : "CoreRoles" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-05-21 20:47:44 +08:00
} ,
{
2025-07-22 01:32:15 +08:00
Kind : "Role" ,
Plural : "Roles" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-05-21 20:47:44 +08:00
} ,
{
2025-07-22 01:32:15 +08:00
Kind : "RoleBinding" ,
Plural : "RoleBindings" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-05-21 20:47:44 +08:00
} ,
{
2025-07-22 01:32:15 +08:00
Kind : "ResourcePermission" ,
Plural : "ResourcePermissions" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-05-21 20:47:44 +08:00
} ,
2025-07-04 17:07:48 +08:00
{
2025-07-22 01:32:15 +08:00
Kind : "User" ,
Plural : "Users" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-07-04 17:07:48 +08:00
} ,
{
2025-07-22 01:32:15 +08:00
Kind : "Team" ,
Plural : "Teams" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-07-04 17:07:48 +08:00
} ,
{
2025-07-22 01:32:15 +08:00
Kind : "TeamBinding" ,
Plural : "TeamBindings" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-07-04 17:07:48 +08:00
} ,
{
2025-07-22 01:32:15 +08:00
Kind : "ServiceAccount" ,
Plural : "ServiceAccounts" ,
Scope : "Namespaced" ,
Conversion : false ,
2025-07-04 17:07:48 +08:00
} ,
} ,
} ,
2025-05-21 20:47:44 +08:00
} ,
}
func LocalManifest ( ) app . Manifest {
return app . NewEmbeddedManifest ( appManifestData )
}
func RemoteManifest ( ) app . Manifest {
return app . NewAPIServerManifest ( "iam" )
}
2025-05-28 17:35:44 +08:00
var kindVersionToGoType = map [ string ] resource . Kind {
"GlobalRole/v0alpha1" : v0alpha1 . GlobalRoleKind ( ) ,
"GlobalRoleBinding/v0alpha1" : v0alpha1 . GlobalRoleBindingKind ( ) ,
"CoreRole/v0alpha1" : v0alpha1 . CoreRoleKind ( ) ,
"Role/v0alpha1" : v0alpha1 . RoleKind ( ) ,
"RoleBinding/v0alpha1" : v0alpha1 . RoleBindingKind ( ) ,
"ResourcePermission/v0alpha1" : v0alpha1 . ResourcePermissionKind ( ) ,
2025-07-04 17:07:48 +08:00
"User/v0alpha1" : v0alpha1 . UserKind ( ) ,
"Team/v0alpha1" : v0alpha1 . TeamKind ( ) ,
"TeamBinding/v0alpha1" : v0alpha1 . TeamBindingKind ( ) ,
"ServiceAccount/v0alpha1" : v0alpha1 . ServiceAccountKind ( ) ,
2025-05-28 17:35:44 +08:00
}
// 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
}
2025-07-22 01:32:15 +08:00
var customRouteToGoResponseType = map [ string ] any { }
// ManifestCustomRouteResponsesAssociator returns the associated response go type for a given kind, version, custom route path, and method, if one exists.
// kind may be empty for custom routes which are not kind subroutes. Leading slashes are removed from subroute paths.
// If there is no association for the provided kind, version, custom route path, and method, exists will return false.
func ManifestCustomRouteResponsesAssociator ( kind , version , path , verb string ) ( goType any , exists bool ) {
if len ( path ) > 0 && path [ 0 ] == '/' {
path = path [ 1 : ]
}
goType , exists = customRouteToGoResponseType [ fmt . Sprintf ( "%s|%s|%s|%s" , version , kind , path , strings . ToUpper ( verb ) ) ]
return goType , exists
}