var $schema = "../schema.json";
var schemaVersion = "v1";
var pluginType = "stackdriver";
var pluginName = "Google Cloud Monitoring";
var docURL = "https://grafana.com/docs/grafana/latest/datasources/google-cloud-monitoring/";
var fields = [
	{
		id: "jsonData.authenticationType",
		key: "authenticationType",
		label: "Authentication type",
		description: "Google Cloud authentication mechanism.",
		valueType: "string",
		target: "jsonData",
		required: true,
		defaultValue: "jwt",
		validations: [
			{
				type: "allowedValues",
				values: [
					"jwt",
					"gce"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "Google JWT File",
					value: "jwt"
				},
				{
					label: "GCE Default Service Account",
					value: "gce"
				}
			]
		},
		effects: [
			{
				when: "value == 'jwt'",
				set: {
					"virtual.jwtUpload": "upload"
				}
			},
			{
				when: "value == 'gce'",
				set: {
					"virtual.jwtUpload": "manual"
				}
			}
		]
	},
	{
		id: "virtual.jwtUpload",
		key: "jwtUpload",
		label: "JWT Token",
		description: "Upload or paste a Google service account JSON key file. The file contents are parsed and the relevant fields are populated automatically.",
		valueType: "string",
		kind: "virtual",
		defaultValue: "upload",
		dependsOn: "jsonData.authenticationType == 'jwt'",
		storage: {
			type: "computed",
			read: "jsonData.clientEmail ? 'manual' : 'upload'"
		},
		ui: {
			component: "fileUpload",
			accept: [
				".json"
			],
			placeholder: "Paste Google JWT token here",
			fileMapping: {
				project_id: "jsonData.defaultProject",
				client_email: "jsonData.clientEmail",
				token_uri: "jsonData.tokenUri",
				private_key: "secureJsonData.privateKey"
			}
		}
	},
	{
		id: "jsonData.defaultProject",
		key: "defaultProject",
		label: "Project ID",
		description: "GCP project ID. In JWT mode, auto-filled from the service account JSON.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.authenticationType == 'jwt' && virtual.jwtUpload == 'manual'"
	},
	{
		id: "jsonData.clientEmail",
		key: "clientEmail",
		label: "Client Email",
		description: "Service account email address for JWT authentication.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.authenticationType == 'jwt' && virtual.jwtUpload == 'manual'"
	},
	{
		id: "jsonData.tokenUri",
		key: "tokenUri",
		label: "Token URI",
		description: "OAuth2 token endpoint URI.",
		valueType: "string",
		target: "jsonData",
		defaultValue: "https://oauth2.googleapis.com/token",
		dependsOn: "jsonData.authenticationType == 'jwt' && virtual.jwtUpload == 'manual'"
	},
	{
		id: "virtual.privateKeyMode",
		key: "privateKeyMode",
		label: "Private key",
		valueType: "string",
		kind: "virtual",
		defaultValue: "paste",
		dependsOn: "jsonData.authenticationType == 'jwt' && virtual.jwtUpload == 'manual'",
		storage: {
			type: "computed",
			read: "jsonData.privateKeyPath ? 'path' : 'paste'"
		},
		ui: {
			component: "radio",
			options: [
				{
					label: "Paste private key",
					value: "paste"
				},
				{
					label: "Provide path to private key file",
					value: "path"
				}
			]
		}
	},
	{
		id: "secureJsonData.privateKey",
		key: "privateKey",
		label: "Private Key",
		description: "Service account private key for JWT authentication.",
		valueType: "string",
		semanticType: "token",
		target: "secureJsonData",
		dependsOn: "virtual.privateKeyMode == 'paste'"
	},
	{
		id: "jsonData.privateKeyPath",
		key: "privateKeyPath",
		label: "Private Key Path",
		description: "Path to a local private key file on the Grafana server. Not supported in hosted environments.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "virtual.privateKeyMode == 'path'",
		ui: {
			component: "input",
			placeholder: "File location of your private key (e.g. /etc/secrets/gce.pem)"
		}
	},
	{
		id: "jsonData.defaultProjectGce",
		key: "defaultProject",
		label: "Default Project",
		description: "Default GCP project. Used when running on Google Compute Engine.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.authenticationType == 'gce'"
	},
	{
		id: "jsonData.usingImpersonation",
		key: "usingImpersonation",
		label: "Enable service account impersonation",
		description: "Read more about service account impersonation.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.serviceAccountToImpersonate",
		key: "serviceAccountToImpersonate",
		label: "Service account to impersonate",
		description: "Email of the service account to impersonate.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.usingImpersonation == true"
	}
];
var groups = [
	{
		id: "auth",
		title: "Authentication",
		fieldRefs: [
			"jsonData.authenticationType",
			"virtual.jwtUpload",
			"jsonData.defaultProject",
			"jsonData.clientEmail",
			"jsonData.tokenUri",
			"virtual.privateKeyMode",
			"secureJsonData.privateKey",
			"jsonData.privateKeyPath",
			"jsonData.defaultProjectGce"
		]
	},
	{
		id: "impersonation",
		title: "Service account impersonation",
		optional: true,
		fieldRefs: [
			"jsonData.usingImpersonation",
			"jsonData.serviceAccountToImpersonate"
		]
	}
];
var stackdriverSchema = {
	$schema: $schema,
	schemaVersion: schemaVersion,
	pluginType: pluginType,
	pluginName: pluginName,
	docURL: docURL,
	fields: fields,
	groups: groups
};

export { $schema, stackdriverSchema as default, docURL, fields, groups, pluginName, pluginType, schemaVersion };
//# sourceMappingURL=stackdriver.schema.json.js.map
