{
	"$schema": "https://json-schema.org/draft/2020-12/schema",
	"anyOf": [
		{
			"type": "object",
			"properties": {
				"ok": {
					"type": "boolean",
					"const": true
				},
				"schemaVersion": {
					"type": "number",
					"const": 1
				},
				"command": {
					"type": "string",
					"const": "tap"
				},
				"device": {
					"type": "object",
					"properties": {
						"udid": {
							"type": "string"
						},
						"platform": {
							"type": "string",
							"enum": [
								"ios",
								"android"
							]
						},
						"name": {
							"type": "string"
						}
					},
					"required": [
						"udid",
						"platform"
					],
					"additionalProperties": false
				},
				"generation": {
					"type": "number"
				},
				"durationMs": {
					"type": "number"
				},
				"attachedTo": {
					"type": "string"
				},
				"result": {
					"type": "object",
					"properties": {
						"action": {
							"type": "string",
							"const": "press"
						},
						"target": {
							"type": "object",
							"properties": {
								"ref": {
									"type": "string"
								},
								"selector": {
									"type": "string"
								},
								"point": {
									"type": "object",
									"properties": {
										"x": {
											"type": "number"
										},
										"y": {
											"type": "number"
										}
									},
									"required": [
										"x",
										"y"
									],
									"additionalProperties": false
								}
							},
							"required": [
								"point"
							],
							"additionalProperties": false
						},
						"settled": {
							"type": "object",
							"properties": {
								"quiet": {
									"type": "boolean"
								},
								"waitedMs": {
									"type": "number"
								},
								"diff": {
									"anyOf": [
										{
											"type": "object",
											"properties": {
												"added": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"kind": {
																"type": "string",
																"enum": [
																	"+",
																	"-"
																]
															},
															"line": {
																"type": "string"
															},
															"ref": {
																"type": "string"
															}
														},
														"required": [
															"kind",
															"line"
														],
														"additionalProperties": false
													}
												},
												"removed": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"kind": {
																"type": "string",
																"enum": [
																	"+",
																	"-"
																]
															},
															"line": {
																"type": "string"
															},
															"ref": {
																"type": "string"
															}
														},
														"required": [
															"kind",
															"line"
														],
														"additionalProperties": false
													}
												},
												"unchanged": {
													"type": "number"
												},
												"against": {
													"type": "number"
												}
											},
											"required": [
												"added",
												"removed",
												"unchanged",
												"against"
											],
											"additionalProperties": false
										},
										{
											"type": "null"
										}
									]
								}
							},
							"required": [
								"quiet",
								"waitedMs",
								"diff"
							],
							"additionalProperties": false
						},
						"verified": {
							"anyOf": [
								{
									"type": "boolean"
								},
								{
									"type": "string",
									"const": "unconfirmed"
								}
							]
						}
					},
					"required": [
						"action"
					],
					"additionalProperties": false
				},
				"warnings": {
					"type": "array",
					"items": {
						"type": "string"
					}
				}
			},
			"required": [
				"ok",
				"schemaVersion",
				"command",
				"device",
				"durationMs",
				"result"
			],
			"additionalProperties": false
		},
		{
			"type": "object",
			"properties": {
				"ok": {
					"type": "boolean",
					"const": false
				},
				"schemaVersion": {
					"type": "number",
					"const": 1
				},
				"command": {
					"type": "string"
				},
				"device": {
					"type": "object",
					"properties": {
						"udid": {
							"type": "string"
						},
						"platform": {
							"type": "string",
							"enum": [
								"ios",
								"android"
							]
						},
						"name": {
							"type": "string"
						}
					},
					"required": [
						"udid",
						"platform"
					],
					"additionalProperties": false
				},
				"error": {
					"type": "object",
					"properties": {
						"code": {
							"type": "string",
							"enum": [
								"usage",
								"failed",
								"wait_target_absent",
								"wait_target_hidden",
								"wait_target_present",
								"wait_text_absent",
								"wait_not_stable",
								"target_not_found",
								"no_alert",
								"device_foreign",
								"device_busy",
								"device_unauthorized",
								"device_offline",
								"device_locked",
								"device_not_leased",
								"no_device_leased",
								"ambiguous_device",
								"lease_not_found",
								"engine_unavailable",
								"devtools_unavailable",
								"stale_ref",
								"no_recording",
								"recording_active",
								"target_exists",
								"empty_recording",
								"verify_failed",
								"helper_missing",
								"use_failed",
								"verify_unavailable",
								"interrupted",
								"device_unknown",
								"session_active",
								"session_not_found",
								"app_not_found",
								"unsupported",
								"not_profileable",
								"tool_missing",
								"NO_DEVICE",
								"QUEUE_TIMEOUT",
								"NO_CAPACITY",
								"REQUESTER_LIMIT",
								"RUNTIME_MISSING",
								"HEALTH_FAILED",
								"LEASE_LOST"
							]
						},
						"message": {
							"type": "string"
						},
						"hint": {
							"type": "string"
						},
						"details": {
							"type": "object",
							"propertyNames": {
								"type": "string"
							},
							"additionalProperties": {}
						}
					},
					"required": [
						"code",
						"message"
					],
					"additionalProperties": false
				}
			},
			"required": [
				"ok",
				"schemaVersion",
				"command",
				"error"
			],
			"additionalProperties": false
		}
	],
	"$id": "https://warden.co.nz/schemas/warden.ui.tap/1.json",
	"title": "warden.ui.tap"
}
