From f3c3d3df4b3bac8b2b11b75fad1ccab414e258fc Mon Sep 17 00:00:00 2001 From: Andrii Balitskyi <10balian10@gmail.com> Date: Fri, 12 Apr 2024 15:51:56 +0200 Subject: [PATCH 1/4] Generate PHP SDK from OpenAPI spec imported from @seamapi/types --- package-lock.json | 484 +++++++++++++++++++++++++++++++++++++++++++- package.json | 7 +- scripts/generate.js | 37 ++++ 3 files changed, 514 insertions(+), 14 deletions(-) create mode 100644 scripts/generate.js diff --git a/package-lock.json b/package-lock.json index 1ef3718..b720736 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,9 @@ "license": "MIT", "devDependencies": { "@prettier/plugin-php": "^0.22.1", - "@seamapi/nextlove-sdk-generator": "^1.6.1", - "@seamapi/types": "^1.75.0", + "@seamapi/nextlove-sdk-generator": "1.8.2", + "@seamapi/types": "^1.157.1", + "del": "^7.1.0", "prettier": "^3.0.0" } }, @@ -433,9 +434,9 @@ } }, "node_modules/@seamapi/nextlove-sdk-generator": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/@seamapi/nextlove-sdk-generator/-/nextlove-sdk-generator-1.6.1.tgz", - "integrity": "sha512-5xkmrJaOo+YtSCTPlQYyP08PCWSxR/nJYGpmpNfUntzggVJXNMDuzwQmq1miWFt2l/2W1fkmJ7Crq8l82G5QTg==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@seamapi/nextlove-sdk-generator/-/nextlove-sdk-generator-1.8.2.tgz", + "integrity": "sha512-lKbBDeB/GJkemmmg5x76MBazohmMV/BctzyunSn1vok4giCCPHHO/YAZE1urYrxDph9YFoQkay8vFa7Nj7Y5gg==", "dev": true, "dependencies": { "@nodelib/fs.walk": "^2.0.0", @@ -454,9 +455,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.79.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.79.0.tgz", - "integrity": "sha512-P4zAnCCxSjKKJdIMN1YQfXXmTJDLgHd4BdGJcoqUU30Ujq1awIqOplfe/diSoRLjN8KjC0Rl4JZYH3fUEDsDmg==", + "version": "1.157.1", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.157.1.tgz", + "integrity": "sha512-vIzhW6vtdg1rHUxv3VGlmRnc6jJvxPsMLTOuDFW+8F6y4xOyD2uMyTTjniQWD+MX8Uv4ngkbl6w/dcWsiosPyg==", "dev": true, "engines": { "node": ">=18.12.0", @@ -472,6 +473,22 @@ } } }, + "node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -513,6 +530,34 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/camel-case": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", @@ -554,6 +599,21 @@ "tslib": "^2.0.3" } }, + "node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -598,6 +658,12 @@ "node": ">= 0.8" } }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/constant-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", @@ -609,6 +675,28 @@ "upper-case": "^2.0.2" } }, + "node_modules/del": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/del/-/del-7.1.0.tgz", + "integrity": "sha512-v2KyNk7efxhlyHpjEvfyxaAihKKK0nWCuf6ZtqZcFFpQRG0bJ12Qsr0RpvsICMjAAZ8DOVCxrlqpxISlMHC4Kg==", + "dev": true, + "dependencies": { + "globby": "^13.1.2", + "graceful-fs": "^4.2.10", + "is-glob": "^4.0.3", + "is-path-cwd": "^3.0.0", + "is-path-inside": "^4.0.0", + "p-map": "^5.5.0", + "rimraf": "^3.0.2", + "slash": "^4.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -618,6 +706,18 @@ "node": ">=0.4.0" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/dot-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", @@ -681,6 +781,69 @@ "node": ">=6" } }, + "node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fast-glob/node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fast-glob/node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/fastq": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", @@ -690,6 +853,18 @@ "reusify": "^1.0.4" } }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/follow-redirects": { "version": "1.15.4", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", @@ -724,6 +899,12 @@ "node": ">= 6" } }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -759,6 +940,63 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, "node_modules/header-case": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", @@ -769,6 +1007,52 @@ "tslib": "^2.0.3" } }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -778,6 +1062,51 @@ "node": ">=8" } }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-3.0.0.tgz", + "integrity": "sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/linguist-languages": { "version": "7.27.0", "resolved": "https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.27.0.tgz", @@ -827,6 +1156,28 @@ "url": "https://github.com/sindresorhus/mem?sponsor=1" } }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -860,6 +1211,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/no-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", @@ -870,6 +1233,15 @@ "tslib": "^2.0.3" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -879,6 +1251,21 @@ "node": ">=4" } }, + "node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -909,12 +1296,42 @@ "tslib": "^2.0.3" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/php-parser": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/php-parser/-/php-parser-3.1.5.tgz", "integrity": "sha512-jEY2DcbgCm5aclzBdfW86GM6VEIWcSlhTBSHN1qhJguVePlYe28GhwS0yoeLYXpM2K8y6wzLwrbq814n2PHSoQ==", "dev": true }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/prettier": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", @@ -984,6 +1401,21 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -1018,6 +1450,18 @@ "upper-case-first": "^2.0.2" } }, + "node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/snake-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", @@ -1054,6 +1498,18 @@ "node": ">=8" } }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", @@ -1061,9 +1517,9 @@ "dev": true }, "node_modules/tsx": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.0.tgz", - "integrity": "sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==", + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.7.2.tgz", + "integrity": "sha512-BCNd4kz6fz12fyrgCTEdZHGJ9fWTGeUzXmQysh0RVocDY3h4frk05ZNCXSy4kIenF7y/QnrdiVpTsyNRn6vlAw==", "dev": true, "dependencies": { "esbuild": "~0.19.10", @@ -1114,6 +1570,12 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 546bbbc..86df2e4 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,14 @@ "private": true, "license": "MIT", "scripts": { - "generate": "./scripts/generate.sh", + "generate": "node ./scripts/generate.js", "postgenerate": "prettier --write --ignore-path .gitignore ." }, "devDependencies": { "@prettier/plugin-php": "^0.22.1", - "@seamapi/nextlove-sdk-generator": "^1.6.1", - "@seamapi/types": "^1.75.0", + "@seamapi/nextlove-sdk-generator": "1.8.2", + "@seamapi/types": "1.157.1", + "del": "^7.1.0", "prettier": "^3.0.0" } } diff --git a/scripts/generate.js b/scripts/generate.js new file mode 100644 index 0000000..69ab231 --- /dev/null +++ b/scripts/generate.js @@ -0,0 +1,37 @@ +import { generatePhpSDK, writeFs } from "@seamapi/nextlove-sdk-generator" +import { openapi } from "@seamapi/types/connect" +import path from "node:path" +import { fileURLToPath } from "node:url" +import { deleteAsync } from "del" + +const PHP_SDK_DIRECTORY_PREFIX = "src/" +const PROJECT_ROOT_PATH = path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + "../", +) +const MAIN_SEAM_DIR_PATH = path.resolve( + PROJECT_ROOT_PATH, + PHP_SDK_DIRECTORY_PREFIX, +) + +const main = async () => { + try { + await deleteAsync(MAIN_SEAM_DIR_PATH) + + const pythonSdkFileSystem = await generatePhpSDK({ + openApiSpecObject: openapi, + }) + + const seamFiles = Object.entries(pythonSdkFileSystem).filter(([fileName]) => + fileName.startsWith(PHP_SDK_DIRECTORY_PREFIX), + ) + + writeFs(PROJECT_ROOT_PATH, Object.fromEntries(seamFiles)) + + console.log("PHP SDK generated successfully!") + } catch (error) { + console.error("Failed to generate SDK:", error) + } +} + +await main() From 4a038b3e4d57f8fa787e1d8bd54b63d4543566de Mon Sep 17 00:00:00 2001 From: Andrii Balitskyi <10balian10@gmail.com> Date: Fri, 12 Apr 2024 15:53:11 +0200 Subject: [PATCH 2/4] Set type to module --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 86df2e4..e0ad2b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "@seamapi/php", "version": "2.0.0", + "type": "module", "private": true, "license": "MIT", "scripts": { From adaa1f6511de5968d74a580a997c2c55e3781325 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Fri, 12 Apr 2024 13:53:33 +0000 Subject: [PATCH 3/4] ci: Generate code --- package-lock.json | 2 +- src/Objects/AccessCode.php | 56 +- src/Objects/AcsAccessGroup.php | 20 +- src/Objects/AcsCredential.php | 38 +- src/Objects/AcsCredentialPool.php | 4 +- .../AcsCredentialProvisioningAutomation.php | 4 +- .../AcsCredentialVisionlineMetadata.php | 8 +- src/Objects/AcsCredentialWarnings.php | 4 +- src/Objects/AcsEntrance.php | 4 +- src/Objects/AcsEntranceLatchMetadata.php | 8 +- src/Objects/AcsEntranceVisionlineMetadata.php | 4 +- src/Objects/AcsSystem.php | 24 +- src/Objects/AcsUser.php | 40 +- src/Objects/AcsUserAccessSchedule.php | 4 +- src/Objects/ActionAttempt.php | 12 +- src/Objects/ActionAttemptError.php | 4 +- src/Objects/ClientSession.php | 16 +- src/Objects/ClimateSettingSchedule.php | 40 +- src/Objects/ConnectWebview.php | 52 +- src/Objects/ConnectedAccount.php | 20 +- .../ConnectedAccountUserIdentifier.php | 8 +- src/Objects/Device.php | 54 +- src/Objects/DeviceAccessoryKeypad.php | 4 +- .../DeviceActiveClimateSettingSchedule.php | 40 +- ...viceAssaAbloyCredentialServiceMetadata.php | 4 +- src/Objects/DeviceAugustMetadata.php | 16 +- src/Objects/DeviceAvigilonAltaMetadata.php | 8 +- src/Objects/DeviceCodeConstraints.php | 4 +- src/Objects/DeviceCurrentClimateSetting.php | 12 +- src/Objects/DeviceDefaultClimateSetting.php | 12 +- .../DeviceDormakabaOracodeMetadata.php | 14 +- src/Objects/DeviceEcobeeMetadata.php | 4 +- .../DeviceHoneywellResideoMetadata.php | 4 +- src/Objects/DeviceHubitatMetadata.php | 4 +- src/Objects/DeviceIglooMetadata.php | 4 +- src/Objects/DeviceIgloohomeMetadata.php | 8 +- src/Objects/DeviceLatestSensorValues.php | 12 +- src/Objects/DeviceModel.php | 8 +- src/Objects/DeviceNestMetadata.php | 8 +- src/Objects/DeviceNoiseawareMetadata.php | 12 +- src/Objects/DeviceNukiMetadata.php | 4 +- src/Objects/DevicePredefinedTimeSlots.php | 20 +- src/Objects/DeviceProperties.php | 196 +- src/Objects/DeviceSaltoMetadata.php | 8 +- src/Objects/DeviceSchlageMetadata.php | 4 +- src/Objects/DeviceSeamBridgeMetadata.php | 4 +- src/Objects/DeviceSmartthingsMetadata.php | 4 +- src/Objects/DeviceTedeeMetadata.php | 16 +- src/Objects/DeviceTtlockMetadata.php | 4 +- src/Objects/DeviceWarnings.php | 4 +- src/Objects/DeviceWyzeMetadata.php | 16 +- src/Objects/EnrollmentAutomation.php | 8 +- src/Objects/Event.php | 12 +- src/Objects/Network.php | 8 +- src/Objects/NoiseThreshold.php | 12 +- src/Objects/Phone.php | 50 +- ...honeAssaAbloyCredentialServiceMetadata.php | 4 +- src/Objects/PhoneWarnings.php | 4 +- src/Objects/ServiceHealth.php | 4 +- src/Objects/UnmanagedAccessCode.php | 20 +- src/Objects/UnmanagedDevice.php | 40 +- .../UnmanagedDeviceAccessoryKeypad.php | 4 +- src/Objects/UnmanagedDeviceModel.php | 8 +- src/Objects/UnmanagedDeviceProperties.php | 28 +- src/Objects/UnmanagedDeviceWarnings.php | 4 +- src/Objects/UserIdentity.php | 20 +- src/Objects/Webhook.php | 8 +- src/Objects/Workspace.php | 12 +- src/SeamClient.php | 4650 ++++++++--------- 69 files changed, 2832 insertions(+), 2948 deletions(-) diff --git a/package-lock.json b/package-lock.json index b720736..1f6c09c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.22.1", "@seamapi/nextlove-sdk-generator": "1.8.2", - "@seamapi/types": "^1.157.1", + "@seamapi/types": "1.157.1", "del": "^7.1.0", "prettier": "^3.0.0" } diff --git a/src/Objects/AccessCode.php b/src/Objects/AccessCode.php index c324f22..c63c6da 100644 --- a/src/Objects/AccessCode.php +++ b/src/Objects/AccessCode.php @@ -11,54 +11,54 @@ public static function from_json(mixed $json): AccessCode|null return null; } return new self( - common_code_key: $json->common_code_key ?? null, - is_scheduled_on_device: $json->is_scheduled_on_device ?? null, - type: $json->type, - is_waiting_for_code_assignment: $json->is_waiting_for_code_assignment ?? null, access_code_id: $json->access_code_id, - device_id: $json->device_id, - name: $json->name ?? null, code: $json->code ?? null, + common_code_key: $json->common_code_key ?? null, created_at: $json->created_at, - errors: $json->errors ?? null, - warnings: $json->warnings ?? null, - is_managed: $json->is_managed, - starts_at: $json->starts_at ?? null, + device_id: $json->device_id, ends_at: $json->ends_at ?? null, - status: $json->status, - is_backup_access_code_available: $json->is_backup_access_code_available, + errors: $json->errors ?? null, is_backup: $json->is_backup ?? null, - pulled_backup_access_code_id: $json->pulled_backup_access_code_id ?? null, + is_backup_access_code_available: $json->is_backup_access_code_available, is_external_modification_allowed: $json->is_external_modification_allowed, - is_one_time_use: $json->is_one_time_use, + is_managed: $json->is_managed, is_offline_access_code: $json->is_offline_access_code, + is_one_time_use: $json->is_one_time_use, + is_scheduled_on_device: $json->is_scheduled_on_device ?? null, + is_waiting_for_code_assignment: $json->is_waiting_for_code_assignment ?? null, + name: $json->name ?? null, + pulled_backup_access_code_id: $json->pulled_backup_access_code_id ?? null, + starts_at: $json->starts_at ?? null, + status: $json->status, + type: $json->type, + warnings: $json->warnings ?? null, ); } public function __construct( - public string | null $common_code_key, - public bool | null $is_scheduled_on_device, - public string $type, - public bool | null $is_waiting_for_code_assignment, public string $access_code_id, - public string $device_id, - public string | null $name, public string | null $code, + public string | null $common_code_key, public string $created_at, - public mixed $errors, - public mixed $warnings, - public bool $is_managed, - public string | null $starts_at, + public string $device_id, public string | null $ends_at, - public string $status, - public bool $is_backup_access_code_available, + public mixed $errors, public bool | null $is_backup, - public string | null $pulled_backup_access_code_id, + public bool $is_backup_access_code_available, public bool $is_external_modification_allowed, - public bool $is_one_time_use, + public bool $is_managed, public bool $is_offline_access_code, + public bool $is_one_time_use, + public bool | null $is_scheduled_on_device, + public bool | null $is_waiting_for_code_assignment, + public string | null $name, + public string | null $pulled_backup_access_code_id, + public string | null $starts_at, + public string $status, + public string $type, + public mixed $warnings, ) { } diff --git a/src/Objects/AcsAccessGroup.php b/src/Objects/AcsAccessGroup.php index 81c6c89..361f43d 100644 --- a/src/Objects/AcsAccessGroup.php +++ b/src/Objects/AcsAccessGroup.php @@ -11,30 +11,30 @@ public static function from_json(mixed $json): AcsAccessGroup|null return null; } return new self( - acs_access_group_id: $json->acs_access_group_id, - acs_system_id: $json->acs_system_id, - workspace_id: $json->workspace_id, - name: $json->name, access_group_type: $json->access_group_type, access_group_type_display_name: $json->access_group_type_display_name, + acs_access_group_id: $json->acs_access_group_id, + acs_system_id: $json->acs_system_id, + created_at: $json->created_at, external_type: $json->external_type, external_type_display_name: $json->external_type_display_name, - created_at: $json->created_at, + name: $json->name, + workspace_id: $json->workspace_id, ); } public function __construct( - public string $acs_access_group_id, - public string $acs_system_id, - public string $workspace_id, - public string $name, public string $access_group_type, public string $access_group_type_display_name, + public string $acs_access_group_id, + public string $acs_system_id, + public string $created_at, public string $external_type, public string $external_type_display_name, - public string $created_at, + public string $name, + public string $workspace_id, ) { } diff --git a/src/Objects/AcsCredential.php b/src/Objects/AcsCredential.php index 7d1fa6e..5363d1c 100644 --- a/src/Objects/AcsCredential.php +++ b/src/Objects/AcsCredential.php @@ -11,54 +11,54 @@ public static function from_json(mixed $json): AcsCredential|null return null; } return new self( + access_method: $json->access_method, acs_credential_id: $json->acs_credential_id, - acs_user_id: $json->acs_user_id ?? null, acs_credential_pool_id: $json->acs_credential_pool_id ?? null, acs_system_id: $json->acs_system_id, - parent_acs_credential_id: $json->parent_acs_credential_id ?? null, - display_name: $json->display_name, + acs_user_id: $json->acs_user_id ?? null, code: $json->code ?? null, - access_method: $json->access_method, - external_type: $json->external_type ?? null, - external_type_display_name: $json->external_type_display_name ?? null, created_at: $json->created_at, - workspace_id: $json->workspace_id, - starts_at: $json->starts_at ?? null, + display_name: $json->display_name, ends_at: $json->ends_at ?? null, errors: array_map( fn ($e) => AcsCredentialErrors::from_json($e), $json->errors ?? [] ), + external_type: $json->external_type ?? null, + external_type_display_name: $json->external_type_display_name ?? null, + is_multi_phone_sync_credential: $json->is_multi_phone_sync_credential ?? null, + parent_acs_credential_id: $json->parent_acs_credential_id ?? null, + starts_at: $json->starts_at ?? null, + visionline_metadata: isset($json->visionline_metadata) ? AcsCredentialVisionlineMetadata::from_json($json->visionline_metadata) : null, warnings: array_map( fn ($w) => AcsCredentialWarnings::from_json($w), $json->warnings ?? [] ), - is_multi_phone_sync_credential: $json->is_multi_phone_sync_credential ?? null, - visionline_metadata: isset($json->visionline_metadata) ? AcsCredentialVisionlineMetadata::from_json($json->visionline_metadata) : null, + workspace_id: $json->workspace_id, ); } public function __construct( + public string $access_method, public string $acs_credential_id, - public string | null $acs_user_id, public string | null $acs_credential_pool_id, public string $acs_system_id, - public string | null $parent_acs_credential_id, - public string $display_name, + public string | null $acs_user_id, public string | null $code, - public string $access_method, - public string | null $external_type, - public string | null $external_type_display_name, public string $created_at, - public string $workspace_id, - public string | null $starts_at, + public string $display_name, public string | null $ends_at, public array $errors, - public array $warnings, + public string | null $external_type, + public string | null $external_type_display_name, public bool | null $is_multi_phone_sync_credential, + public string | null $parent_acs_credential_id, + public string | null $starts_at, public AcsCredentialVisionlineMetadata | null $visionline_metadata, + public array $warnings, + public string $workspace_id, ) { } diff --git a/src/Objects/AcsCredentialPool.php b/src/Objects/AcsCredentialPool.php index 53251ec..0b783b5 100644 --- a/src/Objects/AcsCredentialPool.php +++ b/src/Objects/AcsCredentialPool.php @@ -13,10 +13,10 @@ public static function from_json(mixed $json): AcsCredentialPool|null return new self( acs_credential_pool_id: $json->acs_credential_pool_id, acs_system_id: $json->acs_system_id, + created_at: $json->created_at, display_name: $json->display_name, external_type: $json->external_type, external_type_display_name: $json->external_type_display_name, - created_at: $json->created_at, workspace_id: $json->workspace_id, ); } @@ -26,10 +26,10 @@ public static function from_json(mixed $json): AcsCredentialPool|null public function __construct( public string $acs_credential_pool_id, public string $acs_system_id, + public string $created_at, public string $display_name, public string $external_type, public string $external_type_display_name, - public string $created_at, public string $workspace_id, ) { } diff --git a/src/Objects/AcsCredentialProvisioningAutomation.php b/src/Objects/AcsCredentialProvisioningAutomation.php index d2cf7ee..49880ab 100644 --- a/src/Objects/AcsCredentialProvisioningAutomation.php +++ b/src/Objects/AcsCredentialProvisioningAutomation.php @@ -12,9 +12,9 @@ public static function from_json(mixed $json): AcsCredentialProvisioningAutomati } return new self( acs_credential_provisioning_automation_id: $json->acs_credential_provisioning_automation_id, + created_at: $json->created_at, credential_manager_acs_system_id: $json->credential_manager_acs_system_id, user_identity_id: $json->user_identity_id, - created_at: $json->created_at, workspace_id: $json->workspace_id, ); } @@ -23,9 +23,9 @@ public static function from_json(mixed $json): AcsCredentialProvisioningAutomati public function __construct( public string $acs_credential_provisioning_automation_id, + public string $created_at, public string $credential_manager_acs_system_id, public string $user_identity_id, - public string $created_at, public string $workspace_id, ) { } diff --git a/src/Objects/AcsCredentialVisionlineMetadata.php b/src/Objects/AcsCredentialVisionlineMetadata.php index bb99509..6066146 100644 --- a/src/Objects/AcsCredentialVisionlineMetadata.php +++ b/src/Objects/AcsCredentialVisionlineMetadata.php @@ -11,18 +11,18 @@ public static function from_json(mixed $json): AcsCredentialVisionlineMetadata|n return null; } return new self( - joiner_acs_credential_ids: $json->joiner_acs_credential_ids ?? null, - guest_acs_entrance_ids: $json->guest_acs_entrance_ids ?? null, common_acs_entrance_ids: $json->common_acs_entrance_ids ?? null, + guest_acs_entrance_ids: $json->guest_acs_entrance_ids ?? null, + joiner_acs_credential_ids: $json->joiner_acs_credential_ids ?? null, ); } public function __construct( - public array | null $joiner_acs_credential_ids, - public array | null $guest_acs_entrance_ids, public array | null $common_acs_entrance_ids, + public array | null $guest_acs_entrance_ids, + public array | null $joiner_acs_credential_ids, ) { } diff --git a/src/Objects/AcsCredentialWarnings.php b/src/Objects/AcsCredentialWarnings.php index 0e2b955..3146f05 100644 --- a/src/Objects/AcsCredentialWarnings.php +++ b/src/Objects/AcsCredentialWarnings.php @@ -11,8 +11,8 @@ public static function from_json(mixed $json): AcsCredentialWarnings|null return null; } return new self( - warning_code: $json->warning_code, message: $json->message, + warning_code: $json->warning_code, created_at: $json->created_at ?? null, ); } @@ -20,8 +20,8 @@ public static function from_json(mixed $json): AcsCredentialWarnings|null public function __construct( - public string $warning_code, public string $message, + public string $warning_code, public string | null $created_at, ) { } diff --git a/src/Objects/AcsEntrance.php b/src/Objects/AcsEntrance.php index f988068..b66cf53 100644 --- a/src/Objects/AcsEntrance.php +++ b/src/Objects/AcsEntrance.php @@ -12,9 +12,9 @@ public static function from_json(mixed $json): AcsEntrance|null } return new self( acs_entrance_id: $json->acs_entrance_id, - display_name: $json->display_name, acs_system_id: $json->acs_system_id, created_at: $json->created_at, + display_name: $json->display_name, latch_metadata: isset($json->latch_metadata) ? AcsEntranceLatchMetadata::from_json($json->latch_metadata) : null, visionline_metadata: isset($json->visionline_metadata) ? AcsEntranceVisionlineMetadata::from_json($json->visionline_metadata) : null, ); @@ -24,9 +24,9 @@ public static function from_json(mixed $json): AcsEntrance|null public function __construct( public string $acs_entrance_id, - public string $display_name, public string $acs_system_id, public string $created_at, + public string $display_name, public AcsEntranceLatchMetadata | null $latch_metadata, public AcsEntranceVisionlineMetadata | null $visionline_metadata, ) { diff --git a/src/Objects/AcsEntranceLatchMetadata.php b/src/Objects/AcsEntranceLatchMetadata.php index 063d1b5..fab928c 100644 --- a/src/Objects/AcsEntranceLatchMetadata.php +++ b/src/Objects/AcsEntranceLatchMetadata.php @@ -12,8 +12,8 @@ public static function from_json(mixed $json): AcsEntranceLatchMetadata|null } return new self( accessibility_type: $json->accessibility_type, - name: $json->name, - type: $json->type, + door_name: $json->door_name, + door_type: $json->door_type, is_connected: $json->is_connected, ); } @@ -22,8 +22,8 @@ public static function from_json(mixed $json): AcsEntranceLatchMetadata|null public function __construct( public string $accessibility_type, - public string $name, - public string $type, + public string $door_name, + public string $door_type, public bool $is_connected, ) { } diff --git a/src/Objects/AcsEntranceVisionlineMetadata.php b/src/Objects/AcsEntranceVisionlineMetadata.php index 9451ff1..df146da 100644 --- a/src/Objects/AcsEntranceVisionlineMetadata.php +++ b/src/Objects/AcsEntranceVisionlineMetadata.php @@ -11,8 +11,8 @@ public static function from_json(mixed $json): AcsEntranceVisionlineMetadata|nul return null; } return new self( - door_name: $json->door_name, door_category: $json->door_category, + door_name: $json->door_name, profiles: array_map( fn ($p) => AcsEntranceProfiles::from_json($p), $json->profiles ?? [] @@ -23,8 +23,8 @@ public static function from_json(mixed $json): AcsEntranceVisionlineMetadata|nul public function __construct( - public string $door_name, public string $door_category, + public string $door_name, public array | null $profiles, ) { } diff --git a/src/Objects/AcsSystem.php b/src/Objects/AcsSystem.php index dfb99ca..6d51d37 100644 --- a/src/Objects/AcsSystem.php +++ b/src/Objects/AcsSystem.php @@ -12,17 +12,17 @@ public static function from_json(mixed $json): AcsSystem|null } return new self( acs_system_id: $json->acs_system_id, + can_automate_enrollment: $json->can_automate_enrollment ?? null, + connected_account_ids: $json->connected_account_ids, + created_at: $json->created_at, external_type: $json->external_type ?? null, external_type_display_name: $json->external_type_display_name ?? null, + image_alt_text: $json->image_alt_text, + image_url: $json->image_url, + name: $json->name, system_type: $json->system_type ?? null, system_type_display_name: $json->system_type_display_name ?? null, - name: $json->name, - created_at: $json->created_at, workspace_id: $json->workspace_id, - connected_account_ids: $json->connected_account_ids, - image_url: $json->image_url, - image_alt_text: $json->image_alt_text, - can_automate_enrollment: $json->can_automate_enrollment ?? null, ); } @@ -30,17 +30,17 @@ public static function from_json(mixed $json): AcsSystem|null public function __construct( public string $acs_system_id, + public bool | null $can_automate_enrollment, + public array $connected_account_ids, + public string $created_at, public string | null $external_type, public string | null $external_type_display_name, + public string $image_alt_text, + public string $image_url, + public string $name, public string | null $system_type, public string | null $system_type_display_name, - public string $name, - public string $created_at, public string $workspace_id, - public array $connected_account_ids, - public string $image_url, - public string $image_alt_text, - public bool | null $can_automate_enrollment, ) { } diff --git a/src/Objects/AcsUser.php b/src/Objects/AcsUser.php index 5bf8d4e..6734976 100644 --- a/src/Objects/AcsUser.php +++ b/src/Objects/AcsUser.php @@ -11,48 +11,48 @@ public static function from_json(mixed $json): AcsUser|null return null; } return new self( - acs_user_id: $json->acs_user_id, + access_schedule: isset($json->access_schedule) ? AcsUserAccessSchedule::from_json($json->access_schedule) : null, acs_system_id: $json->acs_system_id, - hid_acs_system_id: $json->hid_acs_system_id ?? null, - workspace_id: $json->workspace_id, + acs_user_id: $json->acs_user_id, created_at: $json->created_at, display_name: $json->display_name, + email: $json->email ?? null, + email_address: $json->email_address ?? null, external_type: $json->external_type ?? null, external_type_display_name: $json->external_type_display_name ?? null, + full_name: $json->full_name ?? null, + hid_acs_system_id: $json->hid_acs_system_id ?? null, is_suspended: $json->is_suspended, - access_schedule: isset($json->access_schedule) ? AcsUserAccessSchedule::from_json($json->access_schedule) : null, - user_identity_id: $json->user_identity_id ?? null, - user_identity_full_name: $json->user_identity_full_name ?? null, + phone_number: $json->phone_number ?? null, user_identity_email_address: $json->user_identity_email_address ?? null, + user_identity_full_name: $json->user_identity_full_name ?? null, + user_identity_id: $json->user_identity_id ?? null, user_identity_phone_number: $json->user_identity_phone_number ?? null, - full_name: $json->full_name ?? null, - email: $json->email ?? null, - email_address: $json->email_address ?? null, - phone_number: $json->phone_number ?? null, + workspace_id: $json->workspace_id, ); } public function __construct( - public string $acs_user_id, + public AcsUserAccessSchedule | null $access_schedule, public string $acs_system_id, - public string | null $hid_acs_system_id, - public string $workspace_id, + public string $acs_user_id, public string $created_at, public string $display_name, + public string | null $email, + public string | null $email_address, public string | null $external_type, public string | null $external_type_display_name, + public string | null $full_name, + public string | null $hid_acs_system_id, public bool $is_suspended, - public AcsUserAccessSchedule | null $access_schedule, - public string | null $user_identity_id, - public string | null $user_identity_full_name, + public string | null $phone_number, public string | null $user_identity_email_address, + public string | null $user_identity_full_name, + public string | null $user_identity_id, public string | null $user_identity_phone_number, - public string | null $full_name, - public string | null $email, - public string | null $email_address, - public string | null $phone_number, + public string $workspace_id, ) { } diff --git a/src/Objects/AcsUserAccessSchedule.php b/src/Objects/AcsUserAccessSchedule.php index fe297d5..dcb2fc0 100644 --- a/src/Objects/AcsUserAccessSchedule.php +++ b/src/Objects/AcsUserAccessSchedule.php @@ -11,16 +11,16 @@ public static function from_json(mixed $json): AcsUserAccessSchedule|null return null; } return new self( - starts_at: $json->starts_at, ends_at: $json->ends_at, + starts_at: $json->starts_at, ); } public function __construct( - public string $starts_at, public string $ends_at, + public string $starts_at, ) { } diff --git a/src/Objects/ActionAttempt.php b/src/Objects/ActionAttempt.php index fe8c5b2..a3ed7bc 100644 --- a/src/Objects/ActionAttempt.php +++ b/src/Objects/ActionAttempt.php @@ -11,22 +11,22 @@ public static function from_json(mixed $json): ActionAttempt|null return null; } return new self( - status: $json->status ?? null, - action_type: $json->action_type ?? null, action_attempt_id: $json->action_attempt_id ?? null, - result: $json->result ?? null, + action_type: $json->action_type ?? null, error: isset($json->error) ? ActionAttemptError::from_json($json->error) : null, + result: $json->result ?? null, + status: $json->status ?? null, ); } public function __construct( - public string | null $status, - public string | null $action_type, public string | null $action_attempt_id, - public mixed $result, + public string | null $action_type, public ActionAttemptError | null $error, + public mixed $result, + public string | null $status, ) { } diff --git a/src/Objects/ActionAttemptError.php b/src/Objects/ActionAttemptError.php index 0f36f54..d958baa 100644 --- a/src/Objects/ActionAttemptError.php +++ b/src/Objects/ActionAttemptError.php @@ -11,16 +11,16 @@ public static function from_json(mixed $json): ActionAttemptError|null return null; } return new self( - type: $json->type, message: $json->message, + type: $json->type, ); } public function __construct( - public string $type, public string $message, + public string $type, ) { } diff --git a/src/Objects/ClientSession.php b/src/Objects/ClientSession.php index 1b863c2..873c41a 100644 --- a/src/Objects/ClientSession.php +++ b/src/Objects/ClientSession.php @@ -12,12 +12,12 @@ public static function from_json(mixed $json): ClientSession|null } return new self( client_session_id: $json->client_session_id, - user_identifier_key: $json->user_identifier_key ?? null, + connect_webview_ids: $json->connect_webview_ids, + connected_account_ids: $json->connected_account_ids, created_at: $json->created_at, - token: $json->token, device_count: $json->device_count, - connected_account_ids: $json->connected_account_ids, - connect_webview_ids: $json->connect_webview_ids, + token: $json->token, + user_identifier_key: $json->user_identifier_key ?? null, user_identity_ids: $json->user_identity_ids, workspace_id: $json->workspace_id, ); @@ -27,12 +27,12 @@ public static function from_json(mixed $json): ClientSession|null public function __construct( public string $client_session_id, - public string | null $user_identifier_key, + public array $connect_webview_ids, + public array $connected_account_ids, public string $created_at, - public string $token, public int $device_count, - public array $connected_account_ids, - public array $connect_webview_ids, + public string $token, + public string | null $user_identifier_key, public array $user_identity_ids, public string $workspace_id, ) { diff --git a/src/Objects/ClimateSettingSchedule.php b/src/Objects/ClimateSettingSchedule.php index 4eaefd7..5dd00f8 100644 --- a/src/Objects/ClimateSettingSchedule.php +++ b/src/Objects/ClimateSettingSchedule.php @@ -11,44 +11,44 @@ public static function from_json(mixed $json): ClimateSettingSchedule|null return null; } return new self( + automatic_cooling_enabled: $json->automatic_cooling_enabled ?? null, + automatic_heating_enabled: $json->automatic_heating_enabled ?? null, climate_setting_schedule_id: $json->climate_setting_schedule_id, - schedule_type: $json->schedule_type, - device_id: $json->device_id, - name: $json->name ?? null, - schedule_starts_at: $json->schedule_starts_at, - schedule_ends_at: $json->schedule_ends_at, + cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, + cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, created_at: $json->created_at, + device_id: $json->device_id, errors: $json->errors ?? null, - automatic_heating_enabled: $json->automatic_heating_enabled ?? null, - automatic_cooling_enabled: $json->automatic_cooling_enabled ?? null, - hvac_mode_setting: $json->hvac_mode_setting ?? null, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, + hvac_mode_setting: $json->hvac_mode_setting ?? null, manual_override_allowed: $json->manual_override_allowed ?? null, + name: $json->name ?? null, + schedule_ends_at: $json->schedule_ends_at, + schedule_starts_at: $json->schedule_starts_at, + schedule_type: $json->schedule_type, ); } public function __construct( + public bool | null $automatic_cooling_enabled, + public bool | null $automatic_heating_enabled, public string $climate_setting_schedule_id, - public string $schedule_type, - public string $device_id, - public string | null $name, - public string $schedule_starts_at, - public string $schedule_ends_at, + public int | null $cooling_set_point_celsius, + public int | null $cooling_set_point_fahrenheit, public string $created_at, + public string $device_id, public mixed $errors, - public bool | null $automatic_heating_enabled, - public bool | null $automatic_cooling_enabled, - public string | null $hvac_mode_setting, - public int | null $cooling_set_point_celsius, public int | null $heating_set_point_celsius, - public int | null $cooling_set_point_fahrenheit, public int | null $heating_set_point_fahrenheit, + public string | null $hvac_mode_setting, public bool | null $manual_override_allowed, + public string | null $name, + public string $schedule_ends_at, + public string $schedule_starts_at, + public string $schedule_type, ) { } diff --git a/src/Objects/ConnectWebview.php b/src/Objects/ConnectWebview.php index 2ad3216..a21b57c 100644 --- a/src/Objects/ConnectWebview.php +++ b/src/Objects/ConnectWebview.php @@ -11,50 +11,50 @@ public static function from_json(mixed $json): ConnectWebview|null return null; } return new self( - connect_webview_id: $json->connect_webview_id, - workspace_id: $json->workspace_id, - created_at: $json->created_at, - connected_account_id: $json->connected_account_id ?? null, - url: $json->url, - device_selection_mode: $json->device_selection_mode, - accepted_providers: $json->accepted_providers, accepted_devices: $json->accepted_devices, + accepted_providers: $json->accepted_providers, any_device_allowed: $json->any_device_allowed, any_provider_allowed: $json->any_provider_allowed, + authorized_at: $json->authorized_at ?? null, + automatically_manage_new_devices: $json->automatically_manage_new_devices, + connect_webview_id: $json->connect_webview_id, + connected_account_id: $json->connected_account_id ?? null, + created_at: $json->created_at, + custom_metadata: $json->custom_metadata, + custom_redirect_failure_url: $json->custom_redirect_failure_url ?? null, + custom_redirect_url: $json->custom_redirect_url ?? null, + device_selection_mode: $json->device_selection_mode, login_successful: $json->login_successful, + selected_provider: $json->selected_provider ?? null, status: $json->status, - custom_redirect_url: $json->custom_redirect_url ?? null, - custom_redirect_failure_url: $json->custom_redirect_failure_url ?? null, - custom_metadata: $json->custom_metadata, - automatically_manage_new_devices: $json->automatically_manage_new_devices, + url: $json->url, wait_for_device_creation: $json->wait_for_device_creation, - authorized_at: $json->authorized_at ?? null, - selected_provider: $json->selected_provider ?? null, + workspace_id: $json->workspace_id, ); } public function __construct( - public string $connect_webview_id, - public string $workspace_id, - public string $created_at, - public string | null $connected_account_id, - public string $url, - public string $device_selection_mode, - public array $accepted_providers, public array $accepted_devices, + public array $accepted_providers, public bool $any_device_allowed, public bool $any_provider_allowed, + public string | null $authorized_at, + public bool $automatically_manage_new_devices, + public string $connect_webview_id, + public string | null $connected_account_id, + public string $created_at, + public mixed $custom_metadata, + public string | null $custom_redirect_failure_url, + public string | null $custom_redirect_url, + public string $device_selection_mode, public bool $login_successful, + public string | null $selected_provider, public string $status, - public string | null $custom_redirect_url, - public string | null $custom_redirect_failure_url, - public mixed $custom_metadata, - public bool $automatically_manage_new_devices, + public string $url, public bool $wait_for_device_creation, - public string | null $authorized_at, - public string | null $selected_provider, + public string $workspace_id, ) { } diff --git a/src/Objects/ConnectedAccount.php b/src/Objects/ConnectedAccount.php index f95b93d..ed2a334 100644 --- a/src/Objects/ConnectedAccount.php +++ b/src/Objects/ConnectedAccount.php @@ -11,30 +11,30 @@ public static function from_json(mixed $json): ConnectedAccount|null return null; } return new self( - connected_account_id: $json->connected_account_id ?? null, - created_at: $json->created_at ?? null, - user_identifier: isset($json->user_identifier) ? ConnectedAccountUserIdentifier::from_json($json->user_identifier) : null, account_type: $json->account_type ?? null, account_type_display_name: $json->account_type_display_name, + automatically_manage_new_devices: $json->automatically_manage_new_devices, + connected_account_id: $json->connected_account_id ?? null, + created_at: $json->created_at ?? null, + custom_metadata: $json->custom_metadata, errors: $json->errors ?? null, + user_identifier: isset($json->user_identifier) ? ConnectedAccountUserIdentifier::from_json($json->user_identifier) : null, warnings: $json->warnings ?? null, - custom_metadata: $json->custom_metadata, - automatically_manage_new_devices: $json->automatically_manage_new_devices, ); } public function __construct( - public string | null $connected_account_id, - public string | null $created_at, - public ConnectedAccountUserIdentifier | null $user_identifier, public string | null $account_type, public string $account_type_display_name, + public bool $automatically_manage_new_devices, + public string | null $connected_account_id, + public string | null $created_at, + public mixed $custom_metadata, public mixed $errors, + public ConnectedAccountUserIdentifier | null $user_identifier, public mixed $warnings, - public mixed $custom_metadata, - public bool $automatically_manage_new_devices, ) { } diff --git a/src/Objects/ConnectedAccountUserIdentifier.php b/src/Objects/ConnectedAccountUserIdentifier.php index b8c0356..2c81346 100644 --- a/src/Objects/ConnectedAccountUserIdentifier.php +++ b/src/Objects/ConnectedAccountUserIdentifier.php @@ -11,22 +11,22 @@ public static function from_json(mixed $json): ConnectedAccountUserIdentifier|nu return null; } return new self( - username: $json->username ?? null, api_url: $json->api_url ?? null, email: $json->email ?? null, - phone: $json->phone ?? null, exclusive: $json->exclusive ?? null, + phone: $json->phone ?? null, + username: $json->username ?? null, ); } public function __construct( - public string | null $username, public string | null $api_url, public string | null $email, - public string | null $phone, public bool | null $exclusive, + public string | null $phone, + public string | null $username, ) { } diff --git a/src/Objects/Device.php b/src/Objects/Device.php index 498c451..18d88f3 100644 --- a/src/Objects/Device.php +++ b/src/Objects/Device.php @@ -11,54 +11,56 @@ public static function from_json(mixed $json): Device|null return null; } return new self( + can_program_offline_access_codes: $json->can_program_offline_access_codes ?? null, + can_program_online_access_codes: $json->can_program_online_access_codes ?? null, + can_remotely_lock: $json->can_remotely_lock ?? null, + can_remotely_unlock: $json->can_remotely_unlock ?? null, + can_simulate_removal: $json->can_simulate_removal ?? null, + capabilities_supported: $json->capabilities_supported, + connected_account_id: $json->connected_account_id, + created_at: $json->created_at, + custom_metadata: $json->custom_metadata, device_id: $json->device_id, device_type: $json->device_type, - nickname: $json->nickname ?? null, display_name: $json->display_name, - capabilities_supported: $json->capabilities_supported, - properties: DeviceProperties::from_json($json->properties), - location: isset($json->location) ? DeviceLocation::from_json($json->location) : null, - connected_account_id: $json->connected_account_id, - workspace_id: $json->workspace_id, errors: array_map( fn ($e) => DeviceErrors::from_json($e), $json->errors ?? [] ), + is_managed: $json->is_managed, + location: isset($json->location) ? DeviceLocation::from_json($json->location) : null, + nickname: $json->nickname ?? null, + properties: DeviceProperties::from_json($json->properties), warnings: array_map( fn ($w) => DeviceWarnings::from_json($w), $json->warnings ?? [] ), - created_at: $json->created_at, - is_managed: $json->is_managed, - custom_metadata: $json->custom_metadata, - can_remotely_unlock: $json->can_remotely_unlock ?? null, - can_remotely_lock: $json->can_remotely_lock ?? null, - can_program_online_access_codes: $json->can_program_online_access_codes ?? null, - can_simulate_removal: $json->can_simulate_removal ?? null, + workspace_id: $json->workspace_id, ); } public function __construct( + public bool | null $can_program_offline_access_codes, + public bool | null $can_program_online_access_codes, + public bool | null $can_remotely_lock, + public bool | null $can_remotely_unlock, + public bool | null $can_simulate_removal, + public array $capabilities_supported, + public string $connected_account_id, + public string $created_at, + public mixed $custom_metadata, public string $device_id, public string $device_type, - public string | null $nickname, public string $display_name, - public array $capabilities_supported, - public DeviceProperties $properties, - public DeviceLocation | null $location, - public string $connected_account_id, - public string $workspace_id, public array $errors, - public array $warnings, - public string $created_at, public bool $is_managed, - public mixed $custom_metadata, - public bool | null $can_remotely_unlock, - public bool | null $can_remotely_lock, - public bool | null $can_program_online_access_codes, - public bool | null $can_simulate_removal, + public DeviceLocation | null $location, + public string | null $nickname, + public DeviceProperties $properties, + public array $warnings, + public string $workspace_id, ) { } diff --git a/src/Objects/DeviceAccessoryKeypad.php b/src/Objects/DeviceAccessoryKeypad.php index f4b6c77..8bd6d04 100644 --- a/src/Objects/DeviceAccessoryKeypad.php +++ b/src/Objects/DeviceAccessoryKeypad.php @@ -11,16 +11,16 @@ public static function from_json(mixed $json): DeviceAccessoryKeypad|null return null; } return new self( - is_connected: $json->is_connected, battery: isset($json->battery) ? DeviceBattery::from_json($json->battery) : null, + is_connected: $json->is_connected, ); } public function __construct( - public bool $is_connected, public DeviceBattery | null $battery, + public bool $is_connected, ) { } diff --git a/src/Objects/DeviceActiveClimateSettingSchedule.php b/src/Objects/DeviceActiveClimateSettingSchedule.php index 43182c6..c7ce86b 100644 --- a/src/Objects/DeviceActiveClimateSettingSchedule.php +++ b/src/Objects/DeviceActiveClimateSettingSchedule.php @@ -11,44 +11,44 @@ public static function from_json(mixed $json): DeviceActiveClimateSettingSchedul return null; } return new self( + automatic_cooling_enabled: $json->automatic_cooling_enabled ?? null, + automatic_heating_enabled: $json->automatic_heating_enabled ?? null, climate_setting_schedule_id: $json->climate_setting_schedule_id, - schedule_type: $json->schedule_type, - device_id: $json->device_id, - name: $json->name ?? null, - schedule_starts_at: $json->schedule_starts_at, - schedule_ends_at: $json->schedule_ends_at, + cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, + cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, created_at: $json->created_at, + device_id: $json->device_id, errors: $json->errors ?? null, - automatic_heating_enabled: $json->automatic_heating_enabled ?? null, - automatic_cooling_enabled: $json->automatic_cooling_enabled ?? null, - hvac_mode_setting: $json->hvac_mode_setting ?? null, - cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, heating_set_point_celsius: $json->heating_set_point_celsius ?? null, - cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, + hvac_mode_setting: $json->hvac_mode_setting ?? null, manual_override_allowed: $json->manual_override_allowed ?? null, + name: $json->name ?? null, + schedule_ends_at: $json->schedule_ends_at, + schedule_starts_at: $json->schedule_starts_at, + schedule_type: $json->schedule_type, ); } public function __construct( + public bool | null $automatic_cooling_enabled, + public bool | null $automatic_heating_enabled, public string $climate_setting_schedule_id, - public string $schedule_type, - public string $device_id, - public string | null $name, - public string $schedule_starts_at, - public string $schedule_ends_at, + public int | null $cooling_set_point_celsius, + public int | null $cooling_set_point_fahrenheit, public string $created_at, + public string $device_id, public mixed $errors, - public bool | null $automatic_heating_enabled, - public bool | null $automatic_cooling_enabled, - public string | null $hvac_mode_setting, - public int | null $cooling_set_point_celsius, public int | null $heating_set_point_celsius, - public int | null $cooling_set_point_fahrenheit, public int | null $heating_set_point_fahrenheit, + public string | null $hvac_mode_setting, public bool | null $manual_override_allowed, + public string | null $name, + public string $schedule_ends_at, + public string $schedule_starts_at, + public string $schedule_type, ) { } diff --git a/src/Objects/DeviceAssaAbloyCredentialServiceMetadata.php b/src/Objects/DeviceAssaAbloyCredentialServiceMetadata.php index 3c8cfef..a1d033e 100644 --- a/src/Objects/DeviceAssaAbloyCredentialServiceMetadata.php +++ b/src/Objects/DeviceAssaAbloyCredentialServiceMetadata.php @@ -11,19 +11,19 @@ public static function from_json(mixed $json): DeviceAssaAbloyCredentialServiceM return null; } return new self( - has_active_endpoint: $json->has_active_endpoint, endpoints: array_map( fn ($e) => DeviceEndpoints::from_json($e), $json->endpoints ?? [] ), + has_active_endpoint: $json->has_active_endpoint, ); } public function __construct( - public bool $has_active_endpoint, public array $endpoints, + public bool $has_active_endpoint, ) { } diff --git a/src/Objects/DeviceAugustMetadata.php b/src/Objects/DeviceAugustMetadata.php index 0096bb2..9f438ab 100644 --- a/src/Objects/DeviceAugustMetadata.php +++ b/src/Objects/DeviceAugustMetadata.php @@ -11,26 +11,26 @@ public static function from_json(mixed $json): DeviceAugustMetadata|null return null; } return new self( - lock_id: $json->lock_id, - lock_name: $json->lock_name, - house_name: $json->house_name, has_keypad: $json->has_keypad, + house_id: $json->house_id ?? null, + house_name: $json->house_name, keypad_battery_level: $json->keypad_battery_level ?? null, + lock_id: $json->lock_id, + lock_name: $json->lock_name, model: $json->model ?? null, - house_id: $json->house_id ?? null, ); } public function __construct( - public string $lock_id, - public string $lock_name, - public string $house_name, public bool $has_keypad, + public string | null $house_id, + public string $house_name, public string | null $keypad_battery_level, + public string $lock_id, + public string $lock_name, public string | null $model, - public string | null $house_id, ) { } diff --git a/src/Objects/DeviceAvigilonAltaMetadata.php b/src/Objects/DeviceAvigilonAltaMetadata.php index 79db219..81fc434 100644 --- a/src/Objects/DeviceAvigilonAltaMetadata.php +++ b/src/Objects/DeviceAvigilonAltaMetadata.php @@ -13,10 +13,10 @@ public static function from_json(mixed $json): DeviceAvigilonAltaMetadata|null return new self( entry_name: $json->entry_name, org_name: $json->org_name, - zone_id: $json->zone_id, - zone_name: $json->zone_name, site_id: $json->site_id, site_name: $json->site_name, + zone_id: $json->zone_id, + zone_name: $json->zone_name, ); } @@ -25,10 +25,10 @@ public static function from_json(mixed $json): DeviceAvigilonAltaMetadata|null public function __construct( public string $entry_name, public string $org_name, - public int $zone_id, - public string $zone_name, public int $site_id, public string $site_name, + public int $zone_id, + public string $zone_name, ) { } diff --git a/src/Objects/DeviceCodeConstraints.php b/src/Objects/DeviceCodeConstraints.php index 737404f..ae2d3a4 100644 --- a/src/Objects/DeviceCodeConstraints.php +++ b/src/Objects/DeviceCodeConstraints.php @@ -12,8 +12,8 @@ public static function from_json(mixed $json): DeviceCodeConstraints|null } return new self( constraint_type: $json->constraint_type, - min_length: $json->min_length ?? null, max_length: $json->max_length ?? null, + min_length: $json->min_length ?? null, ); } @@ -21,8 +21,8 @@ public static function from_json(mixed $json): DeviceCodeConstraints|null public function __construct( public string $constraint_type, - public int | null $min_length, public int | null $max_length, + public int | null $min_length, ) { } diff --git a/src/Objects/DeviceCurrentClimateSetting.php b/src/Objects/DeviceCurrentClimateSetting.php index be6edea..db4ac99 100644 --- a/src/Objects/DeviceCurrentClimateSetting.php +++ b/src/Objects/DeviceCurrentClimateSetting.php @@ -11,13 +11,13 @@ public static function from_json(mixed $json): DeviceCurrentClimateSetting|null return null; } return new self( - automatic_heating_enabled: $json->automatic_heating_enabled, automatic_cooling_enabled: $json->automatic_cooling_enabled, - hvac_mode_setting: $json->hvac_mode_setting, + automatic_heating_enabled: $json->automatic_heating_enabled, cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, + heating_set_point_celsius: $json->heating_set_point_celsius ?? null, heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, + hvac_mode_setting: $json->hvac_mode_setting, manual_override_allowed: $json->manual_override_allowed, ); } @@ -25,13 +25,13 @@ public static function from_json(mixed $json): DeviceCurrentClimateSetting|null public function __construct( - public bool $automatic_heating_enabled, public bool $automatic_cooling_enabled, - public string $hvac_mode_setting, + public bool $automatic_heating_enabled, public int | null $cooling_set_point_celsius, - public int | null $heating_set_point_celsius, public int | null $cooling_set_point_fahrenheit, + public int | null $heating_set_point_celsius, public int | null $heating_set_point_fahrenheit, + public string $hvac_mode_setting, public bool $manual_override_allowed, ) { } diff --git a/src/Objects/DeviceDefaultClimateSetting.php b/src/Objects/DeviceDefaultClimateSetting.php index 35af97f..afb4040 100644 --- a/src/Objects/DeviceDefaultClimateSetting.php +++ b/src/Objects/DeviceDefaultClimateSetting.php @@ -11,13 +11,13 @@ public static function from_json(mixed $json): DeviceDefaultClimateSetting|null return null; } return new self( - automatic_heating_enabled: $json->automatic_heating_enabled, automatic_cooling_enabled: $json->automatic_cooling_enabled, - hvac_mode_setting: $json->hvac_mode_setting, + automatic_heating_enabled: $json->automatic_heating_enabled, cooling_set_point_celsius: $json->cooling_set_point_celsius ?? null, - heating_set_point_celsius: $json->heating_set_point_celsius ?? null, cooling_set_point_fahrenheit: $json->cooling_set_point_fahrenheit ?? null, + heating_set_point_celsius: $json->heating_set_point_celsius ?? null, heating_set_point_fahrenheit: $json->heating_set_point_fahrenheit ?? null, + hvac_mode_setting: $json->hvac_mode_setting, manual_override_allowed: $json->manual_override_allowed, ); } @@ -25,13 +25,13 @@ public static function from_json(mixed $json): DeviceDefaultClimateSetting|null public function __construct( - public bool $automatic_heating_enabled, public bool $automatic_cooling_enabled, - public string $hvac_mode_setting, + public bool $automatic_heating_enabled, public int | null $cooling_set_point_celsius, - public int | null $heating_set_point_celsius, public int | null $cooling_set_point_fahrenheit, + public int | null $heating_set_point_celsius, public int | null $heating_set_point_fahrenheit, + public string $hvac_mode_setting, public bool $manual_override_allowed, ) { } diff --git a/src/Objects/DeviceDormakabaOracodeMetadata.php b/src/Objects/DeviceDormakabaOracodeMetadata.php index e27dd21..ae08f2e 100644 --- a/src/Objects/DeviceDormakabaOracodeMetadata.php +++ b/src/Objects/DeviceDormakabaOracodeMetadata.php @@ -11,29 +11,31 @@ public static function from_json(mixed $json): DeviceDormakabaOracodeMetadata|nu return null; } return new self( + device_id: $json->device_id ?? null, door_id: $json->door_id, + door_is_wireless: $json->door_is_wireless, door_name: $json->door_name, - device_id: $json->device_id ?? null, - site_id: $json->site_id, - site_name: $json->site_name, iana_timezone: $json->iana_timezone ?? null, predefined_time_slots: array_map( fn ($p) => DevicePredefinedTimeSlots::from_json($p), $json->predefined_time_slots ?? [] ), + site_id: $json->site_id, + site_name: $json->site_name, ); } public function __construct( + public int | null $device_id, public int $door_id, + public bool $door_is_wireless, public string $door_name, - public int | null $device_id, - public int $site_id, - public string $site_name, public string | null $iana_timezone, public array | null $predefined_time_slots, + public int $site_id, + public string $site_name, ) { } diff --git a/src/Objects/DeviceEcobeeMetadata.php b/src/Objects/DeviceEcobeeMetadata.php index 70a64d9..5582b1c 100644 --- a/src/Objects/DeviceEcobeeMetadata.php +++ b/src/Objects/DeviceEcobeeMetadata.php @@ -11,16 +11,16 @@ public static function from_json(mixed $json): DeviceEcobeeMetadata|null return null; } return new self( - ecobee_device_id: $json->ecobee_device_id, device_name: $json->device_name, + ecobee_device_id: $json->ecobee_device_id, ); } public function __construct( - public string $ecobee_device_id, public string $device_name, + public string $ecobee_device_id, ) { } diff --git a/src/Objects/DeviceHoneywellResideoMetadata.php b/src/Objects/DeviceHoneywellResideoMetadata.php index e5963f8..4a9bca9 100644 --- a/src/Objects/DeviceHoneywellResideoMetadata.php +++ b/src/Objects/DeviceHoneywellResideoMetadata.php @@ -11,16 +11,16 @@ public static function from_json(mixed $json): DeviceHoneywellResideoMetadata|nu return null; } return new self( - honeywell_resideo_device_id: $json->honeywell_resideo_device_id, device_name: $json->device_name, + honeywell_resideo_device_id: $json->honeywell_resideo_device_id, ); } public function __construct( - public string $honeywell_resideo_device_id, public string $device_name, + public string $honeywell_resideo_device_id, ) { } diff --git a/src/Objects/DeviceHubitatMetadata.php b/src/Objects/DeviceHubitatMetadata.php index ca71788..3b1e500 100644 --- a/src/Objects/DeviceHubitatMetadata.php +++ b/src/Objects/DeviceHubitatMetadata.php @@ -12,8 +12,8 @@ public static function from_json(mixed $json): DeviceHubitatMetadata|null } return new self( device_id: $json->device_id, - device_name: $json->device_name, device_label: $json->device_label, + device_name: $json->device_name, ); } @@ -21,8 +21,8 @@ public static function from_json(mixed $json): DeviceHubitatMetadata|null public function __construct( public string $device_id, - public string $device_name, public string $device_label, + public string $device_name, ) { } diff --git a/src/Objects/DeviceIglooMetadata.php b/src/Objects/DeviceIglooMetadata.php index b9ac728..f87f21d 100644 --- a/src/Objects/DeviceIglooMetadata.php +++ b/src/Objects/DeviceIglooMetadata.php @@ -11,8 +11,8 @@ public static function from_json(mixed $json): DeviceIglooMetadata|null return null; } return new self( - device_id: $json->device_id, bridge_id: $json->bridge_id, + device_id: $json->device_id, model: $json->model ?? null, ); } @@ -20,8 +20,8 @@ public static function from_json(mixed $json): DeviceIglooMetadata|null public function __construct( - public string $device_id, public string $bridge_id, + public string $device_id, public string | null $model, ) { } diff --git a/src/Objects/DeviceIgloohomeMetadata.php b/src/Objects/DeviceIgloohomeMetadata.php index 5799310..653ac3f 100644 --- a/src/Objects/DeviceIgloohomeMetadata.php +++ b/src/Objects/DeviceIgloohomeMetadata.php @@ -11,10 +11,10 @@ public static function from_json(mixed $json): DeviceIgloohomeMetadata|null return null; } return new self( - device_id: $json->device_id, - device_name: $json->device_name, bridge_id: $json->bridge_id ?? null, bridge_name: $json->bridge_name ?? null, + device_id: $json->device_id, + device_name: $json->device_name, keypad_id: $json->keypad_id ?? null, ); } @@ -22,10 +22,10 @@ public static function from_json(mixed $json): DeviceIgloohomeMetadata|null public function __construct( - public string $device_id, - public string $device_name, public string | null $bridge_id, public string | null $bridge_name, + public string $device_id, + public string $device_name, public string | null $keypad_id, ) { } diff --git a/src/Objects/DeviceLatestSensorValues.php b/src/Objects/DeviceLatestSensorValues.php index 3330a5a..c189843 100644 --- a/src/Objects/DeviceLatestSensorValues.php +++ b/src/Objects/DeviceLatestSensorValues.php @@ -11,22 +11,22 @@ public static function from_json(mixed $json): DeviceLatestSensorValues|null return null; } return new self( - temperature: DeviceTemperature::from_json($json->temperature), - sound: DeviceSound::from_json($json->sound), + accelerometer_z: DeviceAccelerometerZ::from_json($json->accelerometer_z), humidity: DeviceHumidity::from_json($json->humidity), pressure: DevicePressure::from_json($json->pressure), - accelerometer_z: DeviceAccelerometerZ::from_json($json->accelerometer_z), + sound: DeviceSound::from_json($json->sound), + temperature: DeviceTemperature::from_json($json->temperature), ); } public function __construct( - public DeviceTemperature $temperature, - public DeviceSound $sound, + public DeviceAccelerometerZ $accelerometer_z, public DeviceHumidity $humidity, public DevicePressure $pressure, - public DeviceAccelerometerZ $accelerometer_z, + public DeviceSound $sound, + public DeviceTemperature $temperature, ) { } diff --git a/src/Objects/DeviceModel.php b/src/Objects/DeviceModel.php index 36ce4d1..db79eaf 100644 --- a/src/Objects/DeviceModel.php +++ b/src/Objects/DeviceModel.php @@ -11,26 +11,26 @@ public static function from_json(mixed $json): DeviceModel|null return null; } return new self( + accessory_keypad_supported: $json->accessory_keypad_supported ?? null, can_connect_accessory_keypad: $json->can_connect_accessory_keypad ?? null, display_name: $json->display_name, - manufacturer_display_name: $json->manufacturer_display_name, has_built_in_keypad: $json->has_built_in_keypad ?? null, + manufacturer_display_name: $json->manufacturer_display_name, offline_access_codes_supported: $json->offline_access_codes_supported ?? null, online_access_codes_supported: $json->online_access_codes_supported ?? null, - accessory_keypad_supported: $json->accessory_keypad_supported ?? null, ); } public function __construct( + public bool | null $accessory_keypad_supported, public bool | null $can_connect_accessory_keypad, public string $display_name, - public string $manufacturer_display_name, public bool | null $has_built_in_keypad, + public string $manufacturer_display_name, public bool | null $offline_access_codes_supported, public bool | null $online_access_codes_supported, - public bool | null $accessory_keypad_supported, ) { } diff --git a/src/Objects/DeviceNestMetadata.php b/src/Objects/DeviceNestMetadata.php index 824984c..9b0ec57 100644 --- a/src/Objects/DeviceNestMetadata.php +++ b/src/Objects/DeviceNestMetadata.php @@ -11,18 +11,18 @@ public static function from_json(mixed $json): DeviceNestMetadata|null return null; } return new self( - nest_device_id: $json->nest_device_id, - device_name: $json->device_name, custom_name: $json->custom_name, + device_name: $json->device_name, + nest_device_id: $json->nest_device_id, ); } public function __construct( - public string $nest_device_id, - public string $device_name, public string $custom_name, + public string $device_name, + public string $nest_device_id, ) { } diff --git a/src/Objects/DeviceNoiseawareMetadata.php b/src/Objects/DeviceNoiseawareMetadata.php index 5e480a4..9408326 100644 --- a/src/Objects/DeviceNoiseawareMetadata.php +++ b/src/Objects/DeviceNoiseawareMetadata.php @@ -11,22 +11,22 @@ public static function from_json(mixed $json): DeviceNoiseawareMetadata|null return null; } return new self( + device_id: $json->device_id, device_model: $json->device_model, - noise_level_nrs: $json->noise_level_nrs, - noise_level_decibel: $json->noise_level_decibel, device_name: $json->device_name, - device_id: $json->device_id, + noise_level_decibel: $json->noise_level_decibel, + noise_level_nrs: $json->noise_level_nrs, ); } public function __construct( + public string $device_id, public string $device_model, - public int $noise_level_nrs, - public int $noise_level_decibel, public string $device_name, - public string $device_id, + public int $noise_level_decibel, + public int $noise_level_nrs, ) { } diff --git a/src/Objects/DeviceNukiMetadata.php b/src/Objects/DeviceNukiMetadata.php index 25a35ca..20c36d6 100644 --- a/src/Objects/DeviceNukiMetadata.php +++ b/src/Objects/DeviceNukiMetadata.php @@ -13,9 +13,9 @@ public static function from_json(mixed $json): DeviceNukiMetadata|null return new self( device_id: $json->device_id, device_name: $json->device_name, + keypad_2_paired: $json->keypad_2_paired ?? null, keypad_battery_critical: $json->keypad_battery_critical ?? null, keypad_paired: $json->keypad_paired ?? null, - keypad_2_paired: $json->keypad_2_paired ?? null, ); } @@ -24,9 +24,9 @@ public static function from_json(mixed $json): DeviceNukiMetadata|null public function __construct( public string $device_id, public string $device_name, + public bool | null $keypad_2_paired, public bool | null $keypad_battery_critical, public bool | null $keypad_paired, - public bool | null $keypad_2_paired, ) { } diff --git a/src/Objects/DevicePredefinedTimeSlots.php b/src/Objects/DevicePredefinedTimeSlots.php index 285673c..1ce4b36 100644 --- a/src/Objects/DevicePredefinedTimeSlots.php +++ b/src/Objects/DevicePredefinedTimeSlots.php @@ -11,32 +11,32 @@ public static function from_json(mixed $json): DevicePredefinedTimeSlots|null return null; } return new self( - name: $json->name, - prefix: $json->prefix, check_in_time: $json->check_in_time, check_out_time: $json->check_out_time, + dormakaba_oracode_user_level_id: $json->dormakaba_oracode_user_level_id, + ext_dormakaba_oracode_user_level_prefix: $json->ext_dormakaba_oracode_user_level_prefix, is_24_hour: $json->is_24_hour, is_biweekly_mode: $json->is_biweekly_mode, - is_one_shot: $json->is_one_shot, is_master: $json->is_master, - ext_dormakaba_oracode_user_level_prefix: $json->ext_dormakaba_oracode_user_level_prefix, - dormakaba_oracode_user_level_id: $json->dormakaba_oracode_user_level_id, + is_one_shot: $json->is_one_shot, + name: $json->name, + prefix: $json->prefix, ); } public function __construct( - public string $name, - public int $prefix, public string $check_in_time, public string $check_out_time, + public string $dormakaba_oracode_user_level_id, + public int $ext_dormakaba_oracode_user_level_prefix, public bool $is_24_hour, public bool $is_biweekly_mode, - public bool $is_one_shot, public bool $is_master, - public int $ext_dormakaba_oracode_user_level_prefix, - public string $dormakaba_oracode_user_level_id, + public bool $is_one_shot, + public string $name, + public int $prefix, ) { } diff --git a/src/Objects/DeviceProperties.php b/src/Objects/DeviceProperties.php index 9a5f488..1601d10 100644 --- a/src/Objects/DeviceProperties.php +++ b/src/Objects/DeviceProperties.php @@ -11,173 +11,173 @@ public static function from_json(mixed $json): DeviceProperties|null return null; } return new self( - online: $json->online, - name: $json->name, accessory_keypad: isset($json->accessory_keypad) ? DeviceAccessoryKeypad::from_json($json->accessory_keypad) : null, appearance: DeviceAppearance::from_json($json->appearance), - model: DeviceModel::from_json($json->model), - has_direct_power: $json->has_direct_power ?? null, - battery_level: $json->battery_level ?? null, battery: isset($json->battery) ? DeviceBattery::from_json($json->battery) : null, - manufacturer: $json->manufacturer ?? null, - image_url: $json->image_url ?? null, + battery_level: $json->battery_level ?? null, + has_direct_power: $json->has_direct_power ?? null, image_alt_text: $json->image_alt_text ?? null, - serial_number: $json->serial_number ?? null, - online_access_codes_enabled: $json->online_access_codes_enabled ?? null, + image_url: $json->image_url ?? null, + manufacturer: $json->manufacturer ?? null, + model: DeviceModel::from_json($json->model), + name: $json->name, offline_access_codes_enabled: $json->offline_access_codes_enabled ?? null, + online: $json->online, + online_access_codes_enabled: $json->online_access_codes_enabled ?? null, + serial_number: $json->serial_number ?? null, supports_accessory_keypad: $json->supports_accessory_keypad ?? null, supports_offline_access_codes: $json->supports_offline_access_codes ?? null, assa_abloy_credential_service_metadata: isset($json->assa_abloy_credential_service_metadata) ? DeviceAssaAbloyCredentialServiceMetadata::from_json($json->assa_abloy_credential_service_metadata) : null, august_metadata: isset($json->august_metadata) ? DeviceAugustMetadata::from_json($json->august_metadata) : null, avigilon_alta_metadata: isset($json->avigilon_alta_metadata) ? DeviceAvigilonAltaMetadata::from_json($json->avigilon_alta_metadata) : null, - schlage_metadata: isset($json->schlage_metadata) ? DeviceSchlageMetadata::from_json($json->schlage_metadata) : null, - smartthings_metadata: isset($json->smartthings_metadata) ? DeviceSmartthingsMetadata::from_json($json->smartthings_metadata) : null, - lockly_metadata: isset($json->lockly_metadata) ? DeviceLocklyMetadata::from_json($json->lockly_metadata) : null, - nuki_metadata: isset($json->nuki_metadata) ? DeviceNukiMetadata::from_json($json->nuki_metadata) : null, - kwikset_metadata: isset($json->kwikset_metadata) ? DeviceKwiksetMetadata::from_json($json->kwikset_metadata) : null, - salto_metadata: isset($json->salto_metadata) ? DeviceSaltoMetadata::from_json($json->salto_metadata) : null, - genie_metadata: isset($json->genie_metadata) ? DeviceGenieMetadata::from_json($json->genie_metadata) : null, brivo_metadata: isset($json->brivo_metadata) ? DeviceBrivoMetadata::from_json($json->brivo_metadata) : null, - igloo_metadata: isset($json->igloo_metadata) ? DeviceIglooMetadata::from_json($json->igloo_metadata) : null, - noiseaware_metadata: isset($json->noiseaware_metadata) ? DeviceNoiseawareMetadata::from_json($json->noiseaware_metadata) : null, - minut_metadata: isset($json->minut_metadata) ? DeviceMinutMetadata::from_json($json->minut_metadata) : null, - four_suites_metadata: isset($json->four_suites_metadata) ? DeviceFourSuitesMetadata::from_json($json->four_suites_metadata) : null, - two_n_metadata: isset($json->two_n_metadata) ? DeviceTwoNMetadata::from_json($json->two_n_metadata) : null, controlbyweb_metadata: isset($json->controlbyweb_metadata) ? DeviceControlbywebMetadata::from_json($json->controlbyweb_metadata) : null, - ttlock_metadata: isset($json->ttlock_metadata) ? DeviceTtlockMetadata::from_json($json->ttlock_metadata) : null, - seam_bridge_metadata: isset($json->seam_bridge_metadata) ? DeviceSeamBridgeMetadata::from_json($json->seam_bridge_metadata) : null, - igloohome_metadata: isset($json->igloohome_metadata) ? DeviceIgloohomeMetadata::from_json($json->igloohome_metadata) : null, - nest_metadata: isset($json->nest_metadata) ? DeviceNestMetadata::from_json($json->nest_metadata) : null, + dormakaba_oracode_metadata: isset($json->dormakaba_oracode_metadata) ? DeviceDormakabaOracodeMetadata::from_json($json->dormakaba_oracode_metadata) : null, ecobee_metadata: isset($json->ecobee_metadata) ? DeviceEcobeeMetadata::from_json($json->ecobee_metadata) : null, + four_suites_metadata: isset($json->four_suites_metadata) ? DeviceFourSuitesMetadata::from_json($json->four_suites_metadata) : null, + genie_metadata: isset($json->genie_metadata) ? DeviceGenieMetadata::from_json($json->genie_metadata) : null, honeywell_resideo_metadata: isset($json->honeywell_resideo_metadata) ? DeviceHoneywellResideoMetadata::from_json($json->honeywell_resideo_metadata) : null, hubitat_metadata: isset($json->hubitat_metadata) ? DeviceHubitatMetadata::from_json($json->hubitat_metadata) : null, - dormakaba_oracode_metadata: isset($json->dormakaba_oracode_metadata) ? DeviceDormakabaOracodeMetadata::from_json($json->dormakaba_oracode_metadata) : null, - wyze_metadata: isset($json->wyze_metadata) ? DeviceWyzeMetadata::from_json($json->wyze_metadata) : null, + igloo_metadata: isset($json->igloo_metadata) ? DeviceIglooMetadata::from_json($json->igloo_metadata) : null, + igloohome_metadata: isset($json->igloohome_metadata) ? DeviceIgloohomeMetadata::from_json($json->igloohome_metadata) : null, + kwikset_metadata: isset($json->kwikset_metadata) ? DeviceKwiksetMetadata::from_json($json->kwikset_metadata) : null, + lockly_metadata: isset($json->lockly_metadata) ? DeviceLocklyMetadata::from_json($json->lockly_metadata) : null, + minut_metadata: isset($json->minut_metadata) ? DeviceMinutMetadata::from_json($json->minut_metadata) : null, + nest_metadata: isset($json->nest_metadata) ? DeviceNestMetadata::from_json($json->nest_metadata) : null, + noiseaware_metadata: isset($json->noiseaware_metadata) ? DeviceNoiseawareMetadata::from_json($json->noiseaware_metadata) : null, + nuki_metadata: isset($json->nuki_metadata) ? DeviceNukiMetadata::from_json($json->nuki_metadata) : null, + salto_metadata: isset($json->salto_metadata) ? DeviceSaltoMetadata::from_json($json->salto_metadata) : null, + schlage_metadata: isset($json->schlage_metadata) ? DeviceSchlageMetadata::from_json($json->schlage_metadata) : null, + seam_bridge_metadata: isset($json->seam_bridge_metadata) ? DeviceSeamBridgeMetadata::from_json($json->seam_bridge_metadata) : null, + smartthings_metadata: isset($json->smartthings_metadata) ? DeviceSmartthingsMetadata::from_json($json->smartthings_metadata) : null, tedee_metadata: isset($json->tedee_metadata) ? DeviceTedeeMetadata::from_json($json->tedee_metadata) : null, + ttlock_metadata: isset($json->ttlock_metadata) ? DeviceTtlockMetadata::from_json($json->ttlock_metadata) : null, + two_n_metadata: isset($json->two_n_metadata) ? DeviceTwoNMetadata::from_json($json->two_n_metadata) : null, + wyze_metadata: isset($json->wyze_metadata) ? DeviceWyzeMetadata::from_json($json->wyze_metadata) : null, _experimental_supported_code_from_access_codes_lengths: $json->_experimental_supported_code_from_access_codes_lengths ?? null, code_constraints: array_map( fn ($c) => DeviceCodeConstraints::from_json($c), $json->code_constraints ?? [] ), - supported_code_lengths: $json->supported_code_lengths ?? null, - max_active_codes_supported: $json->max_active_codes_supported ?? null, - supports_backup_access_code_pool: $json->supports_backup_access_code_pool ?? null, + door_open: $json->door_open ?? null, has_native_entry_events: $json->has_native_entry_events ?? null, - locked: $json->locked ?? null, keypad_battery: isset($json->keypad_battery) ? DeviceKeypadBattery::from_json($json->keypad_battery) : null, - door_open: $json->door_open ?? null, - temperature_fahrenheit: $json->temperature_fahrenheit ?? null, - temperature_celsius: $json->temperature_celsius ?? null, - relative_humidity: $json->relative_humidity ?? null, - can_enable_automatic_heating: $json->can_enable_automatic_heating ?? null, - can_enable_automatic_cooling: $json->can_enable_automatic_cooling ?? null, + locked: $json->locked ?? null, + max_active_codes_supported: $json->max_active_codes_supported ?? null, + supported_code_lengths: $json->supported_code_lengths ?? null, + supports_backup_access_code_pool: $json->supports_backup_access_code_pool ?? null, + active_climate_setting_schedule: isset($json->active_climate_setting_schedule) ? DeviceActiveClimateSettingSchedule::from_json($json->active_climate_setting_schedule) : null, available_hvac_mode_settings: $json->available_hvac_mode_settings ?? null, - is_heating_available: $json->is_heating_available ?? null, - is_cooling_available: $json->is_cooling_available ?? null, - is_heating: $json->is_heating ?? null, - is_cooling: $json->is_cooling ?? null, - is_fan_running: $json->is_fan_running ?? null, - fan_mode_setting: $json->fan_mode_setting ?? null, - is_temporary_manual_override_active: $json->is_temporary_manual_override_active ?? null, + can_enable_automatic_cooling: $json->can_enable_automatic_cooling ?? null, + can_enable_automatic_heating: $json->can_enable_automatic_heating ?? null, current_climate_setting: isset($json->current_climate_setting) ? DeviceCurrentClimateSetting::from_json($json->current_climate_setting) : null, default_climate_setting: isset($json->default_climate_setting) ? DeviceDefaultClimateSetting::from_json($json->default_climate_setting) : null, + fan_mode_setting: $json->fan_mode_setting ?? null, is_climate_setting_schedule_active: $json->is_climate_setting_schedule_active ?? null, - active_climate_setting_schedule: isset($json->active_climate_setting_schedule) ? DeviceActiveClimateSettingSchedule::from_json($json->active_climate_setting_schedule) : null, - min_cooling_set_point_celsius: $json->min_cooling_set_point_celsius ?? null, - min_cooling_set_point_fahrenheit: $json->min_cooling_set_point_fahrenheit ?? null, + is_cooling: $json->is_cooling ?? null, + is_cooling_available: $json->is_cooling_available ?? null, + is_fan_running: $json->is_fan_running ?? null, + is_heating: $json->is_heating ?? null, + is_heating_available: $json->is_heating_available ?? null, + is_temporary_manual_override_active: $json->is_temporary_manual_override_active ?? null, max_cooling_set_point_celsius: $json->max_cooling_set_point_celsius ?? null, max_cooling_set_point_fahrenheit: $json->max_cooling_set_point_fahrenheit ?? null, - min_heating_set_point_celsius: $json->min_heating_set_point_celsius ?? null, - min_heating_set_point_fahrenheit: $json->min_heating_set_point_fahrenheit ?? null, max_heating_set_point_celsius: $json->max_heating_set_point_celsius ?? null, max_heating_set_point_fahrenheit: $json->max_heating_set_point_fahrenheit ?? null, + min_cooling_set_point_celsius: $json->min_cooling_set_point_celsius ?? null, + min_cooling_set_point_fahrenheit: $json->min_cooling_set_point_fahrenheit ?? null, min_heating_cooling_delta_celsius: $json->min_heating_cooling_delta_celsius ?? null, min_heating_cooling_delta_fahrenheit: $json->min_heating_cooling_delta_fahrenheit ?? null, + min_heating_set_point_celsius: $json->min_heating_set_point_celsius ?? null, + min_heating_set_point_fahrenheit: $json->min_heating_set_point_fahrenheit ?? null, + relative_humidity: $json->relative_humidity ?? null, + temperature_celsius: $json->temperature_celsius ?? null, + temperature_fahrenheit: $json->temperature_fahrenheit ?? null, ); } public function __construct( - public bool $online, - public string $name, public DeviceAccessoryKeypad | null $accessory_keypad, public DeviceAppearance $appearance, - public DeviceModel $model, - public bool | null $has_direct_power, - public int | null $battery_level, public DeviceBattery | null $battery, - public string | null $manufacturer, - public string | null $image_url, + public int | null $battery_level, + public bool | null $has_direct_power, public string | null $image_alt_text, - public string | null $serial_number, - public bool | null $online_access_codes_enabled, + public string | null $image_url, + public string | null $manufacturer, + public DeviceModel $model, + public string $name, public bool | null $offline_access_codes_enabled, + public bool $online, + public bool | null $online_access_codes_enabled, + public string | null $serial_number, public bool | null $supports_accessory_keypad, public bool | null $supports_offline_access_codes, public DeviceAssaAbloyCredentialServiceMetadata | null $assa_abloy_credential_service_metadata, public DeviceAugustMetadata | null $august_metadata, public DeviceAvigilonAltaMetadata | null $avigilon_alta_metadata, - public DeviceSchlageMetadata | null $schlage_metadata, - public DeviceSmartthingsMetadata | null $smartthings_metadata, - public DeviceLocklyMetadata | null $lockly_metadata, - public DeviceNukiMetadata | null $nuki_metadata, - public DeviceKwiksetMetadata | null $kwikset_metadata, - public DeviceSaltoMetadata | null $salto_metadata, - public DeviceGenieMetadata | null $genie_metadata, public DeviceBrivoMetadata | null $brivo_metadata, - public DeviceIglooMetadata | null $igloo_metadata, - public DeviceNoiseawareMetadata | null $noiseaware_metadata, - public DeviceMinutMetadata | null $minut_metadata, - public DeviceFourSuitesMetadata | null $four_suites_metadata, - public DeviceTwoNMetadata | null $two_n_metadata, public DeviceControlbywebMetadata | null $controlbyweb_metadata, - public DeviceTtlockMetadata | null $ttlock_metadata, - public DeviceSeamBridgeMetadata | null $seam_bridge_metadata, - public DeviceIgloohomeMetadata | null $igloohome_metadata, - public DeviceNestMetadata | null $nest_metadata, + public DeviceDormakabaOracodeMetadata | null $dormakaba_oracode_metadata, public DeviceEcobeeMetadata | null $ecobee_metadata, + public DeviceFourSuitesMetadata | null $four_suites_metadata, + public DeviceGenieMetadata | null $genie_metadata, public DeviceHoneywellResideoMetadata | null $honeywell_resideo_metadata, public DeviceHubitatMetadata | null $hubitat_metadata, - public DeviceDormakabaOracodeMetadata | null $dormakaba_oracode_metadata, - public DeviceWyzeMetadata | null $wyze_metadata, + public DeviceIglooMetadata | null $igloo_metadata, + public DeviceIgloohomeMetadata | null $igloohome_metadata, + public DeviceKwiksetMetadata | null $kwikset_metadata, + public DeviceLocklyMetadata | null $lockly_metadata, + public DeviceMinutMetadata | null $minut_metadata, + public DeviceNestMetadata | null $nest_metadata, + public DeviceNoiseawareMetadata | null $noiseaware_metadata, + public DeviceNukiMetadata | null $nuki_metadata, + public DeviceSaltoMetadata | null $salto_metadata, + public DeviceSchlageMetadata | null $schlage_metadata, + public DeviceSeamBridgeMetadata | null $seam_bridge_metadata, + public DeviceSmartthingsMetadata | null $smartthings_metadata, public DeviceTedeeMetadata | null $tedee_metadata, + public DeviceTtlockMetadata | null $ttlock_metadata, + public DeviceTwoNMetadata | null $two_n_metadata, + public DeviceWyzeMetadata | null $wyze_metadata, public array | null $_experimental_supported_code_from_access_codes_lengths, public array | null $code_constraints, - public array | null $supported_code_lengths, - public int | null $max_active_codes_supported, - public bool | null $supports_backup_access_code_pool, + public bool | null $door_open, public bool | null $has_native_entry_events, - public bool | null $locked, public DeviceKeypadBattery | null $keypad_battery, - public bool | null $door_open, - public int | null $temperature_fahrenheit, - public int | null $temperature_celsius, - public int | null $relative_humidity, - public bool | null $can_enable_automatic_heating, - public bool | null $can_enable_automatic_cooling, + public bool | null $locked, + public int | null $max_active_codes_supported, + public array | null $supported_code_lengths, + public bool | null $supports_backup_access_code_pool, + public DeviceActiveClimateSettingSchedule | null $active_climate_setting_schedule, public array | null $available_hvac_mode_settings, - public bool | null $is_heating_available, - public bool | null $is_cooling_available, - public bool | null $is_heating, - public bool | null $is_cooling, - public bool | null $is_fan_running, - public string | null $fan_mode_setting, - public bool | null $is_temporary_manual_override_active, + public bool | null $can_enable_automatic_cooling, + public bool | null $can_enable_automatic_heating, public DeviceCurrentClimateSetting | null $current_climate_setting, public DeviceDefaultClimateSetting | null $default_climate_setting, + public string | null $fan_mode_setting, public bool | null $is_climate_setting_schedule_active, - public DeviceActiveClimateSettingSchedule | null $active_climate_setting_schedule, - public int | null $min_cooling_set_point_celsius, - public int | null $min_cooling_set_point_fahrenheit, + public bool | null $is_cooling, + public bool | null $is_cooling_available, + public bool | null $is_fan_running, + public bool | null $is_heating, + public bool | null $is_heating_available, + public bool | null $is_temporary_manual_override_active, public int | null $max_cooling_set_point_celsius, public int | null $max_cooling_set_point_fahrenheit, - public int | null $min_heating_set_point_celsius, - public int | null $min_heating_set_point_fahrenheit, public int | null $max_heating_set_point_celsius, public int | null $max_heating_set_point_fahrenheit, + public int | null $min_cooling_set_point_celsius, + public int | null $min_cooling_set_point_fahrenheit, public int | null $min_heating_cooling_delta_celsius, public int | null $min_heating_cooling_delta_fahrenheit, + public int | null $min_heating_set_point_celsius, + public int | null $min_heating_set_point_fahrenheit, + public int | null $relative_humidity, + public int | null $temperature_celsius, + public int | null $temperature_fahrenheit, ) { } diff --git a/src/Objects/DeviceSaltoMetadata.php b/src/Objects/DeviceSaltoMetadata.php index 380052c..91694f1 100644 --- a/src/Objects/DeviceSaltoMetadata.php +++ b/src/Objects/DeviceSaltoMetadata.php @@ -11,10 +11,10 @@ public static function from_json(mixed $json): DeviceSaltoMetadata|null return null; } return new self( - lock_id: $json->lock_id, + battery_level: $json->battery_level, customer_reference: $json->customer_reference, + lock_id: $json->lock_id, lock_type: $json->lock_type, - battery_level: $json->battery_level, locked_state: $json->locked_state, model: $json->model ?? null, ); @@ -23,10 +23,10 @@ public static function from_json(mixed $json): DeviceSaltoMetadata|null public function __construct( - public string $lock_id, + public string $battery_level, public string $customer_reference, + public string $lock_id, public string $lock_type, - public string $battery_level, public string $locked_state, public string | null $model, ) { diff --git a/src/Objects/DeviceSchlageMetadata.php b/src/Objects/DeviceSchlageMetadata.php index 54ec590..f33c820 100644 --- a/src/Objects/DeviceSchlageMetadata.php +++ b/src/Objects/DeviceSchlageMetadata.php @@ -11,9 +11,9 @@ public static function from_json(mixed $json): DeviceSchlageMetadata|null return null; } return new self( + access_code_length: $json->access_code_length ?? null, device_id: $json->device_id, device_name: $json->device_name, - access_code_length: $json->access_code_length ?? null, model: $json->model ?? null, ); } @@ -21,9 +21,9 @@ public static function from_json(mixed $json): DeviceSchlageMetadata|null public function __construct( + public int | null $access_code_length, public string $device_id, public string $device_name, - public int | null $access_code_length, public string | null $model, ) { } diff --git a/src/Objects/DeviceSeamBridgeMetadata.php b/src/Objects/DeviceSeamBridgeMetadata.php index 3fa8ff4..bf3daac 100644 --- a/src/Objects/DeviceSeamBridgeMetadata.php +++ b/src/Objects/DeviceSeamBridgeMetadata.php @@ -11,18 +11,18 @@ public static function from_json(mixed $json): DeviceSeamBridgeMetadata|null return null; } return new self( - unlock_method: $json->unlock_method ?? null, device_num: $json->device_num, name: $json->name, + unlock_method: $json->unlock_method ?? null, ); } public function __construct( - public string | null $unlock_method, public int $device_num, public string $name, + public string | null $unlock_method, ) { } diff --git a/src/Objects/DeviceSmartthingsMetadata.php b/src/Objects/DeviceSmartthingsMetadata.php index c4191fb..f4626ca 100644 --- a/src/Objects/DeviceSmartthingsMetadata.php +++ b/src/Objects/DeviceSmartthingsMetadata.php @@ -13,8 +13,8 @@ public static function from_json(mixed $json): DeviceSmartthingsMetadata|null return new self( device_id: $json->device_id, device_name: $json->device_name, - model: $json->model ?? null, location_id: $json->location_id ?? null, + model: $json->model ?? null, ); } @@ -23,8 +23,8 @@ public static function from_json(mixed $json): DeviceSmartthingsMetadata|null public function __construct( public string $device_id, public string $device_name, - public string | null $model, public string | null $location_id, + public string | null $model, ) { } diff --git a/src/Objects/DeviceTedeeMetadata.php b/src/Objects/DeviceTedeeMetadata.php index f1ab63f..a6337b8 100644 --- a/src/Objects/DeviceTedeeMetadata.php +++ b/src/Objects/DeviceTedeeMetadata.php @@ -11,26 +11,26 @@ public static function from_json(mixed $json): DeviceTedeeMetadata|null return null; } return new self( - device_id: $json->device_id, - serial_number: $json->serial_number, - device_name: $json->device_name, - device_model: $json->device_model, bridge_id: $json->bridge_id, bridge_name: $json->bridge_name, + device_id: $json->device_id, + device_model: $json->device_model, + device_name: $json->device_name, keypad_id: $json->keypad_id ?? null, + serial_number: $json->serial_number, ); } public function __construct( - public int $device_id, - public string $serial_number, - public string $device_name, - public string $device_model, public int $bridge_id, public string $bridge_name, + public int $device_id, + public string $device_model, + public string $device_name, public int | null $keypad_id, + public string $serial_number, ) { } diff --git a/src/Objects/DeviceTtlockMetadata.php b/src/Objects/DeviceTtlockMetadata.php index 4fa95f8..24179ea 100644 --- a/src/Objects/DeviceTtlockMetadata.php +++ b/src/Objects/DeviceTtlockMetadata.php @@ -11,16 +11,16 @@ public static function from_json(mixed $json): DeviceTtlockMetadata|null return null; } return new self( - lock_id: $json->lock_id, lock_alias: $json->lock_alias, + lock_id: $json->lock_id, ); } public function __construct( - public int $lock_id, public string $lock_alias, + public int $lock_id, ) { } diff --git a/src/Objects/DeviceWarnings.php b/src/Objects/DeviceWarnings.php index a39c076..f8cea1d 100644 --- a/src/Objects/DeviceWarnings.php +++ b/src/Objects/DeviceWarnings.php @@ -11,8 +11,8 @@ public static function from_json(mixed $json): DeviceWarnings|null return null; } return new self( - warning_code: $json->warning_code, message: $json->message, + warning_code: $json->warning_code, created_at: $json->created_at ?? null, ); } @@ -20,8 +20,8 @@ public static function from_json(mixed $json): DeviceWarnings|null public function __construct( - public string $warning_code, public string $message, + public string $warning_code, public string | null $created_at, ) { } diff --git a/src/Objects/DeviceWyzeMetadata.php b/src/Objects/DeviceWyzeMetadata.php index b78084e..8236298 100644 --- a/src/Objects/DeviceWyzeMetadata.php +++ b/src/Objects/DeviceWyzeMetadata.php @@ -12,13 +12,13 @@ public static function from_json(mixed $json): DeviceWyzeMetadata|null } return new self( device_id: $json->device_id, - device_name: $json->device_name, - product_name: $json->product_name, - product_type: $json->product_type, - product_model: $json->product_model, device_info_model: $json->device_info_model, + device_name: $json->device_name, keypad_uuid: $json->keypad_uuid ?? null, locker_status_hardlock: $json->locker_status_hardlock ?? null, + product_model: $json->product_model, + product_name: $json->product_name, + product_type: $json->product_type, ); } @@ -26,13 +26,13 @@ public static function from_json(mixed $json): DeviceWyzeMetadata|null public function __construct( public string $device_id, - public string $device_name, - public string $product_name, - public string $product_type, - public string $product_model, public string $device_info_model, + public string $device_name, public string | null $keypad_uuid, public int | null $locker_status_hardlock, + public string $product_model, + public string $product_name, + public string $product_type, ) { } diff --git a/src/Objects/EnrollmentAutomation.php b/src/Objects/EnrollmentAutomation.php index 87a72d5..4467d41 100644 --- a/src/Objects/EnrollmentAutomation.php +++ b/src/Objects/EnrollmentAutomation.php @@ -11,22 +11,22 @@ public static function from_json(mixed $json): EnrollmentAutomation|null return null; } return new self( + created_at: $json->created_at, credential_manager_acs_system_id: $json->credential_manager_acs_system_id, + enrollment_automation_id: $json->enrollment_automation_id, user_identity_id: $json->user_identity_id, - created_at: $json->created_at, workspace_id: $json->workspace_id, - enrollment_automation_id: $json->enrollment_automation_id, ); } public function __construct( + public string $created_at, public string $credential_manager_acs_system_id, + public string $enrollment_automation_id, public string $user_identity_id, - public string $created_at, public string $workspace_id, - public string $enrollment_automation_id, ) { } diff --git a/src/Objects/Event.php b/src/Objects/Event.php index abfc808..06697d4 100644 --- a/src/Objects/Event.php +++ b/src/Objects/Event.php @@ -11,24 +11,24 @@ public static function from_json(mixed $json): Event|null return null; } return new self( - event_id: $json->event_id, + created_at: $json->created_at, device_id: $json->device_id ?? null, + event_id: $json->event_id, event_type: $json->event_type, - workspace_id: $json->workspace_id, - created_at: $json->created_at, occurred_at: $json->occurred_at, + workspace_id: $json->workspace_id, ); } public function __construct( - public string $event_id, + public string $created_at, public string | null $device_id, + public string $event_id, public string $event_type, - public string $workspace_id, - public string $created_at, public string $occurred_at, + public string $workspace_id, ) { } diff --git a/src/Objects/Network.php b/src/Objects/Network.php index d144fcf..463ad82 100644 --- a/src/Objects/Network.php +++ b/src/Objects/Network.php @@ -11,20 +11,20 @@ public static function from_json(mixed $json): Network|null return null; } return new self( + created_at: $json->created_at, + display_name: $json->display_name, network_id: $json->network_id, workspace_id: $json->workspace_id, - display_name: $json->display_name, - created_at: $json->created_at, ); } public function __construct( + public string $created_at, + public string $display_name, public string $network_id, public string $workspace_id, - public string $display_name, - public string $created_at, ) { } diff --git a/src/Objects/NoiseThreshold.php b/src/Objects/NoiseThreshold.php index 5447cbf..38fd62a 100644 --- a/src/Objects/NoiseThreshold.php +++ b/src/Objects/NoiseThreshold.php @@ -11,26 +11,26 @@ public static function from_json(mixed $json): NoiseThreshold|null return null; } return new self( - noise_threshold_id: $json->noise_threshold_id, device_id: $json->device_id, + ends_daily_at: $json->ends_daily_at, name: $json->name, + noise_threshold_decibels: $json->noise_threshold_decibels, + noise_threshold_id: $json->noise_threshold_id, noise_threshold_nrs: $json->noise_threshold_nrs ?? null, starts_daily_at: $json->starts_daily_at, - ends_daily_at: $json->ends_daily_at, - noise_threshold_decibels: $json->noise_threshold_decibels, ); } public function __construct( - public string $noise_threshold_id, public string $device_id, + public string $ends_daily_at, public string $name, + public int $noise_threshold_decibels, + public string $noise_threshold_id, public int | null $noise_threshold_nrs, public string $starts_daily_at, - public string $ends_daily_at, - public int $noise_threshold_decibels, ) { } diff --git a/src/Objects/Phone.php b/src/Objects/Phone.php index a07d9d4..8609361 100644 --- a/src/Objects/Phone.php +++ b/src/Objects/Phone.php @@ -11,52 +11,54 @@ public static function from_json(mixed $json): Phone|null return null; } return new self( + can_program_offline_access_codes: $json->can_program_offline_access_codes ?? null, + can_program_online_access_codes: $json->can_program_online_access_codes ?? null, + can_remotely_lock: $json->can_remotely_lock ?? null, + can_remotely_unlock: $json->can_remotely_unlock ?? null, + can_simulate_removal: $json->can_simulate_removal ?? null, + capabilities_supported: $json->capabilities_supported, + created_at: $json->created_at, + custom_metadata: $json->custom_metadata, device_id: $json->device_id, device_type: $json->device_type, - nickname: $json->nickname ?? null, display_name: $json->display_name, - capabilities_supported: $json->capabilities_supported, - properties: PhoneProperties::from_json($json->properties), - location: isset($json->location) ? PhoneLocation::from_json($json->location) : null, - workspace_id: $json->workspace_id, errors: array_map( fn ($e) => PhoneErrors::from_json($e), $json->errors ?? [] ), + is_managed: $json->is_managed, + location: isset($json->location) ? PhoneLocation::from_json($json->location) : null, + nickname: $json->nickname ?? null, + properties: PhoneProperties::from_json($json->properties), warnings: array_map( fn ($w) => PhoneWarnings::from_json($w), $json->warnings ?? [] ), - created_at: $json->created_at, - is_managed: $json->is_managed, - custom_metadata: $json->custom_metadata, - can_remotely_unlock: $json->can_remotely_unlock ?? null, - can_remotely_lock: $json->can_remotely_lock ?? null, - can_program_online_access_codes: $json->can_program_online_access_codes ?? null, - can_simulate_removal: $json->can_simulate_removal ?? null, + workspace_id: $json->workspace_id, ); } public function __construct( + public bool | null $can_program_offline_access_codes, + public bool | null $can_program_online_access_codes, + public bool | null $can_remotely_lock, + public bool | null $can_remotely_unlock, + public bool | null $can_simulate_removal, + public array $capabilities_supported, + public string $created_at, + public mixed $custom_metadata, public string $device_id, public string $device_type, - public string | null $nickname, public string $display_name, - public array $capabilities_supported, - public PhoneProperties $properties, - public PhoneLocation | null $location, - public string $workspace_id, public array $errors, - public array $warnings, - public string $created_at, public bool $is_managed, - public mixed $custom_metadata, - public bool | null $can_remotely_unlock, - public bool | null $can_remotely_lock, - public bool | null $can_program_online_access_codes, - public bool | null $can_simulate_removal, + public PhoneLocation | null $location, + public string | null $nickname, + public PhoneProperties $properties, + public array $warnings, + public string $workspace_id, ) { } diff --git a/src/Objects/PhoneAssaAbloyCredentialServiceMetadata.php b/src/Objects/PhoneAssaAbloyCredentialServiceMetadata.php index 4e66cea..2a7c01e 100644 --- a/src/Objects/PhoneAssaAbloyCredentialServiceMetadata.php +++ b/src/Objects/PhoneAssaAbloyCredentialServiceMetadata.php @@ -11,19 +11,19 @@ public static function from_json(mixed $json): PhoneAssaAbloyCredentialServiceMe return null; } return new self( - has_active_endpoint: $json->has_active_endpoint, endpoints: array_map( fn ($e) => PhoneEndpoints::from_json($e), $json->endpoints ?? [] ), + has_active_endpoint: $json->has_active_endpoint, ); } public function __construct( - public bool $has_active_endpoint, public array $endpoints, + public bool $has_active_endpoint, ) { } diff --git a/src/Objects/PhoneWarnings.php b/src/Objects/PhoneWarnings.php index 45ef34b..9749b8d 100644 --- a/src/Objects/PhoneWarnings.php +++ b/src/Objects/PhoneWarnings.php @@ -11,8 +11,8 @@ public static function from_json(mixed $json): PhoneWarnings|null return null; } return new self( - warning_code: $json->warning_code, message: $json->message, + warning_code: $json->warning_code, created_at: $json->created_at ?? null, ); } @@ -20,8 +20,8 @@ public static function from_json(mixed $json): PhoneWarnings|null public function __construct( - public string $warning_code, public string $message, + public string $warning_code, public string | null $created_at, ) { } diff --git a/src/Objects/ServiceHealth.php b/src/Objects/ServiceHealth.php index dc4dd0b..b0a8cd0 100644 --- a/src/Objects/ServiceHealth.php +++ b/src/Objects/ServiceHealth.php @@ -11,18 +11,18 @@ public static function from_json(mixed $json): ServiceHealth|null return null; } return new self( + description: $json->description, service: $json->service, status: $json->status, - description: $json->description, ); } public function __construct( + public string $description, public string $service, public string $status, - public string $description, ) { } diff --git a/src/Objects/UnmanagedAccessCode.php b/src/Objects/UnmanagedAccessCode.php index c86570e..a30cda5 100644 --- a/src/Objects/UnmanagedAccessCode.php +++ b/src/Objects/UnmanagedAccessCode.php @@ -11,36 +11,36 @@ public static function from_json(mixed $json): UnmanagedAccessCode|null return null; } return new self( - type: $json->type, access_code_id: $json->access_code_id, - device_id: $json->device_id, - name: $json->name ?? null, code: $json->code ?? null, created_at: $json->created_at, + device_id: $json->device_id, + ends_at: $json->ends_at ?? null, errors: $json->errors ?? null, - warnings: $json->warnings ?? null, is_managed: $json->is_managed, + name: $json->name ?? null, starts_at: $json->starts_at ?? null, - ends_at: $json->ends_at ?? null, status: $json->status, + type: $json->type, + warnings: $json->warnings ?? null, ); } public function __construct( - public string $type, public string $access_code_id, - public string $device_id, - public string | null $name, public string | null $code, public string $created_at, + public string $device_id, + public string | null $ends_at, public mixed $errors, - public mixed $warnings, public bool $is_managed, + public string | null $name, public string | null $starts_at, - public string | null $ends_at, public string $status, + public string $type, + public mixed $warnings, ) { } diff --git a/src/Objects/UnmanagedDevice.php b/src/Objects/UnmanagedDevice.php index 2c4c150..c398df6 100644 --- a/src/Objects/UnmanagedDevice.php +++ b/src/Objects/UnmanagedDevice.php @@ -11,46 +11,48 @@ public static function from_json(mixed $json): UnmanagedDevice|null return null; } return new self( + can_program_offline_access_codes: $json->can_program_offline_access_codes ?? null, + can_program_online_access_codes: $json->can_program_online_access_codes ?? null, + can_remotely_lock: $json->can_remotely_lock ?? null, + can_remotely_unlock: $json->can_remotely_unlock ?? null, + can_simulate_removal: $json->can_simulate_removal ?? null, + capabilities_supported: $json->capabilities_supported, + connected_account_id: $json->connected_account_id, + created_at: $json->created_at, device_id: $json->device_id, device_type: $json->device_type, - connected_account_id: $json->connected_account_id, - capabilities_supported: $json->capabilities_supported, - workspace_id: $json->workspace_id, errors: array_map( fn ($e) => UnmanagedDeviceErrors::from_json($e), $json->errors ?? [] ), + is_managed: $json->is_managed, + properties: UnmanagedDeviceProperties::from_json($json->properties), warnings: array_map( fn ($w) => UnmanagedDeviceWarnings::from_json($w), $json->warnings ?? [] ), - created_at: $json->created_at, - is_managed: $json->is_managed, - properties: UnmanagedDeviceProperties::from_json($json->properties), - can_remotely_unlock: $json->can_remotely_unlock ?? null, - can_remotely_lock: $json->can_remotely_lock ?? null, - can_program_online_access_codes: $json->can_program_online_access_codes ?? null, - can_simulate_removal: $json->can_simulate_removal ?? null, + workspace_id: $json->workspace_id, ); } public function __construct( + public bool | null $can_program_offline_access_codes, + public bool | null $can_program_online_access_codes, + public bool | null $can_remotely_lock, + public bool | null $can_remotely_unlock, + public bool | null $can_simulate_removal, + public array $capabilities_supported, + public string $connected_account_id, + public string $created_at, public string $device_id, public string $device_type, - public string $connected_account_id, - public array $capabilities_supported, - public string $workspace_id, public array $errors, - public array $warnings, - public string $created_at, public bool $is_managed, public UnmanagedDeviceProperties $properties, - public bool | null $can_remotely_unlock, - public bool | null $can_remotely_lock, - public bool | null $can_program_online_access_codes, - public bool | null $can_simulate_removal, + public array $warnings, + public string $workspace_id, ) { } diff --git a/src/Objects/UnmanagedDeviceAccessoryKeypad.php b/src/Objects/UnmanagedDeviceAccessoryKeypad.php index 53e6385..67f58a6 100644 --- a/src/Objects/UnmanagedDeviceAccessoryKeypad.php +++ b/src/Objects/UnmanagedDeviceAccessoryKeypad.php @@ -11,16 +11,16 @@ public static function from_json(mixed $json): UnmanagedDeviceAccessoryKeypad|nu return null; } return new self( - is_connected: $json->is_connected, battery: isset($json->battery) ? UnmanagedDeviceBattery::from_json($json->battery) : null, + is_connected: $json->is_connected, ); } public function __construct( - public bool $is_connected, public UnmanagedDeviceBattery | null $battery, + public bool $is_connected, ) { } diff --git a/src/Objects/UnmanagedDeviceModel.php b/src/Objects/UnmanagedDeviceModel.php index 9872248..bb2a0ce 100644 --- a/src/Objects/UnmanagedDeviceModel.php +++ b/src/Objects/UnmanagedDeviceModel.php @@ -11,26 +11,26 @@ public static function from_json(mixed $json): UnmanagedDeviceModel|null return null; } return new self( + accessory_keypad_supported: $json->accessory_keypad_supported ?? null, can_connect_accessory_keypad: $json->can_connect_accessory_keypad ?? null, display_name: $json->display_name, - manufacturer_display_name: $json->manufacturer_display_name, has_built_in_keypad: $json->has_built_in_keypad ?? null, + manufacturer_display_name: $json->manufacturer_display_name, offline_access_codes_supported: $json->offline_access_codes_supported ?? null, online_access_codes_supported: $json->online_access_codes_supported ?? null, - accessory_keypad_supported: $json->accessory_keypad_supported ?? null, ); } public function __construct( + public bool | null $accessory_keypad_supported, public bool | null $can_connect_accessory_keypad, public string $display_name, - public string $manufacturer_display_name, public bool | null $has_built_in_keypad, + public string $manufacturer_display_name, public bool | null $offline_access_codes_supported, public bool | null $online_access_codes_supported, - public bool | null $accessory_keypad_supported, ) { } diff --git a/src/Objects/UnmanagedDeviceProperties.php b/src/Objects/UnmanagedDeviceProperties.php index 7047a15..591a799 100644 --- a/src/Objects/UnmanagedDeviceProperties.php +++ b/src/Objects/UnmanagedDeviceProperties.php @@ -12,16 +12,16 @@ public static function from_json(mixed $json): UnmanagedDeviceProperties|null } return new self( accessory_keypad: isset($json->accessory_keypad) ? UnmanagedDeviceAccessoryKeypad::from_json($json->accessory_keypad) : null, + battery: isset($json->battery) ? UnmanagedDeviceBattery::from_json($json->battery) : null, + battery_level: $json->battery_level ?? null, + image_alt_text: $json->image_alt_text ?? null, + image_url: $json->image_url ?? null, + manufacturer: $json->manufacturer ?? null, + model: UnmanagedDeviceModel::from_json($json->model), name: $json->name, + offline_access_codes_enabled: $json->offline_access_codes_enabled ?? null, online: $json->online, - manufacturer: $json->manufacturer ?? null, - image_url: $json->image_url ?? null, - image_alt_text: $json->image_alt_text ?? null, - battery_level: $json->battery_level ?? null, - battery: isset($json->battery) ? UnmanagedDeviceBattery::from_json($json->battery) : null, online_access_codes_enabled: $json->online_access_codes_enabled ?? null, - offline_access_codes_enabled: $json->offline_access_codes_enabled ?? null, - model: UnmanagedDeviceModel::from_json($json->model), ); } @@ -29,16 +29,16 @@ public static function from_json(mixed $json): UnmanagedDeviceProperties|null public function __construct( public UnmanagedDeviceAccessoryKeypad | null $accessory_keypad, + public UnmanagedDeviceBattery | null $battery, + public int | null $battery_level, + public string | null $image_alt_text, + public string | null $image_url, + public string | null $manufacturer, + public UnmanagedDeviceModel $model, public string $name, + public bool | null $offline_access_codes_enabled, public bool $online, - public string | null $manufacturer, - public string | null $image_url, - public string | null $image_alt_text, - public int | null $battery_level, - public UnmanagedDeviceBattery | null $battery, public bool | null $online_access_codes_enabled, - public bool | null $offline_access_codes_enabled, - public UnmanagedDeviceModel $model, ) { } diff --git a/src/Objects/UnmanagedDeviceWarnings.php b/src/Objects/UnmanagedDeviceWarnings.php index db80a1a..8cad447 100644 --- a/src/Objects/UnmanagedDeviceWarnings.php +++ b/src/Objects/UnmanagedDeviceWarnings.php @@ -11,8 +11,8 @@ public static function from_json(mixed $json): UnmanagedDeviceWarnings|null return null; } return new self( - warning_code: $json->warning_code, message: $json->message, + warning_code: $json->warning_code, created_at: $json->created_at ?? null, ); } @@ -20,8 +20,8 @@ public static function from_json(mixed $json): UnmanagedDeviceWarnings|null public function __construct( - public string $warning_code, public string $message, + public string $warning_code, public string | null $created_at, ) { } diff --git a/src/Objects/UserIdentity.php b/src/Objects/UserIdentity.php index f4f2ad1..99f573b 100644 --- a/src/Objects/UserIdentity.php +++ b/src/Objects/UserIdentity.php @@ -11,13 +11,13 @@ public static function from_json(mixed $json): UserIdentity|null return null; } return new self( - user_identity_id: $json->user_identity_id, - user_identity_key: $json->user_identity_key ?? null, - email_address: $json->email_address ?? null, - phone_number: $json->phone_number ?? null, + created_at: $json->created_at, display_name: $json->display_name, + email_address: $json->email_address ?? null, full_name: $json->full_name ?? null, - created_at: $json->created_at, + phone_number: $json->phone_number ?? null, + user_identity_id: $json->user_identity_id, + user_identity_key: $json->user_identity_key ?? null, workspace_id: $json->workspace_id, ); } @@ -25,13 +25,13 @@ public static function from_json(mixed $json): UserIdentity|null public function __construct( - public string $user_identity_id, - public string | null $user_identity_key, - public string | null $email_address, - public string | null $phone_number, + public string $created_at, public string $display_name, + public string | null $email_address, public string | null $full_name, - public string $created_at, + public string | null $phone_number, + public string $user_identity_id, + public string | null $user_identity_key, public string $workspace_id, ) { } diff --git a/src/Objects/Webhook.php b/src/Objects/Webhook.php index cddfcc9..7671fd6 100644 --- a/src/Objects/Webhook.php +++ b/src/Objects/Webhook.php @@ -11,20 +11,20 @@ public static function from_json(mixed $json): Webhook|null return null; } return new self( - webhook_id: $json->webhook_id, - url: $json->url, event_types: $json->event_types ?? null, secret: $json->secret ?? null, + url: $json->url, + webhook_id: $json->webhook_id, ); } public function __construct( - public string $webhook_id, - public string $url, public array | null $event_types, public string | null $secret, + public string $url, + public string $webhook_id, ) { } diff --git a/src/Objects/Workspace.php b/src/Objects/Workspace.php index 5bd81db..9e9941d 100644 --- a/src/Objects/Workspace.php +++ b/src/Objects/Workspace.php @@ -11,20 +11,20 @@ public static function from_json(mixed $json): Workspace|null return null; } return new self( - workspace_id: $json->workspace_id, - name: $json->name, - is_sandbox: $json->is_sandbox, connect_partner_name: $json->connect_partner_name ?? null, + is_sandbox: $json->is_sandbox, + name: $json->name, + workspace_id: $json->workspace_id, ); } public function __construct( - public string $workspace_id, - public string $name, - public bool $is_sandbox, public string | null $connect_partner_name, + public bool $is_sandbox, + public string $name, + public string $workspace_id, ) { } diff --git a/src/SeamClient.php b/src/SeamClient.php index 18a09b3..0e5117c 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -3,31 +3,31 @@ namespace Seam; use Seam\Objects\AccessCode; -use Seam\Objects\UnmanagedAccessCode; +use Seam\Objects\AcsAccessGroup; +use Seam\Objects\AcsCredential; +use Seam\Objects\AcsCredentialPool; +use Seam\Objects\AcsCredentialProvisioningAutomation; +use Seam\Objects\AcsEntrance; +use Seam\Objects\AcsSystem; +use Seam\Objects\AcsUser; use Seam\Objects\ActionAttempt; use Seam\Objects\ClientSession; use Seam\Objects\ClimateSettingSchedule; use Seam\Objects\ConnectWebview; use Seam\Objects\ConnectedAccount; use Seam\Objects\Device; -use Seam\Objects\UnmanagedDevice; use Seam\Objects\DeviceProvider; +use Seam\Objects\EnrollmentAutomation; use Seam\Objects\Event; +use Seam\Objects\Network; use Seam\Objects\NoiseThreshold; +use Seam\Objects\Phone; use Seam\Objects\ServiceHealth; +use Seam\Objects\UnmanagedAccessCode; +use Seam\Objects\UnmanagedDevice; +use Seam\Objects\UserIdentity; use Seam\Objects\Webhook; use Seam\Objects\Workspace; -use Seam\Objects\AcsSystem; -use Seam\Objects\AcsAccessGroup; -use Seam\Objects\AcsUser; -use Seam\Objects\AcsEntrance; -use Seam\Objects\AcsCredentialProvisioningAutomation; -use Seam\Objects\AcsCredentialPool; -use Seam\Objects\AcsCredential; -use Seam\Objects\EnrollmentAutomation; -use Seam\Objects\Phone; -use Seam\Objects\UserIdentity; -use Seam\Objects\Network; use GuzzleHttp\Client as HTTPClient; use \Exception as Exception; @@ -35,22 +35,21 @@ class SeamClient { public AccessCodesClient $access_codes; + public AcsClient $acs; public ActionAttemptsClient $action_attempts; public ClientSessionsClient $client_sessions; public ConnectWebviewsClient $connect_webviews; public ConnectedAccountsClient $connected_accounts; public DevicesClient $devices; public EventsClient $events; - public HealthClient $health; public LocksClient $locks; public NetworksClient $networks; + public NoiseSensorsClient $noise_sensors; public PhonesClient $phones; public ThermostatsClient $thermostats; public UserIdentitiesClient $user_identities; public WebhooksClient $webhooks; public WorkspacesClient $workspaces; - public AcsClient $acs; - public NoiseSensorsClient $noise_sensors; public string $api_key; public HTTPClient $client; @@ -71,22 +70,21 @@ public function __construct( "http_errors" => $throw_http_errors, ]); $this->access_codes = new AccessCodesClient($this); + $this->acs = new AcsClient($this); $this->action_attempts = new ActionAttemptsClient($this); $this->client_sessions = new ClientSessionsClient($this); $this->connect_webviews = new ConnectWebviewsClient($this); $this->connected_accounts = new ConnectedAccountsClient($this); $this->devices = new DevicesClient($this); $this->events = new EventsClient($this); - $this->health = new HealthClient($this); $this->locks = new LocksClient($this); $this->networks = new NetworksClient($this); + $this->noise_sensors = new NoiseSensorsClient($this); $this->phones = new PhonesClient($this); $this->thermostats = new ThermostatsClient($this); $this->user_identities = new UserIdentitiesClient($this); $this->webhooks = new WebhooksClient($this); $this->workspaces = new WorkspacesClient($this); - $this->acs = new AcsClient($this); - $this->noise_sensors = new NoiseSensorsClient($this); } public function request( @@ -169,63 +167,45 @@ public function __construct(SeamClient $seam) public function create( string $device_id, - string $name = null, - string $starts_at = null, - string $ends_at = null, - string $code = null, - bool $sync = null, + bool $allow_external_modification = null, bool $attempt_for_offline_device = null, + string $code = null, string $common_code_key = null, - bool $prefer_native_scheduling = null, - bool $use_backup_access_code_pool = null, - bool $allow_external_modification = null, + string $ends_at = null, bool $is_external_modification_allowed = null, - bool $use_offline_access_code = null, bool $is_offline_access_code = null, bool $is_one_time_use = null, - string $max_time_rounding = null + string $max_time_rounding = null, + string $name = null, + bool $prefer_native_scheduling = null, + string $starts_at = null, + bool $sync = null, + bool $use_backup_access_code_pool = null, + bool $use_offline_access_code = null ): AccessCode { $request_payload = []; if ($device_id !== null) { $request_payload["device_id"] = $device_id; } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($starts_at !== null) { - $request_payload["starts_at"] = $starts_at; + if ($allow_external_modification !== null) { + $request_payload["allow_external_modification"] = $allow_external_modification; } - if ($ends_at !== null) { - $request_payload["ends_at"] = $ends_at; + if ($attempt_for_offline_device !== null) { + $request_payload["attempt_for_offline_device"] = $attempt_for_offline_device; } if ($code !== null) { $request_payload["code"] = $code; } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - if ($attempt_for_offline_device !== null) { - $request_payload["attempt_for_offline_device"] = $attempt_for_offline_device; - } if ($common_code_key !== null) { $request_payload["common_code_key"] = $common_code_key; } - if ($prefer_native_scheduling !== null) { - $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; - } - if ($use_backup_access_code_pool !== null) { - $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; - } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; + if ($ends_at !== null) { + $request_payload["ends_at"] = $ends_at; } if ($is_external_modification_allowed !== null) { $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; } - if ($use_offline_access_code !== null) { - $request_payload["use_offline_access_code"] = $use_offline_access_code; - } if ($is_offline_access_code !== null) { $request_payload["is_offline_access_code"] = $is_offline_access_code; } @@ -235,6 +215,24 @@ public function create( if ($max_time_rounding !== null) { $request_payload["max_time_rounding"] = $max_time_rounding; } + if ($name !== null) { + $request_payload["name"] = $name; + } + if ($prefer_native_scheduling !== null) { + $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; + } + if ($starts_at !== null) { + $request_payload["starts_at"] = $starts_at; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; + } + if ($use_backup_access_code_pool !== null) { + $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; + } + if ($use_offline_access_code !== null) { + $request_payload["use_offline_access_code"] = $use_offline_access_code; + } $res = $this->seam->request( "POST", @@ -252,63 +250,45 @@ public function create( public function create_multiple( array $device_ids, + bool $allow_external_modification = null, + bool $attempt_for_offline_device = null, string $behavior_when_code_cannot_be_shared = null, - int $preferred_code_length = null, - string $name = null, - string $starts_at = null, - string $ends_at = null, string $code = null, - bool $attempt_for_offline_device = null, - bool $prefer_native_scheduling = null, - bool $use_backup_access_code_pool = null, - bool $allow_external_modification = null, + string $ends_at = null, bool $is_external_modification_allowed = null, - bool $use_offline_access_code = null, bool $is_offline_access_code = null, bool $is_one_time_use = null, - string $max_time_rounding = null + string $max_time_rounding = null, + string $name = null, + bool $prefer_native_scheduling = null, + int $preferred_code_length = null, + string $starts_at = null, + bool $use_backup_access_code_pool = null, + bool $use_offline_access_code = null ): array { $request_payload = []; if ($device_ids !== null) { $request_payload["device_ids"] = $device_ids; } - if ($behavior_when_code_cannot_be_shared !== null) { - $request_payload["behavior_when_code_cannot_be_shared"] = $behavior_when_code_cannot_be_shared; - } - if ($preferred_code_length !== null) { - $request_payload["preferred_code_length"] = $preferred_code_length; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($starts_at !== null) { - $request_payload["starts_at"] = $starts_at; - } - if ($ends_at !== null) { - $request_payload["ends_at"] = $ends_at; - } - if ($code !== null) { - $request_payload["code"] = $code; + if ($allow_external_modification !== null) { + $request_payload["allow_external_modification"] = $allow_external_modification; } if ($attempt_for_offline_device !== null) { $request_payload["attempt_for_offline_device"] = $attempt_for_offline_device; } - if ($prefer_native_scheduling !== null) { - $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; + if ($behavior_when_code_cannot_be_shared !== null) { + $request_payload["behavior_when_code_cannot_be_shared"] = $behavior_when_code_cannot_be_shared; } - if ($use_backup_access_code_pool !== null) { - $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; + if ($code !== null) { + $request_payload["code"] = $code; } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; + if ($ends_at !== null) { + $request_payload["ends_at"] = $ends_at; } if ($is_external_modification_allowed !== null) { $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; } - if ($use_offline_access_code !== null) { - $request_payload["use_offline_access_code"] = $use_offline_access_code; - } if ($is_offline_access_code !== null) { $request_payload["is_offline_access_code"] = $is_offline_access_code; } @@ -318,6 +298,24 @@ public function create_multiple( if ($max_time_rounding !== null) { $request_payload["max_time_rounding"] = $max_time_rounding; } + if ($name !== null) { + $request_payload["name"] = $name; + } + if ($prefer_native_scheduling !== null) { + $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; + } + if ($preferred_code_length !== null) { + $request_payload["preferred_code_length"] = $preferred_code_length; + } + if ($starts_at !== null) { + $request_payload["starts_at"] = $starts_at; + } + if ($use_backup_access_code_pool !== null) { + $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; + } + if ($use_offline_access_code !== null) { + $request_payload["use_offline_access_code"] = $use_offline_access_code; + } $res = $this->seam->request( "POST", @@ -336,9 +334,8 @@ public function create_multiple( public function delete( string $access_code_id, string $device_id = null, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + bool $sync = null + ): void { $request_payload = []; if ($access_code_id !== null) { @@ -351,22 +348,16 @@ public function delete( $request_payload["sync"] = $sync; } - $res = $this->seam->request( + $this->seam->request( "POST", "/access_codes/delete", json: $request_payload, - inner_object: "action_attempt", + ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + } @@ -395,21 +386,21 @@ public function generate_code( } public function get( - string $device_id = null, string $access_code_id = null, - string $code = null + string $code = null, + string $device_id = null ): AccessCode { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } if ($access_code_id !== null) { $request_payload["access_code_id"] = $access_code_id; } if ($code !== null) { $request_payload["code"] = $code; } + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } $res = $this->seam->request( "POST", @@ -426,18 +417,18 @@ public function get( } public function list( - string $device_id = null, array $access_code_ids = null, + string $device_id = null, string $user_identifier_key = null ): array { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } if ($access_code_ids !== null) { $request_payload["access_code_ids"] = $access_code_ids; } + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } if ($user_identifier_key !== null) { $request_payload["user_identifier_key"] = $user_identifier_key; } @@ -481,63 +472,50 @@ public function pull_backup_access_code( public function update( string $access_code_id, - string $name = null, - string $starts_at = null, - string $ends_at = null, - string $code = null, - bool $sync = null, - bool $attempt_for_offline_device = null, - bool $prefer_native_scheduling = null, - bool $use_backup_access_code_pool = null, bool $allow_external_modification = null, + bool $attempt_for_offline_device = null, + string $code = null, + string $device_id = null, + string $ends_at = null, bool $is_external_modification_allowed = null, - bool $use_offline_access_code = null, + bool $is_managed = null, bool $is_offline_access_code = null, bool $is_one_time_use = null, string $max_time_rounding = null, - string $device_id = null, + string $name = null, + bool $prefer_native_scheduling = null, + string $starts_at = null, + bool $sync = null, string $type = null, - bool $is_managed = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + bool $use_backup_access_code_pool = null, + bool $use_offline_access_code = null + ): void { $request_payload = []; if ($access_code_id !== null) { $request_payload["access_code_id"] = $access_code_id; } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($starts_at !== null) { - $request_payload["starts_at"] = $starts_at; - } - if ($ends_at !== null) { - $request_payload["ends_at"] = $ends_at; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($allow_external_modification !== null) { + $request_payload["allow_external_modification"] = $allow_external_modification; } if ($attempt_for_offline_device !== null) { $request_payload["attempt_for_offline_device"] = $attempt_for_offline_device; } - if ($prefer_native_scheduling !== null) { - $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; + if ($code !== null) { + $request_payload["code"] = $code; } - if ($use_backup_access_code_pool !== null) { - $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; + if ($ends_at !== null) { + $request_payload["ends_at"] = $ends_at; } if ($is_external_modification_allowed !== null) { $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; } - if ($use_offline_access_code !== null) { - $request_payload["use_offline_access_code"] = $use_offline_access_code; - } + if ($is_managed !== null) { + $request_payload["is_managed"] = $is_managed; + } if ($is_offline_access_code !== null) { $request_payload["is_offline_access_code"] = $is_offline_access_code; } @@ -547,39 +525,45 @@ public function update( if ($max_time_rounding !== null) { $request_payload["max_time_rounding"] = $max_time_rounding; } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($name !== null) { + $request_payload["name"] = $name; + } + if ($prefer_native_scheduling !== null) { + $request_payload["prefer_native_scheduling"] = $prefer_native_scheduling; + } + if ($starts_at !== null) { + $request_payload["starts_at"] = $starts_at; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } if ($type !== null) { $request_payload["type"] = $type; } - if ($is_managed !== null) { - $request_payload["is_managed"] = $is_managed; + if ($use_backup_access_code_pool !== null) { + $request_payload["use_backup_access_code_pool"] = $use_backup_access_code_pool; + } + if ($use_offline_access_code !== null) { + $request_payload["use_offline_access_code"] = $use_offline_access_code; } - $res = $this->seam->request( + $this->seam->request( "POST", "/access_codes/update", json: $request_payload, - inner_object: "action_attempt", + ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + } } -class ActionAttemptsClient +class AccessCodesSimulateClient { private SeamClient $seam; @@ -590,79 +574,40 @@ public function __construct(SeamClient $seam) } - public function get( - string $action_attempt_id - ): ActionAttempt { + public function create_unmanaged_access_code( + string $code, + string $device_id, + string $name + ): UnmanagedAccessCode { $request_payload = []; - if ($action_attempt_id !== null) { - $request_payload["action_attempt_id"] = $action_attempt_id; + if ($code !== null) { + $request_payload["code"] = $code; } - - $res = $this->seam->request( - "POST", - "/action_attempts/get", - json: $request_payload, - inner_object: "action_attempt", - ); - - - - - - return ActionAttempt::from_json($res); - } - - public function list( - array $action_attempt_ids - ): array { - $request_payload = []; - - if ($action_attempt_ids !== null) { - $request_payload["action_attempt_ids"] = $action_attempt_ids; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($name !== null) { + $request_payload["name"] = $name; } $res = $this->seam->request( "POST", - "/action_attempts/list", + "/access_codes/simulate/create_unmanaged_access_code", json: $request_payload, - inner_object: "action_attempts", + inner_object: "access_code", ); - return array_map(fn ($r) => ActionAttempt::from_json($r), $res); + return UnmanagedAccessCode::from_json($res); } - public function poll_until_ready(string $action_attempt_id): ActionAttempt - { - $seam = $this->seam; - $time_waiting = 0.0; - $action_attempt = $seam->action_attempts->get($action_attempt_id); - - while ($action_attempt->status == "pending") { - $action_attempt = $seam->action_attempts->get( - $action_attempt->action_attempt_id - ); - if ($time_waiting > 20.0) { - throw new Exception("Timed out waiting for action attempt to be ready"); - } - $time_waiting += 0.4; - usleep(400000); // sleep for 0.4 seconds - } - if ($action_attempt->status == "failed") { - throw new Exception( - "Action Attempt failed: " . $action_attempt->error->message - ); - } - - return $action_attempt; - } } -class ClientSessionsClient +class AccessCodesUnmanagedClient { private SeamClient $seam; @@ -673,57 +618,61 @@ public function __construct(SeamClient $seam) } - public function create( - string $user_identifier_key = null, - array $connect_webview_ids = null, - array $connected_account_ids = null, - array $user_identity_ids = null, - string $expires_at = null - ): ClientSession { + public function convert_to_managed( + string $access_code_id, + bool $allow_external_modification = null, + bool $force = null, + bool $is_external_modification_allowed = null, + bool $sync = null + ): void { $request_payload = []; - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; + if ($access_code_id !== null) { + $request_payload["access_code_id"] = $access_code_id; } - if ($connect_webview_ids !== null) { - $request_payload["connect_webview_ids"] = $connect_webview_ids; + if ($allow_external_modification !== null) { + $request_payload["allow_external_modification"] = $allow_external_modification; } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; + if ($force !== null) { + $request_payload["force"] = $force; } - if ($user_identity_ids !== null) { - $request_payload["user_identity_ids"] = $user_identity_ids; + if ($is_external_modification_allowed !== null) { + $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; } - if ($expires_at !== null) { - $request_payload["expires_at"] = $expires_at; + if ($sync !== null) { + $request_payload["sync"] = $sync; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/client_sessions/create", + "/access_codes/unmanaged/convert_to_managed", json: $request_payload, - inner_object: "client_session", + ); - return ClientSession::from_json($res); + } public function delete( - string $client_session_id + string $access_code_id, + bool $sync = null ): void { $request_payload = []; - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; + if ($access_code_id !== null) { + $request_payload["access_code_id"] = $access_code_id; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } $this->seam->request( "POST", - "/client_sessions/delete", + "/access_codes/unmanaged/delete", json: $request_payload, ); @@ -736,99 +685,91 @@ public function delete( } public function get( - string $client_session_id = null, - string $user_identifier_key = null - ): ClientSession { + string $access_code_id = null, + string $code = null, + string $device_id = null + ): UnmanagedAccessCode { $request_payload = []; - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; + if ($access_code_id !== null) { + $request_payload["access_code_id"] = $access_code_id; } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; + if ($code !== null) { + $request_payload["code"] = $code; + } + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } $res = $this->seam->request( "POST", - "/client_sessions/get", + "/access_codes/unmanaged/get", json: $request_payload, - inner_object: "client_session", + inner_object: "access_code", ); - return ClientSession::from_json($res); + return UnmanagedAccessCode::from_json($res); } - public function get_or_create( - string $user_identifier_key = null, - array $connect_webview_ids = null, - array $connected_account_ids = null, - array $user_identity_ids = null, - string $expires_at = null - ): ClientSession { + public function list( + string $device_id, + string $user_identifier_key = null + ): array { $request_payload = []; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } if ($user_identifier_key !== null) { $request_payload["user_identifier_key"] = $user_identifier_key; } - if ($connect_webview_ids !== null) { - $request_payload["connect_webview_ids"] = $connect_webview_ids; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($user_identity_ids !== null) { - $request_payload["user_identity_ids"] = $user_identity_ids; - } - if ($expires_at !== null) { - $request_payload["expires_at"] = $expires_at; - } $res = $this->seam->request( "POST", - "/client_sessions/get_or_create", + "/access_codes/unmanaged/list", json: $request_payload, - inner_object: "client_session", + inner_object: "access_codes", ); - return ClientSession::from_json($res); + return array_map(fn ($r) => UnmanagedAccessCode::from_json($r), $res); } - public function grant_access( - string $client_session_id = null, - string $user_identifier_key = null, - array $connected_account_ids = null, - array $connect_webview_ids = null, - array $user_identity_ids = null + public function update( + string $access_code_id, + bool $is_managed, + bool $allow_external_modification = null, + bool $force = null, + bool $is_external_modification_allowed = null ): void { $request_payload = []; - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; + if ($access_code_id !== null) { + $request_payload["access_code_id"] = $access_code_id; } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; + if ($is_managed !== null) { + $request_payload["is_managed"] = $is_managed; } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; + if ($allow_external_modification !== null) { + $request_payload["allow_external_modification"] = $allow_external_modification; } - if ($connect_webview_ids !== null) { - $request_payload["connect_webview_ids"] = $connect_webview_ids; + if ($force !== null) { + $request_payload["force"] = $force; } - if ($user_identity_ids !== null) { - $request_payload["user_identity_ids"] = $user_identity_ids; + if ($is_external_modification_allowed !== null) { + $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; } $this->seam->request( "POST", - "/client_sessions/grant_access", + "/access_codes/unmanaged/update", json: $request_payload, ); @@ -840,208 +781,210 @@ public function grant_access( } - public function list( - string $client_session_id = null, - string $user_identifier_key = null, - string $connect_webview_id = null, - bool $without_user_identifier_key = null, - string $user_identity_id = null - ): array { - $request_payload = []; +} - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($without_user_identifier_key !== null) { - $request_payload["without_user_identifier_key"] = $without_user_identifier_key; +class AcsAccessGroupsClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + + } + + + public function add_user( + string $acs_access_group_id, + string $acs_user_id + ): void { + $request_payload = []; + + if ($acs_access_group_id !== null) { + $request_payload["acs_access_group_id"] = $acs_access_group_id; } - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/client_sessions/list", + "/acs/access_groups/add_user", json: $request_payload, - inner_object: "client_sessions", + ); - return array_map(fn ($r) => ClientSession::from_json($r), $res); + } - public function revoke( - string $client_session_id - ): void { + public function get( + string $acs_access_group_id + ): AcsAccessGroup { $request_payload = []; - if ($client_session_id !== null) { - $request_payload["client_session_id"] = $client_session_id; + if ($acs_access_group_id !== null) { + $request_payload["acs_access_group_id"] = $acs_access_group_id; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/client_sessions/revoke", + "/acs/access_groups/get", json: $request_payload, - + inner_object: "acs_access_group", ); - - } - -} - -class ConnectWebviewsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - + return AcsAccessGroup::from_json($res); } - - public function create( - string $device_selection_mode = null, - string $custom_redirect_url = null, - string $custom_redirect_failure_url = null, - array $accepted_providers = null, - string $provider_category = null, - mixed $custom_metadata = null, - bool $automatically_manage_new_devices = null, - bool $wait_for_device_creation = null - ): ConnectWebview { + public function list( + string $acs_system_id = null, + string $acs_user_id = null + ): array { $request_payload = []; - if ($device_selection_mode !== null) { - $request_payload["device_selection_mode"] = $device_selection_mode; - } - if ($custom_redirect_url !== null) { - $request_payload["custom_redirect_url"] = $custom_redirect_url; - } - if ($custom_redirect_failure_url !== null) { - $request_payload["custom_redirect_failure_url"] = $custom_redirect_failure_url; - } - if ($accepted_providers !== null) { - $request_payload["accepted_providers"] = $accepted_providers; - } - if ($provider_category !== null) { - $request_payload["provider_category"] = $provider_category; - } - if ($custom_metadata !== null) { - $request_payload["custom_metadata"] = $custom_metadata; - } - if ($automatically_manage_new_devices !== null) { - $request_payload["automatically_manage_new_devices"] = $automatically_manage_new_devices; + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; } - if ($wait_for_device_creation !== null) { - $request_payload["wait_for_device_creation"] = $wait_for_device_creation; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } $res = $this->seam->request( "POST", - "/connect_webviews/create", + "/acs/access_groups/list", json: $request_payload, - inner_object: "connect_webview", + inner_object: "acs_access_groups", ); - return ConnectWebview::from_json($res); + return array_map(fn ($r) => AcsAccessGroup::from_json($r), $res); } - public function delete( - string $connect_webview_id - ): void { + public function list_users( + string $acs_access_group_id + ): array { $request_payload = []; - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; + if ($acs_access_group_id !== null) { + $request_payload["acs_access_group_id"] = $acs_access_group_id; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/connect_webviews/delete", + "/acs/access_groups/list_users", json: $request_payload, - + inner_object: "acs_users", ); - + return array_map(fn ($r) => AcsUser::from_json($r), $res); } - public function get( - string $connect_webview_id - ): ConnectWebview { + public function remove_user( + string $acs_access_group_id, + string $acs_user_id + ): void { $request_payload = []; - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; + if ($acs_access_group_id !== null) { + $request_payload["acs_access_group_id"] = $acs_access_group_id; + } + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/connect_webviews/get", + "/acs/access_groups/remove_user", json: $request_payload, - inner_object: "connect_webview", + ); - return ConnectWebview::from_json($res); + + } + +} + +class AcsClient +{ + private SeamClient $seam; + public AcsAccessGroupsClient $access_groups; + public AcsCredentialPoolsClient $credential_pools; + public AcsCredentialProvisioningAutomationsClient $credential_provisioning_automations; + public AcsCredentialsClient $credentials; + public AcsEntrancesClient $entrances; + public AcsSystemsClient $systems; + public AcsUsersClient $users; + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + $this->access_groups = new AcsAccessGroupsClient($seam); +$this->credential_pools = new AcsCredentialPoolsClient($seam); +$this->credential_provisioning_automations = new AcsCredentialProvisioningAutomationsClient($seam); +$this->credentials = new AcsCredentialsClient($seam); +$this->entrances = new AcsEntrancesClient($seam); +$this->systems = new AcsSystemsClient($seam); +$this->users = new AcsUsersClient($seam); + } + + +} + +class AcsCredentialPoolsClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + } + public function list( - string $user_identifier_key = null, - mixed $custom_metadata_has = null + string $acs_system_id ): array { $request_payload = []; - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; } $res = $this->seam->request( "POST", - "/connect_webviews/list", + "/acs/credential_pools/list", json: $request_payload, - inner_object: "connect_webviews", + inner_object: "acs_credential_pools", ); - return array_map(fn ($r) => ConnectWebview::from_json($r), $res); + return array_map(fn ($r) => AcsCredentialPool::from_json($r), $res); } } -class ConnectedAccountsClient +class AcsCredentialProvisioningAutomationsClient { private SeamClient $seam; @@ -1052,141 +995,152 @@ public function __construct(SeamClient $seam) } - public function delete( - string $connected_account_id, - bool $sync = null - ): void { + public function launch( + string $credential_manager_acs_system_id, + string $user_identity_id, + string $acs_credential_pool_id = null, + bool $create_credential_manager_user = null, + string $credential_manager_acs_user_id = null + ): AcsCredentialProvisioningAutomation { $request_payload = []; - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; + if ($credential_manager_acs_system_id !== null) { + $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } + if ($acs_credential_pool_id !== null) { + $request_payload["acs_credential_pool_id"] = $acs_credential_pool_id; + } + if ($create_credential_manager_user !== null) { + $request_payload["create_credential_manager_user"] = $create_credential_manager_user; + } + if ($credential_manager_acs_user_id !== null) { + $request_payload["credential_manager_acs_user_id"] = $credential_manager_acs_user_id; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/connected_accounts/delete", + "/acs/credential_provisioning_automations/launch", json: $request_payload, - + inner_object: "acs_credential_provisioning_automation", ); - + return AcsCredentialProvisioningAutomation::from_json($res); } - public function get( - string $connected_account_id = null, - string $email = null - ): ConnectedAccount { - $request_payload = []; +} - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($email !== null) { - $request_payload["email"] = $email; - } - - $res = $this->seam->request( - "POST", - "/connected_accounts/get", - json: $request_payload, - inner_object: "connected_account", - ); - - - - - - return ConnectedAccount::from_json($res); +class AcsCredentialsClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + } - public function list( - mixed $custom_metadata_has = null - ): array { + + public function assign( + string $acs_credential_id, + string $acs_user_id + ): void { $request_payload = []; - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; + if ($acs_credential_id !== null) { + $request_payload["acs_credential_id"] = $acs_credential_id; + } + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/connected_accounts/list", + "/acs/credentials/assign", json: $request_payload, - inner_object: "connected_accounts", + ); - return array_map(fn ($r) => ConnectedAccount::from_json($r), $res); + } - public function update( - string $connected_account_id, - bool $automatically_manage_new_devices = null, - mixed $custom_metadata = null - ): ConnectedAccount { + public function create( + string $access_method, + string $acs_user_id, + array $allowed_acs_entrance_ids = null, + string $code = null, + string $credential_manager_acs_system_id = null, + string $ends_at = null, + bool $is_multi_phone_sync_credential = null, + string $starts_at = null, + mixed $visionline_metadata = null + ): AcsCredential { $request_payload = []; - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; + if ($access_method !== null) { + $request_payload["access_method"] = $access_method; } - if ($automatically_manage_new_devices !== null) { - $request_payload["automatically_manage_new_devices"] = $automatically_manage_new_devices; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - if ($custom_metadata !== null) { - $request_payload["custom_metadata"] = $custom_metadata; + if ($allowed_acs_entrance_ids !== null) { + $request_payload["allowed_acs_entrance_ids"] = $allowed_acs_entrance_ids; + } + if ($code !== null) { + $request_payload["code"] = $code; + } + if ($credential_manager_acs_system_id !== null) { + $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; + } + if ($ends_at !== null) { + $request_payload["ends_at"] = $ends_at; + } + if ($is_multi_phone_sync_credential !== null) { + $request_payload["is_multi_phone_sync_credential"] = $is_multi_phone_sync_credential; + } + if ($starts_at !== null) { + $request_payload["starts_at"] = $starts_at; + } + if ($visionline_metadata !== null) { + $request_payload["visionline_metadata"] = $visionline_metadata; } $res = $this->seam->request( "POST", - "/connected_accounts/update", + "/acs/credentials/create", json: $request_payload, - inner_object: "connected_account", + inner_object: "acs_credential", ); - return ConnectedAccount::from_json($res); - } - -} - -class DevicesClient -{ - private SeamClient $seam; - public DevicesSimulateClient $simulate; - public DevicesUnmanagedClient $unmanaged; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->simulate = new DevicesSimulateClient($seam); -$this->unmanaged = new DevicesUnmanagedClient($seam); + return AcsCredential::from_json($res); } - public function delete( - string $device_id + string $acs_credential_id ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($acs_credential_id !== null) { + $request_payload["acs_credential_id"] = $acs_credential_id; } $this->seam->request( "POST", - "/devices/delete", + "/acs/credentials/delete", json: $request_payload, ); @@ -1199,154 +1153,106 @@ public function delete( } public function get( - string $device_id = null, - string $name = null - ): Device { + string $acs_credential_id + ): AcsCredential { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; + if ($acs_credential_id !== null) { + $request_payload["acs_credential_id"] = $acs_credential_id; } $res = $this->seam->request( "POST", - "/devices/get", + "/acs/credentials/get", json: $request_payload, - inner_object: "device", + inner_object: "acs_credential", ); - return Device::from_json($res); + return AcsCredential::from_json($res); } public function list( - string $connected_account_id = null, - array $connected_account_ids = null, - string $connect_webview_id = null, - string $device_type = null, - array $device_types = null, - string $manufacturer = null, - array $device_ids = null, - int $limit = null, - string $created_before = null, - string $user_identifier_key = null, - mixed $custom_metadata_has = null, - array $include_if = null, - array $exclude_if = null + string $acs_user_id = null, + string $acs_system_id = null, + string $user_identity_id = null, + bool $is_multi_phone_sync_credential = null ): array { $request_payload = []; - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($device_type !== null) { - $request_payload["device_type"] = $device_type; - } - if ($device_types !== null) { - $request_payload["device_types"] = $device_types; - } - if ($manufacturer !== null) { - $request_payload["manufacturer"] = $manufacturer; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($limit !== null) { - $request_payload["limit"] = $limit; - } - if ($created_before !== null) { - $request_payload["created_before"] = $created_before; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; } - if ($include_if !== null) { - $request_payload["include_if"] = $include_if; + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } - if ($exclude_if !== null) { - $request_payload["exclude_if"] = $exclude_if; + if ($is_multi_phone_sync_credential !== null) { + $request_payload["is_multi_phone_sync_credential"] = $is_multi_phone_sync_credential; } $res = $this->seam->request( "POST", - "/devices/list", + "/acs/credentials/list", json: $request_payload, - inner_object: "devices", + inner_object: "acs_credentials", ); - return array_map(fn ($r) => Device::from_json($r), $res); + return array_map(fn ($r) => AcsCredential::from_json($r), $res); } - public function list_device_providers( - string $provider_category = null - ): array { + public function unassign( + string $acs_credential_id, + string $acs_user_id + ): void { $request_payload = []; - if ($provider_category !== null) { - $request_payload["provider_category"] = $provider_category; + if ($acs_credential_id !== null) { + $request_payload["acs_credential_id"] = $acs_credential_id; + } + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/devices/list_device_providers", + "/acs/credentials/unassign", json: $request_payload, - inner_object: "device_providers", + ); - return array_map(fn ($r) => DeviceProvider::from_json($r), $res); + } public function update( - string $device_id, - mixed $properties = null, - string $name = null, - bool $is_managed = null, - mixed $custom_metadata = null + string $acs_credential_id, + string $code ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($properties !== null) { - $request_payload["properties"] = $properties; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($is_managed !== null) { - $request_payload["is_managed"] = $is_managed; + if ($acs_credential_id !== null) { + $request_payload["acs_credential_id"] = $acs_credential_id; } - if ($custom_metadata !== null) { - $request_payload["custom_metadata"] = $custom_metadata; + if ($code !== null) { + $request_payload["code"] = $code; } $this->seam->request( "POST", - "/devices/update", + "/acs/credentials/update", json: $request_payload, ); @@ -1360,7 +1266,7 @@ public function update( } -class EventsClient +class AcsEntrancesClient { private SeamClient $seam; @@ -1372,155 +1278,112 @@ public function __construct(SeamClient $seam) public function get( - string $event_id = null, - string $event_type = null, - string $device_id = null - ): Event { + string $acs_entrance_id + ): AcsEntrance { $request_payload = []; - if ($event_id !== null) { - $request_payload["event_id"] = $event_id; - } - if ($event_type !== null) { - $request_payload["event_type"] = $event_type; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($acs_entrance_id !== null) { + $request_payload["acs_entrance_id"] = $acs_entrance_id; } $res = $this->seam->request( "POST", - "/events/get", + "/acs/entrances/get", json: $request_payload, - inner_object: "event", + inner_object: "acs_entrance", ); - return Event::from_json($res); + return AcsEntrance::from_json($res); } - public function list( - string $since = null, - array $between = null, - string $device_id = null, - array $device_ids = null, - string $access_code_id = null, - array $access_code_ids = null, - string $event_type = null, - array $event_types = null, - string $connected_account_id = null, - int $limit = null - ): array { + public function grant_access( + string $acs_entrance_id, + string $acs_user_id + ): void { $request_payload = []; - if ($since !== null) { - $request_payload["since"] = $since; - } - if ($between !== null) { - $request_payload["between"] = $between; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($access_code_ids !== null) { - $request_payload["access_code_ids"] = $access_code_ids; - } - if ($event_type !== null) { - $request_payload["event_type"] = $event_type; - } - if ($event_types !== null) { - $request_payload["event_types"] = $event_types; - } - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; + if ($acs_entrance_id !== null) { + $request_payload["acs_entrance_id"] = $acs_entrance_id; } - if ($limit !== null) { - $request_payload["limit"] = $limit; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/events/list", + "/acs/entrances/grant_access", json: $request_payload, - inner_object: "events", + ); - return array_map(fn ($r) => Event::from_json($r), $res); - } - -} -class HealthClient -{ - private SeamClient $seam; - public HealthServiceClient $service; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->service = new HealthServiceClient($seam); } - - public function get_health( - - ): void { + public function list( + string $acs_credential_id = null, + string $acs_system_id = null + ): array { $request_payload = []; + if ($acs_credential_id !== null) { + $request_payload["acs_credential_id"] = $acs_credential_id; + } + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; + } - - $this->seam->request( + $res = $this->seam->request( "POST", - "/health/get_health", + "/acs/entrances/list", json: $request_payload, - + inner_object: "acs_entrances", ); - + return array_map(fn ($r) => AcsEntrance::from_json($r), $res); } - public function get_service_health( - string $service - ): void { + public function list_credentials_with_access( + string $acs_entrance_id, + array $include_if = null + ): array { $request_payload = []; - if ($service !== null) { - $request_payload["service"] = $service; + if ($acs_entrance_id !== null) { + $request_payload["acs_entrance_id"] = $acs_entrance_id; + } + if ($include_if !== null) { + $request_payload["include_if"] = $include_if; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/health/get_service_health", + "/acs/entrances/list_credentials_with_access", json: $request_payload, - + inner_object: "acs_credentials", ); - + return array_map(fn ($r) => AcsCredential::from_json($r), $res); } } -class LocksClient +class AcsSystemsClient { private SeamClient $seam; @@ -1532,253 +1395,262 @@ public function __construct(SeamClient $seam) public function get( - string $device_id = null, - string $name = null - ): Device { + string $acs_system_id + ): AcsSystem { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; } $res = $this->seam->request( "POST", - "/locks/get", + "/acs/systems/get", json: $request_payload, - inner_object: "device", + inner_object: "acs_system", ); - return Device::from_json($res); + return AcsSystem::from_json($res); } public function list( - string $connected_account_id = null, - array $connected_account_ids = null, - string $connect_webview_id = null, - string $device_type = null, - array $device_types = null, - string $manufacturer = null, - array $device_ids = null, - int $limit = null, - string $created_before = null, - string $user_identifier_key = null, - mixed $custom_metadata_has = null, - array $include_if = null, - array $exclude_if = null + string $connected_account_id = null ): array { $request_payload = []; if ($connected_account_id !== null) { $request_payload["connected_account_id"] = $connected_account_id; } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($device_type !== null) { - $request_payload["device_type"] = $device_type; - } - if ($device_types !== null) { - $request_payload["device_types"] = $device_types; - } - if ($manufacturer !== null) { - $request_payload["manufacturer"] = $manufacturer; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($limit !== null) { - $request_payload["limit"] = $limit; - } - if ($created_before !== null) { - $request_payload["created_before"] = $created_before; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; - } - if ($include_if !== null) { - $request_payload["include_if"] = $include_if; - } - if ($exclude_if !== null) { - $request_payload["exclude_if"] = $exclude_if; - } $res = $this->seam->request( "POST", - "/locks/list", + "/acs/systems/list", json: $request_payload, - inner_object: "devices", + inner_object: "acs_systems", ); - return array_map(fn ($r) => Device::from_json($r), $res); + return array_map(fn ($r) => AcsSystem::from_json($r), $res); } - public function lock_door( - string $device_id, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { +} + +class AcsUsersClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + + } + + + public function add_to_access_group( + string $acs_access_group_id, + string $acs_user_id + ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($acs_access_group_id !== null) { + $request_payload["acs_access_group_id"] = $acs_access_group_id; } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/locks/lock_door", + "/acs/users/add_to_access_group", json: $request_payload, - inner_object: "action_attempt", + ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + } - public function unlock_door( - string $device_id, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + public function create( + string $acs_system_id, + mixed $access_schedule = null, + array $acs_access_group_ids = null, + string $email = null, + string $email_address = null, + string $full_name = null, + string $phone_number = null, + string $user_identity_id = null + ): AcsUser { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($access_schedule !== null) { + $request_payload["access_schedule"] = $access_schedule; + } + if ($acs_access_group_ids !== null) { + $request_payload["acs_access_group_ids"] = $acs_access_group_ids; + } + if ($email !== null) { + $request_payload["email"] = $email; + } + if ($email_address !== null) { + $request_payload["email_address"] = $email_address; + } + if ($full_name !== null) { + $request_payload["full_name"] = $full_name; + } + if ($phone_number !== null) { + $request_payload["phone_number"] = $phone_number; + } + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } $res = $this->seam->request( "POST", - "/locks/unlock_door", + "/acs/users/create", json: $request_payload, - inner_object: "action_attempt", + inner_object: "acs_user", ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); + + + + + return AcsUser::from_json($res); + } + + public function delete( + string $acs_user_id + ): void { + $request_payload = []; + + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id + $this->seam->request( + "POST", + "/acs/users/delete", + json: $request_payload, + ); - return $action_attempt; - } -} -class NetworksClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } + } public function get( - string $network_id - ): Network { + string $acs_user_id + ): AcsUser { $request_payload = []; - if ($network_id !== null) { - $request_payload["network_id"] = $network_id; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } $res = $this->seam->request( "POST", - "/networks/get", + "/acs/users/get", json: $request_payload, - inner_object: "network", + inner_object: "acs_user", ); - return Network::from_json($res); + return AcsUser::from_json($res); } public function list( - + string $acs_system_id = null, + string $user_identity_email_address = null, + string $user_identity_id = null, + string $user_identity_phone_number = null ): array { $request_payload = []; - + if ($acs_system_id !== null) { + $request_payload["acs_system_id"] = $acs_system_id; + } + if ($user_identity_email_address !== null) { + $request_payload["user_identity_email_address"] = $user_identity_email_address; + } + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } + if ($user_identity_phone_number !== null) { + $request_payload["user_identity_phone_number"] = $user_identity_phone_number; + } $res = $this->seam->request( "POST", - "/networks/list", + "/acs/users/list", json: $request_payload, - inner_object: "networks", + inner_object: "acs_users", ); - return array_map(fn ($r) => Network::from_json($r), $res); + return array_map(fn ($r) => AcsUser::from_json($r), $res); } -} + public function list_accessible_entrances( + string $acs_user_id + ): array { + $request_payload = []; -class PhonesClient -{ - private SeamClient $seam; - public PhonesSimulateClient $simulate; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->simulate = new PhonesSimulateClient($seam); - } + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; + } + + $res = $this->seam->request( + "POST", + "/acs/users/list_accessible_entrances", + json: $request_payload, + inner_object: "acs_entrances", + ); - public function deactivate( - string $device_id + + + + return array_map(fn ($r) => AcsEntrance::from_json($r), $res); + } + + public function remove_from_access_group( + string $acs_access_group_id, + string $acs_user_id ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($acs_access_group_id !== null) { + $request_payload["acs_access_group_id"] = $acs_access_group_id; + } + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } $this->seam->request( "POST", - "/phones/deactivate", + "/acs/users/remove_from_access_group", json: $request_payload, ); @@ -1790,464 +1662,269 @@ public function deactivate( } - public function list( - string $owner_user_identity_id = null - ): array { + public function revoke_access_to_all_entrances( + string $acs_user_id + ): void { $request_payload = []; - if ($owner_user_identity_id !== null) { - $request_payload["owner_user_identity_id"] = $owner_user_identity_id; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/phones/list", + "/acs/users/revoke_access_to_all_entrances", json: $request_payload, - inner_object: "phones", + ); - return array_map(fn ($r) => Phone::from_json($r), $res); - } - -} -class ThermostatsClient -{ - private SeamClient $seam; - public ThermostatsClimateSettingSchedulesClient $climate_setting_schedules; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->climate_setting_schedules = new ThermostatsClimateSettingSchedulesClient($seam); } - - public function cool( - string $device_id, - int $cooling_set_point_celsius = null, - int $cooling_set_point_fahrenheit = null, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + public function suspend( + string $acs_user_id + ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($cooling_set_point_celsius !== null) { - $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; - } - if ($cooling_set_point_fahrenheit !== null) { - $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/thermostats/cool", + "/acs/users/suspend", json: $request_payload, - inner_object: "action_attempt", + ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + } - public function get( - string $device_id = null, - string $name = null - ): Device { + public function unsuspend( + string $acs_user_id + ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($name !== null) { - $request_payload["name"] = $name; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/thermostats/get", + "/acs/users/unsuspend", json: $request_payload, - inner_object: "thermostat", + ); - return Device::from_json($res); + } - public function heat( - string $device_id, - int $heating_set_point_celsius = null, - int $heating_set_point_fahrenheit = null, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + public function update( + string $acs_user_id, + mixed $access_schedule = null, + string $email = null, + string $email_address = null, + string $full_name = null, + string $hid_acs_system_id = null, + string $phone_number = null + ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($heating_set_point_celsius !== null) { - $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; } - if ($heating_set_point_fahrenheit !== null) { - $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; + if ($access_schedule !== null) { + $request_payload["access_schedule"] = $access_schedule; } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - - $res = $this->seam->request( - "POST", - "/thermostats/heat", - json: $request_payload, - inner_object: "action_attempt", - ); - - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - - - } - - public function heat_cool( - string $device_id, - int $heating_set_point_celsius = null, - int $heating_set_point_fahrenheit = null, - int $cooling_set_point_celsius = null, - int $cooling_set_point_fahrenheit = null, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($heating_set_point_celsius !== null) { - $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; + if ($email !== null) { + $request_payload["email"] = $email; } - if ($heating_set_point_fahrenheit !== null) { - $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; + if ($email_address !== null) { + $request_payload["email_address"] = $email_address; } - if ($cooling_set_point_celsius !== null) { - $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; + if ($full_name !== null) { + $request_payload["full_name"] = $full_name; } - if ($cooling_set_point_fahrenheit !== null) { - $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; + if ($hid_acs_system_id !== null) { + $request_payload["hid_acs_system_id"] = $hid_acs_system_id; } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($phone_number !== null) { + $request_payload["phone_number"] = $phone_number; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/thermostats/heat_cool", + "/acs/users/update", json: $request_payload, - inner_object: "action_attempt", + ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - - return $action_attempt; - } - - public function list( - string $connected_account_id = null, - array $connected_account_ids = null, - string $connect_webview_id = null, - string $device_type = null, - array $device_types = null, - string $manufacturer = null, - array $device_ids = null, - int $limit = null, - string $created_before = null, - string $user_identifier_key = null, - mixed $custom_metadata_has = null, - array $include_if = null, - array $exclude_if = null - ): array { - $request_payload = []; - - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($device_type !== null) { - $request_payload["device_type"] = $device_type; - } - if ($device_types !== null) { - $request_payload["device_types"] = $device_types; - } - if ($manufacturer !== null) { - $request_payload["manufacturer"] = $manufacturer; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($limit !== null) { - $request_payload["limit"] = $limit; - } - if ($created_before !== null) { - $request_payload["created_before"] = $created_before; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; - } - if ($include_if !== null) { - $request_payload["include_if"] = $include_if; - } - if ($exclude_if !== null) { - $request_payload["exclude_if"] = $exclude_if; - } - - $res = $this->seam->request( - "POST", - "/thermostats/list", - json: $request_payload, - inner_object: "thermostats", - ); - + } +} - return array_map(fn ($r) => Device::from_json($r), $res); +class ActionAttemptsClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + } - public function off( - string $device_id, - bool $sync = null, - bool $wait_for_action_attempt = true + + public function get( + string $action_attempt_id ): ActionAttempt { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($action_attempt_id !== null) { + $request_payload["action_attempt_id"] = $action_attempt_id; } $res = $this->seam->request( "POST", - "/thermostats/off", + "/action_attempts/get", json: $request_payload, inner_object: "action_attempt", ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + return ActionAttempt::from_json($res); } - public function set_fan_mode( - string $device_id, - string $fan_mode = null, - string $fan_mode_setting = null, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + public function list( + array $action_attempt_ids + ): array { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($fan_mode !== null) { - $request_payload["fan_mode"] = $fan_mode; - } - if ($fan_mode_setting !== null) { - $request_payload["fan_mode_setting"] = $fan_mode_setting; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($action_attempt_ids !== null) { + $request_payload["action_attempt_ids"] = $action_attempt_ids; } $res = $this->seam->request( "POST", - "/thermostats/set_fan_mode", + "/action_attempts/list", json: $request_payload, - inner_object: "action_attempt", + inner_object: "action_attempts", ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + return array_map(fn ($r) => ActionAttempt::from_json($r), $res); } + public function poll_until_ready(string $action_attempt_id): ActionAttempt + { + $seam = $this->seam; + $time_waiting = 0.0; + $action_attempt = $seam->action_attempts->get($action_attempt_id); - public function update( - string $device_id, - mixed $default_climate_setting - ): void { - $request_payload = []; - - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($default_climate_setting !== null) { - $request_payload["default_climate_setting"] = $default_climate_setting; + while ($action_attempt->status == "pending") { + $action_attempt = $seam->action_attempts->get( + $action_attempt->action_attempt_id + ); + if ($time_waiting > 20.0) { + throw new Exception("Timed out waiting for action attempt to be ready"); + } + $time_waiting += 0.4; + usleep(400000); // sleep for 0.4 seconds } - $this->seam->request( - "POST", - "/thermostats/update", - json: $request_payload, - - ); - - - - - + if ($action_attempt->status == "failed") { + throw new Exception( + "Action Attempt failed: " . $action_attempt->error->message + ); + } + return $action_attempt; } - } -class UserIdentitiesClient +class ClientSessionsClient { private SeamClient $seam; - public UserIdentitiesEnrollmentAutomationsClient $enrollment_automations; + public function __construct(SeamClient $seam) { $this->seam = $seam; - $this->enrollment_automations = new UserIdentitiesEnrollmentAutomationsClient($seam); + } - public function add_acs_user( - string $user_identity_id, - string $acs_user_id - ): void { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/user_identities/add_acs_user", - json: $request_payload, - - ); - - - - - - - } - public function create( - string $user_identity_key = null, - string $email_address = null, - string $phone_number = null, - string $full_name = null - ): UserIdentity { + array $connect_webview_ids = null, + array $connected_account_ids = null, + string $expires_at = null, + string $user_identifier_key = null, + array $user_identity_ids = null + ): ClientSession { $request_payload = []; - if ($user_identity_key !== null) { - $request_payload["user_identity_key"] = $user_identity_key; + if ($connect_webview_ids !== null) { + $request_payload["connect_webview_ids"] = $connect_webview_ids; } - if ($email_address !== null) { - $request_payload["email_address"] = $email_address; + if ($connected_account_ids !== null) { + $request_payload["connected_account_ids"] = $connected_account_ids; } - if ($phone_number !== null) { - $request_payload["phone_number"] = $phone_number; + if ($expires_at !== null) { + $request_payload["expires_at"] = $expires_at; } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; + } + if ($user_identity_ids !== null) { + $request_payload["user_identity_ids"] = $user_identity_ids; } $res = $this->seam->request( "POST", - "/user_identities/create", + "/client_sessions/create", json: $request_payload, - inner_object: "user_identity", + inner_object: "client_session", ); - return UserIdentity::from_json($res); + return ClientSession::from_json($res); } public function delete( - string $user_identity_id + string $client_session_id ): void { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; + if ($client_session_id !== null) { + $request_payload["client_session_id"] = $client_session_id; } $this->seam->request( "POST", - "/user_identities/delete", + "/client_sessions/delete", json: $request_payload, ); @@ -2260,167 +1937,248 @@ public function delete( } public function get( - string $user_identity_id = null, - string $user_identity_key = null - ): UserIdentity { + string $client_session_id = null, + string $user_identifier_key = null + ): ClientSession { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; + if ($client_session_id !== null) { + $request_payload["client_session_id"] = $client_session_id; } - if ($user_identity_key !== null) { - $request_payload["user_identity_key"] = $user_identity_key; + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; } $res = $this->seam->request( "POST", - "/user_identities/get", + "/client_sessions/get", json: $request_payload, - inner_object: "user_identity", + inner_object: "client_session", ); - return UserIdentity::from_json($res); + return ClientSession::from_json($res); } - public function grant_access_to_device( - string $user_identity_id, - string $device_id - ): void { + public function get_or_create( + array $connect_webview_ids = null, + array $connected_account_ids = null, + string $expires_at = null, + string $user_identifier_key = null, + array $user_identity_ids = null + ): ClientSession { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; + if ($connect_webview_ids !== null) { + $request_payload["connect_webview_ids"] = $connect_webview_ids; } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($connected_account_ids !== null) { + $request_payload["connected_account_ids"] = $connected_account_ids; + } + if ($expires_at !== null) { + $request_payload["expires_at"] = $expires_at; + } + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; + } + if ($user_identity_ids !== null) { + $request_payload["user_identity_ids"] = $user_identity_ids; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/user_identities/grant_access_to_device", + "/client_sessions/get_or_create", json: $request_payload, - + inner_object: "client_session", ); - + return ClientSession::from_json($res); } - public function list( - string $credential_manager_acs_system_id = null - ): array { + public function grant_access( + string $client_session_id = null, + array $connect_webview_ids = null, + array $connected_account_ids = null, + string $user_identifier_key = null, + array $user_identity_ids = null + ): void { $request_payload = []; - if ($credential_manager_acs_system_id !== null) { - $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; + if ($client_session_id !== null) { + $request_payload["client_session_id"] = $client_session_id; + } + if ($connect_webview_ids !== null) { + $request_payload["connect_webview_ids"] = $connect_webview_ids; + } + if ($connected_account_ids !== null) { + $request_payload["connected_account_ids"] = $connected_account_ids; + } + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; + } + if ($user_identity_ids !== null) { + $request_payload["user_identity_ids"] = $user_identity_ids; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/user_identities/list", + "/client_sessions/grant_access", json: $request_payload, - inner_object: "user_identities", + ); - return array_map(fn ($r) => UserIdentity::from_json($r), $res); + } - public function list_accessible_devices( - string $user_identity_id + public function list( + string $client_session_id = null, + string $connect_webview_id = null, + string $user_identifier_key = null, + string $user_identity_id = null, + bool $without_user_identifier_key = null ): array { $request_payload = []; + if ($client_session_id !== null) { + $request_payload["client_session_id"] = $client_session_id; + } + if ($connect_webview_id !== null) { + $request_payload["connect_webview_id"] = $connect_webview_id; + } + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; + } if ($user_identity_id !== null) { $request_payload["user_identity_id"] = $user_identity_id; } + if ($without_user_identifier_key !== null) { + $request_payload["without_user_identifier_key"] = $without_user_identifier_key; + } $res = $this->seam->request( "POST", - "/user_identities/list_accessible_devices", + "/client_sessions/list", json: $request_payload, - inner_object: "devices", + inner_object: "client_sessions", ); - return array_map(fn ($r) => Device::from_json($r), $res); + return array_map(fn ($r) => ClientSession::from_json($r), $res); } - public function list_acs_systems( - string $user_identity_id - ): array { + public function revoke( + string $client_session_id + ): void { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; + if ($client_session_id !== null) { + $request_payload["client_session_id"] = $client_session_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/user_identities/list_acs_systems", + "/client_sessions/revoke", json: $request_payload, - inner_object: "acs_systems", + ); - return array_map(fn ($r) => AcsSystem::from_json($r), $res); + + } + +} + +class ConnectWebviewsClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + } - public function list_acs_users( - string $user_identity_id - ): array { + + public function create( + array $accepted_providers = null, + bool $automatically_manage_new_devices = null, + mixed $custom_metadata = null, + string $custom_redirect_failure_url = null, + string $custom_redirect_url = null, + string $device_selection_mode = null, + string $provider_category = null, + bool $wait_for_device_creation = null + ): ConnectWebview { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; + if ($accepted_providers !== null) { + $request_payload["accepted_providers"] = $accepted_providers; + } + if ($automatically_manage_new_devices !== null) { + $request_payload["automatically_manage_new_devices"] = $automatically_manage_new_devices; + } + if ($custom_metadata !== null) { + $request_payload["custom_metadata"] = $custom_metadata; + } + if ($custom_redirect_failure_url !== null) { + $request_payload["custom_redirect_failure_url"] = $custom_redirect_failure_url; + } + if ($custom_redirect_url !== null) { + $request_payload["custom_redirect_url"] = $custom_redirect_url; + } + if ($device_selection_mode !== null) { + $request_payload["device_selection_mode"] = $device_selection_mode; + } + if ($provider_category !== null) { + $request_payload["provider_category"] = $provider_category; + } + if ($wait_for_device_creation !== null) { + $request_payload["wait_for_device_creation"] = $wait_for_device_creation; } $res = $this->seam->request( "POST", - "/user_identities/list_acs_users", + "/connect_webviews/create", json: $request_payload, - inner_object: "acs_users", + inner_object: "connect_webview", ); - return array_map(fn ($r) => AcsUser::from_json($r), $res); + return ConnectWebview::from_json($res); } - public function remove_acs_user( - string $user_identity_id, - string $acs_user_id + public function delete( + string $connect_webview_id ): void { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($connect_webview_id !== null) { + $request_payload["connect_webview_id"] = $connect_webview_id; } $this->seam->request( "POST", - "/user_identities/remove_acs_user", + "/connect_webviews/delete", json: $request_payload, ); @@ -2432,75 +2190,59 @@ public function remove_acs_user( } - public function revoke_access_to_device( - string $user_identity_id, - string $device_id - ): void { + public function get( + string $connect_webview_id + ): ConnectWebview { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($connect_webview_id !== null) { + $request_payload["connect_webview_id"] = $connect_webview_id; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/user_identities/revoke_access_to_device", + "/connect_webviews/get", json: $request_payload, - + inner_object: "connect_webview", ); - + return ConnectWebview::from_json($res); } - public function update( - string $user_identity_id, - string $user_identity_key = null, - string $email_address = null, - string $phone_number = null, - string $full_name = null - ): void { + public function list( + mixed $custom_metadata_has = null, + string $user_identifier_key = null + ): array { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($user_identity_key !== null) { - $request_payload["user_identity_key"] = $user_identity_key; - } - if ($email_address !== null) { - $request_payload["email_address"] = $email_address; - } - if ($phone_number !== null) { - $request_payload["phone_number"] = $phone_number; + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/user_identities/update", + "/connect_webviews/list", json: $request_payload, - + inner_object: "connect_webviews", ); - + return array_map(fn ($r) => ConnectWebview::from_json($r), $res); } } -class WebhooksClient +class ConnectedAccountsClient { private SeamClient $seam; @@ -2511,45 +2253,22 @@ public function __construct(SeamClient $seam) } - public function create( - string $url, - array $event_types = null - ): Webhook { - $request_payload = []; - - if ($url !== null) { - $request_payload["url"] = $url; - } - if ($event_types !== null) { - $request_payload["event_types"] = $event_types; - } - - $res = $this->seam->request( - "POST", - "/webhooks/create", - json: $request_payload, - inner_object: "webhook", - ); - - - - - - return Webhook::from_json($res); - } - public function delete( - string $webhook_id + string $connected_account_id, + bool $sync = null ): void { $request_payload = []; - if ($webhook_id !== null) { - $request_payload["webhook_id"] = $webhook_id; + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } $this->seam->request( "POST", - "/webhooks/delete", + "/connected_accounts/delete", json: $request_payload, ); @@ -2562,182 +2281,275 @@ public function delete( } public function get( - string $webhook_id - ): Webhook { + string $connected_account_id = null, + string $email = null + ): ConnectedAccount { $request_payload = []; - if ($webhook_id !== null) { - $request_payload["webhook_id"] = $webhook_id; + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; + } + if ($email !== null) { + $request_payload["email"] = $email; } $res = $this->seam->request( "POST", - "/webhooks/get", + "/connected_accounts/get", json: $request_payload, - inner_object: "webhook", + inner_object: "connected_account", ); - return Webhook::from_json($res); + return ConnectedAccount::from_json($res); } public function list( - + mixed $custom_metadata_has = null ): array { $request_payload = []; - + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } $res = $this->seam->request( "POST", - "/webhooks/list", + "/connected_accounts/list", json: $request_payload, - inner_object: "webhooks", + inner_object: "connected_accounts", ); - return array_map(fn ($r) => Webhook::from_json($r), $res); + return array_map(fn ($r) => ConnectedAccount::from_json($r), $res); } public function update( - string $webhook_id, - array $event_types - ): void { + string $connected_account_id, + bool $automatically_manage_new_devices = null, + mixed $custom_metadata = null + ): ConnectedAccount { $request_payload = []; - if ($webhook_id !== null) { - $request_payload["webhook_id"] = $webhook_id; + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; } - if ($event_types !== null) { - $request_payload["event_types"] = $event_types; + if ($automatically_manage_new_devices !== null) { + $request_payload["automatically_manage_new_devices"] = $automatically_manage_new_devices; + } + if ($custom_metadata !== null) { + $request_payload["custom_metadata"] = $custom_metadata; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/webhooks/update", + "/connected_accounts/update", json: $request_payload, - + inner_object: "connected_account", ); - + return ConnectedAccount::from_json($res); } } -class WorkspacesClient +class DevicesClient { private SeamClient $seam; - + public DevicesSimulateClient $simulate; + public DevicesUnmanagedClient $unmanaged; public function __construct(SeamClient $seam) { $this->seam = $seam; - + $this->simulate = new DevicesSimulateClient($seam); +$this->unmanaged = new DevicesUnmanagedClient($seam); } - public function create( - string $name, - string $connect_partner_name, - bool $is_sandbox = null, - string $webview_primary_button_color = null, - string $webview_logo_shape = null - ): Workspace { + public function delete( + string $device_id + ): void { + $request_payload = []; + + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + + $this->seam->request( + "POST", + "/devices/delete", + json: $request_payload, + + ); + + + + + + + } + + public function get( + string $device_id = null, + string $name = null + ): Device { $request_payload = []; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } if ($name !== null) { $request_payload["name"] = $name; } - if ($connect_partner_name !== null) { - $request_payload["connect_partner_name"] = $connect_partner_name; - } - if ($is_sandbox !== null) { - $request_payload["is_sandbox"] = $is_sandbox; - } - if ($webview_primary_button_color !== null) { - $request_payload["webview_primary_button_color"] = $webview_primary_button_color; - } - if ($webview_logo_shape !== null) { - $request_payload["webview_logo_shape"] = $webview_logo_shape; - } $res = $this->seam->request( "POST", - "/workspaces/create", + "/devices/get", json: $request_payload, - inner_object: "workspace", + inner_object: "device", ); - return Workspace::from_json($res); + return Device::from_json($res); } - public function get( - - ): Workspace { + public function list( + string $connect_webview_id = null, + string $connected_account_id = null, + array $connected_account_ids = null, + string $created_before = null, + mixed $custom_metadata_has = null, + array $device_ids = null, + string $device_type = null, + array $device_types = null, + array $exclude_if = null, + array $include_if = null, + int $limit = null, + string $manufacturer = null, + string $user_identifier_key = null + ): array { $request_payload = []; - + if ($connect_webview_id !== null) { + $request_payload["connect_webview_id"] = $connect_webview_id; + } + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; + } + if ($connected_account_ids !== null) { + $request_payload["connected_account_ids"] = $connected_account_ids; + } + if ($created_before !== null) { + $request_payload["created_before"] = $created_before; + } + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } + if ($device_ids !== null) { + $request_payload["device_ids"] = $device_ids; + } + if ($device_type !== null) { + $request_payload["device_type"] = $device_type; + } + if ($device_types !== null) { + $request_payload["device_types"] = $device_types; + } + if ($exclude_if !== null) { + $request_payload["exclude_if"] = $exclude_if; + } + if ($include_if !== null) { + $request_payload["include_if"] = $include_if; + } + if ($limit !== null) { + $request_payload["limit"] = $limit; + } + if ($manufacturer !== null) { + $request_payload["manufacturer"] = $manufacturer; + } + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; + } $res = $this->seam->request( "POST", - "/workspaces/get", + "/devices/list", json: $request_payload, - inner_object: "workspace", + inner_object: "devices", ); - return Workspace::from_json($res); + return array_map(fn ($r) => Device::from_json($r), $res); } - public function list( - + public function list_device_providers( + string $provider_category = null ): array { $request_payload = []; - + if ($provider_category !== null) { + $request_payload["provider_category"] = $provider_category; + } $res = $this->seam->request( "POST", - "/workspaces/list", + "/devices/list_device_providers", json: $request_payload, - inner_object: "workspaces", + inner_object: "device_providers", ); - return array_map(fn ($r) => Workspace::from_json($r), $res); + return array_map(fn ($r) => DeviceProvider::from_json($r), $res); } - public function reset_sandbox( - + public function update( + string $device_id, + mixed $custom_metadata = null, + bool $is_managed = null, + string $name = null, + mixed $properties = null ): void { $request_payload = []; - + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($custom_metadata !== null) { + $request_payload["custom_metadata"] = $custom_metadata; + } + if ($is_managed !== null) { + $request_payload["is_managed"] = $is_managed; + } + if ($name !== null) { + $request_payload["name"] = $name; + } + if ($properties !== null) { + $request_payload["properties"] = $properties; + } $this->seam->request( "POST", - "/workspaces/reset_sandbox", + "/devices/update", json: $request_payload, - inner_object: "message", + ); @@ -2749,7 +2561,7 @@ public function reset_sandbox( } -class AccessCodesSimulateClient +class DevicesSimulateClient { private SeamClient $seam; @@ -2760,40 +2572,32 @@ public function __construct(SeamClient $seam) } - public function create_unmanaged_access_code( - string $device_id, - string $name, - string $code - ): UnmanagedAccessCode { + public function remove( + string $device_id + ): void { $request_payload = []; if ($device_id !== null) { $request_payload["device_id"] = $device_id; } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($code !== null) { - $request_payload["code"] = $code; - } - $res = $this->seam->request( + $this->seam->request( "POST", - "/access_codes/simulate/create_unmanaged_access_code", + "/devices/simulate/remove", json: $request_payload, - inner_object: "access_code", + ); - return UnmanagedAccessCode::from_json($res); + } } -class AccessCodesUnmanagedClient +class DevicesUnmanagedClient { private SeamClient $seam; @@ -2804,179 +2608,237 @@ public function __construct(SeamClient $seam) } - public function convert_to_managed( - string $access_code_id, - bool $is_external_modification_allowed = null, - bool $allow_external_modification = null, - bool $force = null, - bool $sync = null - ): void { + public function get( + string $device_id = null, + string $name = null + ): UnmanagedDevice { $request_payload = []; - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($is_external_modification_allowed !== null) { - $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; - } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; - } - if ($force !== null) { - $request_payload["force"] = $force; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($name !== null) { + $request_payload["name"] = $name; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/access_codes/unmanaged/convert_to_managed", + "/devices/unmanaged/get", json: $request_payload, - + inner_object: "device", ); - + return UnmanagedDevice::from_json($res); } - public function delete( - string $access_code_id, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + public function list( + string $connect_webview_id = null, + string $connected_account_id = null, + array $connected_account_ids = null, + string $created_before = null, + mixed $custom_metadata_has = null, + array $device_ids = null, + string $device_type = null, + array $device_types = null, + array $exclude_if = null, + array $include_if = null, + int $limit = null, + string $manufacturer = null, + string $user_identifier_key = null + ): array { $request_payload = []; - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; + if ($connect_webview_id !== null) { + $request_payload["connect_webview_id"] = $connect_webview_id; } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; + } + if ($connected_account_ids !== null) { + $request_payload["connected_account_ids"] = $connected_account_ids; + } + if ($created_before !== null) { + $request_payload["created_before"] = $created_before; + } + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } + if ($device_ids !== null) { + $request_payload["device_ids"] = $device_ids; + } + if ($device_type !== null) { + $request_payload["device_type"] = $device_type; + } + if ($device_types !== null) { + $request_payload["device_types"] = $device_types; + } + if ($exclude_if !== null) { + $request_payload["exclude_if"] = $exclude_if; + } + if ($include_if !== null) { + $request_payload["include_if"] = $include_if; + } + if ($limit !== null) { + $request_payload["limit"] = $limit; + } + if ($manufacturer !== null) { + $request_payload["manufacturer"] = $manufacturer; + } + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; } $res = $this->seam->request( "POST", - "/access_codes/unmanaged/delete", + "/devices/unmanaged/list", json: $request_payload, - inner_object: "action_attempt", + inner_object: "devices", ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + + return array_map(fn ($r) => UnmanagedDevice::from_json($r), $res); } - public function get( - string $device_id = null, - string $access_code_id = null, - string $code = null - ): UnmanagedAccessCode { + public function update( + string $device_id, + bool $is_managed + ): void { $request_payload = []; if ($device_id !== null) { $request_payload["device_id"] = $device_id; } - if ($access_code_id !== null) { - $request_payload["access_code_id"] = $access_code_id; - } - if ($code !== null) { - $request_payload["code"] = $code; + if ($is_managed !== null) { + $request_payload["is_managed"] = $is_managed; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/access_codes/unmanaged/get", + "/devices/unmanaged/update", json: $request_payload, - inner_object: "access_code", + ); - return UnmanagedAccessCode::from_json($res); + } - public function list( - string $device_id, - string $user_identifier_key = null - ): array { +} + +class EventsClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + + } + + + public function get( + string $device_id = null, + string $event_id = null, + string $event_type = null + ): Event { $request_payload = []; if ($device_id !== null) { $request_payload["device_id"] = $device_id; } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; + if ($event_id !== null) { + $request_payload["event_id"] = $event_id; + } + if ($event_type !== null) { + $request_payload["event_type"] = $event_type; } $res = $this->seam->request( "POST", - "/access_codes/unmanaged/list", + "/events/get", json: $request_payload, - inner_object: "access_codes", + inner_object: "event", ); - return array_map(fn ($r) => UnmanagedAccessCode::from_json($r), $res); + return Event::from_json($res); } - public function update( - string $access_code_id, - bool $is_managed, - bool $allow_external_modification = null, - bool $is_external_modification_allowed = null, - bool $force = null - ): void { + public function list( + string $access_code_id = null, + array $access_code_ids = null, + array $between = null, + string $connected_account_id = null, + string $device_id = null, + array $device_ids = null, + string $event_type = null, + array $event_types = null, + int $limit = null, + string $since = null + ): array { $request_payload = []; if ($access_code_id !== null) { $request_payload["access_code_id"] = $access_code_id; } - if ($is_managed !== null) { - $request_payload["is_managed"] = $is_managed; + if ($access_code_ids !== null) { + $request_payload["access_code_ids"] = $access_code_ids; } - if ($allow_external_modification !== null) { - $request_payload["allow_external_modification"] = $allow_external_modification; + if ($between !== null) { + $request_payload["between"] = $between; } - if ($is_external_modification_allowed !== null) { - $request_payload["is_external_modification_allowed"] = $is_external_modification_allowed; + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; } - if ($force !== null) { - $request_payload["force"] = $force; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($device_ids !== null) { + $request_payload["device_ids"] = $device_ids; + } + if ($event_type !== null) { + $request_payload["event_type"] = $event_type; + } + if ($event_types !== null) { + $request_payload["event_types"] = $event_types; + } + if ($limit !== null) { + $request_payload["limit"] = $limit; + } + if ($since !== null) { + $request_payload["since"] = $since; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/access_codes/unmanaged/update", + "/events/list", json: $request_payload, - + inner_object: "events", ); - + return array_map(fn ($r) => Event::from_json($r), $res); } } -class AcsAccessGroupsClient +class LocksClient { private SeamClient $seam; @@ -2987,161 +2849,175 @@ public function __construct(SeamClient $seam) } - public function add_user( - string $acs_access_group_id, - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - - $this->seam->request( - "POST", - "/acs/access_groups/add_user", - json: $request_payload, - - ); - - - - - - - } - public function get( - string $acs_access_group_id - ): AcsAccessGroup { + string $device_id = null, + string $name = null + ): Device { $request_payload = []; - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($name !== null) { + $request_payload["name"] = $name; } $res = $this->seam->request( "POST", - "/acs/access_groups/get", + "/locks/get", json: $request_payload, - inner_object: "acs_access_group", + inner_object: "device", ); - return AcsAccessGroup::from_json($res); + return Device::from_json($res); } public function list( - string $acs_system_id = null, - string $acs_user_id = null + string $connect_webview_id = null, + string $connected_account_id = null, + array $connected_account_ids = null, + string $created_before = null, + mixed $custom_metadata_has = null, + array $device_ids = null, + string $device_type = null, + array $device_types = null, + array $exclude_if = null, + array $include_if = null, + int $limit = null, + string $manufacturer = null, + string $user_identifier_key = null ): array { $request_payload = []; - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; + if ($connect_webview_id !== null) { + $request_payload["connect_webview_id"] = $connect_webview_id; } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; + } + if ($connected_account_ids !== null) { + $request_payload["connected_account_ids"] = $connected_account_ids; + } + if ($created_before !== null) { + $request_payload["created_before"] = $created_before; + } + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } + if ($device_ids !== null) { + $request_payload["device_ids"] = $device_ids; + } + if ($device_type !== null) { + $request_payload["device_type"] = $device_type; + } + if ($device_types !== null) { + $request_payload["device_types"] = $device_types; + } + if ($exclude_if !== null) { + $request_payload["exclude_if"] = $exclude_if; + } + if ($include_if !== null) { + $request_payload["include_if"] = $include_if; + } + if ($limit !== null) { + $request_payload["limit"] = $limit; + } + if ($manufacturer !== null) { + $request_payload["manufacturer"] = $manufacturer; + } + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; } $res = $this->seam->request( "POST", - "/acs/access_groups/list", + "/locks/list", json: $request_payload, - inner_object: "acs_access_groups", + inner_object: "devices", ); - return array_map(fn ($r) => AcsAccessGroup::from_json($r), $res); + return array_map(fn ($r) => Device::from_json($r), $res); } - public function list_users( - string $acs_access_group_id - ): array { + public function lock_door( + string $device_id, + bool $sync = null, + bool $wait_for_action_attempt = true + ): ActionAttempt { $request_payload = []; - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } $res = $this->seam->request( "POST", - "/acs/access_groups/list_users", + "/locks/lock_door", json: $request_payload, - inner_object: "acs_users", + inner_object: "action_attempt", ); + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res); + } + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt_id + ); + return $action_attempt; - return array_map(fn ($r) => AcsUser::from_json($r), $res); } - public function remove_user( - string $acs_access_group_id, - string $acs_user_id - ): void { + public function unlock_door( + string $device_id, + bool $sync = null, + bool $wait_for_action_attempt = true + ): ActionAttempt { $request_payload = []; - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($sync !== null) { + $request_payload["sync"] = $sync; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/acs/access_groups/remove_user", + "/locks/unlock_door", json: $request_payload, - + inner_object: "action_attempt", ); + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res); + } + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt_id + ); + return $action_attempt; - - } - -} - -class AcsClient -{ - private SeamClient $seam; - public AcsAccessGroupsClient $access_groups; - public AcsCredentialPoolsClient $credential_pools; - public AcsCredentialProvisioningAutomationsClient $credential_provisioning_automations; - public AcsCredentialsClient $credentials; - public AcsEntrancesClient $entrances; - public AcsSystemsClient $systems; - public AcsUsersClient $users; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->access_groups = new AcsAccessGroupsClient($seam); -$this->credential_pools = new AcsCredentialPoolsClient($seam); -$this->credential_provisioning_automations = new AcsCredentialProvisioningAutomationsClient($seam); -$this->credentials = new AcsCredentialsClient($seam); -$this->entrances = new AcsEntrancesClient($seam); -$this->systems = new AcsSystemsClient($seam); -$this->users = new AcsUsersClient($seam); } - } -class AcsCredentialPoolsClient +class NetworksClient { private SeamClient $seam; @@ -3152,84 +3028,53 @@ public function __construct(SeamClient $seam) } - public function list( - string $acs_system_id - ): array { + public function get( + string $network_id + ): Network { $request_payload = []; - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; + if ($network_id !== null) { + $request_payload["network_id"] = $network_id; } $res = $this->seam->request( "POST", - "/acs/credential_pools/list", + "/networks/get", json: $request_payload, - inner_object: "acs_credential_pools", + inner_object: "network", ); - return array_map(fn ($r) => AcsCredentialPool::from_json($r), $res); + return Network::from_json($res); } -} - -class AcsCredentialProvisioningAutomationsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; + public function list( - } - - - public function launch( - string $user_identity_id, - string $credential_manager_acs_system_id, - string $acs_credential_pool_id = null, - bool $create_credential_manager_user = null, - string $credential_manager_acs_user_id = null - ): AcsCredentialProvisioningAutomation { + ): array { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($credential_manager_acs_system_id !== null) { - $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; - } - if ($acs_credential_pool_id !== null) { - $request_payload["acs_credential_pool_id"] = $acs_credential_pool_id; - } - if ($create_credential_manager_user !== null) { - $request_payload["create_credential_manager_user"] = $create_credential_manager_user; - } - if ($credential_manager_acs_user_id !== null) { - $request_payload["credential_manager_acs_user_id"] = $credential_manager_acs_user_id; - } + $res = $this->seam->request( "POST", - "/acs/credential_provisioning_automations/launch", + "/networks/list", json: $request_payload, - inner_object: "acs_credential_provisioning_automation", + inner_object: "networks", ); - return AcsCredentialProvisioningAutomation::from_json($res); + return array_map(fn ($r) => Network::from_json($r), $res); } } -class AcsCredentialsClient +class NoiseSensorsNoiseThresholdsClient { private SeamClient $seam; @@ -3240,100 +3085,73 @@ public function __construct(SeamClient $seam) } - public function assign( - string $acs_user_id, - string $acs_credential_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; - } - - $this->seam->request( - "POST", - "/acs/credentials/assign", - json: $request_payload, - - ); - - - - - - - } - public function create( - string $acs_user_id, - string $access_method, - string $credential_manager_acs_system_id = null, - string $code = null, - bool $is_multi_phone_sync_credential = null, - array $allowed_acs_entrance_ids = null, - mixed $visionline_metadata = null, - string $starts_at = null, - string $ends_at = null - ): AcsCredential { + string $device_id, + string $ends_daily_at, + string $starts_daily_at, + string $name = null, + int $noise_threshold_decibels = null, + int $noise_threshold_nrs = null, + bool $sync = null + ): NoiseThreshold { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($access_method !== null) { - $request_payload["access_method"] = $access_method; - } - if ($credential_manager_acs_system_id !== null) { - $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($code !== null) { - $request_payload["code"] = $code; + if ($ends_daily_at !== null) { + $request_payload["ends_daily_at"] = $ends_daily_at; } - if ($is_multi_phone_sync_credential !== null) { - $request_payload["is_multi_phone_sync_credential"] = $is_multi_phone_sync_credential; + if ($starts_daily_at !== null) { + $request_payload["starts_daily_at"] = $starts_daily_at; } - if ($allowed_acs_entrance_ids !== null) { - $request_payload["allowed_acs_entrance_ids"] = $allowed_acs_entrance_ids; + if ($name !== null) { + $request_payload["name"] = $name; } - if ($visionline_metadata !== null) { - $request_payload["visionline_metadata"] = $visionline_metadata; + if ($noise_threshold_decibels !== null) { + $request_payload["noise_threshold_decibels"] = $noise_threshold_decibels; } - if ($starts_at !== null) { - $request_payload["starts_at"] = $starts_at; + if ($noise_threshold_nrs !== null) { + $request_payload["noise_threshold_nrs"] = $noise_threshold_nrs; } - if ($ends_at !== null) { - $request_payload["ends_at"] = $ends_at; + if ($sync !== null) { + $request_payload["sync"] = $sync; } $res = $this->seam->request( "POST", - "/acs/credentials/create", + "/noise_sensors/noise_thresholds/create", json: $request_payload, - inner_object: "acs_credential", + inner_object: "noise_threshold", ); - return AcsCredential::from_json($res); + return NoiseThreshold::from_json($res); } public function delete( - string $acs_credential_id + string $device_id, + string $noise_threshold_id, + bool $sync = null ): void { $request_payload = []; - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($noise_threshold_id !== null) { + $request_payload["noise_threshold_id"] = $noise_threshold_id; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } $this->seam->request( "POST", - "/acs/credentials/delete", + "/noise_sensors/noise_thresholds/delete", json: $request_payload, ); @@ -3346,106 +3164,95 @@ public function delete( } public function get( - string $acs_credential_id - ): AcsCredential { - $request_payload = []; - - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; - } - - $res = $this->seam->request( - "POST", - "/acs/credentials/get", - json: $request_payload, - inner_object: "acs_credential", - ); - - - - - - return AcsCredential::from_json($res); - } - - public function list( - string $acs_user_id = null, - string $acs_system_id = null, - string $user_identity_id = null, - bool $is_multi_phone_sync_credential = null - ): array { + string $noise_threshold_id + ): NoiseThreshold { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; - } - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($is_multi_phone_sync_credential !== null) { - $request_payload["is_multi_phone_sync_credential"] = $is_multi_phone_sync_credential; + if ($noise_threshold_id !== null) { + $request_payload["noise_threshold_id"] = $noise_threshold_id; } $res = $this->seam->request( "POST", - "/acs/credentials/list", + "/noise_sensors/noise_thresholds/get", json: $request_payload, - inner_object: "acs_credentials", + inner_object: "noise_threshold", ); - return array_map(fn ($r) => AcsCredential::from_json($r), $res); + return NoiseThreshold::from_json($res); } - public function unassign( - string $acs_user_id, - string $acs_credential_id - ): void { + public function list( + string $device_id, + bool $is_programmed = null + ): array { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; + if ($is_programmed !== null) { + $request_payload["is_programmed"] = $is_programmed; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/acs/credentials/unassign", + "/noise_sensors/noise_thresholds/list", json: $request_payload, - + inner_object: "noise_thresholds", ); - + return array_map(fn ($r) => NoiseThreshold::from_json($r), $res); } public function update( - string $acs_credential_id, - string $code + string $device_id, + string $noise_threshold_id, + string $ends_daily_at = null, + string $name = null, + int $noise_threshold_decibels = null, + int $noise_threshold_nrs = null, + string $starts_daily_at = null, + bool $sync = null ): void { $request_payload = []; - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($code !== null) { - $request_payload["code"] = $code; + if ($noise_threshold_id !== null) { + $request_payload["noise_threshold_id"] = $noise_threshold_id; + } + if ($ends_daily_at !== null) { + $request_payload["ends_daily_at"] = $ends_daily_at; + } + if ($name !== null) { + $request_payload["name"] = $name; + } + if ($noise_threshold_decibels !== null) { + $request_payload["noise_threshold_decibels"] = $noise_threshold_decibels; + } + if ($noise_threshold_nrs !== null) { + $request_payload["noise_threshold_nrs"] = $noise_threshold_nrs; + } + if ($starts_daily_at !== null) { + $request_payload["starts_daily_at"] = $starts_daily_at; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } $this->seam->request( "POST", - "/acs/credentials/update", + "/noise_sensors/noise_thresholds/update", json: $request_payload, ); @@ -3459,7 +3266,22 @@ public function update( } -class AcsEntrancesClient +class NoiseSensorsClient +{ + private SeamClient $seam; + public NoiseSensorsNoiseThresholdsClient $noise_thresholds; + public NoiseSensorsSimulateClient $simulate; + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + $this->noise_thresholds = new NoiseSensorsNoiseThresholdsClient($seam); +$this->simulate = new NoiseSensorsSimulateClient($seam); + } + + +} + +class NoiseSensorsSimulateClient { private SeamClient $seam; @@ -3470,45 +3292,54 @@ public function __construct(SeamClient $seam) } - public function get( - string $acs_entrance_id - ): AcsEntrance { + public function trigger_noise_threshold( + string $device_id + ): void { $request_payload = []; - if ($acs_entrance_id !== null) { - $request_payload["acs_entrance_id"] = $acs_entrance_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/acs/entrances/get", + "/noise_sensors/simulate/trigger_noise_threshold", json: $request_payload, - inner_object: "acs_entrance", + ); - return AcsEntrance::from_json($res); + } - public function grant_access( - string $acs_entrance_id, - string $acs_user_id +} + +class PhonesClient +{ + private SeamClient $seam; + public PhonesSimulateClient $simulate; + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + $this->simulate = new PhonesSimulateClient($seam); + } + + + public function deactivate( + string $device_id ): void { $request_payload = []; - if ($acs_entrance_id !== null) { - $request_payload["acs_entrance_id"] = $acs_entrance_id; - } - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } $this->seam->request( "POST", - "/acs/entrances/grant_access", + "/phones/deactivate", json: $request_payload, ); @@ -3521,221 +3352,297 @@ public function grant_access( } public function list( - string $acs_system_id = null, - string $acs_credential_id = null + string $owner_user_identity_id = null ): array { $request_payload = []; - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; + if ($owner_user_identity_id !== null) { + $request_payload["owner_user_identity_id"] = $owner_user_identity_id; } - if ($acs_credential_id !== null) { - $request_payload["acs_credential_id"] = $acs_credential_id; + + $res = $this->seam->request( + "POST", + "/phones/list", + json: $request_payload, + inner_object: "phones", + ); + + + + + + return array_map(fn ($r) => Phone::from_json($r), $res); + } + +} + +class PhonesSimulateClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + + } + + + public function create_sandbox_phone( + string $user_identity_id, + mixed $assa_abloy_metadata = null, + string $custom_sdk_installation_id = null, + mixed $phone_metadata = null + ): Phone { + $request_payload = []; + + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } + if ($assa_abloy_metadata !== null) { + $request_payload["assa_abloy_metadata"] = $assa_abloy_metadata; + } + if ($custom_sdk_installation_id !== null) { + $request_payload["custom_sdk_installation_id"] = $custom_sdk_installation_id; + } + if ($phone_metadata !== null) { + $request_payload["phone_metadata"] = $phone_metadata; } $res = $this->seam->request( "POST", - "/acs/entrances/list", + "/phones/simulate/create_sandbox_phone", json: $request_payload, - inner_object: "acs_entrances", + inner_object: "phone", ); - return array_map(fn ($r) => AcsEntrance::from_json($r), $res); + return Phone::from_json($res); } - public function list_credentials_with_access( - string $acs_entrance_id, - array $include_if = null - ): array { +} + +class ThermostatsClimateSettingSchedulesClient +{ + private SeamClient $seam; + + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + + } + + + public function create( + string $device_id, + string $schedule_ends_at, + string $schedule_starts_at, + bool $automatic_cooling_enabled = null, + bool $automatic_heating_enabled = null, + int $cooling_set_point_celsius = null, + int $cooling_set_point_fahrenheit = null, + int $heating_set_point_celsius = null, + int $heating_set_point_fahrenheit = null, + string $hvac_mode_setting = null, + bool $manual_override_allowed = null, + string $name = null, + string $schedule_type = null + ): ClimateSettingSchedule { $request_payload = []; - if ($acs_entrance_id !== null) { - $request_payload["acs_entrance_id"] = $acs_entrance_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($schedule_ends_at !== null) { + $request_payload["schedule_ends_at"] = $schedule_ends_at; + } + if ($schedule_starts_at !== null) { + $request_payload["schedule_starts_at"] = $schedule_starts_at; + } + if ($automatic_cooling_enabled !== null) { + $request_payload["automatic_cooling_enabled"] = $automatic_cooling_enabled; + } + if ($automatic_heating_enabled !== null) { + $request_payload["automatic_heating_enabled"] = $automatic_heating_enabled; + } + if ($cooling_set_point_celsius !== null) { + $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; + } + if ($cooling_set_point_fahrenheit !== null) { + $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; + } + if ($heating_set_point_celsius !== null) { + $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; + } + if ($heating_set_point_fahrenheit !== null) { + $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; + } + if ($hvac_mode_setting !== null) { + $request_payload["hvac_mode_setting"] = $hvac_mode_setting; + } + if ($manual_override_allowed !== null) { + $request_payload["manual_override_allowed"] = $manual_override_allowed; + } + if ($name !== null) { + $request_payload["name"] = $name; } - if ($include_if !== null) { - $request_payload["include_if"] = $include_if; + if ($schedule_type !== null) { + $request_payload["schedule_type"] = $schedule_type; } $res = $this->seam->request( "POST", - "/acs/entrances/list_credentials_with_access", + "/thermostats/climate_setting_schedules/create", json: $request_payload, - inner_object: "acs_credentials", + inner_object: "climate_setting_schedule", ); - return array_map(fn ($r) => AcsCredential::from_json($r), $res); - } - -} - -class AcsSystemsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - + return ClimateSettingSchedule::from_json($res); } - - public function get( - string $acs_system_id - ): AcsSystem { + public function delete( + string $climate_setting_schedule_id + ): void { $request_payload = []; - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; + if ($climate_setting_schedule_id !== null) { + $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/acs/systems/get", + "/thermostats/climate_setting_schedules/delete", json: $request_payload, - inner_object: "acs_system", + ); - return AcsSystem::from_json($res); + } - public function list( - string $connected_account_id = null - ): array { + public function get( + string $climate_setting_schedule_id = null, + string $device_id = null + ): ClimateSettingSchedule { $request_payload = []; - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; + if ($climate_setting_schedule_id !== null) { + $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; + } + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } $res = $this->seam->request( "POST", - "/acs/systems/list", + "/thermostats/climate_setting_schedules/get", json: $request_payload, - inner_object: "acs_systems", + inner_object: "climate_setting_schedule", ); - return array_map(fn ($r) => AcsSystem::from_json($r), $res); - } - -} - -class AcsUsersClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - + return ClimateSettingSchedule::from_json($res); } - - public function add_to_access_group( - string $acs_user_id, - string $acs_access_group_id - ): void { + public function list( + string $device_id, + string $user_identifier_key = null + ): array { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/acs/users/add_to_access_group", + "/thermostats/climate_setting_schedules/list", json: $request_payload, - + inner_object: "climate_setting_schedules", ); - + return array_map(fn ($r) => ClimateSettingSchedule::from_json($r), $res); } - public function create( - string $acs_system_id, - array $acs_access_group_ids = null, - string $user_identity_id = null, - mixed $access_schedule = null, - string $full_name = null, - string $email = null, - string $phone_number = null, - string $email_address = null - ): AcsUser { + public function update( + string $climate_setting_schedule_id, + bool $automatic_cooling_enabled = null, + bool $automatic_heating_enabled = null, + int $cooling_set_point_celsius = null, + int $cooling_set_point_fahrenheit = null, + int $heating_set_point_celsius = null, + int $heating_set_point_fahrenheit = null, + string $hvac_mode_setting = null, + bool $manual_override_allowed = null, + string $name = null, + string $schedule_ends_at = null, + string $schedule_starts_at = null, + string $schedule_type = null + ): void { $request_payload = []; - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; + if ($climate_setting_schedule_id !== null) { + $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; } - if ($acs_access_group_ids !== null) { - $request_payload["acs_access_group_ids"] = $acs_access_group_ids; + if ($automatic_cooling_enabled !== null) { + $request_payload["automatic_cooling_enabled"] = $automatic_cooling_enabled; } - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; + if ($automatic_heating_enabled !== null) { + $request_payload["automatic_heating_enabled"] = $automatic_heating_enabled; } - if ($access_schedule !== null) { - $request_payload["access_schedule"] = $access_schedule; + if ($cooling_set_point_celsius !== null) { + $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; + if ($cooling_set_point_fahrenheit !== null) { + $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; } - if ($email !== null) { - $request_payload["email"] = $email; + if ($heating_set_point_celsius !== null) { + $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; } - if ($phone_number !== null) { - $request_payload["phone_number"] = $phone_number; + if ($heating_set_point_fahrenheit !== null) { + $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; } - if ($email_address !== null) { - $request_payload["email_address"] = $email_address; + if ($hvac_mode_setting !== null) { + $request_payload["hvac_mode_setting"] = $hvac_mode_setting; } - - $res = $this->seam->request( - "POST", - "/acs/users/create", - json: $request_payload, - inner_object: "acs_user", - ); - - - - - - return AcsUser::from_json($res); - } - - public function delete( - string $acs_user_id - ): void { - $request_payload = []; - - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($manual_override_allowed !== null) { + $request_payload["manual_override_allowed"] = $manual_override_allowed; + } + if ($name !== null) { + $request_payload["name"] = $name; + } + if ($schedule_ends_at !== null) { + $request_payload["schedule_ends_at"] = $schedule_ends_at; + } + if ($schedule_starts_at !== null) { + $request_payload["schedule_starts_at"] = $schedule_starts_at; + } + if ($schedule_type !== null) { + $request_payload["schedule_type"] = $schedule_type; } $this->seam->request( "POST", - "/acs/users/delete", + "/thermostats/climate_setting_schedules/update", json: $request_payload, ); @@ -3747,219 +3654,343 @@ public function delete( } - public function get( - string $acs_user_id - ): AcsUser { +} + +class ThermostatsClient +{ + private SeamClient $seam; + public ThermostatsClimateSettingSchedulesClient $climate_setting_schedules; + public function __construct(SeamClient $seam) + { + $this->seam = $seam; + $this->climate_setting_schedules = new ThermostatsClimateSettingSchedulesClient($seam); + } + + + public function cool( + string $device_id, + int $cooling_set_point_celsius = null, + int $cooling_set_point_fahrenheit = null, + bool $sync = null, + bool $wait_for_action_attempt = true + ): ActionAttempt { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($cooling_set_point_celsius !== null) { + $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; + } + if ($cooling_set_point_fahrenheit !== null) { + $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } $res = $this->seam->request( "POST", - "/acs/users/get", + "/thermostats/cool", json: $request_payload, - inner_object: "acs_user", + inner_object: "action_attempt", ); + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res); + } + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt_id + ); + return $action_attempt; - return AcsUser::from_json($res); } - public function list( - string $user_identity_id = null, - string $user_identity_phone_number = null, - string $user_identity_email_address = null, - string $acs_system_id = null - ): array { - $request_payload = []; - - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($user_identity_phone_number !== null) { - $request_payload["user_identity_phone_number"] = $user_identity_phone_number; - } - if ($user_identity_email_address !== null) { - $request_payload["user_identity_email_address"] = $user_identity_email_address; + public function get( + string $device_id = null, + string $name = null + ): Device { + $request_payload = []; + + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($acs_system_id !== null) { - $request_payload["acs_system_id"] = $acs_system_id; + if ($name !== null) { + $request_payload["name"] = $name; } $res = $this->seam->request( "POST", - "/acs/users/list", + "/thermostats/get", json: $request_payload, - inner_object: "acs_users", + inner_object: "thermostat", ); - return array_map(fn ($r) => AcsUser::from_json($r), $res); + return Device::from_json($res); } - public function list_accessible_entrances( - string $acs_user_id - ): array { + public function heat( + string $device_id, + int $heating_set_point_celsius = null, + int $heating_set_point_fahrenheit = null, + bool $sync = null, + bool $wait_for_action_attempt = true + ): ActionAttempt { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($heating_set_point_celsius !== null) { + $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; + } + if ($heating_set_point_fahrenheit !== null) { + $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } $res = $this->seam->request( "POST", - "/acs/users/list_accessible_entrances", + "/thermostats/heat", json: $request_payload, - inner_object: "acs_entrances", + inner_object: "action_attempt", ); + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res); + } + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt_id + ); + return $action_attempt; - return array_map(fn ($r) => AcsEntrance::from_json($r), $res); } - public function remove_from_access_group( - string $acs_user_id, - string $acs_access_group_id - ): void { + public function heat_cool( + string $device_id, + int $cooling_set_point_celsius = null, + int $cooling_set_point_fahrenheit = null, + int $heating_set_point_celsius = null, + int $heating_set_point_fahrenheit = null, + bool $sync = null, + bool $wait_for_action_attempt = true + ): ActionAttempt { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } - if ($acs_access_group_id !== null) { - $request_payload["acs_access_group_id"] = $acs_access_group_id; + if ($cooling_set_point_celsius !== null) { + $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; + } + if ($cooling_set_point_fahrenheit !== null) { + $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; + } + if ($heating_set_point_celsius !== null) { + $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; + } + if ($heating_set_point_fahrenheit !== null) { + $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/acs/users/remove_from_access_group", + "/thermostats/heat_cool", json: $request_payload, - + inner_object: "action_attempt", ); + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res); + } + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt_id + ); - + return $action_attempt; } - public function revoke_access_to_all_entrances( - string $acs_user_id - ): void { + public function list( + string $connect_webview_id = null, + string $connected_account_id = null, + array $connected_account_ids = null, + string $created_before = null, + mixed $custom_metadata_has = null, + array $device_ids = null, + string $device_type = null, + array $device_types = null, + array $exclude_if = null, + array $include_if = null, + int $limit = null, + string $manufacturer = null, + string $user_identifier_key = null + ): array { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($connect_webview_id !== null) { + $request_payload["connect_webview_id"] = $connect_webview_id; + } + if ($connected_account_id !== null) { + $request_payload["connected_account_id"] = $connected_account_id; + } + if ($connected_account_ids !== null) { + $request_payload["connected_account_ids"] = $connected_account_ids; + } + if ($created_before !== null) { + $request_payload["created_before"] = $created_before; + } + if ($custom_metadata_has !== null) { + $request_payload["custom_metadata_has"] = $custom_metadata_has; + } + if ($device_ids !== null) { + $request_payload["device_ids"] = $device_ids; + } + if ($device_type !== null) { + $request_payload["device_type"] = $device_type; + } + if ($device_types !== null) { + $request_payload["device_types"] = $device_types; + } + if ($exclude_if !== null) { + $request_payload["exclude_if"] = $exclude_if; + } + if ($include_if !== null) { + $request_payload["include_if"] = $include_if; + } + if ($limit !== null) { + $request_payload["limit"] = $limit; + } + if ($manufacturer !== null) { + $request_payload["manufacturer"] = $manufacturer; + } + if ($user_identifier_key !== null) { + $request_payload["user_identifier_key"] = $user_identifier_key; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/acs/users/revoke_access_to_all_entrances", + "/thermostats/list", json: $request_payload, - + inner_object: "thermostats", ); - + return array_map(fn ($r) => Device::from_json($r), $res); } - public function suspend( - string $acs_user_id - ): void { + public function off( + string $device_id, + bool $sync = null, + bool $wait_for_action_attempt = true + ): ActionAttempt { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/acs/users/suspend", + "/thermostats/off", json: $request_payload, - + inner_object: "action_attempt", ); + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res); + } + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt_id + ); - + return $action_attempt; } - public function unsuspend( - string $acs_user_id - ): void { + public function set_fan_mode( + string $device_id, + string $fan_mode = null, + string $fan_mode_setting = null, + bool $sync = null, + bool $wait_for_action_attempt = true + ): ActionAttempt { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($fan_mode !== null) { + $request_payload["fan_mode"] = $fan_mode; + } + if ($fan_mode_setting !== null) { + $request_payload["fan_mode_setting"] = $fan_mode_setting; + } + if ($sync !== null) { + $request_payload["sync"] = $sync; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/acs/users/unsuspend", + "/thermostats/set_fan_mode", json: $request_payload, - + inner_object: "action_attempt", ); + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res); + } + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt_id + ); - + return $action_attempt; } public function update( - string $acs_user_id, - mixed $access_schedule = null, - string $full_name = null, - string $email = null, - string $phone_number = null, - string $email_address = null, - string $hid_acs_system_id = null + mixed $default_climate_setting, + string $device_id ): void { $request_payload = []; - if ($acs_user_id !== null) { - $request_payload["acs_user_id"] = $acs_user_id; - } - if ($access_schedule !== null) { - $request_payload["access_schedule"] = $access_schedule; - } - if ($full_name !== null) { - $request_payload["full_name"] = $full_name; - } - if ($email !== null) { - $request_payload["email"] = $email; - } - if ($phone_number !== null) { - $request_payload["phone_number"] = $phone_number; - } - if ($email_address !== null) { - $request_payload["email_address"] = $email_address; + if ($default_climate_setting !== null) { + $request_payload["default_climate_setting"] = $default_climate_setting; } - if ($hid_acs_system_id !== null) { - $request_payload["hid_acs_system_id"] = $hid_acs_system_id; + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; } $this->seam->request( "POST", - "/acs/users/update", + "/thermostats/update", json: $request_payload, ); @@ -3973,29 +4004,33 @@ public function update( } -class DevicesSimulateClient +class UserIdentitiesClient { private SeamClient $seam; - + public UserIdentitiesEnrollmentAutomationsClient $enrollment_automations; public function __construct(SeamClient $seam) { $this->seam = $seam; - + $this->enrollment_automations = new UserIdentitiesEnrollmentAutomationsClient($seam); } - public function remove( - string $device_id + public function add_acs_user( + string $acs_user_id, + string $user_identity_id ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; + } + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } $this->seam->request( "POST", - "/devices/simulate/remove", + "/user_identities/add_acs_user", json: $request_payload, ); @@ -4007,133 +4042,107 @@ public function remove( } -} - -class DevicesUnmanagedClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function get( - string $device_id = null, - string $name = null - ): UnmanagedDevice { + public function create( + string $email_address = null, + string $full_name = null, + string $phone_number = null, + string $user_identity_key = null + ): UserIdentity { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($email_address !== null) { + $request_payload["email_address"] = $email_address; } - if ($name !== null) { - $request_payload["name"] = $name; + if ($full_name !== null) { + $request_payload["full_name"] = $full_name; + } + if ($phone_number !== null) { + $request_payload["phone_number"] = $phone_number; + } + if ($user_identity_key !== null) { + $request_payload["user_identity_key"] = $user_identity_key; } $res = $this->seam->request( "POST", - "/devices/unmanaged/get", + "/user_identities/create", json: $request_payload, - inner_object: "device", + inner_object: "user_identity", ); - return UnmanagedDevice::from_json($res); + return UserIdentity::from_json($res); } - public function list( - string $connected_account_id = null, - array $connected_account_ids = null, - string $connect_webview_id = null, - string $device_type = null, - array $device_types = null, - string $manufacturer = null, - array $device_ids = null, - int $limit = null, - string $created_before = null, - string $user_identifier_key = null, - mixed $custom_metadata_has = null, - array $include_if = null, - array $exclude_if = null - ): array { + public function delete( + string $user_identity_id + ): void { $request_payload = []; - if ($connected_account_id !== null) { - $request_payload["connected_account_id"] = $connected_account_id; - } - if ($connected_account_ids !== null) { - $request_payload["connected_account_ids"] = $connected_account_ids; - } - if ($connect_webview_id !== null) { - $request_payload["connect_webview_id"] = $connect_webview_id; - } - if ($device_type !== null) { - $request_payload["device_type"] = $device_type; - } - if ($device_types !== null) { - $request_payload["device_types"] = $device_types; - } - if ($manufacturer !== null) { - $request_payload["manufacturer"] = $manufacturer; - } - if ($device_ids !== null) { - $request_payload["device_ids"] = $device_ids; - } - if ($limit !== null) { - $request_payload["limit"] = $limit; - } - if ($created_before !== null) { - $request_payload["created_before"] = $created_before; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } - if ($custom_metadata_has !== null) { - $request_payload["custom_metadata_has"] = $custom_metadata_has; + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } - if ($include_if !== null) { - $request_payload["include_if"] = $include_if; + + $this->seam->request( + "POST", + "/user_identities/delete", + json: $request_payload, + + ); + + + + + + + } + + public function get( + string $user_identity_id = null, + string $user_identity_key = null + ): UserIdentity { + $request_payload = []; + + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } - if ($exclude_if !== null) { - $request_payload["exclude_if"] = $exclude_if; + if ($user_identity_key !== null) { + $request_payload["user_identity_key"] = $user_identity_key; } $res = $this->seam->request( "POST", - "/devices/unmanaged/list", + "/user_identities/get", json: $request_payload, - inner_object: "devices", + inner_object: "user_identity", ); - return array_map(fn ($r) => UnmanagedDevice::from_json($r), $res); + return UserIdentity::from_json($res); } - public function update( + public function grant_access_to_device( string $device_id, - bool $is_managed + string $user_identity_id ): void { $request_payload = []; if ($device_id !== null) { $request_payload["device_id"] = $device_id; } - if ($is_managed !== null) { - $request_payload["is_managed"] = $is_managed; + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } $this->seam->request( "POST", - "/devices/unmanaged/update", + "/user_identities/grant_access_to_device", json: $request_payload, ); @@ -4145,266 +4154,194 @@ public function update( } -} - -class HealthServiceClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } - - - public function by_service_name( - string $service_name - ): void { + public function list( + string $credential_manager_acs_system_id = null + ): array { $request_payload = []; - if ($service_name !== null) { - $request_payload["service_name"] = $service_name; + if ($credential_manager_acs_system_id !== null) { + $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/health/service/[service_name]", + "/user_identities/list", json: $request_payload, - + inner_object: "user_identities", ); - + return array_map(fn ($r) => UserIdentity::from_json($r), $res); } -} + public function list_accessible_devices( + string $user_identity_id + ): array { + $request_payload = []; -class NoiseSensorsNoiseThresholdsClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } + + $res = $this->seam->request( + "POST", + "/user_identities/list_accessible_devices", + json: $request_payload, + inner_object: "devices", + ); - public function create( - string $device_id, - string $starts_daily_at, - string $ends_daily_at, - bool $sync = null, - string $name = null, - int $noise_threshold_decibels = null, - int $noise_threshold_nrs = null - ): NoiseThreshold { + + + + return array_map(fn ($r) => Device::from_json($r), $res); + } + + public function list_acs_systems( + string $user_identity_id + ): array { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($starts_daily_at !== null) { - $request_payload["starts_daily_at"] = $starts_daily_at; - } - if ($ends_daily_at !== null) { - $request_payload["ends_daily_at"] = $ends_daily_at; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($noise_threshold_decibels !== null) { - $request_payload["noise_threshold_decibels"] = $noise_threshold_decibels; - } - if ($noise_threshold_nrs !== null) { - $request_payload["noise_threshold_nrs"] = $noise_threshold_nrs; + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } $res = $this->seam->request( "POST", - "/noise_sensors/noise_thresholds/create", + "/user_identities/list_acs_systems", json: $request_payload, - inner_object: "noise_threshold", + inner_object: "acs_systems", ); - return NoiseThreshold::from_json($res); + return array_map(fn ($r) => AcsSystem::from_json($r), $res); } - public function delete( - string $noise_threshold_id, - string $device_id, - bool $sync = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + public function list_acs_users( + string $user_identity_id + ): array { $request_payload = []; - if ($noise_threshold_id !== null) { - $request_payload["noise_threshold_id"] = $noise_threshold_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } $res = $this->seam->request( "POST", - "/noise_sensors/noise_thresholds/delete", + "/user_identities/list_acs_users", json: $request_payload, - inner_object: "action_attempt", + inner_object: "acs_users", ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; + return array_map(fn ($r) => AcsUser::from_json($r), $res); } - public function get( - string $noise_threshold_id - ): NoiseThreshold { + public function remove_acs_user( + string $acs_user_id, + string $user_identity_id + ): void { $request_payload = []; - if ($noise_threshold_id !== null) { - $request_payload["noise_threshold_id"] = $noise_threshold_id; + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; + } + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/noise_sensors/noise_thresholds/get", + "/user_identities/remove_acs_user", json: $request_payload, - inner_object: "noise_threshold", + ); - return NoiseThreshold::from_json($res); + } - public function list( + public function revoke_access_to_device( string $device_id, - bool $is_programmed = null - ): array { + string $user_identity_id + ): void { $request_payload = []; if ($device_id !== null) { $request_payload["device_id"] = $device_id; } - if ($is_programmed !== null) { - $request_payload["is_programmed"] = $is_programmed; + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/noise_sensors/noise_thresholds/list", + "/user_identities/revoke_access_to_device", json: $request_payload, - inner_object: "noise_thresholds", + ); - return array_map(fn ($r) => NoiseThreshold::from_json($r), $res); + } public function update( - string $noise_threshold_id, - string $device_id, - bool $sync = null, - string $name = null, - string $starts_daily_at = null, - string $ends_daily_at = null, - int $noise_threshold_decibels = null, - int $noise_threshold_nrs = null, - bool $wait_for_action_attempt = true - ): ActionAttempt { + string $user_identity_id, + string $email_address = null, + string $full_name = null, + string $phone_number = null, + string $user_identity_key = null + ): void { $request_payload = []; - if ($noise_threshold_id !== null) { - $request_payload["noise_threshold_id"] = $noise_threshold_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($sync !== null) { - $request_payload["sync"] = $sync; - } - if ($name !== null) { - $request_payload["name"] = $name; + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } - if ($starts_daily_at !== null) { - $request_payload["starts_daily_at"] = $starts_daily_at; + if ($email_address !== null) { + $request_payload["email_address"] = $email_address; } - if ($ends_daily_at !== null) { - $request_payload["ends_daily_at"] = $ends_daily_at; + if ($full_name !== null) { + $request_payload["full_name"] = $full_name; } - if ($noise_threshold_decibels !== null) { - $request_payload["noise_threshold_decibels"] = $noise_threshold_decibels; + if ($phone_number !== null) { + $request_payload["phone_number"] = $phone_number; } - if ($noise_threshold_nrs !== null) { - $request_payload["noise_threshold_nrs"] = $noise_threshold_nrs; + if ($user_identity_key !== null) { + $request_payload["user_identity_key"] = $user_identity_key; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/noise_sensors/noise_thresholds/update", + "/user_identities/update", json: $request_payload, - inner_object: "action_attempt", + ); - if (!$wait_for_action_attempt) { - return ActionAttempt::from_json($res); - } - - $action_attempt = $this->seam->action_attempts->poll_until_ready( - $res->action_attempt_id - ); - return $action_attempt; - } -} -class NoiseSensorsClient -{ - private SeamClient $seam; - public NoiseSensorsNoiseThresholdsClient $noise_thresholds; - public NoiseSensorsSimulateClient $simulate; - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - $this->noise_thresholds = new NoiseSensorsNoiseThresholdsClient($seam); -$this->simulate = new NoiseSensorsSimulateClient($seam); } - } -class NoiseSensorsSimulateClient +class UserIdentitiesEnrollmentAutomationsClient { private SeamClient $seam; @@ -4415,18 +4352,18 @@ public function __construct(SeamClient $seam) } - public function trigger_noise_threshold( - string $device_id + public function delete( + string $enrollment_automation_id ): void { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($enrollment_automation_id !== null) { + $request_payload["enrollment_automation_id"] = $enrollment_automation_id; } $this->seam->request( "POST", - "/noise_sensors/simulate/trigger_noise_threshold", + "/user_identities/enrollment_automations/delete", json: $request_payload, ); @@ -4438,57 +4375,94 @@ public function trigger_noise_threshold( } -} + public function get( + string $enrollment_automation_id + ): EnrollmentAutomation { + $request_payload = []; -class PhonesSimulateClient -{ - private SeamClient $seam; - - public function __construct(SeamClient $seam) - { - $this->seam = $seam; - - } + if ($enrollment_automation_id !== null) { + $request_payload["enrollment_automation_id"] = $enrollment_automation_id; + } + + $res = $this->seam->request( + "POST", + "/user_identities/enrollment_automations/get", + json: $request_payload, + inner_object: "enrollment_automation", + ); - public function create_sandbox_phone( + + + + return EnrollmentAutomation::from_json($res); + } + + public function launch( + string $credential_manager_acs_system_id, string $user_identity_id, - string $custom_sdk_installation_id = null, - mixed $phone_metadata = null, - mixed $assa_abloy_metadata = null - ): Phone { + string $acs_credential_pool_id = null, + bool $create_credential_manager_user = null, + string $credential_manager_acs_user_id = null + ): void { $request_payload = []; + if ($credential_manager_acs_system_id !== null) { + $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; + } if ($user_identity_id !== null) { $request_payload["user_identity_id"] = $user_identity_id; } - if ($custom_sdk_installation_id !== null) { - $request_payload["custom_sdk_installation_id"] = $custom_sdk_installation_id; + if ($acs_credential_pool_id !== null) { + $request_payload["acs_credential_pool_id"] = $acs_credential_pool_id; } - if ($phone_metadata !== null) { - $request_payload["phone_metadata"] = $phone_metadata; + if ($create_credential_manager_user !== null) { + $request_payload["create_credential_manager_user"] = $create_credential_manager_user; } - if ($assa_abloy_metadata !== null) { - $request_payload["assa_abloy_metadata"] = $assa_abloy_metadata; + if ($credential_manager_acs_user_id !== null) { + $request_payload["credential_manager_acs_user_id"] = $credential_manager_acs_user_id; + } + + $this->seam->request( + "POST", + "/user_identities/enrollment_automations/launch", + json: $request_payload, + inner_object: "enrollment_automation", + ); + + + + + + + } + + public function list( + string $user_identity_id + ): array { + $request_payload = []; + + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; } $res = $this->seam->request( "POST", - "/phones/simulate/create_sandbox_phone", + "/user_identities/enrollment_automations/list", json: $request_payload, - inner_object: "phone", + inner_object: "enrollment_automations", ); - return Phone::from_json($res); + return array_map(fn ($r) => EnrollmentAutomation::from_json($r), $res); } } -class ThermostatsClimateSettingSchedulesClient +class WebhooksClient { private SeamClient $seam; @@ -4500,88 +4474,44 @@ public function __construct(SeamClient $seam) public function create( - string $device_id, - string $schedule_starts_at, - string $schedule_ends_at, - string $schedule_type = null, - string $name = null, - bool $automatic_heating_enabled = null, - bool $automatic_cooling_enabled = null, - string $hvac_mode_setting = null, - int $cooling_set_point_celsius = null, - int $heating_set_point_celsius = null, - int $cooling_set_point_fahrenheit = null, - int $heating_set_point_fahrenheit = null, - bool $manual_override_allowed = null - ): ClimateSettingSchedule { + string $url, + array $event_types = null + ): Webhook { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($schedule_starts_at !== null) { - $request_payload["schedule_starts_at"] = $schedule_starts_at; - } - if ($schedule_ends_at !== null) { - $request_payload["schedule_ends_at"] = $schedule_ends_at; - } - if ($schedule_type !== null) { - $request_payload["schedule_type"] = $schedule_type; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($automatic_heating_enabled !== null) { - $request_payload["automatic_heating_enabled"] = $automatic_heating_enabled; - } - if ($automatic_cooling_enabled !== null) { - $request_payload["automatic_cooling_enabled"] = $automatic_cooling_enabled; - } - if ($hvac_mode_setting !== null) { - $request_payload["hvac_mode_setting"] = $hvac_mode_setting; - } - if ($cooling_set_point_celsius !== null) { - $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; - } - if ($heating_set_point_celsius !== null) { - $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; - } - if ($cooling_set_point_fahrenheit !== null) { - $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; - } - if ($heating_set_point_fahrenheit !== null) { - $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; + if ($url !== null) { + $request_payload["url"] = $url; } - if ($manual_override_allowed !== null) { - $request_payload["manual_override_allowed"] = $manual_override_allowed; + if ($event_types !== null) { + $request_payload["event_types"] = $event_types; } $res = $this->seam->request( "POST", - "/thermostats/climate_setting_schedules/create", + "/webhooks/create", json: $request_payload, - inner_object: "climate_setting_schedule", + inner_object: "webhook", ); - return ClimateSettingSchedule::from_json($res); + return Webhook::from_json($res); } public function delete( - string $climate_setting_schedule_id + string $webhook_id ): void { $request_payload = []; - if ($climate_setting_schedule_id !== null) { - $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; + if ($webhook_id !== null) { + $request_payload["webhook_id"] = $webhook_id; } $this->seam->request( "POST", - "/thermostats/climate_setting_schedules/delete", + "/webhooks/delete", json: $request_payload, ); @@ -4594,133 +4524,79 @@ public function delete( } public function get( - string $climate_setting_schedule_id = null, - string $device_id = null - ): ClimateSettingSchedule { + string $webhook_id + ): Webhook { $request_payload = []; - if ($climate_setting_schedule_id !== null) { - $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; - } - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; + if ($webhook_id !== null) { + $request_payload["webhook_id"] = $webhook_id; } $res = $this->seam->request( "POST", - "/thermostats/climate_setting_schedules/get", + "/webhooks/get", json: $request_payload, - inner_object: "climate_setting_schedule", + inner_object: "webhook", ); - return ClimateSettingSchedule::from_json($res); + return Webhook::from_json($res); } public function list( - string $device_id, - string $user_identifier_key = null + ): array { $request_payload = []; - if ($device_id !== null) { - $request_payload["device_id"] = $device_id; - } - if ($user_identifier_key !== null) { - $request_payload["user_identifier_key"] = $user_identifier_key; - } + $res = $this->seam->request( "POST", - "/thermostats/climate_setting_schedules/list", + "/webhooks/list", json: $request_payload, - inner_object: "climate_setting_schedules", + inner_object: "webhooks", ); - return array_map(fn ($r) => ClimateSettingSchedule::from_json($r), $res); + return array_map(fn ($r) => Webhook::from_json($r), $res); } public function update( - string $climate_setting_schedule_id, - string $schedule_type = null, - string $name = null, - string $schedule_starts_at = null, - string $schedule_ends_at = null, - bool $automatic_heating_enabled = null, - bool $automatic_cooling_enabled = null, - string $hvac_mode_setting = null, - int $cooling_set_point_celsius = null, - int $heating_set_point_celsius = null, - int $cooling_set_point_fahrenheit = null, - int $heating_set_point_fahrenheit = null, - bool $manual_override_allowed = null - ): ClimateSettingSchedule { + array $event_types, + string $webhook_id + ): void { $request_payload = []; - if ($climate_setting_schedule_id !== null) { - $request_payload["climate_setting_schedule_id"] = $climate_setting_schedule_id; - } - if ($schedule_type !== null) { - $request_payload["schedule_type"] = $schedule_type; - } - if ($name !== null) { - $request_payload["name"] = $name; - } - if ($schedule_starts_at !== null) { - $request_payload["schedule_starts_at"] = $schedule_starts_at; - } - if ($schedule_ends_at !== null) { - $request_payload["schedule_ends_at"] = $schedule_ends_at; - } - if ($automatic_heating_enabled !== null) { - $request_payload["automatic_heating_enabled"] = $automatic_heating_enabled; - } - if ($automatic_cooling_enabled !== null) { - $request_payload["automatic_cooling_enabled"] = $automatic_cooling_enabled; - } - if ($hvac_mode_setting !== null) { - $request_payload["hvac_mode_setting"] = $hvac_mode_setting; - } - if ($cooling_set_point_celsius !== null) { - $request_payload["cooling_set_point_celsius"] = $cooling_set_point_celsius; - } - if ($heating_set_point_celsius !== null) { - $request_payload["heating_set_point_celsius"] = $heating_set_point_celsius; - } - if ($cooling_set_point_fahrenheit !== null) { - $request_payload["cooling_set_point_fahrenheit"] = $cooling_set_point_fahrenheit; - } - if ($heating_set_point_fahrenheit !== null) { - $request_payload["heating_set_point_fahrenheit"] = $heating_set_point_fahrenheit; + if ($event_types !== null) { + $request_payload["event_types"] = $event_types; } - if ($manual_override_allowed !== null) { - $request_payload["manual_override_allowed"] = $manual_override_allowed; + if ($webhook_id !== null) { + $request_payload["webhook_id"] = $webhook_id; } - $res = $this->seam->request( + $this->seam->request( "POST", - "/thermostats/climate_setting_schedules/update", + "/webhooks/update", json: $request_payload, - inner_object: "climate_setting_schedule", + ); - return ClimateSettingSchedule::from_json($res); + } } -class UserIdentitiesEnrollmentAutomationsClient +class WorkspacesClient { private SeamClient $seam; @@ -4731,112 +4607,112 @@ public function __construct(SeamClient $seam) } - public function delete( - string $enrollment_automation_id - ): void { + public function create( + string $connect_partner_name, + string $name, + bool $is_sandbox = null, + string $webview_logo_shape = null, + string $webview_primary_button_color = null + ): Workspace { $request_payload = []; - if ($enrollment_automation_id !== null) { - $request_payload["enrollment_automation_id"] = $enrollment_automation_id; + if ($connect_partner_name !== null) { + $request_payload["connect_partner_name"] = $connect_partner_name; + } + if ($name !== null) { + $request_payload["name"] = $name; + } + if ($is_sandbox !== null) { + $request_payload["is_sandbox"] = $is_sandbox; + } + if ($webview_logo_shape !== null) { + $request_payload["webview_logo_shape"] = $webview_logo_shape; + } + if ($webview_primary_button_color !== null) { + $request_payload["webview_primary_button_color"] = $webview_primary_button_color; } - $this->seam->request( + $res = $this->seam->request( "POST", - "/user_identities/enrollment_automations/delete", + "/workspaces/create", json: $request_payload, - + inner_object: "workspace", ); - + return Workspace::from_json($res); } public function get( - string $enrollment_automation_id - ): EnrollmentAutomation { + + ): Workspace { $request_payload = []; - if ($enrollment_automation_id !== null) { - $request_payload["enrollment_automation_id"] = $enrollment_automation_id; - } + $res = $this->seam->request( "POST", - "/user_identities/enrollment_automations/get", + "/workspaces/get", json: $request_payload, - inner_object: "enrollment_automation", + inner_object: "workspace", ); - return EnrollmentAutomation::from_json($res); + return Workspace::from_json($res); } - public function launch( - string $user_identity_id, - string $credential_manager_acs_system_id, - string $acs_credential_pool_id = null, - bool $create_credential_manager_user = null, - string $credential_manager_acs_user_id = null - ): void { + public function list( + + ): array { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } - if ($credential_manager_acs_system_id !== null) { - $request_payload["credential_manager_acs_system_id"] = $credential_manager_acs_system_id; - } - if ($acs_credential_pool_id !== null) { - $request_payload["acs_credential_pool_id"] = $acs_credential_pool_id; - } - if ($create_credential_manager_user !== null) { - $request_payload["create_credential_manager_user"] = $create_credential_manager_user; - } - if ($credential_manager_acs_user_id !== null) { - $request_payload["credential_manager_acs_user_id"] = $credential_manager_acs_user_id; - } - $this->seam->request( + + $res = $this->seam->request( "POST", - "/user_identities/enrollment_automations/launch", + "/workspaces/list", json: $request_payload, - inner_object: "enrollment_automation", + inner_object: "workspaces", ); - + return array_map(fn ($r) => Workspace::from_json($r), $res); } - public function list( - string $user_identity_id - ): array { + public function reset_sandbox( + bool $wait_for_action_attempt = true + ): ActionAttempt { $request_payload = []; - if ($user_identity_id !== null) { - $request_payload["user_identity_id"] = $user_identity_id; - } + $res = $this->seam->request( "POST", - "/user_identities/enrollment_automations/list", + "/workspaces/reset_sandbox", json: $request_payload, - inner_object: "enrollment_automations", + inner_object: "action_attempt", ); + if (!$wait_for_action_attempt) { + return ActionAttempt::from_json($res); + } + $action_attempt = $this->seam->action_attempts->poll_until_ready( + $res->action_attempt_id + ); + return $action_attempt; - return array_map(fn ($r) => EnrollmentAutomation::from_json($r), $res); } } From 2b8cd6aec0199af284c28873e250cd3f15f378e1 Mon Sep 17 00:00:00 2001 From: Andrii Balitskyi <10balian10@gmail.com> Date: Fri, 12 Apr 2024 15:57:06 +0200 Subject: [PATCH 4/4] Fix tests --- tests/AccessCodesTest.php | 1 - tests/ClimateSettingSchedulesTest.php | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/AccessCodesTest.php b/tests/AccessCodesTest.php index d2d9232..d767cc4 100644 --- a/tests/AccessCodesTest.php +++ b/tests/AccessCodesTest.php @@ -57,7 +57,6 @@ public function testAccessCodes(): void $action_attempt = $seam->access_codes->delete( access_code_id: $access_code_id ); - $this->assertEquals($action_attempt->status, "success"); try { $seam->access_codes->get(access_code_id: $access_code_id); diff --git a/tests/ClimateSettingSchedulesTest.php b/tests/ClimateSettingSchedulesTest.php index e655914..1c84421 100644 --- a/tests/ClimateSettingSchedulesTest.php +++ b/tests/ClimateSettingSchedulesTest.php @@ -44,12 +44,15 @@ public function testClimateSettingSchedules(): void $climate_setting_schedule_id ); - $updated_climate_setting_schedule = $seam->thermostats->climate_setting_schedules->update( + $seam->thermostats->climate_setting_schedules->update( climate_setting_schedule_id: $climate_setting_schedule_id, hvac_mode_setting: "cool", cooling_set_point_celsius: 21, manual_override_allowed: true ); + $updated_climate_setting_schedule = $seam->thermostats->climate_setting_schedules->get( + climate_setting_schedule_id: $climate_setting_schedule_id + ); $this->assertTrue( $updated_climate_setting_schedule->cooling_set_point_celsius == 21 );