{
    "$id": "AWSToolkitTelemetry",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "AWS Toolkit Telemetry",
    "type": "object",
    "properties": {
        "types": {
            "type": "array",
            "description": "Metadata used by other calls",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The name of the metadata type",
                        "pattern": "^(?!value|project|createTime).*"
                    },
                    "type": {
                        "enum": ["int", "double", "string", "boolean"]
                    },
                    "description": {
                        "type": "string"
                    },
                    "allowedValues": {
                        "oneOf": [
                            { "type": "array", "items": { "type": "number" } },
                            { "type": "array", "items": { "type": "string" } }
                        ]
                    }
                },
                "required": ["name", "description"]
            }
        },
        "metrics": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The name of the metadata type",
                        "pattern": "^.*_.*$"
                    },
                    "description": {
                        "type": "string"
                    },
                    "unit": {
                        "enum": ["Milliseconds", "Bytes", "Percent", "Count", "None"]
                    },
                    "metadata": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "type": {
                                    "type": "string"
                                },
                                "required": {
                                    "type": "boolean"
                                }
                            },
                            "required": ["type"]
                        }
                    },
                    "passive": {
                        "type": "boolean",
                        "description": "Set as true if the metric is emitted without any explicit user action."
                    },
                    "trackPerformance": {
                        "type": "boolean",
                        "description": "Set as true if the metric can track run-time performance information. Default=false"
                    },
                    "traceId": {
                        "type": "string",
                        "description": "Unique identifier for the trace (a set of events) this metric belongs to"
                    },
                    "metricId": {
                        "type": "string",
                        "description": "Unique identifier for this metric"
                    },
                    "parentId": {
                        "type": "string",
                        "description": "Unique identifier of this metrics parent metric id"
                    }
                },
                "required": ["name", "description"]
            }
        }
    },
    "required": ["metrics"]
}
