//
// This file is generated by grafana-app-sdk
// DO NOT EDIT
//

package apis

import (
	"encoding/json"

	"github.com/grafana/grafana-app-sdk/app"
)

var (
	rawSchemaExamplev1     = []byte(`{"spec":{"properties":{"a":{"type":"string"},"b":{"type":"string"}},"required":["a","b"],"type":"object"},"status":{"properties":{"additionalFields":{"description":"additionalFields is reserved for future use","type":"object","x-kubernetes-preserve-unknown-fields":true},"operatorStates":{"additionalProperties":{"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"description":"details contains any extra information that is operator-specific","type":"object","x-kubernetes-preserve-unknown-fields":true},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"}},"type":"object","x-kubernetes-preserve-unknown-fields":true}}`)
	versionSchemaExamplev1 app.VersionSchema
	_                      = json.Unmarshal(rawSchemaExamplev1, &versionSchemaExamplev1)
)

var appManifestData = app.ManifestData{
	AppName: "example",
	Group:   "example.grafana.app",
	Kinds: []app.ManifestKind{
		{
			Kind:       "Example",
			Scope:      "Namespaced",
			Conversion: false,
			Versions: []app.ManifestKindVersion{
				{
					Name:   "v1",
					Schema: &versionSchemaExamplev1,
				},
			},
		},
	},
}

func jsonToMap(j string) map[string]any {
	m := make(map[string]any)
	json.Unmarshal([]byte(j), &j)
	return m
}

func LocalManifest() app.Manifest {
	return app.NewEmbeddedManifest(appManifestData)
}

func RemoteManifest() app.Manifest {
	return app.NewAPIServerManifest("example")
}
