{
    "$id": "NotifyEventRequest",
    "comment": "OCPP 2.1 Edition 1 (c) OCA, Creative Commons Attribution-NoDerivatives 4.0 International Public License",
    "definitions": {
        "EventNotificationEnumType": {
            "description": "Specifies the event notification type of the message.\r\n\r\n",
            "javaType": "EventNotificationEnum",
            "type": "string",
            "additionalProperties": false,
            "enum": [
                "HardWiredNotification",
                "HardWiredMonitor",
                "PreconfiguredMonitor",
                "CustomMonitor"
            ],
            "tsEnumNames": [
                "HardWiredNotification",
                "HardWiredMonitor",
                "PreconfiguredMonitor",
                "CustomMonitor"
            ]
        },
        "EventTriggerEnumType": {
            "description": "Type of trigger for this event, e.g. exceeding a threshold value.\r\n\r\n",
            "javaType": "EventTriggerEnum",
            "type": "string",
            "additionalProperties": false,
            "enum": ["Alerting", "Delta", "Periodic"],
            "tsEnumNames": ["Alerting", "Delta", "Periodic"]
        },
        "ComponentType": {
            "description": "A physical or logical component\r\n",
            "javaType": "Component",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "evse": {
                    "$ref": "#/definitions/EVSEType"
                },
                "name": {
                    "description": "Name of the component. Name should be taken from the list of standardized component names whenever possible. Case Insensitive. strongly advised to use Camel Case.\r\n",
                    "type": "string",
                    "maxLength": 50,
                    "pattern": "^[a-zA-Z0-9*\\-_=:+|@.]*$"
                },
                "instance": {
                    "description": "Name of instance in case the component exists as multiple instances. Case Insensitive. strongly advised to use Camel Case.\r\n",
                    "type": "string",
                    "maxLength": 50,
                    "pattern": "^[a-zA-Z0-9*\\-_=:+|@.]*$"
                },
                "customData": {
                    "$ref": "#/definitions/CustomDataType"
                }
            },
            "required": ["name"]
        },
        "EventDataType": {
            "description": "Class to report an event notification for a component-variable.\r\n",
            "javaType": "EventData",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "eventId": {
                    "description": "Identifies the event. This field can be referred to as a cause by other events.\r\n\r\n",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483647
                },
                "timestamp": {
                    "description": "Timestamp of the moment the report was generated.\r\n",
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?(?:Z|[+\\-]\\d{2}:\\d{2})$"
                },
                "trigger": {
                    "$ref": "#/definitions/EventTriggerEnumType"
                },
                "cause": {
                    "description": "Refers to the Id of an event that is considered to be the cause for this event.\r\n\r\n",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483647
                },
                "actualValue": {
                    "description": "Actual value (_attributeType_ Actual) of the variable.\r\n\r\nThe Configuration Variable &lt;&lt;configkey-reporting-value-size,ReportingValueSize&gt;&gt; can be used to limit GetVariableResult.attributeValue, VariableAttribute.value and EventData.actualValue. The max size of these values will always remain equal. \r\n\r\n",
                    "type": "string",
                    "maxLength": 2500
                },
                "techCode": {
                    "description": "Technical (error) code as reported by component.\r\n",
                    "type": "string",
                    "maxLength": 50
                },
                "techInfo": {
                    "description": "Technical detail information as reported by component.\r\n",
                    "type": "string",
                    "maxLength": 500
                },
                "cleared": {
                    "description": "_Cleared_ is set to true to report the clearing of a monitored situation, i.e. a 'return to normal'. \r\n\r\n",
                    "type": "boolean"
                },
                "transactionId": {
                    "description": "If an event notification is linked to a specific transaction, this field can be used to specify its transactionId.\r\n",
                    "type": "string",
                    "maxLength": 36,
                    "pattern": "^[a-zA-Z0-9*\\-_=:+|@.]*$"
                },
                "component": {
                    "$ref": "#/definitions/ComponentType"
                },
                "variableMonitoringId": {
                    "description": "Identifies the VariableMonitoring which triggered the event.\r\n",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483647
                },
                "eventNotificationType": {
                    "$ref": "#/definitions/EventNotificationEnumType"
                },
                "variable": {
                    "$ref": "#/definitions/VariableType"
                },
                "severity": {
                    "description": "*(2.1)* Severity associated with the monitor in _variableMonitoringId_ or with the hardwired notification.\r\n",
                    "type": "integer",
                    "minimum": 0
                },
                "customData": {
                    "$ref": "#/definitions/CustomDataType"
                }
            },
            "required": [
                "eventId",
                "timestamp",
                "trigger",
                "actualValue",
                "eventNotificationType",
                "component",
                "variable"
            ]
        },
        "EVSEType": {
            "description": "Electric Vehicle Supply Equipment\r\n",
            "javaType": "EVSE",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "id": {
                    "description": "EVSE Identifier. This contains a number (&gt; 0) designating an EVSE of the Charging Station.\r\n",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647
                },
                "connectorId": {
                    "description": "An id to designate a specific connector (on an EVSE) by connector index number.\r\n",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2147483647
                },
                "customData": {
                    "$ref": "#/definitions/CustomDataType"
                }
            },
            "required": ["id"]
        },
        "VariableType": {
            "description": "Reference key to a component-variable.\r\n",
            "javaType": "Variable",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "name": {
                    "description": "Name of the variable. Name should be taken from the list of standardized variable names whenever possible. Case Insensitive. strongly advised to use Camel Case.\r\n",
                    "type": "string",
                    "maxLength": 50,
                    "pattern": "^[a-zA-Z0-9*\\-_=:+|@.]*$"
                },
                "instance": {
                    "description": "Name of instance in case the variable exists as multiple instances. Case Insensitive. strongly advised to use Camel Case.\r\n",
                    "type": "string",
                    "maxLength": 50,
                    "pattern": "^[a-zA-Z0-9*\\-_=:+|@.]*$"
                },
                "customData": {
                    "$ref": "#/definitions/CustomDataType"
                }
            },
            "required": ["name"]
        },
        "CustomDataType": {
            "description": "This class does not get 'AdditionalProperties = false' in the schema generation, so it can be extended with arbitrary JSON properties to allow adding custom data.",
            "javaType": "CustomData",
            "type": "object",
            "properties": {
                "vendorId": {
                    "type": "string",
                    "maxLength": 255
                }
            },
            "required": ["vendorId"]
        }
    },
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "generatedAt": {
            "description": "Timestamp of the moment this message was generated at the Charging Station.\r\n",
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,3})?(?:Z|[+\\-]\\d{2}:\\d{2})$"
        },
        "tbc": {
            "description": "“to be continued” indicator. Indicates whether another part of the report follows in an upcoming notifyEventRequest message. Default value when omitted is false. \r\n",
            "type": "boolean",
            "default": false
        },
        "seqNo": {
            "description": "Sequence number of this message. First message starts at 0.\r\n",
            "type": "integer",
            "minimum": 0,
            "maximum": 2147483647
        },
        "eventData": {
            "type": "array",
            "additionalItems": false,
            "items": {
                "$ref": "#/definitions/EventDataType"
            },
            "minItems": 1
        },
        "customData": {
            "$ref": "#/definitions/CustomDataType"
        }
    },
    "required": ["generatedAt", "seqNo", "eventData"]
}
