From cc556f9fbf1dbd6083b92514184099a43e54186d Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 28 Oct 2026 06:46:51 -0700 Subject: [PATCH 1/5] fix: Add missing imports for types referenced by List and Map aliases (box/box-codegen#997) --- .codegen.json | 2 +- package-lock.json | 353 ++++++++++++++++++++++++---------------------- 2 files changed, 183 insertions(+), 172 deletions(-) diff --git a/.codegen.json b/.codegen.json index c3fd9662..eaf53e92 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "d55532c", "specHash": "e21eebc", "version": "10.17.0" } +{ "engineHash": "4c5a50b", "specHash": "e21eebc", "version": "10.17.0" } diff --git a/package-lock.json b/package-lock.json index f06a00e7..d4782e80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -181,9 +181,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.29.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", - "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.11.tgz", + "integrity": "sha512-snZbO7MEDOof+hvNa97EjEY7qD7h2kwvQr5AJC3ZhQudKW5dnej6k3kP9NQV88hJwaS8vDqRLFo9rivLEhle2g==", "dev": true, "license": "MIT", "engines": { @@ -225,13 +225,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.29.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", - "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.11.tgz", + "integrity": "sha512-OZ6+oaK7GMyg3IfCpj8JOmn8n+w2rJbDT0LLfVDTLb1ZFeKDh3AiNELgCMUw175IJHSkLl74hG0M0VLsvx+gag==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.29.8" + "@babel/types": "^7.29.11" }, "bin": { "parser": "bin/babel-parser.js" @@ -514,13 +514,13 @@ } }, "node_modules/@babel/types": { - "version": "7.29.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", - "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "version": "7.29.11", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.11.tgz", + "integrity": "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-string-parser": "^7.29.11", "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { @@ -1116,9 +1116,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz", - "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.5.1.tgz", + "integrity": "sha512-P9ZvnfouRu4MSC+ilERaw6FmZs8zqKhpHxEs4aGDGWQAMzQGXnhvCSvoNwokfNvdt7t3Y5Y4p6gStQgezeIqug==", "dev": true, "license": "MIT", "dependencies": { @@ -1139,9 +1139,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.5.tgz", - "integrity": "sha512-MrfgRQSpD5hkkRg6XI16B6EDLb+6+xp8xje6bpdSwkYw+qxrBKbUVrRAQu9h82UT+QumSIVQ8HXsXjPd2dlhqw==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.66.0.tgz", + "integrity": "sha512-7y4XeoUHPecjfUDRmap8U0q6bjfLAPn7uOGT8BKyqy8uNDOjsGS8rlBhOx6sZLVwwjN6hapvGl2mW9/IS6UNww==", "cpu": [ "arm" ], @@ -1153,9 +1153,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.5.tgz", - "integrity": "sha512-+uu2p/R9Tzn8GpoQyX1pAo5dmKT1DhXevfaCzqzmPFhnLjHLWw7uWkaVGlxmhwYoRiYYhsGfRcD5cTBpL7rgSw==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.66.0.tgz", + "integrity": "sha512-e8WugYZXpgqrlMXLCudYVRAxAcK7AIY36JxRDwFRD38L9q62G1VsEUW6ijXxzjxYjNB8i1zo3B/ycIQ/qjLC/Q==", "cpu": [ "arm64" ], @@ -1167,9 +1167,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.5.tgz", - "integrity": "sha512-17dys+YEmzwzzFVHQAVDONg5FALXY9kd99HFEpfk4gJVHYxoh5bGea3D4t1fXXnwkTcOe25wPyd6nWS0I8IdLQ==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.66.0.tgz", + "integrity": "sha512-6vkDCfyDjNLokh+Rt1D2KtNgFFMEPdkWha/mbtP4cSjh9xiN8T/JBS/A7nDYKjmMAXHrvR9J3AzUk2LtFbIBLg==", "cpu": [ "arm64" ], @@ -1181,9 +1181,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.5.tgz", - "integrity": "sha512-wg0zQEKkEvFZf1UaaX1UELOoPs//OSKUG7D+yITuqOsAvza7LvHTv5Wu4nmMfzNG7EYI2jp2PJC7Id6OETmsYQ==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.66.0.tgz", + "integrity": "sha512-/mzZAX0+Q6eXxvkR0HB0RZCCrsbmFD8DpsvCQoMYABDfq/DjqkbfytuJ7GvZ4AhR/Mgis2fXbZrGqfbcK2Z5fA==", "cpu": [ "x64" ], @@ -1195,9 +1195,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.5.tgz", - "integrity": "sha512-CoJmWcpEMuwin+TZ/ev/H9uDyF/uxUKQSWXdmIPn/UBx/uGV9+4ebMp0FwnlhWR9PE1AdzYsKf3bZevhif38+A==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.66.0.tgz", + "integrity": "sha512-JQJx9E8tUjGqed1RevDmoHaS3V30ODdV8uyvGxlwd4K5se6bkPrMeltSybqAtpJ+ltDRfo7FORQaJG2Hd5nGog==", "cpu": [ "arm64" ], @@ -1209,9 +1209,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.5.tgz", - "integrity": "sha512-PxZnLAaTUAL5xG0W2BXLeYPKrK2b3LIASV2/e/Kf7PZvSLI1iAQIm9B9aJD+YyFIT7hc6qaMV3+OOO35R28LfA==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.66.0.tgz", + "integrity": "sha512-GEaUQQjMaG7X1304qMgqLjzCKv6CdDirzJSS+UqUs3xhJ9X2Kjzu0JDbLoUU42FWxwmZqz+SsgU1SlQv9GNRVA==", "cpu": [ "x64" ], @@ -1223,9 +1223,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.5.tgz", - "integrity": "sha512-uPo3IvnONjhbFXwWgroBeFwOicuhT7ZwQrnzkzmOtBJzeQbkUJUE1SJDfDI31ijQ5+ZUIA6sPrdUMxTSnxUWAg==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.66.0.tgz", + "integrity": "sha512-DgmAU9N0NhDQDzHgFUocDio7zRO8jR/nY/obDGvCR8zbJ6J77Fg6X49yPuExJUpYPbC82EOaRhG969pWzUSnHQ==", "cpu": [ "arm" ], @@ -1237,9 +1237,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.5.tgz", - "integrity": "sha512-ywI8Jyuc4LyHYTjC0mw4yA1ulvZBkHusdpWnoiEBsmBuHvSnt90btTBGCZ+s/2y+YNNfVAEKy33nPo5UI9zTmg==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.66.0.tgz", + "integrity": "sha512-zG09YZ+sk/HoHq+P9gYB0EseQ3M20RbDuKGWey6fbiMDV1LxfXvhgSW9jDaCcvFPMgfLXpimzXY+UYvA8R2mLQ==", "cpu": [ "arm" ], @@ -1251,9 +1251,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.5.tgz", - "integrity": "sha512-tmuXJoQ/3ovSr637aykZMdQteU/CB2APAz2CrvsbibuoHZi1BS1Db13cVViBdEARGwXCLn1DSJ8wsjoThLJPGA==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.66.0.tgz", + "integrity": "sha512-vlArhgyXbcVc1D4WZPoiYuqJIaMiSHBj6etRXua0KlfjlZeuiQyVAPYi0/N49O4mSp3u1iGUBLEjNa8ec81XZg==", "cpu": [ "arm64" ], @@ -1265,9 +1265,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.5.tgz", - "integrity": "sha512-5FMjSYNcUOHx7oW8Qu9KB6jGPpvF/8sG7+BDHwU/Ihh1/6FMJ9ySmsFG4tJ1qbNRuP8OLzCBDso4sF0mQaLuFQ==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.66.0.tgz", + "integrity": "sha512-RxJZtk0G87YPotDaRDvRqStV8cbqLSC5TroHvQHHKsqBg0ok64RxKgtXeFsa7FBcy7mb4crBrG3xK8USWIqWNA==", "cpu": [ "arm64" ], @@ -1279,9 +1279,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.5.tgz", - "integrity": "sha512-K8ZJ+neLDbUkIrL8dqF/5LtuVCrKwo27kREgOlxjBEjlOXwHvDnHLU8Z/UKv/B49qi7e8hsSDOyoJwhwqhvX4w==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.66.0.tgz", + "integrity": "sha512-qlGcw959PrLLkZhiBxF3OZ6SQvj+OKY85mCqGNgSRs4LZlDJ6ICqmz6UdxtINdhcXYwNIbZoapQVBAmZlD2hUQ==", "cpu": [ "loong64" ], @@ -1293,9 +1293,9 @@ ] }, "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.5.tgz", - "integrity": "sha512-NlVxsq7PFPv0DBKGuNWRDKixQYQCjM53zl04mxEcKMBmJbCBIUm1JdPfIWDRHyOOFzzYPmLQzfeEwh4716ayQg==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.66.0.tgz", + "integrity": "sha512-TvTI/7Cy0WvRA1SXgwzu6bwXBnMpmeT/ln5q7WvSpqmXy1VbmEnY8HVIDQNBiaHJvoWqRr0M4FNo7qiqtyMaFw==", "cpu": [ "loong64" ], @@ -1307,9 +1307,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.5.tgz", - "integrity": "sha512-ARhRHJYs5eCFet5azfrHD97vOkD8OzNW2RSMlvo5CcBqXaTOLfp0OHDtUQh7/K5AL5fUYoFp2fgC9KDg4vVYMQ==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.66.0.tgz", + "integrity": "sha512-UZEDkSoDRZ50NyLj70nO6mpIK3dvs2cPTTvQb1bA/PBDmr9fvn5KiESuGfh6srd7Zi6Lt9Sv2sVrFr1QoHLvPQ==", "cpu": [ "ppc64" ], @@ -1321,9 +1321,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.5.tgz", - "integrity": "sha512-atSgreM5C7jpxd9aEXN+6vJ5wTd05iYw+S3FiQpw7VsoEl8B90llbq35ARON+GOHj5QlVQEq2vOKWCHTob/BSQ==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.66.0.tgz", + "integrity": "sha512-VRbxTvagLh3HRcysx1CNq+HHcvJbSebNI6fCbk7jwmmWHkXjrSIV3igXBpRHUTFdg0pagWGu50xoSZXnrZHjVQ==", "cpu": [ "ppc64" ], @@ -1335,9 +1335,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.5.tgz", - "integrity": "sha512-vmlmwBFGnjVWxSRoVabNkyYuscSmg52Pd0fM8jEbNT3Jmka4A6HcB84x4uAmuumznWfBVaxKOqU6jbEgomWKCA==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.66.0.tgz", + "integrity": "sha512-uWdJpvYqh0LE/i+YBL3sMX0a2kUkICENjmrPmyBmMOFc3jMrs6MSQH/pMD+VIpGEoUcr3XkHGLLfymzIqPSRRg==", "cpu": [ "riscv64" ], @@ -1349,9 +1349,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.5.tgz", - "integrity": "sha512-hhJrP6S9WkbsbcHgUkvCBS5Cn8IdsG8XjlLZyxjnv9+NdoYfbbZE4TWJYr8apdaj1M5t5Y1id2StnEslxpNFyA==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.66.0.tgz", + "integrity": "sha512-3FUd88pxgWAjK60OgCrika1AcNG+u8zaCdWjg4TlcZTDkt5TGyci8ZU64l3OJ9ax0MEjw3P80B/3PoSQDCLwJQ==", "cpu": [ "riscv64" ], @@ -1363,9 +1363,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.5.tgz", - "integrity": "sha512-NNVCyN9pGrwFmQa4bf+Cnf5aVH3g6ZpnlOg1Cs/H9swIHT9bRixijfzUqyEIWm1WtiAuR1LJ+rJH6zpBm8kgQA==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.66.0.tgz", + "integrity": "sha512-qT2rMmgyej62g5AdwktK+Bt2lBu497pzWZe12TTQ5JmZjOYPnEwcPEAOSLTBxBV+6gIES75rXm219v/QkT397A==", "cpu": [ "s390x" ], @@ -1377,9 +1377,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.5.tgz", - "integrity": "sha512-dR9nd6OKnvSS60Ifz/L7Mj5zzYyoqyRn2NwTuaOONKaa3xsVGXyp8YusMbvFyEOR94DxnwgcbgsFqkHd29ZSzQ==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.66.0.tgz", + "integrity": "sha512-E46rnZgp7J84Qwe8RMlF+rgimnDo/9fuiGbUArGB0ZkMWf97O7yeSCfKls5x/YJOF0RcuSe9RctuKe1hlxICiA==", "cpu": [ "x64" ], @@ -1391,9 +1391,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.5.tgz", - "integrity": "sha512-1tzsMjaqhsh3bAO6SJiJqh8hIr9sSPRd+i2vPPxJHod8/XYnf9TEnK0z/u3r1z1AkI347X0KbRSg9dWcxeGahw==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.66.0.tgz", + "integrity": "sha512-Uz1HiZe+qBzqgdPsON+z0wRx3WdATuyzwvGT6cr2VZVrqqko0ZJVfkrQJtwDMuDcAfXYdo7XucaxJ7lTLjEcgg==", "cpu": [ "x64" ], @@ -1405,9 +1405,9 @@ ] }, "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.5.tgz", - "integrity": "sha512-01mWMQblKoXXsmk28KXtpbA96w7g/aOWUoV3AC16fdHdqkykGalqyyM+5u8M7uP5/MEMiiPv69Hv7iv/hEH/dA==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.66.0.tgz", + "integrity": "sha512-Ph7TX3Ex5qdfcb7Tc6eEPugVkRfJ501eTovO4T5029YObfpZ7dzn3RiwpFvGp50nk2QUhvBMZ0PFGlEj6pOYTg==", "cpu": [ "x64" ], @@ -1419,9 +1419,9 @@ ] }, "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.5.tgz", - "integrity": "sha512-trdnMPb/DNm4V/CgsaoGgr90HfQQ071wfK0KoIs4YpLvjBgVQGXhGabg2Z6nK4EcYNilrb9ZZPcsP6+zpJIdxQ==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.66.0.tgz", + "integrity": "sha512-nZYPEya7ZkeNxUEiF7qmNZbyLTyRN3MK5cO22KqsaoneUzXJuzBIQRw+7BEQy9LGj2O5vrCE9V3EpK06FYo1tQ==", "cpu": [ "arm64" ], @@ -1433,9 +1433,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.5.tgz", - "integrity": "sha512-x2LxZlfdfsw99T6/qb9EqE/Qi84JWzibjyOJyhJsgFJy6CafaTiqIXCCnslCGrV5XWNh7fwrS3FbRENcuKnooA==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.66.0.tgz", + "integrity": "sha512-u7aTfS3R6C4hRsqXSzaO6qLZYLVuMkHMvcWlux4IM8IJif1VCl2cgPBSo5gSNoFoStQypQP+qwq8W1IyFBf1QQ==", "cpu": [ "arm64" ], @@ -1447,9 +1447,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.5.tgz", - "integrity": "sha512-/Qd/9aDQIo0+jmItgBmPIs8195YVbDxRRApn47GyufgbutCDOh7eP5vSKKlI4QNFeaI+wKQAkSMsPnF3EuMpaA==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.66.0.tgz", + "integrity": "sha512-e+i9ueHrH1Bafb0cf0woAIVJbYcoC8vRaD+vz+Xi8w6jz9cYJSV3vyKO6ELGSZ6g4W4MJOm2WPLN4/nQf77h7w==", "cpu": [ "ia32" ], @@ -1461,9 +1461,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.5.tgz", - "integrity": "sha512-ngUJ/XvOWrqbd2IMsfXfh2xXFLTP3sY7sCKvxbGvYdBZ1KmXFd3ewDZ9n3/GNzAUgzRuhLT/UvJRivbNoAQRBw==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.66.0.tgz", + "integrity": "sha512-KfTCbrtr2zXTqH2E1F+uYlFTrYibxHKqPAHobpd8Kfg49cEHmuHebOidCTDRgqG1suaPFX7oejFQeGE71zWKfA==", "cpu": [ "x64" ], @@ -1475,9 +1475,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.5.tgz", - "integrity": "sha512-IhV6ew/DuzUWwHaYmlh7MrPCV3lKFUq/amTEwysi4r/mwNPAEfAMh5dYWeTSPTeMy2pFHGMEWYtPkHzfX3tG5A==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.66.0.tgz", + "integrity": "sha512-xA+neBh1bqkqaS3b48T2UHZnDsTIpb9B0h+TdBzynjF/ymCpYndhfY10RqW0qSKB1HqqQA83mINVhAdwA+mETg==", "cpu": [ "x64" ], @@ -2203,9 +2203,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.11.28", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz", - "integrity": "sha512-br0LOmjJqr6Rt4AEkadbcNf67Zpo7EPwKsWbjnRrJIa1QYFHQBqM4C7F2WTbV8ahTEcg1Eo+Y0aWjjORInYFyA==", + "version": "2.11.34", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.34.tgz", + "integrity": "sha512-Aqr8mA1kIvyJ3UY5YAY7ib8LSo1DmDMbMnVqGPtsKW1LxaFQFwn9Eb3yvq2fUKJsRvaXjnAV7R5osqETapzNiA==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2261,9 +2261,9 @@ } }, "node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "version": "4.29.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.5.tgz", + "integrity": "sha512-khTmKu5NGYTotqcYo8Bew2k4RAE9PuXRSFRXG2lQBrCEQHyeQ/vX6gKMxfokwywBsLiXZMnHsmWMG1pnO8J7uQ==", "dev": true, "funding": [ { @@ -2281,11 +2281,11 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" + "baseline-browser-mapping": "^2.11.33", + "caniuse-lite": "^1.0.30001819", + "electron-to-chromium": "^1.5.464", + "node-releases": "^2.0.60", + "update-browserslist-db": "^1.3.4" }, "bin": { "browserslist": "cli.js" @@ -2382,9 +2382,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001815", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001815.tgz", - "integrity": "sha512-uDybUEyfgbyJJ93J1vikTylBX31AkdVYeVPeffMQpf8XN7hSfr0oZOn4VFOIMNvtU5+rHvC5Udg2TgtJKHm23Q==", + "version": "1.0.30001819", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001819.tgz", + "integrity": "sha512-LFUqIIAwpzsIuevnKnsR9qnStBcgzPShTX61lBwN9uFkkf8o8zLiebEjbW8AYtZiF+1YKDWfdt/pWDtMuG8Xwg==", "dev": true, "funding": [ { @@ -2743,9 +2743,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.452", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.452.tgz", - "integrity": "sha512-cVvk1YBSj6571VmV6hdJTqj94Y79xSu8cj6Y9t6ae4Y4431z8/7EJFvu3rVp90xhfuv9BpPKUmaLfTo4+FOGBg==", + "version": "1.5.467", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.467.tgz", + "integrity": "sha512-Nw9X371rtZmYcBSnEijnCDONILjs93biCZO34juC7MBOmK8E+GFnyD4T/WvyrlJkppul7oxg6TwvtKst9SODTw==", "dev": true, "license": "ISC" }, @@ -3020,9 +3020,9 @@ "license": "MIT" }, "node_modules/fast-uri": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.8.tgz", - "integrity": "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==", + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", "dev": true, "funding": [ { @@ -3512,9 +3512,9 @@ "license": "ISC" }, "node_modules/ip-address": { - "version": "10.7.4", - "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.4.tgz", - "integrity": "sha512-DWBMKyeM25D70nrIiTkgQth59/G+naKOTep6huF9j+GmeK3DMD60Zvxg5d5qQnz+38AHgou6ean2LECX+lrKDg==", + "version": "10.7.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.5.tgz", + "integrity": "sha512-t2v0rkILYv9WXmSL7TpAaU3HXgaFYOPUcH3QHgwQ++gpJuH3bqyMy4Fvt/DJCTKwzH3Cf+bAp5W/mFL39KPLzA==", "license": "MIT", "engines": { "node": ">= 12" @@ -4723,16 +4723,16 @@ } }, "node_modules/minimizer-webpack-plugin": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.13.0.tgz", - "integrity": "sha512-OO1NF2zHj6sf4CNv2AsUWYcS8WEwkVKQDXxxKzlOxx1Xl+WlqYtVC+oNlGNwGkLAOnpj277BSHypWwRtd9w4JQ==", + "version": "5.13.1", + "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.13.1.tgz", + "integrity": "sha512-1mhAfvachWYYOm8tpmany5NLuvP+F2wxZWBSX8DC0uFS2wJpM9q3rWgN9wBooAH9d5V12wX0BjyJe4fMjHMarQ==", "dev": true, "license": "MIT", "peer": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.31", "jest-worker": "^27.4.5", - "schema-utils": "^4.3.3", + "schema-utils": "^4.6.0", "terser": "^5.51.0" }, "engines": { @@ -4900,9 +4900,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.58", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.58.tgz", - "integrity": "sha512-BdiKAgbfRlvfMq/XzO/AF9NPmaA8a+YpLAyAFTVFBj3gARrAIfWvNq7Q7NE4se3KgFu0KkrvQMxTS0XVnsGzHg==", + "version": "2.0.60", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.60.tgz", + "integrity": "sha512-OmO8+GM1JUZqXET720VrJCwkjUCXmCMQm0Z3UDDRbfNLHS4NEAvY60j5jiFv0tkKw2PNNlqOLhahVmwJIOLDIQ==", "dev": true, "license": "MIT", "engines": { @@ -5401,9 +5401,9 @@ } }, "node_modules/resolve.exports": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", - "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.4.tgz", + "integrity": "sha512-zepuGL0ulf+nt+XaFrlKeaiTJeyPFPLLY62+ncq1/VTHBdt3HsfXOH60priZ6tnXQozdGcDeIF5JVTanvIcYWQ==", "dev": true, "license": "MIT", "engines": { @@ -5422,9 +5422,9 @@ } }, "node_modules/rollup": { - "version": "4.64.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.64.5.tgz", - "integrity": "sha512-EAP5ZHcz2ijbgCWwPkpI7zh6bfsri2Ez5FtCy2dCp1k62duXzfG7DLGGh7RU2QQXWwavT+u4qpvDF/TWOiiGTw==", + "version": "4.66.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.66.0.tgz", + "integrity": "sha512-Onq6/qO4ARhxIs+jYiHE0pYehadLyMECAiGEqQ+0/aWND3+2PmifJIIqBLYtuBODqHTlOUEQFtIVPyCy0Lck7A==", "dev": true, "license": "MIT", "dependencies": { @@ -5439,31 +5439,31 @@ }, "optionalDependencies": { "@napi-rs/lzma-linux-x64-gnu": "1.5.1", - "@rollup/rollup-android-arm-eabi": "4.64.5", - "@rollup/rollup-android-arm64": "4.64.5", - "@rollup/rollup-darwin-arm64": "4.64.5", - "@rollup/rollup-darwin-x64": "4.64.5", - "@rollup/rollup-freebsd-arm64": "4.64.5", - "@rollup/rollup-freebsd-x64": "4.64.5", - "@rollup/rollup-linux-arm-gnueabihf": "4.64.5", - "@rollup/rollup-linux-arm-musleabihf": "4.64.5", - "@rollup/rollup-linux-arm64-gnu": "4.64.5", - "@rollup/rollup-linux-arm64-musl": "4.64.5", - "@rollup/rollup-linux-loong64-gnu": "4.64.5", - "@rollup/rollup-linux-loong64-musl": "4.64.5", - "@rollup/rollup-linux-ppc64-gnu": "4.64.5", - "@rollup/rollup-linux-ppc64-musl": "4.64.5", - "@rollup/rollup-linux-riscv64-gnu": "4.64.5", - "@rollup/rollup-linux-riscv64-musl": "4.64.5", - "@rollup/rollup-linux-s390x-gnu": "4.64.5", - "@rollup/rollup-linux-x64-gnu": "4.64.5", - "@rollup/rollup-linux-x64-musl": "4.64.5", - "@rollup/rollup-openbsd-x64": "4.64.5", - "@rollup/rollup-openharmony-arm64": "4.64.5", - "@rollup/rollup-win32-arm64-msvc": "4.64.5", - "@rollup/rollup-win32-ia32-msvc": "4.64.5", - "@rollup/rollup-win32-x64-gnu": "4.64.5", - "@rollup/rollup-win32-x64-msvc": "4.64.5", + "@rollup/rollup-android-arm-eabi": "4.66.0", + "@rollup/rollup-android-arm64": "4.66.0", + "@rollup/rollup-darwin-arm64": "4.66.0", + "@rollup/rollup-darwin-x64": "4.66.0", + "@rollup/rollup-freebsd-arm64": "4.66.0", + "@rollup/rollup-freebsd-x64": "4.66.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.66.0", + "@rollup/rollup-linux-arm-musleabihf": "4.66.0", + "@rollup/rollup-linux-arm64-gnu": "4.66.0", + "@rollup/rollup-linux-arm64-musl": "4.66.0", + "@rollup/rollup-linux-loong64-gnu": "4.66.0", + "@rollup/rollup-linux-loong64-musl": "4.66.0", + "@rollup/rollup-linux-ppc64-gnu": "4.66.0", + "@rollup/rollup-linux-ppc64-musl": "4.66.0", + "@rollup/rollup-linux-riscv64-gnu": "4.66.0", + "@rollup/rollup-linux-riscv64-musl": "4.66.0", + "@rollup/rollup-linux-s390x-gnu": "4.66.0", + "@rollup/rollup-linux-x64-gnu": "4.66.0", + "@rollup/rollup-linux-x64-musl": "4.66.0", + "@rollup/rollup-openbsd-x64": "4.66.0", + "@rollup/rollup-openharmony-arm64": "4.66.0", + "@rollup/rollup-win32-arm64-msvc": "4.66.0", + "@rollup/rollup-win32-ia32-msvc": "4.66.0", + "@rollup/rollup-win32-x64-gnu": "4.66.0", + "@rollup/rollup-win32-x64-msvc": "4.66.0", "fsevents": "~2.3.2" } }, @@ -5492,9 +5492,9 @@ } }, "node_modules/schema-utils": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.5.0.tgz", - "integrity": "sha512-zJlMCZ0cAR5p/Y4oVpRoqioDMJcGxaXRrQ/4rP4WyR84vc5z/DolXdbvXeDpTwbtocDFr2rhPqHPErDCUtz2kA==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.8.1.tgz", + "integrity": "sha512-x39pYlJPyH7Uge5QO64B9XGP9zLDc9WNmiQZc+CE3IzZPvMu3lHOuAMGpYNoPixEL7MSWlGhYTg5UlLSL8G6iw==", "dev": true, "license": "MIT", "peer": true, @@ -5504,12 +5504,23 @@ "ajv-formats": "^3.0.1", "ajv-keywords": "^5.1.0" }, + "bin": { + "schema-utils": "bin/schema-utils.js" + }, "engines": { "node": ">= 10.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.112.0" + }, + "peerDependenciesMeta": { + "webpack": { + "optional": true + } } }, "node_modules/semver": { @@ -5892,15 +5903,15 @@ "license": "MIT" }, "node_modules/ts-jest": { - "version": "29.4.14", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.14.tgz", - "integrity": "sha512-+943G6wCX5E3VpzTQhBGBFntCmdT+QAkTvUlp03edTONFBvqskuXPhpyX16xdUotO4P5HQKyppldSWjocoltLQ==", + "version": "29.4.15", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.15.tgz", + "integrity": "sha512-s2qmEUYFRqbjz1wv0EmccNPVOb45HOFpFuhzQJLKShYVisuTbCFPIIAIV2EuK5rIxb4BejLDbH7dnBZfYjybUQ==", "dev": true, "license": "MIT", "dependencies": { "bs-logger": "^0.2.6", "fast-json-stable-stringify": "^2.1.0", - "handlebars": "^4.7.9", + "handlebars": "^4.7.10", "json5": "^2.2.3", "lodash.memoize": "^4.1.2", "make-error": "^1.3.6", @@ -6006,9 +6017,9 @@ } }, "node_modules/tsc-alias": { - "version": "1.9.7", - "resolved": "https://registry.npmjs.org/tsc-alias/-/tsc-alias-1.9.7.tgz", - "integrity": "sha512-nGOOLMkaociegx2Y9J1lnbqrledf1EfSq3Ds4H4CLySG5RyD58KrR4ahFIAgpeMVJz4BIhJND3ETt02o9zKQAw==", + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/tsc-alias/-/tsc-alias-1.9.9.tgz", + "integrity": "sha512-TxUi+OyqQXRwSMUQaB0pqM89VbOEvL/6RkgQa2LrxNvbhCmkQvrp8NX7VyMW9KYVLGlwICxrLwNv3Ik4vtIQxw==", "dev": true, "license": "MIT", "dependencies": { @@ -6164,9 +6175,9 @@ } }, "node_modules/watchpack": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.2.tgz", - "integrity": "sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.6.3.tgz", + "integrity": "sha512-s3NZy0QpTY9qGqzc0wtz4qI28z3+5qKbbAec4MV4G9N3CfgZ9wgvQRr0cl2jh/tqkWG1NWHkmVMHZpCamev5Wg==", "dev": true, "license": "MIT", "peer": true, @@ -6184,9 +6195,9 @@ "license": "BSD-2-Clause" }, "node_modules/webpack": { - "version": "5.111.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.111.1.tgz", - "integrity": "sha512-cNypaz0RP+S4cvQVi1M/3bRUkvNP0xZpL0TjFx+c6jg64VbxD+2weWDgY9UnjRI6dhZgtaj8DU76GGFcJ79xPQ==", + "version": "5.112.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.112.2.tgz", + "integrity": "sha512-B2tp1LI9D8GVpPDqprdt12ukTkXXahj9MzqSWJq4faSPgOUM7CdZaGAB6HrL/8E6UwbBpdj4vzWDbKoFnVoU6g==", "dev": true, "license": "MIT", "peer": true, @@ -6198,16 +6209,16 @@ "@webassemblyjs/wasm-parser": "^1.14.1", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.25.0", + "enhanced-resolve": "^5.26.0", "es-module-lexer": "^2.1.0", "events": "^3.2.0", "graceful-fs": "^4.2.11", "mime-db": "^1.54.0", - "minimizer-webpack-plugin": "^5.7.0", - "schema-utils": "^4.5.0", + "minimizer-webpack-plugin": "^5.13.0", + "schema-utils": "^4.8.1", "tapable": "^2.3.0", - "watchpack": "^2.5.2", - "webpack-sources": "^3.5.1" + "watchpack": "^2.6.3", + "webpack-sources": "^3.6.0" }, "bin": { "webpack": "bin/webpack.js" From 40902a5f01068c39c3f24cb750bb60af56922772 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 28 Oct 2026 06:49:40 -0700 Subject: [PATCH 2/5] feat: add one-time passcode documentation (box/box-openapi#621) --- .codegen.json | 2 +- docs/README.md | 1 + docs/documentSplit.md | 93 +++ docs/users.md | 6 + src/client.ts | 7 + src/managers/documentSplit.ts | 396 +++++++++++++ src/managers/files.ts | 22 + src/managers/folders.ts | 22 + src/managers/index.ts | 1 + src/managers/sharedLinksFiles.ts | 32 + src/managers/sharedLinksFolders.ts | 32 + src/managers/sharedLinksWebLinks.ts | 32 + src/managers/users.ts | 14 +- src/managers/webLinks.ts | 22 + src/schemas/file.ts | 102 ++++ src/schemas/folder.ts | 102 ++++ src/schemas/index.ts | 12 +- src/schemas/keywordSkillCard.ts | 4 +- src/schemas/sharedLinkOtpAllowlistEntry.ts | 119 ++++ .../sharedLinkOtpAllowlistEntryWritable.ts | 85 +++ src/schemas/sharedLinkOtpWritable.ts | 95 +++ src/schemas/sharedLinkOtpWritableAllowlist.ts | 182 ++++++ src/schemas/sharedLinkOtpWritableNone.ts | 98 ++++ src/schemas/sharedLinkOtpWritableOpen.ts | 100 ++++ src/schemas/transcriptSkillCard.ts | 4 +- src/schemas/uploadSession.ts | 4 +- .../v2026R0/documentFailuresV2026R0.ts | 85 +++ ...documentSplitCreateRequestManualV2026R0.ts | 245 ++++++++ ...tSplitCreateRequestPageSelectionV2026R0.ts | 215 +++++++ .../documentSplitCreateRequestSmartV2026R0.ts | 156 +++++ .../documentSplitCreateRequestTypeV2026R0.ts | 119 ++++ .../documentSplitCreateRequestV2026R0.ts | 154 +++++ .../documentSplitCreateResponseV2026R0.ts | 137 +++++ .../v2026R0/documentSplitFailuresV2026R0.ts | 22 + .../v2026R0/documentSplitOutputV2026R0.ts | 95 +++ .../v2026R0/documentSplitPageRangeV2026R0.ts | 58 ++ .../documentSplitPageSelectionItemV2026R0.ts | 80 +++ ...umentSplitPageSelectionPageRangeV2026R0.ts | 188 ++++++ ...ocumentSplitPageSelectionSegmentV2026R0.ts | 46 ++ ...mentSplitPageSelectionSinglePageV2026R0.ts | 150 +++++ .../documentSplitPageSelectionV2026R0.ts | 33 ++ src/schemas/v2026R0/documentSplitV2026R0.ts | 550 ++++++++++++++++++ src/schemas/v2026R0/documentSplitsV2026R0.ts | 84 +++ .../v2026R0/enterpriseReferenceV2026R0.ts | 133 +++++ src/schemas/v2026R0/fileReferenceV2026R0.ts | 130 +++++ src/schemas/v2026R0/index.ts | 19 + src/schemas/webLink.ts | 102 ++++ 47 files changed, 4379 insertions(+), 11 deletions(-) create mode 100644 docs/documentSplit.md create mode 100644 src/managers/documentSplit.ts create mode 100644 src/schemas/sharedLinkOtpAllowlistEntry.ts create mode 100644 src/schemas/sharedLinkOtpAllowlistEntryWritable.ts create mode 100644 src/schemas/sharedLinkOtpWritable.ts create mode 100644 src/schemas/sharedLinkOtpWritableAllowlist.ts create mode 100644 src/schemas/sharedLinkOtpWritableNone.ts create mode 100644 src/schemas/sharedLinkOtpWritableOpen.ts create mode 100644 src/schemas/v2026R0/documentFailuresV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitCreateRequestManualV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitCreateRequestPageSelectionV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitCreateRequestSmartV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitCreateRequestTypeV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitCreateResponseV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitFailuresV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitOutputV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitPageRangeV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitPageSelectionItemV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitPageSelectionPageRangeV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitPageSelectionSegmentV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitPageSelectionSinglePageV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitPageSelectionV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitV2026R0.ts create mode 100644 src/schemas/v2026R0/documentSplitsV2026R0.ts create mode 100644 src/schemas/v2026R0/enterpriseReferenceV2026R0.ts create mode 100644 src/schemas/v2026R0/fileReferenceV2026R0.ts diff --git a/.codegen.json b/.codegen.json index eaf53e92..9d7b55a7 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "4c5a50b", "specHash": "e21eebc", "version": "10.17.0" } +{ "engineHash": "4c5a50b", "specHash": "fcfcd5d", "version": "10.17.0" } diff --git a/docs/README.md b/docs/README.md index 7577a645..124e76da 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,6 +29,7 @@ the SDK are available by topic: - [Device pinners](devicePinners.md) - [Docgen](docgen.md) - [Docgen template](docgenTemplate.md) +- [Document split](documentSplit.md) - [Downloads](downloads.md) - [Email aliases](emailAliases.md) - [Enterprise configurations](enterpriseConfigurations.md) diff --git a/docs/documentSplit.md b/docs/documentSplit.md new file mode 100644 index 00000000..59b6d67c --- /dev/null +++ b/docs/documentSplit.md @@ -0,0 +1,93 @@ +# DocumentSplitManager + +- [Create Document Split job](#create-document-split-job) +- [List Document Split jobs](#list-document-split-jobs) +- [Get Document Split job by ID](#get-document-split-job-by-id) + +## Create Document Split job + +Initiates a Document Split job for the supplied source file. The job runs +asynchronously; clients can poll the returned job ID to track progress. + +All split-specific input lives under `split_input`. When +`split_input.split_type` is `manual`, provide +`split_input.split_definition` (continuous page ranges; `version` may be +omitted or `v_1`). When `split_input.split_type` is `page_selection`, +provide `split_input.page_selection` (non-linear page segments; `version` +may be omitted or `v_2`). `split_input.prompt` must not be provided for +either of those variants. When `split_input.split_type` is `smart`, +`split_input.prompt` is required and neither +`split_input.split_definition` nor `split_input.page_selection` must be +provided. + +This operation is performed by calling function `createDocumentSplitV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-document-splits/). + +_Currently we don't have an example for calling `createDocumentSplitV2026R0` in integration tests_ + +### Arguments + +- requestBody `DocumentSplitCreateRequestV2026R0` + - Request body of createDocumentSplitV2026R0 method +- optionalsInput `CreateDocumentSplitV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `DocumentSplitCreateResponseV2026R0`. + +The Document Split job was accepted for processing. Returns a reference +to the newly created job. + +## List Document Split jobs + +Returns a paginated list of Document Split jobs accessible to the +authenticated user. + +This operation is performed by calling function `getDocumentSplitsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-document-splits/). + +_Currently we don't have an example for calling `getDocumentSplitsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetDocumentSplitsV2026R0QueryParams` + - Query parameters of getDocumentSplitsV2026R0 method +- headersInput `GetDocumentSplitsV2026R0HeadersInput` + - Headers of getDocumentSplitsV2026R0 method +- cancellationToken `undefined | CancellationToken` + - Token used for request cancellation. + +### Returns + +This function returns a value of type `DocumentSplitsV2026R0`. + +Returns a paginated list of Document Split jobs. + +## Get Document Split job by ID + +Returns details for a single Document Split job identified by its ID, +including the current status, the input definition, and any output files +produced by the job. + +This operation is performed by calling function `getDocumentSplitByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-document-splits-id/). + +_Currently we don't have an example for calling `getDocumentSplitByIdV2026R0` in integration tests_ + +### Arguments + +- documentSplitId `string` + - The unique identifier for the Document Split job. Example: "1748426" +- optionalsInput `GetDocumentSplitByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `DocumentSplitV2026R0`. + +Returns the Document Split job. diff --git a/docs/users.md b/docs/users.md index 4efbd223..dc9246a7 100644 --- a/docs/users.md +++ b/docs/users.md @@ -194,6 +194,12 @@ still owns any content. To proceed, move their owned content first, or use the `force` parameter to delete the user and their files. +If the enterprise has a retention policy, including a retired one, or a +legal hold that is not fully released, you can't delete a user who owns +content, even with `force`. Transfer the user's content first by using the +[Transfer owned folders](https://developer.box.com/reference/put-users-id-folders-0) +endpoint. + This operation is performed by calling function `deleteUserById`. See the endpoint docs at diff --git a/src/client.ts b/src/client.ts index 31104e1e..0b791311 100644 --- a/src/client.ts +++ b/src/client.ts @@ -87,6 +87,7 @@ import { ArchivesManager } from './managers/archives'; import { ExternalUsersManager } from './managers/externalUsers'; import { AutomateWorkflowsManager } from './managers/automateWorkflows'; import { NotesManager } from './managers/notes'; +import { DocumentSplitManager } from './managers/documentSplit'; import { QueryManager } from './managers/query'; import { Authentication } from './networking/auth'; import { NetworkSession } from './networking/network'; @@ -195,6 +196,7 @@ export class BoxClient { readonly externalUsers: ExternalUsersManager; readonly automateWorkflows: AutomateWorkflowsManager; readonly notes: NotesManager; + readonly documentSplit: DocumentSplitManager; readonly query: QueryManager; constructor( fields: Omit< @@ -284,6 +286,7 @@ export class BoxClient { | 'externalUsers' | 'automateWorkflows' | 'notes' + | 'documentSplit' | 'query' | 'networkSession' | 'makeRequest' @@ -650,6 +653,10 @@ export class BoxClient { auth: this.auth, networkSession: this.networkSession, }); + this.documentSplit = new DocumentSplitManager({ + auth: this.auth, + networkSession: this.networkSession, + }); this.query = new QueryManager({ auth: this.auth, networkSession: this.networkSession, diff --git a/src/managers/documentSplit.ts b/src/managers/documentSplit.ts new file mode 100644 index 00000000..66003d5e --- /dev/null +++ b/src/managers/documentSplit.ts @@ -0,0 +1,396 @@ +import { serializeDocumentSplitCreateResponseV2026R0 } from '../schemas/v2026R0/documentSplitCreateResponseV2026R0'; +import { deserializeDocumentSplitCreateResponseV2026R0 } from '../schemas/v2026R0/documentSplitCreateResponseV2026R0'; +import { serializeClientErrorV2026R0 } from '../schemas/v2026R0/clientErrorV2026R0'; +import { deserializeClientErrorV2026R0 } from '../schemas/v2026R0/clientErrorV2026R0'; +import { serializeBoxVersionHeaderV2026R0 } from '../parameters/v2026R0/boxVersionHeaderV2026R0'; +import { deserializeBoxVersionHeaderV2026R0 } from '../parameters/v2026R0/boxVersionHeaderV2026R0'; +import { serializeDocumentSplitCreateRequestV2026R0 } from '../schemas/v2026R0/documentSplitCreateRequestV2026R0'; +import { deserializeDocumentSplitCreateRequestV2026R0 } from '../schemas/v2026R0/documentSplitCreateRequestV2026R0'; +import { serializeDocumentSplitsV2026R0 } from '../schemas/v2026R0/documentSplitsV2026R0'; +import { deserializeDocumentSplitsV2026R0 } from '../schemas/v2026R0/documentSplitsV2026R0'; +import { serializeDocumentSplitV2026R0 } from '../schemas/v2026R0/documentSplitV2026R0'; +import { deserializeDocumentSplitV2026R0 } from '../schemas/v2026R0/documentSplitV2026R0'; +import { ResponseFormat } from '../networking/fetchOptions'; +import { DocumentSplitCreateResponseV2026R0 } from '../schemas/v2026R0/documentSplitCreateResponseV2026R0'; +import { ClientErrorV2026R0 } from '../schemas/v2026R0/clientErrorV2026R0'; +import { BoxVersionHeaderV2026R0 } from '../parameters/v2026R0/boxVersionHeaderV2026R0'; +import { DocumentSplitCreateRequestV2026R0 } from '../schemas/v2026R0/documentSplitCreateRequestV2026R0'; +import { DocumentSplitsV2026R0 } from '../schemas/v2026R0/documentSplitsV2026R0'; +import { DocumentSplitV2026R0 } from '../schemas/v2026R0/documentSplitV2026R0'; +import { BoxSdkError } from '../box/errors'; +import { Authentication } from '../networking/auth'; +import { NetworkSession } from '../networking/network'; +import { FetchOptions } from '../networking/fetchOptions'; +import { FetchResponse } from '../networking/fetchResponse'; +import { prepareParams } from '../internal/utils'; +import { toString } from '../internal/utils'; +import { ByteStream } from '../internal/utils'; +import { CancellationToken } from '../internal/utils'; +import { sdToJson } from '../serialization/json'; +import { SerializedData } from '../serialization/json'; +import { sdIsEmpty } from '../serialization/json'; +import { sdIsBoolean } from '../serialization/json'; +import { sdIsNumber } from '../serialization/json'; +import { sdIsString } from '../serialization/json'; +import { sdIsList } from '../serialization/json'; +import { sdIsMap } from '../serialization/json'; +export class CreateDocumentSplitV2026R0Optionals { + readonly headers: CreateDocumentSplitV2026R0Headers = + new CreateDocumentSplitV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateDocumentSplitV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateDocumentSplitV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateDocumentSplitV2026R0OptionalsInput { + readonly headers?: CreateDocumentSplitV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetDocumentSplitByIdV2026R0Optionals { + readonly headers: GetDocumentSplitByIdV2026R0Headers = + new GetDocumentSplitByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetDocumentSplitByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetDocumentSplitByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetDocumentSplitByIdV2026R0OptionalsInput { + readonly headers?: GetDocumentSplitByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateDocumentSplitV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateDocumentSplitV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateDocumentSplitV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetDocumentSplitsV2026R0QueryParams { + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetDocumentSplitsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetDocumentSplitsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetDocumentSplitsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class GetDocumentSplitByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetDocumentSplitByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetDocumentSplitByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class DocumentSplitManager { + readonly auth?: Authentication; + readonly networkSession: NetworkSession = new NetworkSession({}); + constructor( + fields: Omit< + DocumentSplitManager, + | 'networkSession' + | 'createDocumentSplitV2026R0' + | 'getDocumentSplitsV2026R0' + | 'getDocumentSplitByIdV2026R0' + > & + Partial>, + ) { + if (fields.auth !== undefined) { + this.auth = fields.auth; + } + if (fields.networkSession !== undefined) { + this.networkSession = fields.networkSession; + } + } + /** + * Initiates a Document Split job for the supplied source file. The job runs + * asynchronously; clients can poll the returned job ID to track progress. + * + * All split-specific input lives under `split_input`. When + * `split_input.split_type` is `manual`, provide + * `split_input.split_definition` (continuous page ranges; `version` may be + * omitted or `v_1`). When `split_input.split_type` is `page_selection`, + * provide `split_input.page_selection` (non-linear page segments; `version` + * may be omitted or `v_2`). `split_input.prompt` must not be provided for + * either of those variants. When `split_input.split_type` is `smart`, + * `split_input.prompt` is required and neither + * `split_input.split_definition` nor `split_input.page_selection` must be + * provided. + * @param {DocumentSplitCreateRequestV2026R0} requestBody Request body of createDocumentSplitV2026R0 method + * @param {CreateDocumentSplitV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createDocumentSplitV2026R0( + requestBody: DocumentSplitCreateRequestV2026R0, + optionalsInput: CreateDocumentSplitV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateDocumentSplitV2026R0Optionals = + new CreateDocumentSplitV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/document_splits', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeDocumentSplitCreateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeDocumentSplitCreateResponseV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns a paginated list of Document Split jobs accessible to the + * authenticated user. + * @param {GetDocumentSplitsV2026R0QueryParams} queryParams Query parameters of getDocumentSplitsV2026R0 method + * @param {GetDocumentSplitsV2026R0HeadersInput} headersInput Headers of getDocumentSplitsV2026R0 method + * @param {CancellationToken} cancellationToken Token used for request cancellation. + * @returns {Promise} + */ + async getDocumentSplitsV2026R0( + queryParams: GetDocumentSplitsV2026R0QueryParams = {} satisfies GetDocumentSplitsV2026R0QueryParams, + headersInput: GetDocumentSplitsV2026R0HeadersInput = new GetDocumentSplitsV2026R0Headers( + {}, + ), + cancellationToken?: CancellationToken, + ): Promise { + const headers: GetDocumentSplitsV2026R0Headers = + new GetDocumentSplitsV2026R0Headers({ + boxVersion: headersInput.boxVersion, + extraHeaders: headersInput.extraHeaders, + }); + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/document_splits', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeDocumentSplitsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns details for a single Document Split job identified by its ID, + * including the current status, the input definition, and any output files + * produced by the job. + * @param {string} documentSplitId The unique identifier for the Document Split job. + Example: "1748426" + * @param {GetDocumentSplitByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getDocumentSplitByIdV2026R0( + documentSplitId: string, + optionalsInput: GetDocumentSplitByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetDocumentSplitByIdV2026R0Optionals = + new GetDocumentSplitByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/document_splits/', + (toString(documentSplitId) as string)!, + ) as string, + method: 'GET', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeDocumentSplitV2026R0(response.data!), + rawData: response.data!, + }; + } +} +export interface DocumentSplitManagerInput { + readonly auth?: Authentication; + readonly networkSession?: NetworkSession; +} diff --git a/src/managers/files.ts b/src/managers/files.ts index d422eeab..89a20292 100644 --- a/src/managers/files.ts +++ b/src/managers/files.ts @@ -1,12 +1,24 @@ +import { serializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { deserializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { serializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { deserializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { serializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; +import { deserializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { serializeFileFull } from '../schemas/fileFull'; import { deserializeFileFull } from '../schemas/fileFull'; import { serializeClientError } from '../schemas/clientError'; import { deserializeClientError } from '../schemas/clientError'; +import { serializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; +import { deserializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { serializeDateTime } from '../internal/utils'; import { deserializeDateTime } from '../internal/utils'; +import { SharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { SharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { SharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { ResponseFormat } from '../networking/fetchOptions'; import { FileFull } from '../schemas/fileFull'; import { ClientError } from '../schemas/clientError'; +import { SharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { BoxSdkError } from '../box/errors'; import { Authentication } from '../networking/auth'; import { NetworkSession } from '../networking/network'; @@ -403,6 +415,7 @@ export interface UpdateFileByIdRequestBodySharedLinkField { * users with paid accounts. */ readonly unsharedAt?: DateTime; readonly permissions?: UpdateFileByIdRequestBodySharedLinkPermissionsField; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export type UpdateFileByIdRequestBodyLockAccessField = 'lock' | string; @@ -1265,6 +1278,10 @@ export function serializeUpdateFileByIdRequestBodySharedLinkField( : serializeUpdateFileByIdRequestBodySharedLinkPermissionsField( val.permissions, ), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeUpdateFileByIdRequestBodySharedLinkField( @@ -1310,12 +1327,17 @@ export function deserializeUpdateFileByIdRequestBodySharedLinkField( : deserializeUpdateFileByIdRequestBodySharedLinkPermissionsField( val.permissions, ); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions, + oneTimePasscode: oneTimePasscode, } satisfies UpdateFileByIdRequestBodySharedLinkField; } export function serializeUpdateFileByIdRequestBodyLockAccessField( diff --git a/src/managers/folders.ts b/src/managers/folders.ts index ca4c5a70..c3f4a9b3 100644 --- a/src/managers/folders.ts +++ b/src/managers/folders.ts @@ -1,14 +1,26 @@ +import { serializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { deserializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { serializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { deserializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { serializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; +import { deserializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { serializeFolderFull } from '../schemas/folderFull'; import { deserializeFolderFull } from '../schemas/folderFull'; import { serializeClientError } from '../schemas/clientError'; import { deserializeClientError } from '../schemas/clientError'; +import { serializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; +import { deserializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { serializeItems } from '../schemas/items'; import { deserializeItems } from '../schemas/items'; import { serializeDateTime } from '../internal/utils'; import { deserializeDateTime } from '../internal/utils'; +import { SharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { SharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { SharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { ResponseFormat } from '../networking/fetchOptions'; import { FolderFull } from '../schemas/folderFull'; import { ClientError } from '../schemas/clientError'; +import { SharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { Items } from '../schemas/items'; import { BoxSdkError } from '../box/errors'; import { Authentication } from '../networking/auth'; @@ -423,6 +435,7 @@ export interface UpdateFolderByIdRequestBodySharedLinkField { * users with paid accounts. */ readonly unsharedAt?: DateTime; readonly permissions?: UpdateFolderByIdRequestBodySharedLinkPermissionsField; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export type UpdateFolderByIdRequestBodyFolderUploadEmailAccessField = @@ -1504,6 +1517,10 @@ export function serializeUpdateFolderByIdRequestBodySharedLinkField( : serializeUpdateFolderByIdRequestBodySharedLinkPermissionsField( val.permissions, ), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeUpdateFolderByIdRequestBodySharedLinkField( @@ -1550,12 +1567,17 @@ export function deserializeUpdateFolderByIdRequestBodySharedLinkField( : deserializeUpdateFolderByIdRequestBodySharedLinkPermissionsField( val.permissions, ); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions, + oneTimePasscode: oneTimePasscode, } satisfies UpdateFolderByIdRequestBodySharedLinkField; } export function serializeUpdateFolderByIdRequestBodyFolderUploadEmailAccessField( diff --git a/src/managers/index.ts b/src/managers/index.ts index 01c94c9c..fd564adb 100644 --- a/src/managers/index.ts +++ b/src/managers/index.ts @@ -83,4 +83,5 @@ export * from './archives'; export * from './externalUsers'; export * from './automateWorkflows'; export * from './notes'; +export * from './documentSplit'; export * from './query'; diff --git a/src/managers/sharedLinksFiles.ts b/src/managers/sharedLinksFiles.ts index 595c1462..b1f45688 100644 --- a/src/managers/sharedLinksFiles.ts +++ b/src/managers/sharedLinksFiles.ts @@ -1,12 +1,24 @@ +import { serializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { deserializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { serializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { deserializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { serializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; +import { deserializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { serializeFileFull } from '../schemas/fileFull'; import { deserializeFileFull } from '../schemas/fileFull'; import { serializeClientError } from '../schemas/clientError'; import { deserializeClientError } from '../schemas/clientError'; +import { serializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; +import { deserializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { serializeDateTime } from '../internal/utils'; import { deserializeDateTime } from '../internal/utils'; +import { SharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { SharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { SharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { ResponseFormat } from '../networking/fetchOptions'; import { FileFull } from '../schemas/fileFull'; import { ClientError } from '../schemas/clientError'; +import { SharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { BoxSdkError } from '../box/errors'; import { Authentication } from '../networking/auth'; import { NetworkSession } from '../networking/network'; @@ -298,6 +310,7 @@ export interface AddShareLinkToFileRequestBodySharedLinkField { * current date and time. */ readonly unsharedAt?: DateTime; readonly permissions?: AddShareLinkToFileRequestBodySharedLinkPermissionsField; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export interface AddShareLinkToFileRequestBody { @@ -396,6 +409,7 @@ export interface UpdateSharedLinkOnFileRequestBodySharedLinkField { * current date and time. */ readonly unsharedAt?: DateTime; readonly permissions?: UpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export interface UpdateSharedLinkOnFileRequestBody { @@ -893,6 +907,10 @@ export function serializeAddShareLinkToFileRequestBodySharedLinkField( : serializeAddShareLinkToFileRequestBodySharedLinkPermissionsField( val.permissions, ), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeAddShareLinkToFileRequestBodySharedLinkField( @@ -941,12 +959,17 @@ export function deserializeAddShareLinkToFileRequestBodySharedLinkField( : deserializeAddShareLinkToFileRequestBodySharedLinkPermissionsField( val.permissions, ); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions, + oneTimePasscode: oneTimePasscode, } satisfies AddShareLinkToFileRequestBodySharedLinkField; } export function serializeAddShareLinkToFileRequestBody( @@ -1070,6 +1093,10 @@ export function serializeUpdateSharedLinkOnFileRequestBodySharedLinkField( : serializeUpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField( val.permissions, ), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeUpdateSharedLinkOnFileRequestBodySharedLinkField( @@ -1119,12 +1146,17 @@ export function deserializeUpdateSharedLinkOnFileRequestBodySharedLinkField( : deserializeUpdateSharedLinkOnFileRequestBodySharedLinkPermissionsField( val.permissions, ); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions, + oneTimePasscode: oneTimePasscode, } satisfies UpdateSharedLinkOnFileRequestBodySharedLinkField; } export function serializeUpdateSharedLinkOnFileRequestBody( diff --git a/src/managers/sharedLinksFolders.ts b/src/managers/sharedLinksFolders.ts index b964003e..612e62c3 100644 --- a/src/managers/sharedLinksFolders.ts +++ b/src/managers/sharedLinksFolders.ts @@ -1,12 +1,24 @@ +import { serializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { deserializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { serializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { deserializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { serializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; +import { deserializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { serializeFolderFull } from '../schemas/folderFull'; import { deserializeFolderFull } from '../schemas/folderFull'; import { serializeClientError } from '../schemas/clientError'; import { deserializeClientError } from '../schemas/clientError'; +import { serializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; +import { deserializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { serializeDateTime } from '../internal/utils'; import { deserializeDateTime } from '../internal/utils'; +import { SharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { SharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { SharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { ResponseFormat } from '../networking/fetchOptions'; import { FolderFull } from '../schemas/folderFull'; import { ClientError } from '../schemas/clientError'; +import { SharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { BoxSdkError } from '../box/errors'; import { Authentication } from '../networking/auth'; import { NetworkSession } from '../networking/network'; @@ -300,6 +312,7 @@ export interface AddShareLinkToFolderRequestBodySharedLinkField { * current date and time. */ readonly unsharedAt?: DateTime; readonly permissions?: AddShareLinkToFolderRequestBodySharedLinkPermissionsField; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export interface AddShareLinkToFolderRequestBody { @@ -396,6 +409,7 @@ export interface UpdateSharedLinkOnFolderRequestBodySharedLinkField { * current date and time. */ readonly unsharedAt?: DateTime; readonly permissions?: UpdateSharedLinkOnFolderRequestBodySharedLinkPermissionsField; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export interface UpdateSharedLinkOnFolderRequestBody { @@ -902,6 +916,10 @@ export function serializeAddShareLinkToFolderRequestBodySharedLinkField( : serializeAddShareLinkToFolderRequestBodySharedLinkPermissionsField( val.permissions, ), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeAddShareLinkToFolderRequestBodySharedLinkField( @@ -951,12 +969,17 @@ export function deserializeAddShareLinkToFolderRequestBodySharedLinkField( : deserializeAddShareLinkToFolderRequestBodySharedLinkPermissionsField( val.permissions, ); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions, + oneTimePasscode: oneTimePasscode, } satisfies AddShareLinkToFolderRequestBodySharedLinkField; } export function serializeAddShareLinkToFolderRequestBody( @@ -1082,6 +1105,10 @@ export function serializeUpdateSharedLinkOnFolderRequestBodySharedLinkField( : serializeUpdateSharedLinkOnFolderRequestBodySharedLinkPermissionsField( val.permissions, ), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeUpdateSharedLinkOnFolderRequestBodySharedLinkField( @@ -1131,12 +1158,17 @@ export function deserializeUpdateSharedLinkOnFolderRequestBodySharedLinkField( : deserializeUpdateSharedLinkOnFolderRequestBodySharedLinkPermissionsField( val.permissions, ); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions, + oneTimePasscode: oneTimePasscode, } satisfies UpdateSharedLinkOnFolderRequestBodySharedLinkField; } export function serializeUpdateSharedLinkOnFolderRequestBody( diff --git a/src/managers/sharedLinksWebLinks.ts b/src/managers/sharedLinksWebLinks.ts index 1932b58a..a090ebfc 100644 --- a/src/managers/sharedLinksWebLinks.ts +++ b/src/managers/sharedLinksWebLinks.ts @@ -1,12 +1,24 @@ +import { serializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { deserializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { serializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { deserializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { serializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; +import { deserializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { serializeWebLink } from '../schemas/webLink'; import { deserializeWebLink } from '../schemas/webLink'; import { serializeClientError } from '../schemas/clientError'; import { deserializeClientError } from '../schemas/clientError'; +import { serializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; +import { deserializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { serializeDateTime } from '../internal/utils'; import { deserializeDateTime } from '../internal/utils'; +import { SharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { SharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { SharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { ResponseFormat } from '../networking/fetchOptions'; import { WebLink } from '../schemas/webLink'; import { ClientError } from '../schemas/clientError'; +import { SharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { BoxSdkError } from '../box/errors'; import { Authentication } from '../networking/auth'; import { NetworkSession } from '../networking/network'; @@ -302,6 +314,7 @@ export interface AddShareLinkToWebLinkRequestBodySharedLinkField { * current date and time. */ readonly unsharedAt?: DateTime; readonly permissions?: AddShareLinkToWebLinkRequestBodySharedLinkPermissionsField; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export interface AddShareLinkToWebLinkRequestBody { @@ -397,6 +410,7 @@ export interface UpdateSharedLinkOnWebLinkRequestBodySharedLinkField { * current date and time. */ readonly unsharedAt?: DateTime; readonly permissions?: UpdateSharedLinkOnWebLinkRequestBodySharedLinkPermissionsField; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export interface UpdateSharedLinkOnWebLinkRequestBody { @@ -867,6 +881,10 @@ export function serializeAddShareLinkToWebLinkRequestBodySharedLinkField( : serializeAddShareLinkToWebLinkRequestBodySharedLinkPermissionsField( val.permissions, ), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeAddShareLinkToWebLinkRequestBodySharedLinkField( @@ -916,12 +934,17 @@ export function deserializeAddShareLinkToWebLinkRequestBodySharedLinkField( : deserializeAddShareLinkToWebLinkRequestBodySharedLinkPermissionsField( val.permissions, ); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions, + oneTimePasscode: oneTimePasscode, } satisfies AddShareLinkToWebLinkRequestBodySharedLinkField; } export function serializeAddShareLinkToWebLinkRequestBody( @@ -1048,6 +1071,10 @@ export function serializeUpdateSharedLinkOnWebLinkRequestBodySharedLinkField( : serializeUpdateSharedLinkOnWebLinkRequestBodySharedLinkPermissionsField( val.permissions, ), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeUpdateSharedLinkOnWebLinkRequestBodySharedLinkField( @@ -1097,12 +1124,17 @@ export function deserializeUpdateSharedLinkOnWebLinkRequestBodySharedLinkField( : deserializeUpdateSharedLinkOnWebLinkRequestBodySharedLinkPermissionsField( val.permissions, ); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, permissions: permissions, + oneTimePasscode: oneTimePasscode, } satisfies UpdateSharedLinkOnWebLinkRequestBodySharedLinkField; } export function serializeUpdateSharedLinkOnWebLinkRequestBody( diff --git a/src/managers/users.ts b/src/managers/users.ts index 9a0bf71c..382f24f1 100644 --- a/src/managers/users.ts +++ b/src/managers/users.ts @@ -587,7 +587,13 @@ export interface DeleteUserByIdQueryParams { * the deletion. */ readonly notify?: boolean; /** - * Specifies whether to delete the user even if they still own files. */ + * Specifies whether to delete the user even if they still own files. + * + * If the user owns content and the enterprise has a retention policy, + * including a retired one, or a legal hold that is not fully released, + * setting `force` to `true` doesn't delete the user. The request returns + * a `403` error, and you must transfer the user's content before deleting + * the user. */ readonly force?: boolean; } export class DeleteUserByIdHeaders { @@ -926,6 +932,12 @@ export class UsersManager { * still owns any content. * To proceed, move their owned content first, or use the `force` parameter to delete * the user and their files. + * + * If the enterprise has a retention policy, including a retired one, or a + * legal hold that is not fully released, you can't delete a user who owns + * content, even with `force`. Transfer the user's content first by using the + * [Transfer owned folders](https://developer.box.com/reference/put-users-id-folders-0) + * endpoint. * @param {string} userId The ID of the user. Example: "12345" * @param {DeleteUserByIdOptionalsInput} optionalsInput diff --git a/src/managers/webLinks.ts b/src/managers/webLinks.ts index cd7072e3..dbcc8bbd 100644 --- a/src/managers/webLinks.ts +++ b/src/managers/webLinks.ts @@ -1,12 +1,24 @@ +import { serializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { deserializeSharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { serializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { deserializeSharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { serializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; +import { deserializeSharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { serializeWebLink } from '../schemas/webLink'; import { deserializeWebLink } from '../schemas/webLink'; import { serializeClientError } from '../schemas/clientError'; import { deserializeClientError } from '../schemas/clientError'; +import { serializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; +import { deserializeSharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { serializeDateTime } from '../internal/utils'; import { deserializeDateTime } from '../internal/utils'; +import { SharedLinkOtpWritableNone } from '../schemas/sharedLinkOtpWritableNone'; +import { SharedLinkOtpWritableOpen } from '../schemas/sharedLinkOtpWritableOpen'; +import { SharedLinkOtpWritableAllowlist } from '../schemas/sharedLinkOtpWritableAllowlist'; import { ResponseFormat } from '../networking/fetchOptions'; import { WebLink } from '../schemas/webLink'; import { ClientError } from '../schemas/clientError'; +import { SharedLinkOtpWritable } from '../schemas/sharedLinkOtpWritable'; import { BoxSdkError } from '../box/errors'; import { Authentication } from '../networking/auth'; import { NetworkSession } from '../networking/network'; @@ -258,6 +270,7 @@ export interface UpdateWebLinkByIdRequestBodySharedLinkField { * users with paid accounts. The value must be greater than the * current date and time. */ readonly unsharedAt?: DateTime; + readonly oneTimePasscode?: SharedLinkOtpWritable; readonly rawData?: SerializedData; } export interface UpdateWebLinkByIdRequestBody { @@ -678,6 +691,10 @@ export function serializeUpdateWebLinkByIdRequestBodySharedLinkField( val.unsharedAt == void 0 ? val.unsharedAt : serializeDateTime(val.unsharedAt), + ['one_time_passcode']: + val.oneTimePasscode == void 0 + ? val.oneTimePasscode + : serializeSharedLinkOtpWritable(val.oneTimePasscode), }; } export function deserializeUpdateWebLinkByIdRequestBodySharedLinkField( @@ -719,11 +736,16 @@ export function deserializeUpdateWebLinkByIdRequestBodySharedLinkField( } const unsharedAt: undefined | DateTime = val.unshared_at == void 0 ? void 0 : deserializeDateTime(val.unshared_at); + const oneTimePasscode: undefined | SharedLinkOtpWritable = + val.one_time_passcode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritable(val.one_time_passcode); return { access: access, password: password, vanityName: vanityName, unsharedAt: unsharedAt, + oneTimePasscode: oneTimePasscode, } satisfies UpdateWebLinkByIdRequestBodySharedLinkField; } export function serializeUpdateWebLinkByIdRequestBody( diff --git a/src/schemas/file.ts b/src/schemas/file.ts index 2b1aaa86..12adcebb 100644 --- a/src/schemas/file.ts +++ b/src/schemas/file.ts @@ -10,6 +10,8 @@ import { serializeFolderMini } from './folderMini'; import { deserializeFolderMini } from './folderMini'; import { serializeUserMini } from './userMini'; import { deserializeUserMini } from './userMini'; +import { serializeSharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; +import { deserializeSharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; import { serializeDateTime } from '../internal/utils'; import { deserializeDateTime } from '../internal/utils'; import { FileBaseTypeField } from './fileBase'; @@ -18,6 +20,7 @@ import { FileVersionMini } from './fileVersionMini'; import { FileMini } from './fileMini'; import { FolderMini } from './folderMini'; import { UserMini } from './userMini'; +import { SharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; import { BoxSdkError } from '../box/errors'; import { DateTime } from '../internal/utils'; import { SerializedData } from '../serialization/json'; @@ -64,6 +67,35 @@ export interface FileSharedLinkPermissionsField { readonly canEdit: boolean; readonly rawData?: SerializedData; } +export interface FileSharedLinkOneTimePasscodeField { + /** + * The current OTP enforcement mode for the shared link. + * + * * `none` - OTP enforcement is turned off. The shared link is accessible + * without any one-time-passcode verification. + * * `open` - Any anonymous recipient can request a one-time-passcode to + * any email address and access the shared link after verifying it. + * Collaborators and registered Box users access the link without + * being prompted. + * * `allowlist` - Anonymous recipients can request a one-time-passcode + * only when they enter an email that matches an entry on the + * `allowlist`. */ + readonly mode: string; + /** + * The list of email and domain entries that are permitted to access the + * shared link when `mode` is `allowlist`. Anonymous users whose + * email matches an entry can request and verify a one-time-passcode. + * + * Because the entries carry recipient email addresses and the identity + * of the user who added them, this field is only returned to users + * with owner, co-owner, or editor access on the item. For viewer + * collaborators and below the field is omitted. + * + * An allowlist contains at most 1000 entries, matching the limit + * enforced when setting the allowlist on a shared link. */ + readonly allowlist?: readonly SharedLinkOtpAllowlistEntry[]; + readonly rawData?: SerializedData; +} export interface FileSharedLinkField { /** * The URL that can be used to access the item on Box. @@ -129,6 +161,7 @@ export interface FileSharedLinkField { /** * The number of times this item has been previewed. */ readonly previewCount: number; + readonly oneTimePasscode: FileSharedLinkOneTimePasscodeField; readonly rawData?: SerializedData; } export type FileItemStatusField = 'active' | 'trashed' | 'deleted' | string; @@ -387,6 +420,63 @@ export function deserializeFileSharedLinkPermissionsField( canEdit: canEdit, } satisfies FileSharedLinkPermissionsField; } +export function serializeFileSharedLinkOneTimePasscodeField( + val: FileSharedLinkOneTimePasscodeField, +): SerializedData { + return { + ['mode']: val.mode, + ['allowlist']: + val.allowlist == void 0 + ? val.allowlist + : (val.allowlist.map(function ( + item: SharedLinkOtpAllowlistEntry, + ): SerializedData { + return serializeSharedLinkOtpAllowlistEntry(item); + }) as readonly any[]), + }; +} +export function deserializeFileSharedLinkOneTimePasscodeField( + val: SerializedData, +): FileSharedLinkOneTimePasscodeField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "FileSharedLinkOneTimePasscodeField"', + }); + } + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "FileSharedLinkOneTimePasscodeField" to be defined', + }); + } + if (!sdIsString(val.mode)) { + throw new BoxSdkError({ + message: + 'Expecting string for "mode" of type "FileSharedLinkOneTimePasscodeField"', + }); + } + const mode: string = val.mode; + if (!(val.allowlist == void 0) && !sdIsList(val.allowlist)) { + throw new BoxSdkError({ + message: + 'Expecting array for "allowlist" of type "FileSharedLinkOneTimePasscodeField"', + }); + } + const allowlist: undefined | readonly SharedLinkOtpAllowlistEntry[] = + val.allowlist == void 0 + ? void 0 + : sdIsList(val.allowlist) + ? (val.allowlist.map(function ( + itm: SerializedData, + ): SharedLinkOtpAllowlistEntry { + return deserializeSharedLinkOtpAllowlistEntry(itm); + }) as readonly any[]) + : []; + return { + mode: mode, + allowlist: allowlist, + } satisfies FileSharedLinkOneTimePasscodeField; +} export function serializeFileSharedLinkField( val: FileSharedLinkField, ): SerializedData { @@ -416,6 +506,9 @@ export function serializeFileSharedLinkField( : serializeFileSharedLinkPermissionsField(val.permissions), ['download_count']: val.downloadCount, ['preview_count']: val.previewCount, + ['one_time_passcode']: serializeFileSharedLinkOneTimePasscodeField( + val.oneTimePasscode, + ), }; } export function deserializeFileSharedLinkField( @@ -532,6 +625,14 @@ export function deserializeFileSharedLinkField( }); } const previewCount: number = val.preview_count; + if (val.one_time_passcode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "one_time_passcode" of type "FileSharedLinkField" to be defined', + }); + } + const oneTimePasscode: FileSharedLinkOneTimePasscodeField = + deserializeFileSharedLinkOneTimePasscodeField(val.one_time_passcode); return { url: url, downloadUrl: downloadUrl, @@ -545,6 +646,7 @@ export function deserializeFileSharedLinkField( permissions: permissions, downloadCount: downloadCount, previewCount: previewCount, + oneTimePasscode: oneTimePasscode, } satisfies FileSharedLinkField; } export function serializeFileItemStatusField( diff --git a/src/schemas/folder.ts b/src/schemas/folder.ts index ce7b8907..bb866b7b 100644 --- a/src/schemas/folder.ts +++ b/src/schemas/folder.ts @@ -6,6 +6,8 @@ import { serializeFolderMini } from './folderMini'; import { deserializeFolderMini } from './folderMini'; import { serializeUserMini } from './userMini'; import { deserializeUserMini } from './userMini'; +import { serializeSharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; +import { deserializeSharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; import { serializeItems } from './items'; import { deserializeItems } from './items'; import { serializeDateTime } from '../internal/utils'; @@ -14,6 +16,7 @@ import { FolderBaseTypeField } from './folderBase'; import { FolderBase } from './folderBase'; import { FolderMini } from './folderMini'; import { UserMini } from './userMini'; +import { SharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; import { Items } from './items'; import { BoxSdkError } from '../box/errors'; import { DateTime } from '../internal/utils'; @@ -61,6 +64,35 @@ export interface FolderSharedLinkPermissionsField { readonly canEdit: boolean; readonly rawData?: SerializedData; } +export interface FolderSharedLinkOneTimePasscodeField { + /** + * The current OTP enforcement mode for the shared link. + * + * * `none` - OTP enforcement is turned off. The shared link is accessible + * without any one-time-passcode verification. + * * `open` - Any anonymous recipient can request a one-time-passcode to + * any email address and access the shared link after verifying it. + * Collaborators and registered Box users access the link without + * being prompted. + * * `allowlist` - Anonymous recipients can request a one-time-passcode + * only when they enter an email that matches an entry on the + * `allowlist`. */ + readonly mode: string; + /** + * The list of email and domain entries that are permitted to access the + * shared link when `mode` is `allowlist`. Anonymous users whose + * email matches an entry can request and verify a one-time-passcode. + * + * Because the entries carry recipient email addresses and the identity + * of the user who added them, this field is only returned to users + * with owner, co-owner, or editor access on the item. For viewer + * collaborators and below the field is omitted. + * + * An allowlist contains at most 1000 entries, matching the limit + * enforced when setting the allowlist on a shared link. */ + readonly allowlist?: readonly SharedLinkOtpAllowlistEntry[]; + readonly rawData?: SerializedData; +} export interface FolderSharedLinkField { /** * The URL that can be used to access the item on Box. @@ -126,6 +158,7 @@ export interface FolderSharedLinkField { /** * The number of times this item has been previewed. */ readonly previewCount: number; + readonly oneTimePasscode: FolderSharedLinkOneTimePasscodeField; readonly rawData?: SerializedData; } export type FolderFolderUploadEmailAccessField = @@ -415,6 +448,63 @@ export function deserializeFolderSharedLinkPermissionsField( canEdit: canEdit, } satisfies FolderSharedLinkPermissionsField; } +export function serializeFolderSharedLinkOneTimePasscodeField( + val: FolderSharedLinkOneTimePasscodeField, +): SerializedData { + return { + ['mode']: val.mode, + ['allowlist']: + val.allowlist == void 0 + ? val.allowlist + : (val.allowlist.map(function ( + item: SharedLinkOtpAllowlistEntry, + ): SerializedData { + return serializeSharedLinkOtpAllowlistEntry(item); + }) as readonly any[]), + }; +} +export function deserializeFolderSharedLinkOneTimePasscodeField( + val: SerializedData, +): FolderSharedLinkOneTimePasscodeField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "FolderSharedLinkOneTimePasscodeField"', + }); + } + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "FolderSharedLinkOneTimePasscodeField" to be defined', + }); + } + if (!sdIsString(val.mode)) { + throw new BoxSdkError({ + message: + 'Expecting string for "mode" of type "FolderSharedLinkOneTimePasscodeField"', + }); + } + const mode: string = val.mode; + if (!(val.allowlist == void 0) && !sdIsList(val.allowlist)) { + throw new BoxSdkError({ + message: + 'Expecting array for "allowlist" of type "FolderSharedLinkOneTimePasscodeField"', + }); + } + const allowlist: undefined | readonly SharedLinkOtpAllowlistEntry[] = + val.allowlist == void 0 + ? void 0 + : sdIsList(val.allowlist) + ? (val.allowlist.map(function ( + itm: SerializedData, + ): SharedLinkOtpAllowlistEntry { + return deserializeSharedLinkOtpAllowlistEntry(itm); + }) as readonly any[]) + : []; + return { + mode: mode, + allowlist: allowlist, + } satisfies FolderSharedLinkOneTimePasscodeField; +} export function serializeFolderSharedLinkField( val: FolderSharedLinkField, ): SerializedData { @@ -444,6 +534,9 @@ export function serializeFolderSharedLinkField( : serializeFolderSharedLinkPermissionsField(val.permissions), ['download_count']: val.downloadCount, ['preview_count']: val.previewCount, + ['one_time_passcode']: serializeFolderSharedLinkOneTimePasscodeField( + val.oneTimePasscode, + ), }; } export function deserializeFolderSharedLinkField( @@ -562,6 +655,14 @@ export function deserializeFolderSharedLinkField( }); } const previewCount: number = val.preview_count; + if (val.one_time_passcode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "one_time_passcode" of type "FolderSharedLinkField" to be defined', + }); + } + const oneTimePasscode: FolderSharedLinkOneTimePasscodeField = + deserializeFolderSharedLinkOneTimePasscodeField(val.one_time_passcode); return { url: url, downloadUrl: downloadUrl, @@ -575,6 +676,7 @@ export function deserializeFolderSharedLinkField( permissions: permissions, downloadCount: downloadCount, previewCount: previewCount, + oneTimePasscode: oneTimePasscode, } satisfies FolderSharedLinkField; } export function serializeFolderFolderUploadEmailAccessField( diff --git a/src/schemas/index.ts b/src/schemas/index.ts index f53681e9..a743613e 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -140,6 +140,11 @@ export * from './fileVersionRetentions'; export * from './roleVariable'; export * from './outcome'; export * from './sessionTerminationMessage'; +export * from './sharedLinkOtpAllowlistEntryWritable'; +export * from './sharedLinkOtpWritableAllowlist'; +export * from './sharedLinkOtpWritableNone'; +export * from './sharedLinkOtpWritableOpen'; +export * from './sharedLinkOtpWritable'; export * from './shieldInformationBarrierBase'; export * from './shieldInformationBarrierReference'; export * from './shieldInformationBarrierReportBase'; @@ -235,9 +240,6 @@ export * from './fileVersion'; export * from './fileVersionFull'; export * from './fileVersions'; export * from './fileRequest'; -export * from './file'; -export * from './fileFull'; -export * from './files'; export * from './eventSource'; export * from './devicePinner'; export * from './devicePinners'; @@ -260,6 +262,10 @@ export * from './shieldInformationBarrierReport'; export * from './shieldInformationBarrierReports'; export * from './shieldInformationBarrier'; export * from './shieldInformationBarriers'; +export * from './sharedLinkOtpAllowlistEntry'; +export * from './file'; +export * from './fileFull'; +export * from './files'; export * from './folderLock'; export * from './folderLocks'; export * from './aiAgentAllowedEntity'; diff --git a/src/schemas/keywordSkillCard.ts b/src/schemas/keywordSkillCard.ts index 9d7d801e..7a1bafe3 100644 --- a/src/schemas/keywordSkillCard.ts +++ b/src/schemas/keywordSkillCard.ts @@ -127,7 +127,7 @@ export class KeywordSkillCard { * which instance of a service applied the metadata. */ readonly invocation!: KeywordSkillCardInvocationField; /** - * An list of entries in the metadata card. */ + * A list of entries in the metadata card. */ readonly entries!: readonly KeywordSkillCardEntriesField[]; readonly rawData?: SerializedData; constructor( @@ -181,7 +181,7 @@ export interface KeywordSkillCardInput { * which instance of a service applied the metadata. */ readonly invocation: KeywordSkillCardInvocationField; /** - * An list of entries in the metadata card. */ + * A list of entries in the metadata card. */ readonly entries: readonly KeywordSkillCardEntriesField[]; readonly rawData?: SerializedData; } diff --git a/src/schemas/sharedLinkOtpAllowlistEntry.ts b/src/schemas/sharedLinkOtpAllowlistEntry.ts new file mode 100644 index 00000000..2b84684f --- /dev/null +++ b/src/schemas/sharedLinkOtpAllowlistEntry.ts @@ -0,0 +1,119 @@ +import { serializeUserBase } from './userBase'; +import { deserializeUserBase } from './userBase'; +import { serializeDateTime } from '../internal/utils'; +import { deserializeDateTime } from '../internal/utils'; +import { UserBase } from './userBase'; +import { BoxSdkError } from '../box/errors'; +import { DateTime } from '../internal/utils'; +import { SerializedData } from '../serialization/json'; +import { sdIsEmpty } from '../serialization/json'; +import { sdIsBoolean } from '../serialization/json'; +import { sdIsNumber } from '../serialization/json'; +import { sdIsString } from '../serialization/json'; +import { sdIsList } from '../serialization/json'; +import { sdIsMap } from '../serialization/json'; +export type SharedLinkOtpAllowlistEntryTypeField = 'email' | 'domain'; +export interface SharedLinkOtpAllowlistEntry { + /** + * The kind of allowlist entry. + * + * * `email` - The entry matches a single email address. + * * `domain` - The entry matches every email address under the + * given domain. */ + readonly type: SharedLinkOtpAllowlistEntryTypeField; + /** + * The value of the allowlist entry. + * + * * For `email` entries, the full email address (must contain `@`). + * * For `domain` entries, the bare domain (e.g. `example.com`). */ + readonly value: string; + /** + * The date and time when the allowlist entry was added. */ + readonly createdAt: DateTime; + readonly createdBy: UserBase; + readonly rawData?: SerializedData; +} +export function serializeSharedLinkOtpAllowlistEntryTypeField( + val: SharedLinkOtpAllowlistEntryTypeField, +): SerializedData { + return val; +} +export function deserializeSharedLinkOtpAllowlistEntryTypeField( + val: SerializedData, +): SharedLinkOtpAllowlistEntryTypeField { + if (val == 'email') { + return val; + } + if (val == 'domain') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize SharedLinkOtpAllowlistEntryTypeField", + }); +} +export function serializeSharedLinkOtpAllowlistEntry( + val: SharedLinkOtpAllowlistEntry, +): SerializedData { + return { + ['type']: serializeSharedLinkOtpAllowlistEntryTypeField(val.type), + ['value']: val.value, + ['created_at']: serializeDateTime(val.createdAt), + ['created_by']: serializeUserBase(val.createdBy), + }; +} +export function deserializeSharedLinkOtpAllowlistEntry( + val: SerializedData, +): SharedLinkOtpAllowlistEntry { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "SharedLinkOtpAllowlistEntry"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "SharedLinkOtpAllowlistEntry" to be defined', + }); + } + const type: SharedLinkOtpAllowlistEntryTypeField = + deserializeSharedLinkOtpAllowlistEntryTypeField(val.type); + if (val.value == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "value" of type "SharedLinkOtpAllowlistEntry" to be defined', + }); + } + if (!sdIsString(val.value)) { + throw new BoxSdkError({ + message: + 'Expecting string for "value" of type "SharedLinkOtpAllowlistEntry"', + }); + } + const value: string = val.value; + if (val.created_at == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "created_at" of type "SharedLinkOtpAllowlistEntry" to be defined', + }); + } + if (!sdIsString(val.created_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "created_at" of type "SharedLinkOtpAllowlistEntry"', + }); + } + const createdAt: DateTime = deserializeDateTime(val.created_at); + if (val.created_by == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "created_by" of type "SharedLinkOtpAllowlistEntry" to be defined', + }); + } + const createdBy: UserBase = deserializeUserBase(val.created_by); + return { + type: type, + value: value, + createdAt: createdAt, + createdBy: createdBy, + } satisfies SharedLinkOtpAllowlistEntry; +} diff --git a/src/schemas/sharedLinkOtpAllowlistEntryWritable.ts b/src/schemas/sharedLinkOtpAllowlistEntryWritable.ts new file mode 100644 index 00000000..ba98341d --- /dev/null +++ b/src/schemas/sharedLinkOtpAllowlistEntryWritable.ts @@ -0,0 +1,85 @@ +import { BoxSdkError } from '../box/errors'; +import { SerializedData } from '../serialization/json'; +import { sdIsEmpty } from '../serialization/json'; +import { sdIsBoolean } from '../serialization/json'; +import { sdIsNumber } from '../serialization/json'; +import { sdIsString } from '../serialization/json'; +import { sdIsList } from '../serialization/json'; +import { sdIsMap } from '../serialization/json'; +export type SharedLinkOtpAllowlistEntryWritableTypeField = 'email' | 'domain'; +export interface SharedLinkOtpAllowlistEntryWritable { + /** + * The kind of allowlist entry. + * + * * `email` - The entry matches a single email address. + * * `domain` - The entry matches every email address under the + * given domain. */ + readonly type: SharedLinkOtpAllowlistEntryWritableTypeField; + /** + * The value of the allowlist entry. + * + * * For `email` entries, the full email address (must contain `@`). + * * For `domain` entries, the bare domain (e.g. `example.com`). */ + readonly value: string; + readonly rawData?: SerializedData; +} +export function serializeSharedLinkOtpAllowlistEntryWritableTypeField( + val: SharedLinkOtpAllowlistEntryWritableTypeField, +): SerializedData { + return val; +} +export function deserializeSharedLinkOtpAllowlistEntryWritableTypeField( + val: SerializedData, +): SharedLinkOtpAllowlistEntryWritableTypeField { + if (val == 'email') { + return val; + } + if (val == 'domain') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize SharedLinkOtpAllowlistEntryWritableTypeField", + }); +} +export function serializeSharedLinkOtpAllowlistEntryWritable( + val: SharedLinkOtpAllowlistEntryWritable, +): SerializedData { + return { + ['type']: serializeSharedLinkOtpAllowlistEntryWritableTypeField(val.type), + ['value']: val.value, + }; +} +export function deserializeSharedLinkOtpAllowlistEntryWritable( + val: SerializedData, +): SharedLinkOtpAllowlistEntryWritable { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "SharedLinkOtpAllowlistEntryWritable"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "SharedLinkOtpAllowlistEntryWritable" to be defined', + }); + } + const type: SharedLinkOtpAllowlistEntryWritableTypeField = + deserializeSharedLinkOtpAllowlistEntryWritableTypeField(val.type); + if (val.value == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "value" of type "SharedLinkOtpAllowlistEntryWritable" to be defined', + }); + } + if (!sdIsString(val.value)) { + throw new BoxSdkError({ + message: + 'Expecting string for "value" of type "SharedLinkOtpAllowlistEntryWritable"', + }); + } + const value: string = val.value; + return { + type: type, + value: value, + } satisfies SharedLinkOtpAllowlistEntryWritable; +} diff --git a/src/schemas/sharedLinkOtpWritable.ts b/src/schemas/sharedLinkOtpWritable.ts new file mode 100644 index 00000000..ea0962bf --- /dev/null +++ b/src/schemas/sharedLinkOtpWritable.ts @@ -0,0 +1,95 @@ +import { serializeSharedLinkOtpWritableNone } from './sharedLinkOtpWritableNone'; +import { deserializeSharedLinkOtpWritableNone } from './sharedLinkOtpWritableNone'; +import { serializeSharedLinkOtpWritableOpen } from './sharedLinkOtpWritableOpen'; +import { deserializeSharedLinkOtpWritableOpen } from './sharedLinkOtpWritableOpen'; +import { serializeSharedLinkOtpWritableAllowlist } from './sharedLinkOtpWritableAllowlist'; +import { deserializeSharedLinkOtpWritableAllowlist } from './sharedLinkOtpWritableAllowlist'; +import { SharedLinkOtpWritableNone } from './sharedLinkOtpWritableNone'; +import { SharedLinkOtpWritableOpen } from './sharedLinkOtpWritableOpen'; +import { SharedLinkOtpWritableAllowlist } from './sharedLinkOtpWritableAllowlist'; +import { BoxSdkError } from '../box/errors'; +import { SerializedData } from '../serialization/json'; +import { sdIsEmpty } from '../serialization/json'; +import { sdIsBoolean } from '../serialization/json'; +import { sdIsNumber } from '../serialization/json'; +import { sdIsString } from '../serialization/json'; +import { sdIsList } from '../serialization/json'; +import { sdIsMap } from '../serialization/json'; +export type SharedLinkOtpWritable = + | SharedLinkOtpWritableNone + | SharedLinkOtpWritableOpen + | SharedLinkOtpWritableAllowlist; +export function serializeSharedLinkOtpWritable(val: any): SerializedData { + try { + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "SharedLinkOtpWritableNone" to be defined', + }); + } + return serializeSharedLinkOtpWritableNone(val); + } catch (error) { + void 0; + } finally { + } + try { + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "SharedLinkOtpWritableOpen" to be defined', + }); + } + return serializeSharedLinkOtpWritableOpen(val); + } catch (error) { + void 0; + } finally { + } + try { + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "SharedLinkOtpWritableAllowlist" to be defined', + }); + } + if (val.allowlist == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "allowlist" of type "SharedLinkOtpWritableAllowlist" to be defined', + }); + } + if (!sdIsList(val.allowlist)) { + throw new BoxSdkError({ + message: + 'Expecting array for "allowlist" of type "SharedLinkOtpWritableAllowlist"', + }); + } + return serializeSharedLinkOtpWritableAllowlist(val); + } catch (error) { + void 0; + } finally { + } + throw new BoxSdkError({ message: "Can't serialize SharedLinkOtpWritable" }); +} +export function deserializeSharedLinkOtpWritable( + val: SerializedData, +): SharedLinkOtpWritable { + try { + return deserializeSharedLinkOtpWritableNone(val); + } catch (error) { + void 0; + } finally { + } + try { + return deserializeSharedLinkOtpWritableOpen(val); + } catch (error) { + void 0; + } finally { + } + try { + return deserializeSharedLinkOtpWritableAllowlist(val); + } catch (error) { + void 0; + } finally { + } + throw new BoxSdkError({ message: "Can't deserialize SharedLinkOtpWritable" }); +} diff --git a/src/schemas/sharedLinkOtpWritableAllowlist.ts b/src/schemas/sharedLinkOtpWritableAllowlist.ts new file mode 100644 index 00000000..916824fb --- /dev/null +++ b/src/schemas/sharedLinkOtpWritableAllowlist.ts @@ -0,0 +1,182 @@ +import { serializeSharedLinkOtpAllowlistEntryWritable } from './sharedLinkOtpAllowlistEntryWritable'; +import { deserializeSharedLinkOtpAllowlistEntryWritable } from './sharedLinkOtpAllowlistEntryWritable'; +import { SharedLinkOtpAllowlistEntryWritable } from './sharedLinkOtpAllowlistEntryWritable'; +import { BoxSdkError } from '../box/errors'; +import { SerializedData } from '../serialization/json'; +import { sdIsEmpty } from '../serialization/json'; +import { sdIsBoolean } from '../serialization/json'; +import { sdIsNumber } from '../serialization/json'; +import { sdIsString } from '../serialization/json'; +import { sdIsList } from '../serialization/json'; +import { sdIsMap } from '../serialization/json'; +export type SharedLinkOtpWritableAllowlistModeField = 'allowlist' | string; +export class SharedLinkOtpWritableAllowlist { + /** + * Set to `allowlist` to restrict OTP requests to emails matching an + * entry on the `allowlist`. */ + readonly mode: SharedLinkOtpWritableAllowlistModeField = + 'allowlist' as SharedLinkOtpWritableAllowlistModeField; + /** + * The list of email and domain entries that are permitted to access the + * shared link when `mode` is `allowlist`. Anonymous users whose + * email matches an entry can request and verify a one-time-passcode. + * + * Providing this field replaces the entire existing allowlist; passing + * an empty array clears all entries. Required when `mode` is `allowlist`. */ + readonly allowlist!: readonly SharedLinkOtpAllowlistEntryWritable[]; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.mode !== undefined) { + this.mode = fields.mode; + } + if (fields.allowlist !== undefined) { + this.allowlist = fields.allowlist; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface SharedLinkOtpWritableAllowlistInput { + /** + * Set to `allowlist` to restrict OTP requests to emails matching an + * entry on the `allowlist`. */ + readonly mode?: SharedLinkOtpWritableAllowlistModeField; + /** + * The list of email and domain entries that are permitted to access the + * shared link when `mode` is `allowlist`. Anonymous users whose + * email matches an entry can request and verify a one-time-passcode. + * + * Providing this field replaces the entire existing allowlist; passing + * an empty array clears all entries. Required when `mode` is `allowlist`. */ + readonly allowlist: readonly SharedLinkOtpAllowlistEntryWritable[]; + readonly rawData?: SerializedData; +} +export function serializeSharedLinkOtpWritableAllowlistModeField( + val: SharedLinkOtpWritableAllowlistModeField, +): SerializedData { + return val; +} +export function deserializeSharedLinkOtpWritableAllowlistModeField( + val: SerializedData, +): SharedLinkOtpWritableAllowlistModeField { + if (val == 'allowlist') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize SharedLinkOtpWritableAllowlistModeField", + }); +} +export function serializeSharedLinkOtpWritableAllowlist( + val: SharedLinkOtpWritableAllowlist, +): SerializedData { + return { + ['mode']: serializeSharedLinkOtpWritableAllowlistModeField(val.mode), + ['allowlist']: val.allowlist.map(function ( + item: SharedLinkOtpAllowlistEntryWritable, + ): SerializedData { + return serializeSharedLinkOtpAllowlistEntryWritable(item); + }) as readonly any[], + }; +} +export function deserializeSharedLinkOtpWritableAllowlist( + val: SerializedData, +): SharedLinkOtpWritableAllowlist { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "SharedLinkOtpWritableAllowlist"', + }); + } + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "SharedLinkOtpWritableAllowlist" to be defined', + }); + } + const mode: SharedLinkOtpWritableAllowlistModeField = + deserializeSharedLinkOtpWritableAllowlistModeField(val.mode); + if (val.allowlist == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "allowlist" of type "SharedLinkOtpWritableAllowlist" to be defined', + }); + } + if (!sdIsList(val.allowlist)) { + throw new BoxSdkError({ + message: + 'Expecting array for "allowlist" of type "SharedLinkOtpWritableAllowlist"', + }); + } + const allowlist: readonly SharedLinkOtpAllowlistEntryWritable[] = sdIsList( + val.allowlist, + ) + ? (val.allowlist.map(function ( + itm: SerializedData, + ): SharedLinkOtpAllowlistEntryWritable { + return deserializeSharedLinkOtpAllowlistEntryWritable(itm); + }) as readonly any[]) + : []; + return { + mode: mode, + allowlist: allowlist, + } satisfies SharedLinkOtpWritableAllowlist; +} +export function serializeSharedLinkOtpWritableAllowlistInput( + val: SharedLinkOtpWritableAllowlistInput, +): SerializedData { + return { + ['mode']: + val.mode == void 0 + ? val.mode + : serializeSharedLinkOtpWritableAllowlistModeField(val.mode), + ['allowlist']: val.allowlist.map(function ( + item: SharedLinkOtpAllowlistEntryWritable, + ): SerializedData { + return serializeSharedLinkOtpAllowlistEntryWritable(item); + }) as readonly any[], + }; +} +export function deserializeSharedLinkOtpWritableAllowlistInput( + val: SerializedData, +): SharedLinkOtpWritableAllowlistInput { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "SharedLinkOtpWritableAllowlistInput"', + }); + } + const mode: undefined | SharedLinkOtpWritableAllowlistModeField = + val.mode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritableAllowlistModeField(val.mode); + if (val.allowlist == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "allowlist" of type "SharedLinkOtpWritableAllowlistInput" to be defined', + }); + } + if (!sdIsList(val.allowlist)) { + throw new BoxSdkError({ + message: + 'Expecting array for "allowlist" of type "SharedLinkOtpWritableAllowlistInput"', + }); + } + const allowlist: readonly SharedLinkOtpAllowlistEntryWritable[] = sdIsList( + val.allowlist, + ) + ? (val.allowlist.map(function ( + itm: SerializedData, + ): SharedLinkOtpAllowlistEntryWritable { + return deserializeSharedLinkOtpAllowlistEntryWritable(itm); + }) as readonly any[]) + : []; + return { + mode: mode, + allowlist: allowlist, + } satisfies SharedLinkOtpWritableAllowlistInput; +} diff --git a/src/schemas/sharedLinkOtpWritableNone.ts b/src/schemas/sharedLinkOtpWritableNone.ts new file mode 100644 index 00000000..d6200196 --- /dev/null +++ b/src/schemas/sharedLinkOtpWritableNone.ts @@ -0,0 +1,98 @@ +import { BoxSdkError } from '../box/errors'; +import { SerializedData } from '../serialization/json'; +import { sdIsEmpty } from '../serialization/json'; +import { sdIsBoolean } from '../serialization/json'; +import { sdIsNumber } from '../serialization/json'; +import { sdIsString } from '../serialization/json'; +import { sdIsList } from '../serialization/json'; +import { sdIsMap } from '../serialization/json'; +export type SharedLinkOtpWritableNoneModeField = 'none' | string; +export class SharedLinkOtpWritableNone { + /** + * Set to `none` to disable OTP enforcement for the shared link. */ + readonly mode: SharedLinkOtpWritableNoneModeField = + 'none' as SharedLinkOtpWritableNoneModeField; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.mode !== undefined) { + this.mode = fields.mode; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface SharedLinkOtpWritableNoneInput { + /** + * Set to `none` to disable OTP enforcement for the shared link. */ + readonly mode?: SharedLinkOtpWritableNoneModeField; + readonly rawData?: SerializedData; +} +export function serializeSharedLinkOtpWritableNoneModeField( + val: SharedLinkOtpWritableNoneModeField, +): SerializedData { + return val; +} +export function deserializeSharedLinkOtpWritableNoneModeField( + val: SerializedData, +): SharedLinkOtpWritableNoneModeField { + if (val == 'none') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize SharedLinkOtpWritableNoneModeField", + }); +} +export function serializeSharedLinkOtpWritableNone( + val: SharedLinkOtpWritableNone, +): SerializedData { + return { ['mode']: serializeSharedLinkOtpWritableNoneModeField(val.mode) }; +} +export function deserializeSharedLinkOtpWritableNone( + val: SerializedData, +): SharedLinkOtpWritableNone { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "SharedLinkOtpWritableNone"', + }); + } + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "SharedLinkOtpWritableNone" to be defined', + }); + } + const mode: SharedLinkOtpWritableNoneModeField = + deserializeSharedLinkOtpWritableNoneModeField(val.mode); + return { mode: mode } satisfies SharedLinkOtpWritableNone; +} +export function serializeSharedLinkOtpWritableNoneInput( + val: SharedLinkOtpWritableNoneInput, +): SerializedData { + return { + ['mode']: + val.mode == void 0 + ? val.mode + : serializeSharedLinkOtpWritableNoneModeField(val.mode), + }; +} +export function deserializeSharedLinkOtpWritableNoneInput( + val: SerializedData, +): SharedLinkOtpWritableNoneInput { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "SharedLinkOtpWritableNoneInput"', + }); + } + const mode: undefined | SharedLinkOtpWritableNoneModeField = + val.mode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritableNoneModeField(val.mode); + return { mode: mode } satisfies SharedLinkOtpWritableNoneInput; +} diff --git a/src/schemas/sharedLinkOtpWritableOpen.ts b/src/schemas/sharedLinkOtpWritableOpen.ts new file mode 100644 index 00000000..44a3183a --- /dev/null +++ b/src/schemas/sharedLinkOtpWritableOpen.ts @@ -0,0 +1,100 @@ +import { BoxSdkError } from '../box/errors'; +import { SerializedData } from '../serialization/json'; +import { sdIsEmpty } from '../serialization/json'; +import { sdIsBoolean } from '../serialization/json'; +import { sdIsNumber } from '../serialization/json'; +import { sdIsString } from '../serialization/json'; +import { sdIsList } from '../serialization/json'; +import { sdIsMap } from '../serialization/json'; +export type SharedLinkOtpWritableOpenModeField = 'open' | string; +export class SharedLinkOtpWritableOpen { + /** + * Set to `open` to allow any anonymous recipient to request a + * one-time-passcode to any email address. */ + readonly mode: SharedLinkOtpWritableOpenModeField = + 'open' as SharedLinkOtpWritableOpenModeField; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.mode !== undefined) { + this.mode = fields.mode; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface SharedLinkOtpWritableOpenInput { + /** + * Set to `open` to allow any anonymous recipient to request a + * one-time-passcode to any email address. */ + readonly mode?: SharedLinkOtpWritableOpenModeField; + readonly rawData?: SerializedData; +} +export function serializeSharedLinkOtpWritableOpenModeField( + val: SharedLinkOtpWritableOpenModeField, +): SerializedData { + return val; +} +export function deserializeSharedLinkOtpWritableOpenModeField( + val: SerializedData, +): SharedLinkOtpWritableOpenModeField { + if (val == 'open') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize SharedLinkOtpWritableOpenModeField", + }); +} +export function serializeSharedLinkOtpWritableOpen( + val: SharedLinkOtpWritableOpen, +): SerializedData { + return { ['mode']: serializeSharedLinkOtpWritableOpenModeField(val.mode) }; +} +export function deserializeSharedLinkOtpWritableOpen( + val: SerializedData, +): SharedLinkOtpWritableOpen { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "SharedLinkOtpWritableOpen"', + }); + } + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "SharedLinkOtpWritableOpen" to be defined', + }); + } + const mode: SharedLinkOtpWritableOpenModeField = + deserializeSharedLinkOtpWritableOpenModeField(val.mode); + return { mode: mode } satisfies SharedLinkOtpWritableOpen; +} +export function serializeSharedLinkOtpWritableOpenInput( + val: SharedLinkOtpWritableOpenInput, +): SerializedData { + return { + ['mode']: + val.mode == void 0 + ? val.mode + : serializeSharedLinkOtpWritableOpenModeField(val.mode), + }; +} +export function deserializeSharedLinkOtpWritableOpenInput( + val: SerializedData, +): SharedLinkOtpWritableOpenInput { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "SharedLinkOtpWritableOpenInput"', + }); + } + const mode: undefined | SharedLinkOtpWritableOpenModeField = + val.mode == void 0 + ? void 0 + : deserializeSharedLinkOtpWritableOpenModeField(val.mode); + return { mode: mode } satisfies SharedLinkOtpWritableOpenInput; +} diff --git a/src/schemas/transcriptSkillCard.ts b/src/schemas/transcriptSkillCard.ts index 28a7771a..c1a8a79b 100644 --- a/src/schemas/transcriptSkillCard.ts +++ b/src/schemas/transcriptSkillCard.ts @@ -145,7 +145,7 @@ export class TranscriptSkillCard { * `timeline`. */ readonly duration?: number; /** - * An list of entries for the card. This represents the individual entries of + * A list of entries for the card. This represents the individual entries of * the transcription. */ readonly entries!: readonly TranscriptSkillCardEntriesField[]; readonly rawData?: SerializedData; @@ -209,7 +209,7 @@ export interface TranscriptSkillCardInput { * `timeline`. */ readonly duration?: number; /** - * An list of entries for the card. This represents the individual entries of + * A list of entries for the card. This represents the individual entries of * the transcription. */ readonly entries: readonly TranscriptSkillCardEntriesField[]; readonly rawData?: SerializedData; diff --git a/src/schemas/uploadSession.ts b/src/schemas/uploadSession.ts index e726c080..99d56c6a 100644 --- a/src/schemas/uploadSession.ts +++ b/src/schemas/uploadSession.ts @@ -46,7 +46,7 @@ export interface UploadSession { * The date and time when this session expires. */ readonly sessionExpiresAt?: DateTime; /** - * The size in bytes that must be used for all parts of of the + * The size in bytes that must be used for all parts of the * upload. * * Only the last part is allowed to be of a smaller size. */ @@ -59,7 +59,7 @@ export interface UploadSession { * The number of parts that have been uploaded and processed * by the server. This starts at `0`. * - * When committing a file files, inspecting this property can + * When committing a file, inspecting this property can * provide insight if all parts have been uploaded correctly. */ readonly numPartsProcessed?: number; readonly sessionEndpoints?: UploadSessionSessionEndpointsField; diff --git a/src/schemas/v2026R0/documentFailuresV2026R0.ts b/src/schemas/v2026R0/documentFailuresV2026R0.ts new file mode 100644 index 00000000..8b2c5e49 --- /dev/null +++ b/src/schemas/v2026R0/documentFailuresV2026R0.ts @@ -0,0 +1,85 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface DocumentFailuresV2026R0 { + /** + * A list of errors that occurred during the document job. */ + readonly errors: readonly string[]; + /** + * A list of warnings that occurred during the document job. */ + readonly warnings: readonly string[]; + readonly rawData?: SerializedData; +} +export function serializeDocumentFailuresV2026R0( + val: DocumentFailuresV2026R0, +): SerializedData { + return { + ['errors']: val.errors.map(function (item: string): SerializedData { + return item; + }) as readonly any[], + ['warnings']: val.warnings.map(function (item: string): SerializedData { + return item; + }) as readonly any[], + }; +} +export function deserializeDocumentFailuresV2026R0( + val: SerializedData, +): DocumentFailuresV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentFailuresV2026R0"', + }); + } + if (val.errors == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "errors" of type "DocumentFailuresV2026R0" to be defined', + }); + } + if (!sdIsList(val.errors)) { + throw new BoxSdkError({ + message: 'Expecting array for "errors" of type "DocumentFailuresV2026R0"', + }); + } + const errors: readonly string[] = sdIsList(val.errors) + ? (val.errors.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "DocumentFailuresV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + if (val.warnings == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "warnings" of type "DocumentFailuresV2026R0" to be defined', + }); + } + if (!sdIsList(val.warnings)) { + throw new BoxSdkError({ + message: + 'Expecting array for "warnings" of type "DocumentFailuresV2026R0"', + }); + } + const warnings: readonly string[] = sdIsList(val.warnings) + ? (val.warnings.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "DocumentFailuresV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + return { + errors: errors, + warnings: warnings, + } satisfies DocumentFailuresV2026R0; +} diff --git a/src/schemas/v2026R0/documentSplitCreateRequestManualV2026R0.ts b/src/schemas/v2026R0/documentSplitCreateRequestManualV2026R0.ts new file mode 100644 index 00000000..9d33d2b4 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitCreateRequestManualV2026R0.ts @@ -0,0 +1,245 @@ +import { serializeDocumentSplitPageRangeV2026R0 } from './documentSplitPageRangeV2026R0'; +import { deserializeDocumentSplitPageRangeV2026R0 } from './documentSplitPageRangeV2026R0'; +import { DocumentSplitPageRangeV2026R0 } from './documentSplitPageRangeV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitCreateRequestManualV2026R0SplitTypeField = + 'manual' | string; +export type DocumentSplitCreateRequestManualV2026R0VersionField = + 'v_1' | string; +export class DocumentSplitCreateRequestManualV2026R0 { + /** + * Discriminator. Must be `manual` for this variant. */ + readonly splitType: DocumentSplitCreateRequestManualV2026R0SplitTypeField = + 'manual' as DocumentSplitCreateRequestManualV2026R0SplitTypeField; + /** + * The version of the manual split input format. Omitted or `v_1` is the + * legacy `split_definition` format. Existing clients may omit this field. */ + readonly version?: DocumentSplitCreateRequestManualV2026R0VersionField; + /** + * Page ranges that define the split. Each entry produces one output file + * containing the inclusive page range `[start, end]`. */ + readonly splitDefinition!: readonly DocumentSplitPageRangeV2026R0[]; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.splitType !== undefined) { + this.splitType = fields.splitType; + } + if (fields.version !== undefined) { + this.version = fields.version; + } + if (fields.splitDefinition !== undefined) { + this.splitDefinition = fields.splitDefinition; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface DocumentSplitCreateRequestManualV2026R0Input { + /** + * Discriminator. Must be `manual` for this variant. */ + readonly splitType?: DocumentSplitCreateRequestManualV2026R0SplitTypeField; + /** + * The version of the manual split input format. Omitted or `v_1` is the + * legacy `split_definition` format. Existing clients may omit this field. */ + readonly version?: DocumentSplitCreateRequestManualV2026R0VersionField; + /** + * Page ranges that define the split. Each entry produces one output file + * containing the inclusive page range `[start, end]`. */ + readonly splitDefinition: readonly DocumentSplitPageRangeV2026R0[]; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitCreateRequestManualV2026R0SplitTypeField( + val: DocumentSplitCreateRequestManualV2026R0SplitTypeField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitCreateRequestManualV2026R0SplitTypeField( + val: SerializedData, +): DocumentSplitCreateRequestManualV2026R0SplitTypeField { + if (val == 'manual') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize DocumentSplitCreateRequestManualV2026R0SplitTypeField", + }); +} +export function serializeDocumentSplitCreateRequestManualV2026R0VersionField( + val: DocumentSplitCreateRequestManualV2026R0VersionField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitCreateRequestManualV2026R0VersionField( + val: SerializedData, +): DocumentSplitCreateRequestManualV2026R0VersionField { + if (val == 'v_1') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize DocumentSplitCreateRequestManualV2026R0VersionField", + }); +} +export function serializeDocumentSplitCreateRequestManualV2026R0( + val: DocumentSplitCreateRequestManualV2026R0, +): SerializedData { + return { + ['split_type']: + serializeDocumentSplitCreateRequestManualV2026R0SplitTypeField( + val.splitType, + ), + ['version']: + val.version == void 0 + ? val.version + : serializeDocumentSplitCreateRequestManualV2026R0VersionField( + val.version, + ), + ['split_definition']: val.splitDefinition.map(function ( + item: DocumentSplitPageRangeV2026R0, + ): SerializedData { + return serializeDocumentSplitPageRangeV2026R0(item); + }) as readonly any[], + }; +} +export function deserializeDocumentSplitCreateRequestManualV2026R0( + val: SerializedData, +): DocumentSplitCreateRequestManualV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitCreateRequestManualV2026R0"', + }); + } + if (val.split_type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "split_type" of type "DocumentSplitCreateRequestManualV2026R0" to be defined', + }); + } + const splitType: DocumentSplitCreateRequestManualV2026R0SplitTypeField = + deserializeDocumentSplitCreateRequestManualV2026R0SplitTypeField( + val.split_type, + ); + const version: + undefined | DocumentSplitCreateRequestManualV2026R0VersionField = + val.version == void 0 + ? void 0 + : deserializeDocumentSplitCreateRequestManualV2026R0VersionField( + val.version, + ); + if (val.split_definition == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "split_definition" of type "DocumentSplitCreateRequestManualV2026R0" to be defined', + }); + } + if (!sdIsList(val.split_definition)) { + throw new BoxSdkError({ + message: + 'Expecting array for "split_definition" of type "DocumentSplitCreateRequestManualV2026R0"', + }); + } + const splitDefinition: readonly DocumentSplitPageRangeV2026R0[] = sdIsList( + val.split_definition, + ) + ? (val.split_definition.map(function ( + itm: SerializedData, + ): DocumentSplitPageRangeV2026R0 { + return deserializeDocumentSplitPageRangeV2026R0(itm); + }) as readonly any[]) + : []; + return { + splitType: splitType, + version: version, + splitDefinition: splitDefinition, + } satisfies DocumentSplitCreateRequestManualV2026R0; +} +export function serializeDocumentSplitCreateRequestManualV2026R0Input( + val: DocumentSplitCreateRequestManualV2026R0Input, +): SerializedData { + return { + ['splitType']: + val.splitType == void 0 + ? val.splitType + : serializeDocumentSplitCreateRequestManualV2026R0SplitTypeField( + val.splitType, + ), + ['version']: + val.version == void 0 + ? val.version + : serializeDocumentSplitCreateRequestManualV2026R0VersionField( + val.version, + ), + ['split_definition']: val.splitDefinition.map(function ( + item: DocumentSplitPageRangeV2026R0, + ): SerializedData { + return serializeDocumentSplitPageRangeV2026R0(item); + }) as readonly any[], + }; +} +export function deserializeDocumentSplitCreateRequestManualV2026R0Input( + val: SerializedData, +): DocumentSplitCreateRequestManualV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "DocumentSplitCreateRequestManualV2026R0Input"', + }); + } + const splitType: + undefined | DocumentSplitCreateRequestManualV2026R0SplitTypeField = + val.splitType == void 0 + ? void 0 + : deserializeDocumentSplitCreateRequestManualV2026R0SplitTypeField( + val.splitType, + ); + const version: + undefined | DocumentSplitCreateRequestManualV2026R0VersionField = + val.version == void 0 + ? void 0 + : deserializeDocumentSplitCreateRequestManualV2026R0VersionField( + val.version, + ); + if (val.split_definition == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "split_definition" of type "DocumentSplitCreateRequestManualV2026R0Input" to be defined', + }); + } + if (!sdIsList(val.split_definition)) { + throw new BoxSdkError({ + message: + 'Expecting array for "split_definition" of type "DocumentSplitCreateRequestManualV2026R0Input"', + }); + } + const splitDefinition: readonly DocumentSplitPageRangeV2026R0[] = sdIsList( + val.split_definition, + ) + ? (val.split_definition.map(function ( + itm: SerializedData, + ): DocumentSplitPageRangeV2026R0 { + return deserializeDocumentSplitPageRangeV2026R0(itm); + }) as readonly any[]) + : []; + return { + splitType: splitType, + version: version, + splitDefinition: splitDefinition, + } satisfies DocumentSplitCreateRequestManualV2026R0Input; +} diff --git a/src/schemas/v2026R0/documentSplitCreateRequestPageSelectionV2026R0.ts b/src/schemas/v2026R0/documentSplitCreateRequestPageSelectionV2026R0.ts new file mode 100644 index 00000000..a51a8b38 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitCreateRequestPageSelectionV2026R0.ts @@ -0,0 +1,215 @@ +import { serializeDocumentSplitPageSelectionItemV2026R0 } from './documentSplitPageSelectionItemV2026R0'; +import { deserializeDocumentSplitPageSelectionItemV2026R0 } from './documentSplitPageSelectionItemV2026R0'; +import { serializeDocumentSplitPageSelectionV2026R0 } from './documentSplitPageSelectionV2026R0'; +import { deserializeDocumentSplitPageSelectionV2026R0 } from './documentSplitPageSelectionV2026R0'; +import { DocumentSplitPageSelectionItemV2026R0 } from './documentSplitPageSelectionItemV2026R0'; +import { DocumentSplitPageSelectionV2026R0 } from './documentSplitPageSelectionV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField = + 'page_selection' | string; +export type DocumentSplitCreateRequestPageSelectionV2026R0VersionField = + 'v_2' | string; +export class DocumentSplitCreateRequestPageSelectionV2026R0 { + /** + * Discriminator. Must be `page_selection` for this variant. */ + readonly splitType: DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField = + 'page_selection' as DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField; + /** + * The version of the page selection input format. Optional. When provided + * must be `v_2`. */ + readonly version?: DocumentSplitCreateRequestPageSelectionV2026R0VersionField; + readonly pageSelection!: DocumentSplitPageSelectionV2026R0; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial< + Pick + >, + ) { + if (fields.splitType !== undefined) { + this.splitType = fields.splitType; + } + if (fields.version !== undefined) { + this.version = fields.version; + } + if (fields.pageSelection !== undefined) { + this.pageSelection = fields.pageSelection; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface DocumentSplitCreateRequestPageSelectionV2026R0Input { + /** + * Discriminator. Must be `page_selection` for this variant. */ + readonly splitType?: DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField; + /** + * The version of the page selection input format. Optional. When provided + * must be `v_2`. */ + readonly version?: DocumentSplitCreateRequestPageSelectionV2026R0VersionField; + readonly pageSelection: DocumentSplitPageSelectionV2026R0; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField( + val: DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField( + val: SerializedData, +): DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField { + if (val == 'page_selection') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField", + }); +} +export function serializeDocumentSplitCreateRequestPageSelectionV2026R0VersionField( + val: DocumentSplitCreateRequestPageSelectionV2026R0VersionField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitCreateRequestPageSelectionV2026R0VersionField( + val: SerializedData, +): DocumentSplitCreateRequestPageSelectionV2026R0VersionField { + if (val == 'v_2') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize DocumentSplitCreateRequestPageSelectionV2026R0VersionField", + }); +} +export function serializeDocumentSplitCreateRequestPageSelectionV2026R0( + val: DocumentSplitCreateRequestPageSelectionV2026R0, +): SerializedData { + return { + ['split_type']: + serializeDocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField( + val.splitType, + ), + ['version']: + val.version == void 0 + ? val.version + : serializeDocumentSplitCreateRequestPageSelectionV2026R0VersionField( + val.version, + ), + ['page_selection']: serializeDocumentSplitPageSelectionV2026R0( + val.pageSelection, + ), + }; +} +export function deserializeDocumentSplitCreateRequestPageSelectionV2026R0( + val: SerializedData, +): DocumentSplitCreateRequestPageSelectionV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "DocumentSplitCreateRequestPageSelectionV2026R0"', + }); + } + if (val.split_type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "split_type" of type "DocumentSplitCreateRequestPageSelectionV2026R0" to be defined', + }); + } + const splitType: DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField = + deserializeDocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField( + val.split_type, + ); + const version: + undefined | DocumentSplitCreateRequestPageSelectionV2026R0VersionField = + val.version == void 0 + ? void 0 + : deserializeDocumentSplitCreateRequestPageSelectionV2026R0VersionField( + val.version, + ); + if (val.page_selection == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "page_selection" of type "DocumentSplitCreateRequestPageSelectionV2026R0" to be defined', + }); + } + const pageSelection: DocumentSplitPageSelectionV2026R0 = + deserializeDocumentSplitPageSelectionV2026R0(val.page_selection); + return { + splitType: splitType, + version: version, + pageSelection: pageSelection, + } satisfies DocumentSplitCreateRequestPageSelectionV2026R0; +} +export function serializeDocumentSplitCreateRequestPageSelectionV2026R0Input( + val: DocumentSplitCreateRequestPageSelectionV2026R0Input, +): SerializedData { + return { + ['splitType']: + val.splitType == void 0 + ? val.splitType + : serializeDocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField( + val.splitType, + ), + ['version']: + val.version == void 0 + ? val.version + : serializeDocumentSplitCreateRequestPageSelectionV2026R0VersionField( + val.version, + ), + ['page_selection']: serializeDocumentSplitPageSelectionV2026R0( + val.pageSelection, + ), + }; +} +export function deserializeDocumentSplitCreateRequestPageSelectionV2026R0Input( + val: SerializedData, +): DocumentSplitCreateRequestPageSelectionV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "DocumentSplitCreateRequestPageSelectionV2026R0Input"', + }); + } + const splitType: + undefined | DocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField = + val.splitType == void 0 + ? void 0 + : deserializeDocumentSplitCreateRequestPageSelectionV2026R0SplitTypeField( + val.splitType, + ); + const version: + undefined | DocumentSplitCreateRequestPageSelectionV2026R0VersionField = + val.version == void 0 + ? void 0 + : deserializeDocumentSplitCreateRequestPageSelectionV2026R0VersionField( + val.version, + ); + if (val.page_selection == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "page_selection" of type "DocumentSplitCreateRequestPageSelectionV2026R0Input" to be defined', + }); + } + const pageSelection: DocumentSplitPageSelectionV2026R0 = + deserializeDocumentSplitPageSelectionV2026R0(val.page_selection); + return { + splitType: splitType, + version: version, + pageSelection: pageSelection, + } satisfies DocumentSplitCreateRequestPageSelectionV2026R0Input; +} diff --git a/src/schemas/v2026R0/documentSplitCreateRequestSmartV2026R0.ts b/src/schemas/v2026R0/documentSplitCreateRequestSmartV2026R0.ts new file mode 100644 index 00000000..ff191e0f --- /dev/null +++ b/src/schemas/v2026R0/documentSplitCreateRequestSmartV2026R0.ts @@ -0,0 +1,156 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitCreateRequestSmartV2026R0SplitTypeField = + 'smart' | string; +export class DocumentSplitCreateRequestSmartV2026R0 { + /** + * Discriminator. Must be `smart` for this variant. */ + readonly splitType: DocumentSplitCreateRequestSmartV2026R0SplitTypeField = + 'smart' as DocumentSplitCreateRequestSmartV2026R0SplitTypeField; + /** + * A natural language prompt that guides automatic page range detection. */ + readonly prompt!: string; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.splitType !== undefined) { + this.splitType = fields.splitType; + } + if (fields.prompt !== undefined) { + this.prompt = fields.prompt; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface DocumentSplitCreateRequestSmartV2026R0Input { + /** + * Discriminator. Must be `smart` for this variant. */ + readonly splitType?: DocumentSplitCreateRequestSmartV2026R0SplitTypeField; + /** + * A natural language prompt that guides automatic page range detection. */ + readonly prompt: string; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitCreateRequestSmartV2026R0SplitTypeField( + val: DocumentSplitCreateRequestSmartV2026R0SplitTypeField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitCreateRequestSmartV2026R0SplitTypeField( + val: SerializedData, +): DocumentSplitCreateRequestSmartV2026R0SplitTypeField { + if (val == 'smart') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize DocumentSplitCreateRequestSmartV2026R0SplitTypeField", + }); +} +export function serializeDocumentSplitCreateRequestSmartV2026R0( + val: DocumentSplitCreateRequestSmartV2026R0, +): SerializedData { + return { + ['split_type']: + serializeDocumentSplitCreateRequestSmartV2026R0SplitTypeField( + val.splitType, + ), + ['prompt']: val.prompt, + }; +} +export function deserializeDocumentSplitCreateRequestSmartV2026R0( + val: SerializedData, +): DocumentSplitCreateRequestSmartV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitCreateRequestSmartV2026R0"', + }); + } + if (val.split_type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "split_type" of type "DocumentSplitCreateRequestSmartV2026R0" to be defined', + }); + } + const splitType: DocumentSplitCreateRequestSmartV2026R0SplitTypeField = + deserializeDocumentSplitCreateRequestSmartV2026R0SplitTypeField( + val.split_type, + ); + if (val.prompt == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "prompt" of type "DocumentSplitCreateRequestSmartV2026R0" to be defined', + }); + } + if (!sdIsString(val.prompt)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prompt" of type "DocumentSplitCreateRequestSmartV2026R0"', + }); + } + const prompt: string = val.prompt; + return { + splitType: splitType, + prompt: prompt, + } satisfies DocumentSplitCreateRequestSmartV2026R0; +} +export function serializeDocumentSplitCreateRequestSmartV2026R0Input( + val: DocumentSplitCreateRequestSmartV2026R0Input, +): SerializedData { + return { + ['splitType']: + val.splitType == void 0 + ? val.splitType + : serializeDocumentSplitCreateRequestSmartV2026R0SplitTypeField( + val.splitType, + ), + ['prompt']: val.prompt, + }; +} +export function deserializeDocumentSplitCreateRequestSmartV2026R0Input( + val: SerializedData, +): DocumentSplitCreateRequestSmartV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "DocumentSplitCreateRequestSmartV2026R0Input"', + }); + } + const splitType: + undefined | DocumentSplitCreateRequestSmartV2026R0SplitTypeField = + val.splitType == void 0 + ? void 0 + : deserializeDocumentSplitCreateRequestSmartV2026R0SplitTypeField( + val.splitType, + ); + if (val.prompt == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "prompt" of type "DocumentSplitCreateRequestSmartV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.prompt)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prompt" of type "DocumentSplitCreateRequestSmartV2026R0Input"', + }); + } + const prompt: string = val.prompt; + return { + splitType: splitType, + prompt: prompt, + } satisfies DocumentSplitCreateRequestSmartV2026R0Input; +} diff --git a/src/schemas/v2026R0/documentSplitCreateRequestTypeV2026R0.ts b/src/schemas/v2026R0/documentSplitCreateRequestTypeV2026R0.ts new file mode 100644 index 00000000..b26092b2 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitCreateRequestTypeV2026R0.ts @@ -0,0 +1,119 @@ +import { serializeDocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { deserializeDocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { serializeDocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { deserializeDocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { serializeDocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { deserializeDocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { DocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { DocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { DocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitCreateRequestTypeV2026R0 = + | DocumentSplitCreateRequestManualV2026R0 + | DocumentSplitCreateRequestPageSelectionV2026R0 + | DocumentSplitCreateRequestSmartV2026R0; +export function serializeDocumentSplitCreateRequestTypeV2026R0( + val: any, +): SerializedData { + try { + if (val.splitType == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "splitType" of type "DocumentSplitCreateRequestManualV2026R0" to be defined', + }); + } + if (val.splitDefinition == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "splitDefinition" of type "DocumentSplitCreateRequestManualV2026R0" to be defined', + }); + } + if (!sdIsList(val.splitDefinition)) { + throw new BoxSdkError({ + message: + 'Expecting array for "splitDefinition" of type "DocumentSplitCreateRequestManualV2026R0"', + }); + } + return serializeDocumentSplitCreateRequestManualV2026R0(val); + } catch (error) { + void 0; + } finally { + } + try { + if (val.splitType == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "splitType" of type "DocumentSplitCreateRequestPageSelectionV2026R0" to be defined', + }); + } + if (val.pageSelection == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "pageSelection" of type "DocumentSplitCreateRequestPageSelectionV2026R0" to be defined', + }); + } + return serializeDocumentSplitCreateRequestPageSelectionV2026R0(val); + } catch (error) { + void 0; + } finally { + } + try { + if (val.splitType == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "splitType" of type "DocumentSplitCreateRequestSmartV2026R0" to be defined', + }); + } + if (val.prompt == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "prompt" of type "DocumentSplitCreateRequestSmartV2026R0" to be defined', + }); + } + if (!sdIsString(val.prompt)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prompt" of type "DocumentSplitCreateRequestSmartV2026R0"', + }); + } + return serializeDocumentSplitCreateRequestSmartV2026R0(val); + } catch (error) { + void 0; + } finally { + } + throw new BoxSdkError({ + message: "Can't serialize DocumentSplitCreateRequestTypeV2026R0", + }); +} +export function deserializeDocumentSplitCreateRequestTypeV2026R0( + val: SerializedData, +): DocumentSplitCreateRequestTypeV2026R0 { + try { + return deserializeDocumentSplitCreateRequestManualV2026R0(val); + } catch (error) { + void 0; + } finally { + } + try { + return deserializeDocumentSplitCreateRequestPageSelectionV2026R0(val); + } catch (error) { + void 0; + } finally { + } + try { + return deserializeDocumentSplitCreateRequestSmartV2026R0(val); + } catch (error) { + void 0; + } finally { + } + throw new BoxSdkError({ + message: "Can't deserialize DocumentSplitCreateRequestTypeV2026R0", + }); +} diff --git a/src/schemas/v2026R0/documentSplitCreateRequestV2026R0.ts b/src/schemas/v2026R0/documentSplitCreateRequestV2026R0.ts new file mode 100644 index 00000000..5438f421 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitCreateRequestV2026R0.ts @@ -0,0 +1,154 @@ +import { serializeDocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { deserializeDocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { serializeDocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { deserializeDocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { serializeDocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { deserializeDocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { serializeDocumentSplitCreateRequestTypeV2026R0 } from './documentSplitCreateRequestTypeV2026R0'; +import { deserializeDocumentSplitCreateRequestTypeV2026R0 } from './documentSplitCreateRequestTypeV2026R0'; +import { DocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { DocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { DocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { DocumentSplitCreateRequestTypeV2026R0 } from './documentSplitCreateRequestTypeV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitCreateRequestV2026R0InputSourceField = + 'api' | 'box' | 'relay' | 'salesforce' | string; +export interface DocumentSplitCreateRequestV2026R0 { + /** + * The ID of the source file to split. */ + readonly sourceFileId: string; + /** + * The ID of the folder where the resulting files will be uploaded. */ + readonly destinationFolderId: string; + /** + * The system that initiated the request, used for analytics and + * traceability. */ + readonly inputSource: DocumentSplitCreateRequestV2026R0InputSourceField; + readonly splitInput: DocumentSplitCreateRequestTypeV2026R0; + /** + * An optional identifier supplied by the caller for this Document Split job. + * The value is returned on job responses for correlation only. It is not + * a Box resource ID, is not required to be unique, and cannot be used to + * look up the job. */ + readonly externalId?: string; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitCreateRequestV2026R0InputSourceField( + val: DocumentSplitCreateRequestV2026R0InputSourceField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitCreateRequestV2026R0InputSourceField( + val: SerializedData, +): DocumentSplitCreateRequestV2026R0InputSourceField { + if (val == 'api') { + return val; + } + if (val == 'box') { + return val; + } + if (val == 'relay') { + return val; + } + if (val == 'salesforce') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize DocumentSplitCreateRequestV2026R0InputSourceField", + }); +} +export function serializeDocumentSplitCreateRequestV2026R0( + val: DocumentSplitCreateRequestV2026R0, +): SerializedData { + return { + ['source_file_id']: val.sourceFileId, + ['destination_folder_id']: val.destinationFolderId, + ['input_source']: + serializeDocumentSplitCreateRequestV2026R0InputSourceField( + val.inputSource, + ), + ['split_input']: serializeDocumentSplitCreateRequestTypeV2026R0( + val.splitInput, + ), + ['external_id']: val.externalId, + }; +} +export function deserializeDocumentSplitCreateRequestV2026R0( + val: SerializedData, +): DocumentSplitCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitCreateRequestV2026R0"', + }); + } + if (val.source_file_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source_file_id" of type "DocumentSplitCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.source_file_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "source_file_id" of type "DocumentSplitCreateRequestV2026R0"', + }); + } + const sourceFileId: string = val.source_file_id; + if (val.destination_folder_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "destination_folder_id" of type "DocumentSplitCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.destination_folder_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "destination_folder_id" of type "DocumentSplitCreateRequestV2026R0"', + }); + } + const destinationFolderId: string = val.destination_folder_id; + if (val.input_source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "input_source" of type "DocumentSplitCreateRequestV2026R0" to be defined', + }); + } + const inputSource: DocumentSplitCreateRequestV2026R0InputSourceField = + deserializeDocumentSplitCreateRequestV2026R0InputSourceField( + val.input_source, + ); + if (val.split_input == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "split_input" of type "DocumentSplitCreateRequestV2026R0" to be defined', + }); + } + const splitInput: DocumentSplitCreateRequestTypeV2026R0 = + deserializeDocumentSplitCreateRequestTypeV2026R0(val.split_input); + if (!(val.external_id == void 0) && !sdIsString(val.external_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "external_id" of type "DocumentSplitCreateRequestV2026R0"', + }); + } + const externalId: undefined | string = + val.external_id == void 0 ? void 0 : val.external_id; + return { + sourceFileId: sourceFileId, + destinationFolderId: destinationFolderId, + inputSource: inputSource, + splitInput: splitInput, + externalId: externalId, + } satisfies DocumentSplitCreateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/documentSplitCreateResponseV2026R0.ts b/src/schemas/v2026R0/documentSplitCreateResponseV2026R0.ts new file mode 100644 index 00000000..f8553a54 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitCreateResponseV2026R0.ts @@ -0,0 +1,137 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitCreateResponseV2026R0TypeField = 'document_split'; +export class DocumentSplitCreateResponseV2026R0 { + /** + * The value will always be `document_split`. */ + readonly type: DocumentSplitCreateResponseV2026R0TypeField = + 'document_split' as DocumentSplitCreateResponseV2026R0TypeField; + /** + * The unique identifier of the created Document Split job. */ + readonly id!: string; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface DocumentSplitCreateResponseV2026R0Input { + /** + * The value will always be `document_split`. */ + readonly type?: DocumentSplitCreateResponseV2026R0TypeField; + /** + * The unique identifier of the created Document Split job. */ + readonly id: string; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitCreateResponseV2026R0TypeField( + val: DocumentSplitCreateResponseV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitCreateResponseV2026R0TypeField( + val: SerializedData, +): DocumentSplitCreateResponseV2026R0TypeField { + if (val == 'document_split') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize DocumentSplitCreateResponseV2026R0TypeField", + }); +} +export function serializeDocumentSplitCreateResponseV2026R0( + val: DocumentSplitCreateResponseV2026R0, +): SerializedData { + return { + ['type']: serializeDocumentSplitCreateResponseV2026R0TypeField(val.type), + ['id']: val.id, + }; +} +export function deserializeDocumentSplitCreateResponseV2026R0( + val: SerializedData, +): DocumentSplitCreateResponseV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitCreateResponseV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "DocumentSplitCreateResponseV2026R0" to be defined', + }); + } + const type: DocumentSplitCreateResponseV2026R0TypeField = + deserializeDocumentSplitCreateResponseV2026R0TypeField(val.type); + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "DocumentSplitCreateResponseV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "DocumentSplitCreateResponseV2026R0"', + }); + } + const id: string = val.id; + return { type: type, id: id } satisfies DocumentSplitCreateResponseV2026R0; +} +export function serializeDocumentSplitCreateResponseV2026R0Input( + val: DocumentSplitCreateResponseV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeDocumentSplitCreateResponseV2026R0TypeField(val.type), + ['id']: val.id, + }; +} +export function deserializeDocumentSplitCreateResponseV2026R0Input( + val: SerializedData, +): DocumentSplitCreateResponseV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitCreateResponseV2026R0Input"', + }); + } + const type: undefined | DocumentSplitCreateResponseV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeDocumentSplitCreateResponseV2026R0TypeField(val.type); + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "DocumentSplitCreateResponseV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "DocumentSplitCreateResponseV2026R0Input"', + }); + } + const id: string = val.id; + return { + type: type, + id: id, + } satisfies DocumentSplitCreateResponseV2026R0Input; +} diff --git a/src/schemas/v2026R0/documentSplitFailuresV2026R0.ts b/src/schemas/v2026R0/documentSplitFailuresV2026R0.ts new file mode 100644 index 00000000..a9993dfe --- /dev/null +++ b/src/schemas/v2026R0/documentSplitFailuresV2026R0.ts @@ -0,0 +1,22 @@ +import { serializeDocumentFailuresV2026R0 } from './documentFailuresV2026R0'; +import { deserializeDocumentFailuresV2026R0 } from './documentFailuresV2026R0'; +import { DocumentFailuresV2026R0 } from './documentFailuresV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitFailuresV2026R0 = DocumentFailuresV2026R0; +export function serializeDocumentSplitFailuresV2026R0( + val: DocumentSplitFailuresV2026R0, +): SerializedData { + return serializeDocumentFailuresV2026R0(val); +} +export function deserializeDocumentSplitFailuresV2026R0( + val: SerializedData, +): DocumentSplitFailuresV2026R0 { + return deserializeDocumentFailuresV2026R0(val); +} diff --git a/src/schemas/v2026R0/documentSplitOutputV2026R0.ts b/src/schemas/v2026R0/documentSplitOutputV2026R0.ts new file mode 100644 index 00000000..4cd3bd14 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitOutputV2026R0.ts @@ -0,0 +1,95 @@ +import { serializeFileReferenceV2026R0 } from './fileReferenceV2026R0'; +import { deserializeFileReferenceV2026R0 } from './fileReferenceV2026R0'; +import { serializeDocumentSplitPageRangeV2026R0 } from './documentSplitPageRangeV2026R0'; +import { deserializeDocumentSplitPageRangeV2026R0 } from './documentSplitPageRangeV2026R0'; +import { FileReferenceV2026R0 } from './fileReferenceV2026R0'; +import { DocumentSplitPageRangeV2026R0 } from './documentSplitPageRangeV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface DocumentSplitOutputV2026R0 { + /** + * References to the files that were created by the split. */ + readonly generatedFiles?: readonly FileReferenceV2026R0[]; + /** + * The page ranges that Box produced for a `smart` split. Each entry + * corresponds to one generated file with the inclusive page range + * `[start, end]`. Omitted or `null` for `manual` splits, where the + * caller-supplied ranges are available in `split_input.split_definition`. + * Omitted for `page_selection` splits, where the caller-supplied page + * layout is available in `split_input.page_selection`. */ + readonly splitDefinition?: readonly DocumentSplitPageRangeV2026R0[] | null; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitOutputV2026R0( + val: DocumentSplitOutputV2026R0, +): SerializedData { + return { + ['generated_files']: + val.generatedFiles == void 0 + ? val.generatedFiles + : (val.generatedFiles.map(function ( + item: FileReferenceV2026R0, + ): SerializedData { + return serializeFileReferenceV2026R0(item); + }) as readonly any[]), + ['split_definition']: + val.splitDefinition == void 0 + ? val.splitDefinition + : (val.splitDefinition.map(function ( + item: DocumentSplitPageRangeV2026R0, + ): SerializedData { + return serializeDocumentSplitPageRangeV2026R0(item); + }) as readonly any[]), + }; +} +export function deserializeDocumentSplitOutputV2026R0( + val: SerializedData, +): DocumentSplitOutputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitOutputV2026R0"', + }); + } + if (!(val.generated_files == void 0) && !sdIsList(val.generated_files)) { + throw new BoxSdkError({ + message: + 'Expecting array for "generated_files" of type "DocumentSplitOutputV2026R0"', + }); + } + const generatedFiles: undefined | readonly FileReferenceV2026R0[] = + val.generated_files == void 0 + ? void 0 + : sdIsList(val.generated_files) + ? (val.generated_files.map(function ( + itm: SerializedData, + ): FileReferenceV2026R0 { + return deserializeFileReferenceV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.split_definition == void 0) && !sdIsList(val.split_definition)) { + throw new BoxSdkError({ + message: + 'Expecting array for "split_definition" of type "DocumentSplitOutputV2026R0"', + }); + } + const splitDefinition: undefined | readonly DocumentSplitPageRangeV2026R0[] = + val.split_definition == void 0 + ? void 0 + : sdIsList(val.split_definition) + ? (val.split_definition.map(function ( + itm: SerializedData, + ): DocumentSplitPageRangeV2026R0 { + return deserializeDocumentSplitPageRangeV2026R0(itm); + }) as readonly any[]) + : []; + return { + generatedFiles: generatedFiles, + splitDefinition: splitDefinition, + } satisfies DocumentSplitOutputV2026R0; +} diff --git a/src/schemas/v2026R0/documentSplitPageRangeV2026R0.ts b/src/schemas/v2026R0/documentSplitPageRangeV2026R0.ts new file mode 100644 index 00000000..67b59820 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitPageRangeV2026R0.ts @@ -0,0 +1,58 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface DocumentSplitPageRangeV2026R0 { + /** + * The first page (inclusive) included in this slice. */ + readonly start: number; + /** + * The last page (inclusive) included in this slice. */ + readonly end: number; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitPageRangeV2026R0( + val: DocumentSplitPageRangeV2026R0, +): SerializedData { + return { ['start']: val.start, ['end']: val.end }; +} +export function deserializeDocumentSplitPageRangeV2026R0( + val: SerializedData, +): DocumentSplitPageRangeV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitPageRangeV2026R0"', + }); + } + if (val.start == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "start" of type "DocumentSplitPageRangeV2026R0" to be defined', + }); + } + if (!sdIsNumber(val.start)) { + throw new BoxSdkError({ + message: + 'Expecting number for "start" of type "DocumentSplitPageRangeV2026R0"', + }); + } + const start: number = val.start; + if (val.end == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "end" of type "DocumentSplitPageRangeV2026R0" to be defined', + }); + } + if (!sdIsNumber(val.end)) { + throw new BoxSdkError({ + message: + 'Expecting number for "end" of type "DocumentSplitPageRangeV2026R0"', + }); + } + const end: number = val.end; + return { start: start, end: end } satisfies DocumentSplitPageRangeV2026R0; +} diff --git a/src/schemas/v2026R0/documentSplitPageSelectionItemV2026R0.ts b/src/schemas/v2026R0/documentSplitPageSelectionItemV2026R0.ts new file mode 100644 index 00000000..0e2669f6 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitPageSelectionItemV2026R0.ts @@ -0,0 +1,80 @@ +import { serializeDocumentSplitPageSelectionSinglePageV2026R0 } from './documentSplitPageSelectionSinglePageV2026R0'; +import { deserializeDocumentSplitPageSelectionSinglePageV2026R0 } from './documentSplitPageSelectionSinglePageV2026R0'; +import { serializeDocumentSplitPageSelectionPageRangeV2026R0 } from './documentSplitPageSelectionPageRangeV2026R0'; +import { deserializeDocumentSplitPageSelectionPageRangeV2026R0 } from './documentSplitPageSelectionPageRangeV2026R0'; +import { serializeDocumentSplitPageSelectionSegmentV2026R0 } from './documentSplitPageSelectionSegmentV2026R0'; +import { deserializeDocumentSplitPageSelectionSegmentV2026R0 } from './documentSplitPageSelectionSegmentV2026R0'; +import { DocumentSplitPageSelectionSinglePageV2026R0 } from './documentSplitPageSelectionSinglePageV2026R0'; +import { DocumentSplitPageSelectionPageRangeV2026R0 } from './documentSplitPageSelectionPageRangeV2026R0'; +import { DocumentSplitPageSelectionSegmentV2026R0 } from './documentSplitPageSelectionSegmentV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface DocumentSplitPageSelectionItemV2026R0 { + /** + * Optional name for the output file (without extension). When omitted the + * system generates a sequential name based on the source file name. */ + readonly name?: string; + /** + * An ordered list of page segments to include in this output file. Each + * segment specifies either a single page or a contiguous page range. */ + readonly segments: readonly DocumentSplitPageSelectionSegmentV2026R0[]; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitPageSelectionItemV2026R0( + val: DocumentSplitPageSelectionItemV2026R0, +): SerializedData { + return { + ['name']: val.name, + ['segments']: val.segments.map(function ( + item: DocumentSplitPageSelectionSegmentV2026R0, + ): SerializedData { + return serializeDocumentSplitPageSelectionSegmentV2026R0(item); + }) as readonly any[], + }; +} +export function deserializeDocumentSplitPageSelectionItemV2026R0( + val: SerializedData, +): DocumentSplitPageSelectionItemV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitPageSelectionItemV2026R0"', + }); + } + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "DocumentSplitPageSelectionItemV2026R0"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + if (val.segments == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "segments" of type "DocumentSplitPageSelectionItemV2026R0" to be defined', + }); + } + if (!sdIsList(val.segments)) { + throw new BoxSdkError({ + message: + 'Expecting array for "segments" of type "DocumentSplitPageSelectionItemV2026R0"', + }); + } + const segments: readonly DocumentSplitPageSelectionSegmentV2026R0[] = + sdIsList(val.segments) + ? (val.segments.map(function ( + itm: SerializedData, + ): DocumentSplitPageSelectionSegmentV2026R0 { + return deserializeDocumentSplitPageSelectionSegmentV2026R0(itm); + }) as readonly any[]) + : []; + return { + name: name, + segments: segments, + } satisfies DocumentSplitPageSelectionItemV2026R0; +} diff --git a/src/schemas/v2026R0/documentSplitPageSelectionPageRangeV2026R0.ts b/src/schemas/v2026R0/documentSplitPageSelectionPageRangeV2026R0.ts new file mode 100644 index 00000000..9f512ba8 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitPageSelectionPageRangeV2026R0.ts @@ -0,0 +1,188 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitPageSelectionPageRangeV2026R0TypeField = 'page_range'; +export class DocumentSplitPageSelectionPageRangeV2026R0 { + /** + * Discriminator. Must be `page_range` for this variant. */ + readonly type: DocumentSplitPageSelectionPageRangeV2026R0TypeField = + 'page_range' as DocumentSplitPageSelectionPageRangeV2026R0TypeField; + /** + * The first page (inclusive) included in this segment. */ + readonly start!: number; + /** + * The last page (inclusive) included in this segment. */ + readonly end!: number; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.start !== undefined) { + this.start = fields.start; + } + if (fields.end !== undefined) { + this.end = fields.end; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface DocumentSplitPageSelectionPageRangeV2026R0Input { + /** + * Discriminator. Must be `page_range` for this variant. */ + readonly type?: DocumentSplitPageSelectionPageRangeV2026R0TypeField; + /** + * The first page (inclusive) included in this segment. */ + readonly start: number; + /** + * The last page (inclusive) included in this segment. */ + readonly end: number; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitPageSelectionPageRangeV2026R0TypeField( + val: DocumentSplitPageSelectionPageRangeV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitPageSelectionPageRangeV2026R0TypeField( + val: SerializedData, +): DocumentSplitPageSelectionPageRangeV2026R0TypeField { + if (val == 'page_range') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize DocumentSplitPageSelectionPageRangeV2026R0TypeField", + }); +} +export function serializeDocumentSplitPageSelectionPageRangeV2026R0( + val: DocumentSplitPageSelectionPageRangeV2026R0, +): SerializedData { + return { + ['type']: serializeDocumentSplitPageSelectionPageRangeV2026R0TypeField( + val.type, + ), + ['start']: val.start, + ['end']: val.end, + }; +} +export function deserializeDocumentSplitPageSelectionPageRangeV2026R0( + val: SerializedData, +): DocumentSplitPageSelectionPageRangeV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "DocumentSplitPageSelectionPageRangeV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "DocumentSplitPageSelectionPageRangeV2026R0" to be defined', + }); + } + const type: DocumentSplitPageSelectionPageRangeV2026R0TypeField = + deserializeDocumentSplitPageSelectionPageRangeV2026R0TypeField(val.type); + if (val.start == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "start" of type "DocumentSplitPageSelectionPageRangeV2026R0" to be defined', + }); + } + if (!sdIsNumber(val.start)) { + throw new BoxSdkError({ + message: + 'Expecting number for "start" of type "DocumentSplitPageSelectionPageRangeV2026R0"', + }); + } + const start: number = val.start; + if (val.end == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "end" of type "DocumentSplitPageSelectionPageRangeV2026R0" to be defined', + }); + } + if (!sdIsNumber(val.end)) { + throw new BoxSdkError({ + message: + 'Expecting number for "end" of type "DocumentSplitPageSelectionPageRangeV2026R0"', + }); + } + const end: number = val.end; + return { + type: type, + start: start, + end: end, + } satisfies DocumentSplitPageSelectionPageRangeV2026R0; +} +export function serializeDocumentSplitPageSelectionPageRangeV2026R0Input( + val: DocumentSplitPageSelectionPageRangeV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeDocumentSplitPageSelectionPageRangeV2026R0TypeField( + val.type, + ), + ['start']: val.start, + ['end']: val.end, + }; +} +export function deserializeDocumentSplitPageSelectionPageRangeV2026R0Input( + val: SerializedData, +): DocumentSplitPageSelectionPageRangeV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "DocumentSplitPageSelectionPageRangeV2026R0Input"', + }); + } + const type: undefined | DocumentSplitPageSelectionPageRangeV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeDocumentSplitPageSelectionPageRangeV2026R0TypeField( + val.type, + ); + if (val.start == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "start" of type "DocumentSplitPageSelectionPageRangeV2026R0Input" to be defined', + }); + } + if (!sdIsNumber(val.start)) { + throw new BoxSdkError({ + message: + 'Expecting number for "start" of type "DocumentSplitPageSelectionPageRangeV2026R0Input"', + }); + } + const start: number = val.start; + if (val.end == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "end" of type "DocumentSplitPageSelectionPageRangeV2026R0Input" to be defined', + }); + } + if (!sdIsNumber(val.end)) { + throw new BoxSdkError({ + message: + 'Expecting number for "end" of type "DocumentSplitPageSelectionPageRangeV2026R0Input"', + }); + } + const end: number = val.end; + return { + type: type, + start: start, + end: end, + } satisfies DocumentSplitPageSelectionPageRangeV2026R0Input; +} diff --git a/src/schemas/v2026R0/documentSplitPageSelectionSegmentV2026R0.ts b/src/schemas/v2026R0/documentSplitPageSelectionSegmentV2026R0.ts new file mode 100644 index 00000000..8cabb9aa --- /dev/null +++ b/src/schemas/v2026R0/documentSplitPageSelectionSegmentV2026R0.ts @@ -0,0 +1,46 @@ +import { serializeDocumentSplitPageSelectionSinglePageV2026R0 } from './documentSplitPageSelectionSinglePageV2026R0'; +import { deserializeDocumentSplitPageSelectionSinglePageV2026R0 } from './documentSplitPageSelectionSinglePageV2026R0'; +import { serializeDocumentSplitPageSelectionPageRangeV2026R0 } from './documentSplitPageSelectionPageRangeV2026R0'; +import { deserializeDocumentSplitPageSelectionPageRangeV2026R0 } from './documentSplitPageSelectionPageRangeV2026R0'; +import { DocumentSplitPageSelectionSinglePageV2026R0 } from './documentSplitPageSelectionSinglePageV2026R0'; +import { DocumentSplitPageSelectionPageRangeV2026R0 } from './documentSplitPageSelectionPageRangeV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitPageSelectionSegmentV2026R0 = + | DocumentSplitPageSelectionSinglePageV2026R0 + | DocumentSplitPageSelectionPageRangeV2026R0; +export function serializeDocumentSplitPageSelectionSegmentV2026R0( + val: any, +): SerializedData { + if (val.type == 'single_page') { + return serializeDocumentSplitPageSelectionSinglePageV2026R0(val); + } + if (val.type == 'page_range') { + return serializeDocumentSplitPageSelectionPageRangeV2026R0(val); + } + throw new BoxSdkError({ message: 'unknown type' }); +} +export function deserializeDocumentSplitPageSelectionSegmentV2026R0( + val: SerializedData, +): DocumentSplitPageSelectionSegmentV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitPageSelectionSegmentV2026R0"', + }); + } + if (val.type == 'single_page') { + return deserializeDocumentSplitPageSelectionSinglePageV2026R0(val); + } + if (val.type == 'page_range') { + return deserializeDocumentSplitPageSelectionPageRangeV2026R0(val); + } + throw new BoxSdkError({ + message: "Can't deserialize DocumentSplitPageSelectionSegmentV2026R0", + }); +} diff --git a/src/schemas/v2026R0/documentSplitPageSelectionSinglePageV2026R0.ts b/src/schemas/v2026R0/documentSplitPageSelectionSinglePageV2026R0.ts new file mode 100644 index 00000000..86152e85 --- /dev/null +++ b/src/schemas/v2026R0/documentSplitPageSelectionSinglePageV2026R0.ts @@ -0,0 +1,150 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitPageSelectionSinglePageV2026R0TypeField = + 'single_page'; +export class DocumentSplitPageSelectionSinglePageV2026R0 { + /** + * Discriminator. Must be `single_page` for this variant. */ + readonly type: DocumentSplitPageSelectionSinglePageV2026R0TypeField = + 'single_page' as DocumentSplitPageSelectionSinglePageV2026R0TypeField; + /** + * A single page number to include. */ + readonly page!: number; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.page !== undefined) { + this.page = fields.page; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface DocumentSplitPageSelectionSinglePageV2026R0Input { + /** + * Discriminator. Must be `single_page` for this variant. */ + readonly type?: DocumentSplitPageSelectionSinglePageV2026R0TypeField; + /** + * A single page number to include. */ + readonly page: number; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitPageSelectionSinglePageV2026R0TypeField( + val: DocumentSplitPageSelectionSinglePageV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitPageSelectionSinglePageV2026R0TypeField( + val: SerializedData, +): DocumentSplitPageSelectionSinglePageV2026R0TypeField { + if (val == 'single_page') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize DocumentSplitPageSelectionSinglePageV2026R0TypeField", + }); +} +export function serializeDocumentSplitPageSelectionSinglePageV2026R0( + val: DocumentSplitPageSelectionSinglePageV2026R0, +): SerializedData { + return { + ['type']: serializeDocumentSplitPageSelectionSinglePageV2026R0TypeField( + val.type, + ), + ['page']: val.page, + }; +} +export function deserializeDocumentSplitPageSelectionSinglePageV2026R0( + val: SerializedData, +): DocumentSplitPageSelectionSinglePageV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "DocumentSplitPageSelectionSinglePageV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "DocumentSplitPageSelectionSinglePageV2026R0" to be defined', + }); + } + const type: DocumentSplitPageSelectionSinglePageV2026R0TypeField = + deserializeDocumentSplitPageSelectionSinglePageV2026R0TypeField(val.type); + if (val.page == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "page" of type "DocumentSplitPageSelectionSinglePageV2026R0" to be defined', + }); + } + if (!sdIsNumber(val.page)) { + throw new BoxSdkError({ + message: + 'Expecting number for "page" of type "DocumentSplitPageSelectionSinglePageV2026R0"', + }); + } + const page: number = val.page; + return { + type: type, + page: page, + } satisfies DocumentSplitPageSelectionSinglePageV2026R0; +} +export function serializeDocumentSplitPageSelectionSinglePageV2026R0Input( + val: DocumentSplitPageSelectionSinglePageV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeDocumentSplitPageSelectionSinglePageV2026R0TypeField( + val.type, + ), + ['page']: val.page, + }; +} +export function deserializeDocumentSplitPageSelectionSinglePageV2026R0Input( + val: SerializedData, +): DocumentSplitPageSelectionSinglePageV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "DocumentSplitPageSelectionSinglePageV2026R0Input"', + }); + } + const type: undefined | DocumentSplitPageSelectionSinglePageV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeDocumentSplitPageSelectionSinglePageV2026R0TypeField( + val.type, + ); + if (val.page == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "page" of type "DocumentSplitPageSelectionSinglePageV2026R0Input" to be defined', + }); + } + if (!sdIsNumber(val.page)) { + throw new BoxSdkError({ + message: + 'Expecting number for "page" of type "DocumentSplitPageSelectionSinglePageV2026R0Input"', + }); + } + const page: number = val.page; + return { + type: type, + page: page, + } satisfies DocumentSplitPageSelectionSinglePageV2026R0Input; +} diff --git a/src/schemas/v2026R0/documentSplitPageSelectionV2026R0.ts b/src/schemas/v2026R0/documentSplitPageSelectionV2026R0.ts new file mode 100644 index 00000000..c4d1f5cf --- /dev/null +++ b/src/schemas/v2026R0/documentSplitPageSelectionV2026R0.ts @@ -0,0 +1,33 @@ +import { serializeDocumentSplitPageSelectionItemV2026R0 } from './documentSplitPageSelectionItemV2026R0'; +import { deserializeDocumentSplitPageSelectionItemV2026R0 } from './documentSplitPageSelectionItemV2026R0'; +import { DocumentSplitPageSelectionItemV2026R0 } from './documentSplitPageSelectionItemV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitPageSelectionV2026R0 = + readonly DocumentSplitPageSelectionItemV2026R0[]; +export function serializeDocumentSplitPageSelectionV2026R0( + val: DocumentSplitPageSelectionV2026R0, +): SerializedData { + return val.map(function ( + item: DocumentSplitPageSelectionItemV2026R0, + ): SerializedData { + return serializeDocumentSplitPageSelectionItemV2026R0(item); + }) as readonly any[]; +} +export function deserializeDocumentSplitPageSelectionV2026R0( + val: SerializedData, +): DocumentSplitPageSelectionV2026R0 { + return sdIsList(val) + ? (val.map(function ( + itm: SerializedData, + ): DocumentSplitPageSelectionItemV2026R0 { + return deserializeDocumentSplitPageSelectionItemV2026R0(itm); + }) as readonly any[]) + : []; +} diff --git a/src/schemas/v2026R0/documentSplitV2026R0.ts b/src/schemas/v2026R0/documentSplitV2026R0.ts new file mode 100644 index 00000000..81bf345b --- /dev/null +++ b/src/schemas/v2026R0/documentSplitV2026R0.ts @@ -0,0 +1,550 @@ +import { serializeDocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { deserializeDocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { serializeDocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { deserializeDocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { serializeDocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { deserializeDocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { serializeFileReferenceV2026R0 } from './fileReferenceV2026R0'; +import { deserializeFileReferenceV2026R0 } from './fileReferenceV2026R0'; +import { serializeDocumentSplitCreateRequestTypeV2026R0 } from './documentSplitCreateRequestTypeV2026R0'; +import { deserializeDocumentSplitCreateRequestTypeV2026R0 } from './documentSplitCreateRequestTypeV2026R0'; +import { serializeDocumentSplitOutputV2026R0 } from './documentSplitOutputV2026R0'; +import { deserializeDocumentSplitOutputV2026R0 } from './documentSplitOutputV2026R0'; +import { serializeFolderReferenceV2026R0 } from './folderReferenceV2026R0'; +import { deserializeFolderReferenceV2026R0 } from './folderReferenceV2026R0'; +import { serializeUserMiniV2026R0 } from './userMiniV2026R0'; +import { deserializeUserMiniV2026R0 } from './userMiniV2026R0'; +import { serializeEnterpriseReferenceV2026R0 } from './enterpriseReferenceV2026R0'; +import { deserializeEnterpriseReferenceV2026R0 } from './enterpriseReferenceV2026R0'; +import { serializeDocumentSplitFailuresV2026R0 } from './documentSplitFailuresV2026R0'; +import { deserializeDocumentSplitFailuresV2026R0 } from './documentSplitFailuresV2026R0'; +import { serializeDateTime } from '../../internal/utils'; +import { deserializeDateTime } from '../../internal/utils'; +import { DocumentSplitCreateRequestManualV2026R0 } from './documentSplitCreateRequestManualV2026R0'; +import { DocumentSplitCreateRequestPageSelectionV2026R0 } from './documentSplitCreateRequestPageSelectionV2026R0'; +import { DocumentSplitCreateRequestSmartV2026R0 } from './documentSplitCreateRequestSmartV2026R0'; +import { FileReferenceV2026R0 } from './fileReferenceV2026R0'; +import { DocumentSplitCreateRequestTypeV2026R0 } from './documentSplitCreateRequestTypeV2026R0'; +import { DocumentSplitOutputV2026R0 } from './documentSplitOutputV2026R0'; +import { FolderReferenceV2026R0 } from './folderReferenceV2026R0'; +import { UserMiniV2026R0 } from './userMiniV2026R0'; +import { EnterpriseReferenceV2026R0 } from './enterpriseReferenceV2026R0'; +import { DocumentSplitFailuresV2026R0 } from './documentSplitFailuresV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { DateTime } from '../../internal/utils'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type DocumentSplitV2026R0TypeField = 'document_split'; +export type DocumentSplitV2026R0StatusField = + 'submitted' | 'completed' | 'failed' | 'completed_with_error' | string; +export type DocumentSplitV2026R0InputSourceField = + 'api' | 'box' | 'relay' | 'salesforce' | string; +export class DocumentSplitV2026R0 { + /** + * The unique identifier for the Document Split job. */ + readonly id!: string; + /** + * The value will always be `document_split`. */ + readonly type: DocumentSplitV2026R0TypeField = + 'document_split' as DocumentSplitV2026R0TypeField; + readonly sourceFile!: FileReferenceV2026R0; + /** + * The current state of the Document Split job. */ + readonly status!: DocumentSplitV2026R0StatusField; + readonly splitInput!: DocumentSplitCreateRequestTypeV2026R0; + /** + * The result of the Document Split job. `null` until the job has produced + * output. */ + readonly output?: DocumentSplitOutputV2026R0; + readonly destinationFolder!: FolderReferenceV2026R0; + /** + * The system that initiated the request, used for analytics and + * traceability. */ + readonly inputSource!: DocumentSplitV2026R0InputSourceField; + /** + * When the Document Split job was created. */ + readonly createdAt?: DateTime; + readonly createdBy?: UserMiniV2026R0; + readonly enterprise?: EnterpriseReferenceV2026R0; + /** + * Errors and warnings that occurred during the document split. `null` when + * no failures were recorded. */ + readonly failures?: DocumentSplitFailuresV2026R0; + /** + * An optional identifier supplied by the caller when the Document Split + * job was created. Returned for correlation only. It is not a Box + * resource ID, is not required to be unique, and cannot be used to + * look up the job. */ + readonly externalId?: string; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.sourceFile !== undefined) { + this.sourceFile = fields.sourceFile; + } + if (fields.status !== undefined) { + this.status = fields.status; + } + if (fields.splitInput !== undefined) { + this.splitInput = fields.splitInput; + } + if (fields.output !== undefined) { + this.output = fields.output; + } + if (fields.destinationFolder !== undefined) { + this.destinationFolder = fields.destinationFolder; + } + if (fields.inputSource !== undefined) { + this.inputSource = fields.inputSource; + } + if (fields.createdAt !== undefined) { + this.createdAt = fields.createdAt; + } + if (fields.createdBy !== undefined) { + this.createdBy = fields.createdBy; + } + if (fields.enterprise !== undefined) { + this.enterprise = fields.enterprise; + } + if (fields.failures !== undefined) { + this.failures = fields.failures; + } + if (fields.externalId !== undefined) { + this.externalId = fields.externalId; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface DocumentSplitV2026R0Input { + /** + * The unique identifier for the Document Split job. */ + readonly id: string; + /** + * The value will always be `document_split`. */ + readonly type?: DocumentSplitV2026R0TypeField; + readonly sourceFile: FileReferenceV2026R0; + /** + * The current state of the Document Split job. */ + readonly status: DocumentSplitV2026R0StatusField; + readonly splitInput: DocumentSplitCreateRequestTypeV2026R0; + /** + * The result of the Document Split job. `null` until the job has produced + * output. */ + readonly output?: DocumentSplitOutputV2026R0; + readonly destinationFolder: FolderReferenceV2026R0; + /** + * The system that initiated the request, used for analytics and + * traceability. */ + readonly inputSource: DocumentSplitV2026R0InputSourceField; + /** + * When the Document Split job was created. */ + readonly createdAt?: DateTime; + readonly createdBy?: UserMiniV2026R0; + readonly enterprise?: EnterpriseReferenceV2026R0; + /** + * Errors and warnings that occurred during the document split. `null` when + * no failures were recorded. */ + readonly failures?: DocumentSplitFailuresV2026R0; + /** + * An optional identifier supplied by the caller when the Document Split + * job was created. Returned for correlation only. It is not a Box + * resource ID, is not required to be unique, and cannot be used to + * look up the job. */ + readonly externalId?: string; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitV2026R0TypeField( + val: DocumentSplitV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitV2026R0TypeField( + val: SerializedData, +): DocumentSplitV2026R0TypeField { + if (val == 'document_split') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize DocumentSplitV2026R0TypeField", + }); +} +export function serializeDocumentSplitV2026R0StatusField( + val: DocumentSplitV2026R0StatusField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitV2026R0StatusField( + val: SerializedData, +): DocumentSplitV2026R0StatusField { + if (val == 'submitted') { + return val; + } + if (val == 'completed') { + return val; + } + if (val == 'failed') { + return val; + } + if (val == 'completed_with_error') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize DocumentSplitV2026R0StatusField", + }); +} +export function serializeDocumentSplitV2026R0InputSourceField( + val: DocumentSplitV2026R0InputSourceField, +): SerializedData { + return val; +} +export function deserializeDocumentSplitV2026R0InputSourceField( + val: SerializedData, +): DocumentSplitV2026R0InputSourceField { + if (val == 'api') { + return val; + } + if (val == 'box') { + return val; + } + if (val == 'relay') { + return val; + } + if (val == 'salesforce') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize DocumentSplitV2026R0InputSourceField", + }); +} +export function serializeDocumentSplitV2026R0( + val: DocumentSplitV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeDocumentSplitV2026R0TypeField(val.type), + ['source_file']: serializeFileReferenceV2026R0(val.sourceFile), + ['status']: serializeDocumentSplitV2026R0StatusField(val.status), + ['split_input']: serializeDocumentSplitCreateRequestTypeV2026R0( + val.splitInput, + ), + ['output']: + val.output == void 0 + ? val.output + : serializeDocumentSplitOutputV2026R0(val.output), + ['destination_folder']: serializeFolderReferenceV2026R0( + val.destinationFolder, + ), + ['input_source']: serializeDocumentSplitV2026R0InputSourceField( + val.inputSource, + ), + ['created_at']: + val.createdAt == void 0 + ? val.createdAt + : serializeDateTime(val.createdAt), + ['created_by']: + val.createdBy == void 0 + ? val.createdBy + : serializeUserMiniV2026R0(val.createdBy), + ['enterprise']: + val.enterprise == void 0 + ? val.enterprise + : serializeEnterpriseReferenceV2026R0(val.enterprise), + ['failures']: + val.failures == void 0 + ? val.failures + : serializeDocumentSplitFailuresV2026R0(val.failures), + ['external_id']: val.externalId, + }; +} +export function deserializeDocumentSplitV2026R0( + val: SerializedData, +): DocumentSplitV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "DocumentSplitV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "DocumentSplitV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "DocumentSplitV2026R0" to be defined', + }); + } + const type: DocumentSplitV2026R0TypeField = + deserializeDocumentSplitV2026R0TypeField(val.type); + if (val.source_file == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source_file" of type "DocumentSplitV2026R0" to be defined', + }); + } + const sourceFile: FileReferenceV2026R0 = deserializeFileReferenceV2026R0( + val.source_file, + ); + if (val.status == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "status" of type "DocumentSplitV2026R0" to be defined', + }); + } + const status: DocumentSplitV2026R0StatusField = + deserializeDocumentSplitV2026R0StatusField(val.status); + if (val.split_input == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "split_input" of type "DocumentSplitV2026R0" to be defined', + }); + } + const splitInput: DocumentSplitCreateRequestTypeV2026R0 = + deserializeDocumentSplitCreateRequestTypeV2026R0(val.split_input); + const output: DocumentSplitOutputV2026R0 | undefined = + val.output == void 0 + ? void 0 + : deserializeDocumentSplitOutputV2026R0(val.output); + if (val.destination_folder == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "destination_folder" of type "DocumentSplitV2026R0" to be defined', + }); + } + const destinationFolder: FolderReferenceV2026R0 = + deserializeFolderReferenceV2026R0(val.destination_folder); + if (val.input_source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "input_source" of type "DocumentSplitV2026R0" to be defined', + }); + } + const inputSource: DocumentSplitV2026R0InputSourceField = + deserializeDocumentSplitV2026R0InputSourceField(val.input_source); + if (!(val.created_at == void 0) && !sdIsString(val.created_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "created_at" of type "DocumentSplitV2026R0"', + }); + } + const createdAt: undefined | DateTime = + val.created_at == void 0 ? void 0 : deserializeDateTime(val.created_at); + const createdBy: undefined | UserMiniV2026R0 = + val.created_by == void 0 + ? void 0 + : deserializeUserMiniV2026R0(val.created_by); + const enterprise: undefined | EnterpriseReferenceV2026R0 = + val.enterprise == void 0 + ? void 0 + : deserializeEnterpriseReferenceV2026R0(val.enterprise); + const failures: DocumentSplitFailuresV2026R0 | undefined = + val.failures == void 0 + ? void 0 + : deserializeDocumentSplitFailuresV2026R0(val.failures); + if (!(val.external_id == void 0) && !sdIsString(val.external_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "external_id" of type "DocumentSplitV2026R0"', + }); + } + const externalId: undefined | string = + val.external_id == void 0 ? void 0 : val.external_id; + return { + id: id, + type: type, + sourceFile: sourceFile, + status: status, + splitInput: splitInput, + output: output, + destinationFolder: destinationFolder, + inputSource: inputSource, + createdAt: createdAt, + createdBy: createdBy, + enterprise: enterprise, + failures: failures, + externalId: externalId, + } satisfies DocumentSplitV2026R0; +} +export function serializeDocumentSplitV2026R0Input( + val: DocumentSplitV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeDocumentSplitV2026R0TypeField(val.type), + ['source_file']: serializeFileReferenceV2026R0(val.sourceFile), + ['status']: serializeDocumentSplitV2026R0StatusField(val.status), + ['split_input']: serializeDocumentSplitCreateRequestTypeV2026R0( + val.splitInput, + ), + ['output']: + val.output == void 0 + ? val.output + : serializeDocumentSplitOutputV2026R0(val.output), + ['destination_folder']: serializeFolderReferenceV2026R0( + val.destinationFolder, + ), + ['input_source']: serializeDocumentSplitV2026R0InputSourceField( + val.inputSource, + ), + ['created_at']: + val.createdAt == void 0 + ? val.createdAt + : serializeDateTime(val.createdAt), + ['created_by']: + val.createdBy == void 0 + ? val.createdBy + : serializeUserMiniV2026R0(val.createdBy), + ['enterprise']: + val.enterprise == void 0 + ? val.enterprise + : serializeEnterpriseReferenceV2026R0(val.enterprise), + ['failures']: + val.failures == void 0 + ? val.failures + : serializeDocumentSplitFailuresV2026R0(val.failures), + ['external_id']: val.externalId, + }; +} +export function deserializeDocumentSplitV2026R0Input( + val: SerializedData, +): DocumentSplitV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "DocumentSplitV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "DocumentSplitV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | DocumentSplitV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeDocumentSplitV2026R0TypeField(val.type); + if (val.source_file == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source_file" of type "DocumentSplitV2026R0Input" to be defined', + }); + } + const sourceFile: FileReferenceV2026R0 = deserializeFileReferenceV2026R0( + val.source_file, + ); + if (val.status == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "status" of type "DocumentSplitV2026R0Input" to be defined', + }); + } + const status: DocumentSplitV2026R0StatusField = + deserializeDocumentSplitV2026R0StatusField(val.status); + if (val.split_input == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "split_input" of type "DocumentSplitV2026R0Input" to be defined', + }); + } + const splitInput: DocumentSplitCreateRequestTypeV2026R0 = + deserializeDocumentSplitCreateRequestTypeV2026R0(val.split_input); + const output: DocumentSplitOutputV2026R0 | undefined = + val.output == void 0 + ? void 0 + : deserializeDocumentSplitOutputV2026R0(val.output); + if (val.destination_folder == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "destination_folder" of type "DocumentSplitV2026R0Input" to be defined', + }); + } + const destinationFolder: FolderReferenceV2026R0 = + deserializeFolderReferenceV2026R0(val.destination_folder); + if (val.input_source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "input_source" of type "DocumentSplitV2026R0Input" to be defined', + }); + } + const inputSource: DocumentSplitV2026R0InputSourceField = + deserializeDocumentSplitV2026R0InputSourceField(val.input_source); + if (!(val.created_at == void 0) && !sdIsString(val.created_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "created_at" of type "DocumentSplitV2026R0Input"', + }); + } + const createdAt: undefined | DateTime = + val.created_at == void 0 ? void 0 : deserializeDateTime(val.created_at); + const createdBy: undefined | UserMiniV2026R0 = + val.created_by == void 0 + ? void 0 + : deserializeUserMiniV2026R0(val.created_by); + const enterprise: undefined | EnterpriseReferenceV2026R0 = + val.enterprise == void 0 + ? void 0 + : deserializeEnterpriseReferenceV2026R0(val.enterprise); + const failures: DocumentSplitFailuresV2026R0 | undefined = + val.failures == void 0 + ? void 0 + : deserializeDocumentSplitFailuresV2026R0(val.failures); + if (!(val.external_id == void 0) && !sdIsString(val.external_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "external_id" of type "DocumentSplitV2026R0Input"', + }); + } + const externalId: undefined | string = + val.external_id == void 0 ? void 0 : val.external_id; + return { + id: id, + type: type, + sourceFile: sourceFile, + status: status, + splitInput: splitInput, + output: output, + destinationFolder: destinationFolder, + inputSource: inputSource, + createdAt: createdAt, + createdBy: createdBy, + enterprise: enterprise, + failures: failures, + externalId: externalId, + } satisfies DocumentSplitV2026R0Input; +} diff --git a/src/schemas/v2026R0/documentSplitsV2026R0.ts b/src/schemas/v2026R0/documentSplitsV2026R0.ts new file mode 100644 index 00000000..d4dfa75a --- /dev/null +++ b/src/schemas/v2026R0/documentSplitsV2026R0.ts @@ -0,0 +1,84 @@ +import { serializeDocumentSplitV2026R0 } from './documentSplitV2026R0'; +import { deserializeDocumentSplitV2026R0 } from './documentSplitV2026R0'; +import { DocumentSplitV2026R0 } from './documentSplitV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface DocumentSplitsV2026R0 { + /** + * A list of Document Split jobs. */ + readonly entries?: readonly DocumentSplitV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeDocumentSplitsV2026R0( + val: DocumentSplitsV2026R0, +): SerializedData { + return { + ['entries']: + val.entries == void 0 + ? val.entries + : (val.entries.map(function ( + item: DocumentSplitV2026R0, + ): SerializedData { + return serializeDocumentSplitV2026R0(item); + }) as readonly any[]), + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + }; +} +export function deserializeDocumentSplitsV2026R0( + val: SerializedData, +): DocumentSplitsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "DocumentSplitsV2026R0"', + }); + } + if (!(val.entries == void 0) && !sdIsList(val.entries)) { + throw new BoxSdkError({ + message: 'Expecting array for "entries" of type "DocumentSplitsV2026R0"', + }); + } + const entries: undefined | readonly DocumentSplitV2026R0[] = + val.entries == void 0 + ? void 0 + : sdIsList(val.entries) + ? (val.entries.map(function ( + itm: SerializedData, + ): DocumentSplitV2026R0 { + return deserializeDocumentSplitV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: 'Expecting number for "limit" of type "DocumentSplitsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "DocumentSplitsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + } satisfies DocumentSplitsV2026R0; +} diff --git a/src/schemas/v2026R0/enterpriseReferenceV2026R0.ts b/src/schemas/v2026R0/enterpriseReferenceV2026R0.ts new file mode 100644 index 00000000..afcf9b8d --- /dev/null +++ b/src/schemas/v2026R0/enterpriseReferenceV2026R0.ts @@ -0,0 +1,133 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type EnterpriseReferenceV2026R0TypeField = 'enterprise'; +export class EnterpriseReferenceV2026R0 { + /** + * The unique identifier for this enterprise. */ + readonly id!: string; + /** + * The value will always be `enterprise`. */ + readonly type: EnterpriseReferenceV2026R0TypeField = + 'enterprise' as EnterpriseReferenceV2026R0TypeField; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface EnterpriseReferenceV2026R0Input { + /** + * The unique identifier for this enterprise. */ + readonly id: string; + /** + * The value will always be `enterprise`. */ + readonly type?: EnterpriseReferenceV2026R0TypeField; + readonly rawData?: SerializedData; +} +export function serializeEnterpriseReferenceV2026R0TypeField( + val: EnterpriseReferenceV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeEnterpriseReferenceV2026R0TypeField( + val: SerializedData, +): EnterpriseReferenceV2026R0TypeField { + if (val == 'enterprise') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize EnterpriseReferenceV2026R0TypeField", + }); +} +export function serializeEnterpriseReferenceV2026R0( + val: EnterpriseReferenceV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeEnterpriseReferenceV2026R0TypeField(val.type), + }; +} +export function deserializeEnterpriseReferenceV2026R0( + val: SerializedData, +): EnterpriseReferenceV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "EnterpriseReferenceV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "EnterpriseReferenceV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "EnterpriseReferenceV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "EnterpriseReferenceV2026R0" to be defined', + }); + } + const type: EnterpriseReferenceV2026R0TypeField = + deserializeEnterpriseReferenceV2026R0TypeField(val.type); + return { id: id, type: type } satisfies EnterpriseReferenceV2026R0; +} +export function serializeEnterpriseReferenceV2026R0Input( + val: EnterpriseReferenceV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeEnterpriseReferenceV2026R0TypeField(val.type), + }; +} +export function deserializeEnterpriseReferenceV2026R0Input( + val: SerializedData, +): EnterpriseReferenceV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "EnterpriseReferenceV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "EnterpriseReferenceV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "EnterpriseReferenceV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | EnterpriseReferenceV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeEnterpriseReferenceV2026R0TypeField(val.type); + return { id: id, type: type } satisfies EnterpriseReferenceV2026R0Input; +} diff --git a/src/schemas/v2026R0/fileReferenceV2026R0.ts b/src/schemas/v2026R0/fileReferenceV2026R0.ts new file mode 100644 index 00000000..559ebee4 --- /dev/null +++ b/src/schemas/v2026R0/fileReferenceV2026R0.ts @@ -0,0 +1,130 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type FileReferenceV2026R0TypeField = 'file'; +export class FileReferenceV2026R0 { + /** + * The value will always be `file`. */ + readonly type: FileReferenceV2026R0TypeField = + 'file' as FileReferenceV2026R0TypeField; + /** + * ID of the file. */ + readonly id!: string; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface FileReferenceV2026R0Input { + /** + * The value will always be `file`. */ + readonly type?: FileReferenceV2026R0TypeField; + /** + * ID of the file. */ + readonly id: string; + readonly rawData?: SerializedData; +} +export function serializeFileReferenceV2026R0TypeField( + val: FileReferenceV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeFileReferenceV2026R0TypeField( + val: SerializedData, +): FileReferenceV2026R0TypeField { + if (val == 'file') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize FileReferenceV2026R0TypeField", + }); +} +export function serializeFileReferenceV2026R0( + val: FileReferenceV2026R0, +): SerializedData { + return { + ['type']: serializeFileReferenceV2026R0TypeField(val.type), + ['id']: val.id, + }; +} +export function deserializeFileReferenceV2026R0( + val: SerializedData, +): FileReferenceV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "FileReferenceV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "FileReferenceV2026R0" to be defined', + }); + } + const type: FileReferenceV2026R0TypeField = + deserializeFileReferenceV2026R0TypeField(val.type); + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "FileReferenceV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "FileReferenceV2026R0"', + }); + } + const id: string = val.id; + return { type: type, id: id } satisfies FileReferenceV2026R0; +} +export function serializeFileReferenceV2026R0Input( + val: FileReferenceV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeFileReferenceV2026R0TypeField(val.type), + ['id']: val.id, + }; +} +export function deserializeFileReferenceV2026R0Input( + val: SerializedData, +): FileReferenceV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "FileReferenceV2026R0Input"', + }); + } + const type: undefined | FileReferenceV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeFileReferenceV2026R0TypeField(val.type); + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "FileReferenceV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "FileReferenceV2026R0Input"', + }); + } + const id: string = val.id; + return { type: type, id: id } satisfies FileReferenceV2026R0Input; +} diff --git a/src/schemas/v2026R0/index.ts b/src/schemas/v2026R0/index.ts index feafb66c..e7e31853 100644 --- a/src/schemas/v2026R0/index.ts +++ b/src/schemas/v2026R0/index.ts @@ -1,6 +1,23 @@ export * from './automateWorkflowReferenceV2026R0'; export * from './automateWorkflowStartRequestV2026R0'; export * from './clientErrorV2026R0'; +export * from './documentFailuresV2026R0'; +export * from './documentSplitFailuresV2026R0'; +export * from './documentSplitCreateRequestSmartV2026R0'; +export * from './documentSplitCreateResponseV2026R0'; +export * from './documentSplitPageRangeV2026R0'; +export * from './documentSplitCreateRequestManualV2026R0'; +export * from './documentSplitPageSelectionPageRangeV2026R0'; +export * from './documentSplitPageSelectionSinglePageV2026R0'; +export * from './documentSplitPageSelectionSegmentV2026R0'; +export * from './documentSplitPageSelectionItemV2026R0'; +export * from './documentSplitPageSelectionV2026R0'; +export * from './documentSplitCreateRequestPageSelectionV2026R0'; +export * from './documentSplitCreateRequestTypeV2026R0'; +export * from './documentSplitCreateRequestV2026R0'; +export * from './enterpriseReferenceV2026R0'; +export * from './fileReferenceV2026R0'; +export * from './documentSplitOutputV2026R0'; export * from './folderReferenceV2026R0'; export * from './notesConvertRequestBodyV2026R0'; export * from './notesConvertResponseV2026R0'; @@ -17,5 +34,7 @@ export * from './queryResultEntryV2026R0'; export * from './queryResultsV2026R0'; export * from './userBaseV2026R0'; export * from './userMiniV2026R0'; +export * from './documentSplitV2026R0'; +export * from './documentSplitsV2026R0'; export * from './automateWorkflowActionV2026R0'; export * from './automateWorkflowsV2026R0'; diff --git a/src/schemas/webLink.ts b/src/schemas/webLink.ts index 8ba447dd..d7eeb136 100644 --- a/src/schemas/webLink.ts +++ b/src/schemas/webLink.ts @@ -8,6 +8,8 @@ import { serializeFolderMini } from './folderMini'; import { deserializeFolderMini } from './folderMini'; import { serializeUserMini } from './userMini'; import { deserializeUserMini } from './userMini'; +import { serializeSharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; +import { deserializeSharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; import { serializeCollection } from './collection'; import { deserializeCollection } from './collection'; import { serializeDateTime } from '../internal/utils'; @@ -17,6 +19,7 @@ import { WebLinkBase } from './webLinkBase'; import { WebLinkMini } from './webLinkMini'; import { FolderMini } from './folderMini'; import { UserMini } from './userMini'; +import { SharedLinkOtpAllowlistEntry } from './sharedLinkOtpAllowlistEntry'; import { Collection } from './collection'; import { BoxSdkError } from '../box/errors'; import { DateTime } from '../internal/utils'; @@ -64,6 +67,35 @@ export interface WebLinkSharedLinkPermissionsField { readonly canEdit: boolean; readonly rawData?: SerializedData; } +export interface WebLinkSharedLinkOneTimePasscodeField { + /** + * The current OTP enforcement mode for the shared link. + * + * * `none` - OTP enforcement is turned off. The shared link is accessible + * without any one-time-passcode verification. + * * `open` - Any anonymous recipient can request a one-time-passcode to + * any email address and access the shared link after verifying it. + * Collaborators and registered Box users access the link without + * being prompted. + * * `allowlist` - Anonymous recipients can request a one-time-passcode + * only when they enter an email that matches an entry on the + * `allowlist`. */ + readonly mode: string; + /** + * The list of email and domain entries that are permitted to access the + * shared link when `mode` is `allowlist`. Anonymous users whose + * email matches an entry can request and verify a one-time-passcode. + * + * Because the entries carry recipient email addresses and the identity + * of the user who added them, this field is only returned to users + * with owner, co-owner, or editor access on the item. For viewer + * collaborators and below the field is omitted. + * + * An allowlist contains at most 1000 entries, matching the limit + * enforced when setting the allowlist on a shared link. */ + readonly allowlist?: readonly SharedLinkOtpAllowlistEntry[]; + readonly rawData?: SerializedData; +} export interface WebLinkSharedLinkField { /** * The URL that can be used to access the item on Box. @@ -129,6 +161,7 @@ export interface WebLinkSharedLinkField { /** * The number of times this item has been previewed. */ readonly previewCount: number; + readonly oneTimePasscode: WebLinkSharedLinkOneTimePasscodeField; readonly rawData?: SerializedData; } export type WebLinkItemStatusField = 'active' | 'trashed' | 'deleted' | string; @@ -385,6 +418,63 @@ export function deserializeWebLinkSharedLinkPermissionsField( canEdit: canEdit, } satisfies WebLinkSharedLinkPermissionsField; } +export function serializeWebLinkSharedLinkOneTimePasscodeField( + val: WebLinkSharedLinkOneTimePasscodeField, +): SerializedData { + return { + ['mode']: val.mode, + ['allowlist']: + val.allowlist == void 0 + ? val.allowlist + : (val.allowlist.map(function ( + item: SharedLinkOtpAllowlistEntry, + ): SerializedData { + return serializeSharedLinkOtpAllowlistEntry(item); + }) as readonly any[]), + }; +} +export function deserializeWebLinkSharedLinkOneTimePasscodeField( + val: SerializedData, +): WebLinkSharedLinkOneTimePasscodeField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "WebLinkSharedLinkOneTimePasscodeField"', + }); + } + if (val.mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mode" of type "WebLinkSharedLinkOneTimePasscodeField" to be defined', + }); + } + if (!sdIsString(val.mode)) { + throw new BoxSdkError({ + message: + 'Expecting string for "mode" of type "WebLinkSharedLinkOneTimePasscodeField"', + }); + } + const mode: string = val.mode; + if (!(val.allowlist == void 0) && !sdIsList(val.allowlist)) { + throw new BoxSdkError({ + message: + 'Expecting array for "allowlist" of type "WebLinkSharedLinkOneTimePasscodeField"', + }); + } + const allowlist: undefined | readonly SharedLinkOtpAllowlistEntry[] = + val.allowlist == void 0 + ? void 0 + : sdIsList(val.allowlist) + ? (val.allowlist.map(function ( + itm: SerializedData, + ): SharedLinkOtpAllowlistEntry { + return deserializeSharedLinkOtpAllowlistEntry(itm); + }) as readonly any[]) + : []; + return { + mode: mode, + allowlist: allowlist, + } satisfies WebLinkSharedLinkOneTimePasscodeField; +} export function serializeWebLinkSharedLinkField( val: WebLinkSharedLinkField, ): SerializedData { @@ -415,6 +505,9 @@ export function serializeWebLinkSharedLinkField( : serializeWebLinkSharedLinkPermissionsField(val.permissions), ['download_count']: val.downloadCount, ['preview_count']: val.previewCount, + ['one_time_passcode']: serializeWebLinkSharedLinkOneTimePasscodeField( + val.oneTimePasscode, + ), }; } export function deserializeWebLinkSharedLinkField( @@ -533,6 +626,14 @@ export function deserializeWebLinkSharedLinkField( }); } const previewCount: number = val.preview_count; + if (val.one_time_passcode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "one_time_passcode" of type "WebLinkSharedLinkField" to be defined', + }); + } + const oneTimePasscode: WebLinkSharedLinkOneTimePasscodeField = + deserializeWebLinkSharedLinkOneTimePasscodeField(val.one_time_passcode); return { url: url, downloadUrl: downloadUrl, @@ -546,6 +647,7 @@ export function deserializeWebLinkSharedLinkField( permissions: permissions, downloadCount: downloadCount, previewCount: previewCount, + oneTimePasscode: oneTimePasscode, } satisfies WebLinkSharedLinkField; } export function serializeWebLinkItemStatusField( From be9bb3d70ae42b9631ebb3a9c53c3bed9ac83aa3 Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 28 Oct 2026 06:52:39 -0700 Subject: [PATCH 3/5] docs: (DDOC-1687) OTP for public shared links (box/box-openapi#622) --- .codegen.json | 2 +- docs/README.md | 1 + docs/shuttle.md | 1067 ++++ src/client.ts | 7 + src/managers/events.ts | 32 + src/managers/index.ts | 1 + src/managers/shuttle.ts | 4815 +++++++++++++++++ src/schemas/event.ts | 12 + src/schemas/v2025R0/archiveV2025R0.ts | 37 +- src/schemas/v2026R0/index.ts | 58 + .../v2026R0/shuttleAgentCredentialsV2026R0.ts | 68 + .../shuttleDiscoveredSubjectV2026R0.ts | 281 + .../shuttleDiscoveredSubjectsV2026R0.ts | 101 + .../v2026R0/shuttleJobCreateRequestV2026R0.ts | 452 ++ ...tleJobPermissionConflictStrategyV2026R0.ts | 41 + .../shuttleJobScheduleCreateRequestV2026R0.ts | 158 + .../shuttleJobScheduleTriggerByJobV2026R0.ts | 211 + .../shuttleJobScheduleTriggerByTimeV2026R0.ts | 257 + .../shuttleJobScheduleTriggerV2026R0.ts | 46 + .../shuttleJobScheduleUpdateRequestV2026R0.ts | 141 + .../v2026R0/shuttleJobScheduleV2026R0.ts | 393 ++ .../v2026R0/shuttleJobSchedulesV2026R0.ts | 99 + .../v2026R0/shuttleJobStartRequestV2026R0.ts | 67 + .../v2026R0/shuttleJobUpdateRequestV2026R0.ts | 388 ++ src/schemas/v2026R0/shuttleJobV2026R0.ts | 957 ++++ src/schemas/v2026R0/shuttleJobsV2026R0.ts | 94 + .../v2026R0/shuttleMappingErrorV2026R0.ts | 358 ++ .../v2026R0/shuttleMappingErrorsV2026R0.ts | 99 + .../v2026R0/shuttlePathEntriesV2026R0.ts | 97 + .../shuttlePathEntryAccountScopeV2026R0.ts | 198 + .../v2026R0/shuttlePathEntryScopeV2026R0.ts | 45 + ...shuttlePathEntrySharedSpaceScopeV2026R0.ts | 136 + .../v2026R0/shuttlePathEntryV2026R0.ts | 396 ++ .../shuttlePathMappingAccountInputV2026R0.ts | 49 + ...ePathMappingAccountLocationInputV2026R0.ts | 240 + ...appingAccountLocationTargetInputV2026R0.ts | 215 + ...huttlePathMappingAccountLocationV2026R0.ts | 230 + .../shuttlePathMappingAccountV2026R0.ts | 61 + .../shuttlePathMappingCreateRequestV2026R0.ts | 102 + ...lePathMappingImportCreateRequestV2026R0.ts | 65 + .../shuttlePathMappingLocationInputV2026R0.ts | 46 + .../shuttlePathMappingLocationV2026R0.ts | 46 + ...hMappingSharedSpaceLocationInputV2026R0.ts | 245 + ...ngSharedSpaceLocationTargetInputV2026R0.ts | 220 + ...lePathMappingSharedSpaceLocationV2026R0.ts | 240 + ...lePathMappingTargetLocationInputV2026R0.ts | 51 + .../shuttlePathMappingUpdateRequestV2026R0.ts | 82 + .../v2026R0/shuttlePathMappingV2026R0.ts | 280 + .../v2026R0/shuttlePathMappingsV2026R0.ts | 99 + .../shuttleReportCreateRequestV2026R0.ts | 160 + .../v2026R0/shuttleReportOutputV2026R0.ts | 74 + src/schemas/v2026R0/shuttleReportV2026R0.ts | 507 ++ src/schemas/v2026R0/shuttleReportsV2026R0.ts | 95 + src/schemas/v2026R0/shuttleRunV2026R0.ts | 574 ++ src/schemas/v2026R0/shuttleRunsV2026R0.ts | 94 + ...uttleSubjectMappingCreateRequestV2026R0.ts | 112 + ...ubjectMappingImportCreateRequestV2026R0.ts | 65 + ...uttleSubjectMappingUpdateRequestV2026R0.ts | 62 + .../v2026R0/shuttleSubjectMappingV2026R0.ts | 348 ++ .../v2026R0/shuttleSubjectMappingsV2026R0.ts | 99 + .../v2026R0/shuttleSubjectRoleV2026R0.ts | 53 + src/schemas/v2026R0/shuttleSubjectV2026R0.ts | 123 + .../shuttleSystemCreateRequestV2026R0.ts | 156 + .../shuttleSystemUpdateRequestV2026R0.ts | 36 + src/schemas/v2026R0/shuttleSystemV2026R0.ts | 298 + src/schemas/v2026R0/shuttleSystemsV2026R0.ts | 95 + .../shuttleTargetSubjectInputV2026R0.ts | 75 + .../v2026R0/shuttleTargetSubjectV2026R0.ts | 99 + 68 files changed, 16492 insertions(+), 19 deletions(-) create mode 100644 docs/shuttle.md create mode 100644 src/managers/shuttle.ts create mode 100644 src/schemas/v2026R0/shuttleAgentCredentialsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleDiscoveredSubjectV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleDiscoveredSubjectsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobPermissionConflictStrategyV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobScheduleCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobScheduleTriggerByJobV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobScheduleTriggerByTimeV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobScheduleTriggerV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobScheduleUpdateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobScheduleV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobSchedulesV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobStartRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobUpdateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleJobsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleMappingErrorV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleMappingErrorsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathEntriesV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathEntryAccountScopeV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathEntryScopeV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathEntrySharedSpaceScopeV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathEntryV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingAccountInputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingAccountLocationInputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingAccountLocationTargetInputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingAccountLocationV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingAccountV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingImportCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingLocationInputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingLocationV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationInputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationTargetInputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingTargetLocationInputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingUpdateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttlePathMappingsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleReportCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleReportOutputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleReportV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleReportsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleRunV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleRunsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSubjectMappingCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSubjectMappingImportCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSubjectMappingUpdateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSubjectMappingV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSubjectMappingsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSubjectRoleV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSubjectV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSystemCreateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSystemUpdateRequestV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSystemV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleSystemsV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleTargetSubjectInputV2026R0.ts create mode 100644 src/schemas/v2026R0/shuttleTargetSubjectV2026R0.ts diff --git a/.codegen.json b/.codegen.json index 9d7b55a7..08ec973f 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "4c5a50b", "specHash": "fcfcd5d", "version": "10.17.0" } +{ "engineHash": "4c5a50b", "specHash": "ad8dbb8", "version": "10.17.0" } diff --git a/docs/README.md b/docs/README.md index 124e76da..3d529ca3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -79,6 +79,7 @@ the SDK are available by topic: - [Shield information barrier segments](shieldInformationBarrierSegments.md) - [Shield information barriers](shieldInformationBarriers.md) - [Shield lists](shieldLists.md) +- [Shuttle](shuttle.md) - [Sign requests](signRequests.md) - [Sign templates](signTemplates.md) - [Skills](skills.md) diff --git a/docs/shuttle.md b/docs/shuttle.md new file mode 100644 index 00000000..86f4db09 --- /dev/null +++ b/docs/shuttle.md @@ -0,0 +1,1067 @@ +# ShuttleManager + +- [List shuttle systems](#list-shuttle-systems) +- [Create shuttle system](#create-shuttle-system) +- [Get shuttle system by ID](#get-shuttle-system-by-id) +- [Update shuttle system](#update-shuttle-system) +- [Delete shuttle system](#delete-shuttle-system) +- [Issue registration token for Windows system](#issue-registration-token-for-windows-system) +- [List shuttle jobs](#list-shuttle-jobs) +- [Create shuttle job](#create-shuttle-job) +- [Get shuttle job by ID](#get-shuttle-job-by-id) +- [Update shuttle job](#update-shuttle-job) +- [Delete shuttle job](#delete-shuttle-job) +- [Start shuttle job](#start-shuttle-job) +- [Stop shuttle job](#stop-shuttle-job) +- [Prepare migration](#prepare-migration) +- [List shuttle runs](#list-shuttle-runs) +- [Get shuttle run by ID](#get-shuttle-run-by-id) +- [List shuttle job schedules](#list-shuttle-job-schedules) +- [Create shuttle job schedule](#create-shuttle-job-schedule) +- [Get shuttle job schedule](#get-shuttle-job-schedule) +- [Update shuttle job schedule](#update-shuttle-job-schedule) +- [Delete shuttle job schedule](#delete-shuttle-job-schedule) +- [List shuttle path mappings](#list-shuttle-path-mappings) +- [Create shuttle path mapping](#create-shuttle-path-mapping) +- [Get shuttle path mapping by ID](#get-shuttle-path-mapping-by-id) +- [Update shuttle path mapping](#update-shuttle-path-mapping) +- [Delete shuttle path mapping](#delete-shuttle-path-mapping) +- [Create shuttle path mapping import](#create-shuttle-path-mapping-import) +- [Create shuttle subject mapping import](#create-shuttle-subject-mapping-import) +- [List shuttle subject mappings](#list-shuttle-subject-mappings) +- [Create shuttle subject mapping](#create-shuttle-subject-mapping) +- [Get shuttle subject mapping by ID](#get-shuttle-subject-mapping-by-id) +- [Update shuttle subject mapping](#update-shuttle-subject-mapping) +- [Delete shuttle subject mapping](#delete-shuttle-subject-mapping) +- [List shuttle discovered subjects](#list-shuttle-discovered-subjects) +- [List shuttle path entries](#list-shuttle-path-entries) +- [List shuttle mapping errors](#list-shuttle-mapping-errors) +- [List shuttle reports](#list-shuttle-reports) +- [Create shuttle report](#create-shuttle-report) +- [Get shuttle report by ID](#get-shuttle-report-by-id) + +## List shuttle systems + +Returns a paginated list of shuttle systems accessible to the +authenticated user. + +This operation is performed by calling function `getShuttleSystemsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-systems/). + +_Currently we don't have an example for calling `getShuttleSystemsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttleSystemsV2026R0QueryParams` + - Query parameters of getShuttleSystemsV2026R0 method +- headersInput `GetShuttleSystemsV2026R0HeadersInput` + - Headers of getShuttleSystemsV2026R0 method +- cancellationToken `undefined | CancellationToken` + - Token used for request cancellation. + +### Returns + +This function returns a value of type `ShuttleSystemsV2026R0`. + +Returns a paginated list of shuttle systems. + +## Create shuttle system + +Creates a new shuttle system. Only Windows agent systems can be created +through the public API; other system types must be configured through the +Shuttle application. + +This operation is performed by calling function `createShuttleSystemV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-systems/). + +_Currently we don't have an example for calling `createShuttleSystemV2026R0` in integration tests_ + +### Arguments + +- requestBodyInput `ShuttleSystemCreateRequestV2026R0Input` + - Request body of createShuttleSystemV2026R0 method +- optionalsInput `CreateShuttleSystemV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleSystemV2026R0`. + +Returns the newly created shuttle system. + +## Get shuttle system by ID + +Returns details for a single shuttle system identified by its ID, +including its type and connection state. + +This operation is performed by calling function `getShuttleSystemByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-systems-id/). + +_Currently we don't have an example for calling `getShuttleSystemByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleSystemId `string` + - The unique identifier for the shuttle system. Example: "6a315c0754833bfc5df067bf" +- optionalsInput `GetShuttleSystemByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleSystemV2026R0`. + +Returns the shuttle system. + +## Update shuttle system + +Updates the mutable properties of an existing shuttle system identified by +its ID. Only the fields supplied in the request body are changed. + +This operation is performed by calling function `updateShuttleSystemByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-systems-id/). + +_Currently we don't have an example for calling `updateShuttleSystemByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleSystemId `string` + - The unique identifier for the shuttle system. Example: "6a315c0754833bfc5df067bf" +- requestBody `ShuttleSystemUpdateRequestV2026R0` + - Request body of updateShuttleSystemByIdV2026R0 method +- optionalsInput `UpdateShuttleSystemByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleSystemV2026R0`. + +Returns the updated shuttle system. + +## Delete shuttle system + +Permanently deletes the shuttle system identified by its ID. This does not +affect content that has already been migrated. + +This operation is performed by calling function `deleteShuttleSystemByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-systems-id/). + +_Currently we don't have an example for calling `deleteShuttleSystemByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleSystemId `string` + - The unique identifier for the shuttle system. Example: "6a315c0754833bfc5df067bf" +- optionalsInput `DeleteShuttleSystemByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +Returns an empty response when the shuttle system was successfully +deleted. + +## Issue registration token for Windows system + +Issues a new installation token for the Windows shuttle system identified +by its ID. Paste the returned token into the Windows agent installer to +register the agent with this system. + +This operation is performed by calling function `createShuttleSystemIssueRegistrationTokenV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-systems-id-issue-registration-token/). + +_Currently we don't have an example for calling `createShuttleSystemIssueRegistrationTokenV2026R0` in integration tests_ + +### Arguments + +- shuttleSystemId `string` + - The unique identifier for the shuttle system. Example: "6a315c0754833bfc5df067bf" +- optionalsInput `CreateShuttleSystemIssueRegistrationTokenV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleAgentCredentialsV2026R0`. + +Returns the agent installation credentials for the Windows system. + +## List shuttle jobs + +Returns a paginated list of shuttle jobs accessible to the authenticated +user. + +This operation is performed by calling function `getShuttleJobsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-jobs/). + +_Currently we don't have an example for calling `getShuttleJobsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttleJobsV2026R0QueryParams` + - Query parameters of getShuttleJobsV2026R0 method +- headersInput `GetShuttleJobsV2026R0HeadersInput` + - Headers of getShuttleJobsV2026R0 method +- cancellationToken `undefined | CancellationToken` + - Token used for request cancellation. + +### Returns + +This function returns a value of type `ShuttleJobsV2026R0`. + +Returns a paginated list of shuttle jobs. + +## Create shuttle job + +Creates a new shuttle job that describes a migration from the given source +system into Box. + +This operation is performed by calling function `createShuttleJobV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs/). + +_Currently we don't have an example for calling `createShuttleJobV2026R0` in integration tests_ + +### Arguments + +- requestBody `ShuttleJobCreateRequestV2026R0` + - Request body of createShuttleJobV2026R0 method +- optionalsInput `CreateShuttleJobV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleJobV2026R0`. + +Returns the newly created shuttle job. + +## Get shuttle job by ID + +Returns details for a single shuttle job identified by its ID, including +its current state, mapping-preparation state, and configured source system. + +This operation is performed by calling function `getShuttleJobByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-jobs-id/). + +_Currently we don't have an example for calling `getShuttleJobByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleJobId `string` + - The unique identifier for the shuttle job. Example: "6a3ba68e810d9156194530a1" +- optionalsInput `GetShuttleJobByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleJobV2026R0`. + +Returns the shuttle job. + +## Update shuttle job + +Updates the mutable properties of an existing shuttle job identified by its +ID. Only the fields supplied in the request body are changed. + +This operation is performed by calling function `updateShuttleJobByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-jobs-id/). + +_Currently we don't have an example for calling `updateShuttleJobByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleJobId `string` + - The unique identifier for the shuttle job. Example: "6a3ba68e810d9156194530a1" +- requestBody `ShuttleJobUpdateRequestV2026R0` + - Request body of updateShuttleJobByIdV2026R0 method +- optionalsInput `UpdateShuttleJobByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleJobV2026R0`. + +Returns the updated shuttle job. + +## Delete shuttle job + +Permanently deletes the shuttle job identified by its ID. This does not +affect content that has already been migrated. + +This operation is performed by calling function `deleteShuttleJobByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-jobs-id/). + +_Currently we don't have an example for calling `deleteShuttleJobByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleJobId `string` + - The unique identifier for the shuttle job. Example: "6a3ba68e810d9156194530a1" +- optionalsInput `DeleteShuttleJobByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +Returns an empty response when the shuttle job was successfully deleted. + +## Start shuttle job + +Starts the job in the given mode. When no body is provided the job runs in +simulation mode. + +This operation is performed by calling function `createShuttleJobStartV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-start/). + +_Currently we don't have an example for calling `createShuttleJobStartV2026R0` in integration tests_ + +### Arguments + +- shuttleJobId `string` + - The unique identifier for the shuttle job. Example: "6a3ba68e810d9156194530a1" +- optionalsInput `CreateShuttleJobStartV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +The shuttle job was accepted and is being started. + +## Stop shuttle job + +Stops a running shuttle job identified by its ID. Any work already in +progress is allowed to finish before the job transitions to a stopped +state. + +This operation is performed by calling function `createShuttleJobStopV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-stop/). + +_Currently we don't have an example for calling `createShuttleJobStopV2026R0` in integration tests_ + +### Arguments + +- shuttleJobId `string` + - The unique identifier for the shuttle job. Example: "6a3ba68e810d9156194530a1" +- optionalsInput `CreateShuttleJobStopV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +The shuttle job was accepted and is being stopped. + +## Prepare migration + +Validates the configured account and path mappings before a transfer. Only +relevant when account mapping is enabled. + +This operation is performed by calling function `createShuttleJobPrepareMigrationV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-jobs-id-prepare-migration/). + +_Currently we don't have an example for calling `createShuttleJobPrepareMigrationV2026R0` in integration tests_ + +### Arguments + +- shuttleJobId `string` + - The unique identifier for the shuttle job. Example: "6a3ba68e810d9156194530a1" +- optionalsInput `CreateShuttleJobPrepareMigrationV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +The migration preparation was accepted and is being processed. + +## List shuttle runs + +Returns a paginated list of runs for the shuttle job identified by +`job_id`. + +This operation is performed by calling function `getShuttleRunsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-runs/). + +_Currently we don't have an example for calling `getShuttleRunsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttleRunsV2026R0QueryParams` + - Query parameters of getShuttleRunsV2026R0 method +- optionalsInput `GetShuttleRunsV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleRunsV2026R0`. + +Returns a paginated list of shuttle runs. + +## Get shuttle run by ID + +Returns details for a single shuttle run identified by its ID, including +its mode, state, timing, and transfer statistics. + +This operation is performed by calling function `getShuttleRunByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-runs-id/). + +_Currently we don't have an example for calling `getShuttleRunByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleRunId `string` + - The unique identifier for the shuttle run, in the form `{job_id}:{run_number}`. Example: "6a3ba68e810d9156194530a1:42" +- optionalsInput `GetShuttleRunByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleRunV2026R0`. + +Returns the shuttle run. + +## List shuttle job schedules + +Returns a paginated list of schedules for the shuttle job identified by +`job_id`. + +This operation is performed by calling function `getShuttleJobSchedulesV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-job-schedules/). + +_Currently we don't have an example for calling `getShuttleJobSchedulesV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttleJobSchedulesV2026R0QueryParams` + - Query parameters of getShuttleJobSchedulesV2026R0 method +- optionalsInput `GetShuttleJobSchedulesV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleJobSchedulesV2026R0`. + +Returns a paginated list of shuttle job schedules. + +## Create shuttle job schedule + +Creates a schedule that starts runs of the shuttle job identified by +`job_id`. The schedule starts a run either at a wall-clock time or after +another job's run meets a condition. Schedules cannot start a run in +`scan` mode. + +This operation is performed by calling function `createShuttleJobScheduleV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-job-schedules/). + +_Currently we don't have an example for calling `createShuttleJobScheduleV2026R0` in integration tests_ + +### Arguments + +- requestBody `ShuttleJobScheduleCreateRequestV2026R0` + - Request body of createShuttleJobScheduleV2026R0 method +- optionalsInput `CreateShuttleJobScheduleV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleJobScheduleV2026R0`. + +Returns the newly created shuttle job schedule. + +## Get shuttle job schedule + +Retrieves the shuttle job schedule identified by its ID. + +This operation is performed by calling function `getShuttleJobScheduleByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-job-schedules-id/). + +_Currently we don't have an example for calling `getShuttleJobScheduleByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleJobScheduleId `string` + - The unique identifier for the shuttle job schedule. Example: "7c1ba68e810d9156194530b2" +- optionalsInput `GetShuttleJobScheduleByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleJobScheduleV2026R0`. + +Returns the shuttle job schedule. + +## Update shuttle job schedule + +Updates the mutable properties of an existing shuttle job schedule +identified by its ID. Only the fields supplied in the request body are +changed. The owning job cannot be changed. + +This operation is performed by calling function `updateShuttleJobScheduleByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-job-schedules-id/). + +_Currently we don't have an example for calling `updateShuttleJobScheduleByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleJobScheduleId `string` + - The unique identifier for the shuttle job schedule. Example: "7c1ba68e810d9156194530b2" +- requestBody `ShuttleJobScheduleUpdateRequestV2026R0` + - Request body of updateShuttleJobScheduleByIdV2026R0 method +- optionalsInput `UpdateShuttleJobScheduleByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleJobScheduleV2026R0`. + +Returns the updated shuttle job schedule. + +## Delete shuttle job schedule + +Permanently deletes the shuttle job schedule identified by its ID. This +does not affect runs that have already started. + +This operation is performed by calling function `deleteShuttleJobScheduleByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-job-schedules-id/). + +_Currently we don't have an example for calling `deleteShuttleJobScheduleByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleJobScheduleId `string` + - The unique identifier for the shuttle job schedule. Example: "7c1ba68e810d9156194530b2" +- optionalsInput `DeleteShuttleJobScheduleByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +Returns an empty response when the shuttle job schedule was +successfully deleted. + +## List shuttle path mappings + +Returns a paginated list of path mappings for the shuttle job identified +by `job_id`. + +This operation is performed by calling function `getShuttlePathMappingsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-mappings/). + +_Currently we don't have an example for calling `getShuttlePathMappingsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttlePathMappingsV2026R0QueryParams` + - Query parameters of getShuttlePathMappingsV2026R0 method +- optionalsInput `GetShuttlePathMappingsV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttlePathMappingsV2026R0`. + +Returns a paginated list of shuttle path mappings. + +## Create shuttle path mapping + +Creates a path mapping that connects a source location on the migrated +system to a destination in Box for the given shuttle job. + +This operation is performed by calling function `createShuttlePathMappingV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-path-mappings/). + +_Currently we don't have an example for calling `createShuttlePathMappingV2026R0` in integration tests_ + +### Arguments + +- requestBody `ShuttlePathMappingCreateRequestV2026R0` + - Request body of createShuttlePathMappingV2026R0 method +- optionalsInput `CreateShuttlePathMappingV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttlePathMappingV2026R0`. + +Returns the newly created shuttle path mapping. + +## Get shuttle path mapping by ID + +Returns details for a single shuttle path mapping identified by its ID, +including the source location and destination, if any. + +This operation is performed by calling function `getShuttlePathMappingByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-mappings-id/). + +_Currently we don't have an example for calling `getShuttlePathMappingByIdV2026R0` in integration tests_ + +### Arguments + +- shuttlePathMappingId `string` + - The unique identifier for the shuttle path mapping. Example: "6a3ba7a24ea17bc9461eeacd" +- optionalsInput `GetShuttlePathMappingByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttlePathMappingV2026R0`. + +Returns the shuttle path mapping. + +## Update shuttle path mapping + +Updates the mutable properties of an existing shuttle path mapping +identified by its ID. Only the fields supplied in the request body are +changed. + +This operation is performed by calling function `updateShuttlePathMappingByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-path-mappings-id/). + +_Currently we don't have an example for calling `updateShuttlePathMappingByIdV2026R0` in integration tests_ + +### Arguments + +- shuttlePathMappingId `string` + - The unique identifier for the shuttle path mapping. Example: "6a3ba7a24ea17bc9461eeacd" +- requestBody `ShuttlePathMappingUpdateRequestV2026R0` + - Request body of updateShuttlePathMappingByIdV2026R0 method +- optionalsInput `UpdateShuttlePathMappingByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttlePathMappingV2026R0`. + +Returns the updated shuttle path mapping. + +## Delete shuttle path mapping + +Permanently deletes the shuttle path mapping identified by its ID. This +does not affect content that has already been migrated. + +This operation is performed by calling function `deleteShuttlePathMappingByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-path-mappings-id/). + +_Currently we don't have an example for calling `deleteShuttlePathMappingByIdV2026R0` in integration tests_ + +### Arguments + +- shuttlePathMappingId `string` + - The unique identifier for the shuttle path mapping. Example: "6a3ba7a24ea17bc9461eeacd" +- optionalsInput `DeleteShuttlePathMappingByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +Returns an empty response when the shuttle path mapping was +successfully deleted. + +## Create shuttle path mapping import + +Accepts a spreadsheet of path mappings, already stored in Box, and replaces +the job's path mappings. +A file that is not a mapping workbook, or that exceeds the size or row +limits (10 MiB Box download limit; 100,000 mapping rows), returns `400` +synchronously and leaves the job unchanged. +An accepted import always replaces every path mapping on the job. When all +rows are valid the workbook is deployed in full. When any row is invalid +the job ends with no path mappings and `mapping_state` becomes +`paths_import_rejected` until the next import or the next manual +path-mapping change. Row problems are listed by +`GET /shuttle_mapping_errors?job_id=…` with category `path_import`, messages +of the form `Row N: …`, at most 500 entries plus one overflow entry. +Validation and deployment are asynchronous after acceptance. Poll +`GET /shuttle_jobs/{shuttle_job_id}` while `mapping_state` is +`importing_paths`. Only one import may be in flight per job. + +This operation is performed by calling function `createShuttlePathMappingImportV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-path-mapping-imports/). + +_Currently we don't have an example for calling `createShuttlePathMappingImportV2026R0` in integration tests_ + +### Arguments + +- requestBody `ShuttlePathMappingImportCreateRequestV2026R0` + - Request body of createShuttlePathMappingImportV2026R0 method +- optionalsInput `CreateShuttlePathMappingImportV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +The import was accepted. Validation and deployment continue +asynchronously. Poll `GET /shuttle_jobs/{shuttle_job_id}` until +`mapping_state` is no longer `importing_paths`. A rejected import ends +with `mapping_state` `paths_import_rejected` and an empty path-mapping +list; a successful import moves on to a later mapping-preparation state +such as `paths_ready` or `ready`. + +## Create shuttle subject mapping import + +Accepts a spreadsheet of subject (user and group) mappings, already stored +in Box, and replaces the job's subject mappings. +A file that is not a subject-mapping workbook, or that exceeds the size or +row limits (10 MiB Box download limit; 50,000 mapping rows), returns `400` +synchronously and leaves the job unchanged. +An accepted import always replaces every subject mapping on the job. When +all rows are valid the workbook is deployed in full. When any row is +invalid the job ends with no subject mappings and `mapping_state` becomes +`subjects_import_rejected` until the next import or the next manual +subject-mapping change. Row problems are listed by +`GET /shuttle_mapping_errors?job_id=…` with category `subject_import`, +messages of the form `Row N: …`, at most 500 entries plus one overflow +entry. +Validation and deployment are asynchronous after acceptance. Poll +`GET /shuttle_jobs/{shuttle_job_id}` while `mapping_state` is +`importing_subjects`. Only one import may be in flight per job. The job +must map subjects (`account_mapping` enabled) and its source scan must be +finished; otherwise the request returns `409`. + +Expected workbook format (API clients cannot download the UI template): +sheets `Users` and/or `Groups` (a sheet named `Subjects` is also accepted). +Columns are `Source User `, `Target User `, `Skip` on `Users`, +and `Source Group `, `Target Group `, `Skip` on `Groups`, where +`` is the primary identifier for that role and system: + +- Users: `Email` for most systems; `ID` for `SharePoint` (2007/2010/2013); + `Name` for Windows (`windows_union`, stored as the user id). +- Groups: `Name` for most systems; `Email` for Google Drive admin groups. + Source rows for a template can be taken from + `GET /shuttle_discovered_subjects`. + +This operation is performed by calling function `createShuttleSubjectMappingImportV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-subject-mapping-imports/). + +_Currently we don't have an example for calling `createShuttleSubjectMappingImportV2026R0` in integration tests_ + +### Arguments + +- requestBody `ShuttleSubjectMappingImportCreateRequestV2026R0` + - Request body of createShuttleSubjectMappingImportV2026R0 method +- optionalsInput `CreateShuttleSubjectMappingImportV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +The import was accepted. Validation and deployment continue +asynchronously. Poll `GET /shuttle_jobs/{shuttle_job_id}` until +`mapping_state` is no longer `importing_subjects`. A rejected import +ends with `mapping_state` `subjects_import_rejected` and an empty +subject-mapping list; a successful import moves on to a later +mapping-preparation state such as `mapping_complete` or `ready`. + +## List shuttle subject mappings + +Returns a paginated list of subject mappings for the shuttle job identified +by `job_id`. + +This operation is performed by calling function `getShuttleSubjectMappingsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-subject-mappings/). + +_Currently we don't have an example for calling `getShuttleSubjectMappingsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttleSubjectMappingsV2026R0QueryParams` + - Query parameters of getShuttleSubjectMappingsV2026R0 method +- optionalsInput `GetShuttleSubjectMappingsV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleSubjectMappingsV2026R0`. + +Returns a paginated list of shuttle subject mappings. + +## Create shuttle subject mapping + +Creates a subject mapping that connects a discovered source subject to a +Box user or group for the given shuttle job. + +This operation is performed by calling function `createShuttleSubjectMappingV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-subject-mappings/). + +_Currently we don't have an example for calling `createShuttleSubjectMappingV2026R0` in integration tests_ + +### Arguments + +- requestBody `ShuttleSubjectMappingCreateRequestV2026R0` + - Request body of createShuttleSubjectMappingV2026R0 method +- optionalsInput `CreateShuttleSubjectMappingV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleSubjectMappingV2026R0`. + +Returns the newly created shuttle subject mapping. + +## Get shuttle subject mapping by ID + +Returns details for a single shuttle subject mapping identified by its ID, +including the source subject and Box target, if any. + +This operation is performed by calling function `getShuttleSubjectMappingByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-subject-mappings-id/). + +_Currently we don't have an example for calling `getShuttleSubjectMappingByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleSubjectMappingId `string` + - The unique identifier for the shuttle subject mapping. Example: "6a3ba7b12ea17bc9461eeace" +- optionalsInput `GetShuttleSubjectMappingByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleSubjectMappingV2026R0`. + +Returns the shuttle subject mapping. + +## Update shuttle subject mapping + +Updates the mutable properties of an existing shuttle subject mapping +identified by its ID. Only the fields supplied in the request body are +changed. + +This operation is performed by calling function `updateShuttleSubjectMappingByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/put-shuttle-subject-mappings-id/). + +_Currently we don't have an example for calling `updateShuttleSubjectMappingByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleSubjectMappingId `string` + - The unique identifier for the shuttle subject mapping. Example: "6a3ba7b12ea17bc9461eeace" +- requestBody `ShuttleSubjectMappingUpdateRequestV2026R0` + - Request body of updateShuttleSubjectMappingByIdV2026R0 method +- optionalsInput `UpdateShuttleSubjectMappingByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleSubjectMappingV2026R0`. + +Returns the updated shuttle subject mapping. + +## Delete shuttle subject mapping + +Permanently deletes the shuttle subject mapping identified by its ID. + +This operation is performed by calling function `deleteShuttleSubjectMappingByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/delete-shuttle-subject-mappings-id/). + +_Currently we don't have an example for calling `deleteShuttleSubjectMappingByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleSubjectMappingId `string` + - The unique identifier for the shuttle subject mapping. Example: "6a3ba7b12ea17bc9461eeace" +- optionalsInput `DeleteShuttleSubjectMappingByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `undefined`. + +Returns an empty response when the shuttle subject mapping was +successfully deleted. + +## List shuttle discovered subjects + +Returns a paginated list of subjects discovered on the source system for +the shuttle job identified by `job_id`. + +This operation is performed by calling function `getShuttleDiscoveredSubjectsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-discovered-subjects/). + +_Currently we don't have an example for calling `getShuttleDiscoveredSubjectsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttleDiscoveredSubjectsV2026R0QueryParams` + - Query parameters of getShuttleDiscoveredSubjectsV2026R0 method +- optionalsInput `GetShuttleDiscoveredSubjectsV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleDiscoveredSubjectsV2026R0`. + +Returns a paginated list of discovered subjects. + +## List shuttle path entries + +Returns a paginated list of source or target path entries for a shuttle +job. Call with only `job_id` and `side` to list the roots, then browse one +level at a time using `path`, `path_id`, or both. Each entry includes +`path`, `path_id`, `is_directory`, and a `scope` object (`account` or +`shared_space`) so a mapping can be created from that row without extra +browse state. Valid values depend on the selected system. + +This operation is performed by calling function `getShuttlePathEntriesV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-path-entries/). + +_Currently we don't have an example for calling `getShuttlePathEntriesV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttlePathEntriesV2026R0QueryParams` + - Query parameters of getShuttlePathEntriesV2026R0 method +- optionalsInput `GetShuttlePathEntriesV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttlePathEntriesV2026R0`. + +Returns a paginated list of shuttle path entries. + +## List shuttle mapping errors + +Returns a paginated list of mapping errors for a shuttle job. Only the latest +record for each error is returned. The revision field identifies the mapping +revision in which that error was generated. + +This operation is performed by calling function `getShuttleMappingErrorsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-mapping-errors/). + +_Currently we don't have an example for calling `getShuttleMappingErrorsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttleMappingErrorsV2026R0QueryParams` + - Query parameters of getShuttleMappingErrorsV2026R0 method +- optionalsInput `GetShuttleMappingErrorsV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleMappingErrorsV2026R0`. + +Returns a paginated list of shuttle mapping errors. + +## List shuttle reports + +Returns a paginated list of reports generated for the shuttle run +identified by `run_id`. + +This operation is performed by calling function `getShuttleReportsV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-reports/). + +_Currently we don't have an example for calling `getShuttleReportsV2026R0` in integration tests_ + +### Arguments + +- queryParams `GetShuttleReportsV2026R0QueryParams` + - Query parameters of getShuttleReportsV2026R0 method +- optionalsInput `GetShuttleReportsV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleReportsV2026R0`. + +Returns a paginated list of shuttle reports. + +## Create shuttle report + +Requests asynchronous generation of a report for a shuttle run. The +report is returned immediately in `pending` or `processing` status. +Poll `GET /shuttle_reports/{shuttle_report_id}` while `status` is +`pending` or `processing`. Stop when `status` is `complete`, `failed`, +`canceled`, or `unknown`. Repeating this request with the same +parameters reuses the existing report instead of creating a duplicate. + +This operation is performed by calling function `createShuttleReportV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/post-shuttle-reports/). + +_Currently we don't have an example for calling `createShuttleReportV2026R0` in integration tests_ + +### Arguments + +- requestBody `ShuttleReportCreateRequestV2026R0` + - Request body of createShuttleReportV2026R0 method +- optionalsInput `CreateShuttleReportV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleReportV2026R0`. + +The report was accepted for generation. Returns the shuttle report; +generation continues asynchronously. Repeating this request with the +same parameters reuses the existing report instead of creating a +duplicate. + +## Get shuttle report by ID + +Returns details for a single shuttle report identified by its ID, +including generation status and, once generation finishes, the Box +output reference. + +This operation is performed by calling function `getShuttleReportByIdV2026R0`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/v2026.0/get-shuttle-reports-id/). + +_Currently we don't have an example for calling `getShuttleReportByIdV2026R0` in integration tests_ + +### Arguments + +- shuttleReportId `string` + - The unique identifier for the shuttle report. Example: "6a3ba8d14f2c91e8370b4d12" +- optionalsInput `GetShuttleReportByIdV2026R0OptionalsInput` + +### Returns + +This function returns a value of type `ShuttleReportV2026R0`. + +Returns the shuttle report. diff --git a/src/client.ts b/src/client.ts index 0b791311..6ff8f63a 100644 --- a/src/client.ts +++ b/src/client.ts @@ -89,6 +89,7 @@ import { AutomateWorkflowsManager } from './managers/automateWorkflows'; import { NotesManager } from './managers/notes'; import { DocumentSplitManager } from './managers/documentSplit'; import { QueryManager } from './managers/query'; +import { ShuttleManager } from './managers/shuttle'; import { Authentication } from './networking/auth'; import { NetworkSession } from './networking/network'; import { BoxSdkError } from './box/errors'; @@ -198,6 +199,7 @@ export class BoxClient { readonly notes: NotesManager; readonly documentSplit: DocumentSplitManager; readonly query: QueryManager; + readonly shuttle: ShuttleManager; constructor( fields: Omit< BoxClient, @@ -288,6 +290,7 @@ export class BoxClient { | 'notes' | 'documentSplit' | 'query' + | 'shuttle' | 'networkSession' | 'makeRequest' | 'withAsUserHeader' @@ -661,6 +664,10 @@ export class BoxClient { auth: this.auth, networkSession: this.networkSession, }); + this.shuttle = new ShuttleManager({ + auth: this.auth, + networkSession: this.networkSession, + }); } /** * Make a custom http request using the client authentication and network session. diff --git a/src/managers/events.ts b/src/managers/events.ts index cfc53bee..5aceec09 100644 --- a/src/managers/events.ts +++ b/src/managers/events.ts @@ -143,14 +143,18 @@ export type GetEventsQueryParamsEventTypeField = | 'RENAME' | 'RETENTION_POLICY_ASSIGNMENT_ADD' | 'SHARE' + | 'SHARED_LINK_ONE_TIME_PASSCODE_ACCESS' + | 'SHARED_LINK_ONE_TIME_PASSCODE_CHALLENGE' | 'SHARED_LINK_SEND' | 'SHARE_EXPIRATION' | 'SHIELD_ALERT' | 'SHIELD_DOWNLOAD_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED_MISSING_JUSTIFICATION' + | 'SHIELD_EXTERNAL_COLLAB_ACCESS_JUSTIFIED' | 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED_MISSING_JUSTIFICATION' + | 'SHIELD_EXTERNAL_COLLAB_INVITE_JUSTIFIED' | 'SHIELD_JUSTIFICATION_APPROVAL' | 'SHIELD_PREVIEW_BLOCKED' | 'SHIELD_SHARED_LINK_ACCESS_BLOCKED' @@ -358,14 +362,18 @@ export type GetEventStreamQueryParamsEventTypeField = | 'RENAME' | 'RETENTION_POLICY_ASSIGNMENT_ADD' | 'SHARE' + | 'SHARED_LINK_ONE_TIME_PASSCODE_ACCESS' + | 'SHARED_LINK_ONE_TIME_PASSCODE_CHALLENGE' | 'SHARED_LINK_SEND' | 'SHARE_EXPIRATION' | 'SHIELD_ALERT' | 'SHIELD_DOWNLOAD_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED_MISSING_JUSTIFICATION' + | 'SHIELD_EXTERNAL_COLLAB_ACCESS_JUSTIFIED' | 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED_MISSING_JUSTIFICATION' + | 'SHIELD_EXTERNAL_COLLAB_INVITE_JUSTIFIED' | 'SHIELD_JUSTIFICATION_APPROVAL' | 'SHIELD_PREVIEW_BLOCKED' | 'SHIELD_SHARED_LINK_ACCESS_BLOCKED' @@ -966,6 +974,12 @@ export function deserializeGetEventsQueryParamsEventTypeField( if (val == 'SHARE') { return val; } + if (val == 'SHARED_LINK_ONE_TIME_PASSCODE_ACCESS') { + return val; + } + if (val == 'SHARED_LINK_ONE_TIME_PASSCODE_CHALLENGE') { + return val; + } if (val == 'SHARED_LINK_SEND') { return val; } @@ -984,12 +998,18 @@ export function deserializeGetEventsQueryParamsEventTypeField( if (val == 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED_MISSING_JUSTIFICATION') { return val; } + if (val == 'SHIELD_EXTERNAL_COLLAB_ACCESS_JUSTIFIED') { + return val; + } if (val == 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED') { return val; } if (val == 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED_MISSING_JUSTIFICATION') { return val; } + if (val == 'SHIELD_EXTERNAL_COLLAB_INVITE_JUSTIFIED') { + return val; + } if (val == 'SHIELD_JUSTIFICATION_APPROVAL') { return val; } @@ -1413,6 +1433,12 @@ export function deserializeGetEventStreamQueryParamsEventTypeField( if (val == 'SHARE') { return val; } + if (val == 'SHARED_LINK_ONE_TIME_PASSCODE_ACCESS') { + return val; + } + if (val == 'SHARED_LINK_ONE_TIME_PASSCODE_CHALLENGE') { + return val; + } if (val == 'SHARED_LINK_SEND') { return val; } @@ -1431,12 +1457,18 @@ export function deserializeGetEventStreamQueryParamsEventTypeField( if (val == 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED_MISSING_JUSTIFICATION') { return val; } + if (val == 'SHIELD_EXTERNAL_COLLAB_ACCESS_JUSTIFIED') { + return val; + } if (val == 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED') { return val; } if (val == 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED_MISSING_JUSTIFICATION') { return val; } + if (val == 'SHIELD_EXTERNAL_COLLAB_INVITE_JUSTIFIED') { + return val; + } if (val == 'SHIELD_JUSTIFICATION_APPROVAL') { return val; } diff --git a/src/managers/index.ts b/src/managers/index.ts index fd564adb..9d526334 100644 --- a/src/managers/index.ts +++ b/src/managers/index.ts @@ -85,3 +85,4 @@ export * from './automateWorkflows'; export * from './notes'; export * from './documentSplit'; export * from './query'; +export * from './shuttle'; diff --git a/src/managers/shuttle.ts b/src/managers/shuttle.ts new file mode 100644 index 00000000..a07c3c20 --- /dev/null +++ b/src/managers/shuttle.ts @@ -0,0 +1,4815 @@ +import { serializeShuttleSystemsV2026R0 } from '../schemas/v2026R0/shuttleSystemsV2026R0'; +import { deserializeShuttleSystemsV2026R0 } from '../schemas/v2026R0/shuttleSystemsV2026R0'; +import { serializeClientErrorV2026R0 } from '../schemas/v2026R0/clientErrorV2026R0'; +import { deserializeClientErrorV2026R0 } from '../schemas/v2026R0/clientErrorV2026R0'; +import { serializeBoxVersionHeaderV2026R0 } from '../parameters/v2026R0/boxVersionHeaderV2026R0'; +import { deserializeBoxVersionHeaderV2026R0 } from '../parameters/v2026R0/boxVersionHeaderV2026R0'; +import { serializeShuttleSystemV2026R0 } from '../schemas/v2026R0/shuttleSystemV2026R0'; +import { deserializeShuttleSystemV2026R0 } from '../schemas/v2026R0/shuttleSystemV2026R0'; +import { serializeShuttleSystemCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSystemCreateRequestV2026R0'; +import { deserializeShuttleSystemCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSystemCreateRequestV2026R0'; +import { serializeShuttleSystemUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleSystemUpdateRequestV2026R0'; +import { deserializeShuttleSystemUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleSystemUpdateRequestV2026R0'; +import { serializeShuttleAgentCredentialsV2026R0 } from '../schemas/v2026R0/shuttleAgentCredentialsV2026R0'; +import { deserializeShuttleAgentCredentialsV2026R0 } from '../schemas/v2026R0/shuttleAgentCredentialsV2026R0'; +import { serializeShuttleJobsV2026R0 } from '../schemas/v2026R0/shuttleJobsV2026R0'; +import { deserializeShuttleJobsV2026R0 } from '../schemas/v2026R0/shuttleJobsV2026R0'; +import { serializeShuttleJobV2026R0 } from '../schemas/v2026R0/shuttleJobV2026R0'; +import { deserializeShuttleJobV2026R0 } from '../schemas/v2026R0/shuttleJobV2026R0'; +import { serializeShuttleJobCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobCreateRequestV2026R0'; +import { deserializeShuttleJobCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobCreateRequestV2026R0'; +import { serializeShuttleJobUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobUpdateRequestV2026R0'; +import { deserializeShuttleJobUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobUpdateRequestV2026R0'; +import { serializeShuttleJobStartRequestV2026R0 } from '../schemas/v2026R0/shuttleJobStartRequestV2026R0'; +import { deserializeShuttleJobStartRequestV2026R0 } from '../schemas/v2026R0/shuttleJobStartRequestV2026R0'; +import { serializeShuttleRunsV2026R0 } from '../schemas/v2026R0/shuttleRunsV2026R0'; +import { deserializeShuttleRunsV2026R0 } from '../schemas/v2026R0/shuttleRunsV2026R0'; +import { serializeShuttleRunV2026R0 } from '../schemas/v2026R0/shuttleRunV2026R0'; +import { deserializeShuttleRunV2026R0 } from '../schemas/v2026R0/shuttleRunV2026R0'; +import { serializeShuttleJobSchedulesV2026R0 } from '../schemas/v2026R0/shuttleJobSchedulesV2026R0'; +import { deserializeShuttleJobSchedulesV2026R0 } from '../schemas/v2026R0/shuttleJobSchedulesV2026R0'; +import { serializeShuttleJobScheduleV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleV2026R0'; +import { deserializeShuttleJobScheduleV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleV2026R0'; +import { serializeShuttleJobScheduleCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleCreateRequestV2026R0'; +import { deserializeShuttleJobScheduleCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleCreateRequestV2026R0'; +import { serializeShuttleJobScheduleUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleUpdateRequestV2026R0'; +import { deserializeShuttleJobScheduleUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleUpdateRequestV2026R0'; +import { serializeShuttlePathMappingsV2026R0 } from '../schemas/v2026R0/shuttlePathMappingsV2026R0'; +import { deserializeShuttlePathMappingsV2026R0 } from '../schemas/v2026R0/shuttlePathMappingsV2026R0'; +import { serializeShuttlePathMappingV2026R0 } from '../schemas/v2026R0/shuttlePathMappingV2026R0'; +import { deserializeShuttlePathMappingV2026R0 } from '../schemas/v2026R0/shuttlePathMappingV2026R0'; +import { serializeShuttlePathMappingCreateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingCreateRequestV2026R0'; +import { deserializeShuttlePathMappingCreateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingCreateRequestV2026R0'; +import { serializeShuttlePathMappingUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingUpdateRequestV2026R0'; +import { deserializeShuttlePathMappingUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingUpdateRequestV2026R0'; +import { serializeShuttlePathMappingImportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingImportCreateRequestV2026R0'; +import { deserializeShuttlePathMappingImportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingImportCreateRequestV2026R0'; +import { serializeShuttleSubjectMappingImportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingImportCreateRequestV2026R0'; +import { deserializeShuttleSubjectMappingImportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingImportCreateRequestV2026R0'; +import { serializeShuttleSubjectMappingsV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingsV2026R0'; +import { deserializeShuttleSubjectMappingsV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingsV2026R0'; +import { serializeShuttleSubjectMappingV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingV2026R0'; +import { deserializeShuttleSubjectMappingV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingV2026R0'; +import { serializeShuttleSubjectMappingCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingCreateRequestV2026R0'; +import { deserializeShuttleSubjectMappingCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingCreateRequestV2026R0'; +import { serializeShuttleSubjectMappingUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingUpdateRequestV2026R0'; +import { deserializeShuttleSubjectMappingUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingUpdateRequestV2026R0'; +import { serializeShuttleDiscoveredSubjectsV2026R0 } from '../schemas/v2026R0/shuttleDiscoveredSubjectsV2026R0'; +import { deserializeShuttleDiscoveredSubjectsV2026R0 } from '../schemas/v2026R0/shuttleDiscoveredSubjectsV2026R0'; +import { serializeShuttlePathEntriesV2026R0 } from '../schemas/v2026R0/shuttlePathEntriesV2026R0'; +import { deserializeShuttlePathEntriesV2026R0 } from '../schemas/v2026R0/shuttlePathEntriesV2026R0'; +import { serializeShuttleMappingErrorsV2026R0 } from '../schemas/v2026R0/shuttleMappingErrorsV2026R0'; +import { deserializeShuttleMappingErrorsV2026R0 } from '../schemas/v2026R0/shuttleMappingErrorsV2026R0'; +import { serializeShuttleReportsV2026R0 } from '../schemas/v2026R0/shuttleReportsV2026R0'; +import { deserializeShuttleReportsV2026R0 } from '../schemas/v2026R0/shuttleReportsV2026R0'; +import { serializeShuttleReportV2026R0 } from '../schemas/v2026R0/shuttleReportV2026R0'; +import { deserializeShuttleReportV2026R0 } from '../schemas/v2026R0/shuttleReportV2026R0'; +import { serializeShuttleReportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleReportCreateRequestV2026R0'; +import { deserializeShuttleReportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleReportCreateRequestV2026R0'; +import { ShuttleSystemCreateRequestV2026R0Input } from '../schemas/v2026R0/shuttleSystemCreateRequestV2026R0'; +import { ResponseFormat } from '../networking/fetchOptions'; +import { ShuttleSystemsV2026R0 } from '../schemas/v2026R0/shuttleSystemsV2026R0'; +import { ClientErrorV2026R0 } from '../schemas/v2026R0/clientErrorV2026R0'; +import { BoxVersionHeaderV2026R0 } from '../parameters/v2026R0/boxVersionHeaderV2026R0'; +import { ShuttleSystemV2026R0 } from '../schemas/v2026R0/shuttleSystemV2026R0'; +import { ShuttleSystemCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSystemCreateRequestV2026R0'; +import { ShuttleSystemUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleSystemUpdateRequestV2026R0'; +import { ShuttleAgentCredentialsV2026R0 } from '../schemas/v2026R0/shuttleAgentCredentialsV2026R0'; +import { ShuttleJobsV2026R0 } from '../schemas/v2026R0/shuttleJobsV2026R0'; +import { ShuttleJobV2026R0 } from '../schemas/v2026R0/shuttleJobV2026R0'; +import { ShuttleJobCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobCreateRequestV2026R0'; +import { ShuttleJobUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobUpdateRequestV2026R0'; +import { ShuttleJobStartRequestV2026R0 } from '../schemas/v2026R0/shuttleJobStartRequestV2026R0'; +import { ShuttleRunsV2026R0 } from '../schemas/v2026R0/shuttleRunsV2026R0'; +import { ShuttleRunV2026R0 } from '../schemas/v2026R0/shuttleRunV2026R0'; +import { ShuttleJobSchedulesV2026R0 } from '../schemas/v2026R0/shuttleJobSchedulesV2026R0'; +import { ShuttleJobScheduleV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleV2026R0'; +import { ShuttleJobScheduleCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleCreateRequestV2026R0'; +import { ShuttleJobScheduleUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleJobScheduleUpdateRequestV2026R0'; +import { ShuttlePathMappingsV2026R0 } from '../schemas/v2026R0/shuttlePathMappingsV2026R0'; +import { ShuttlePathMappingV2026R0 } from '../schemas/v2026R0/shuttlePathMappingV2026R0'; +import { ShuttlePathMappingCreateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingCreateRequestV2026R0'; +import { ShuttlePathMappingUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingUpdateRequestV2026R0'; +import { ShuttlePathMappingImportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttlePathMappingImportCreateRequestV2026R0'; +import { ShuttleSubjectMappingImportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingImportCreateRequestV2026R0'; +import { ShuttleSubjectMappingsV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingsV2026R0'; +import { ShuttleSubjectMappingV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingV2026R0'; +import { ShuttleSubjectMappingCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingCreateRequestV2026R0'; +import { ShuttleSubjectMappingUpdateRequestV2026R0 } from '../schemas/v2026R0/shuttleSubjectMappingUpdateRequestV2026R0'; +import { ShuttleDiscoveredSubjectsV2026R0 } from '../schemas/v2026R0/shuttleDiscoveredSubjectsV2026R0'; +import { ShuttlePathEntriesV2026R0 } from '../schemas/v2026R0/shuttlePathEntriesV2026R0'; +import { ShuttleMappingErrorsV2026R0 } from '../schemas/v2026R0/shuttleMappingErrorsV2026R0'; +import { ShuttleReportsV2026R0 } from '../schemas/v2026R0/shuttleReportsV2026R0'; +import { ShuttleReportV2026R0 } from '../schemas/v2026R0/shuttleReportV2026R0'; +import { ShuttleReportCreateRequestV2026R0 } from '../schemas/v2026R0/shuttleReportCreateRequestV2026R0'; +import { BoxSdkError } from '../box/errors'; +import { Authentication } from '../networking/auth'; +import { NetworkSession } from '../networking/network'; +import { FetchOptions } from '../networking/fetchOptions'; +import { FetchResponse } from '../networking/fetchResponse'; +import { prepareParams } from '../internal/utils'; +import { toString } from '../internal/utils'; +import { ByteStream } from '../internal/utils'; +import { CancellationToken } from '../internal/utils'; +import { sdToJson } from '../serialization/json'; +import { SerializedData } from '../serialization/json'; +import { sdIsEmpty } from '../serialization/json'; +import { sdIsBoolean } from '../serialization/json'; +import { sdIsNumber } from '../serialization/json'; +import { sdIsString } from '../serialization/json'; +import { sdIsList } from '../serialization/json'; +import { sdIsMap } from '../serialization/json'; +export class CreateShuttleSystemV2026R0Optionals { + readonly headers: CreateShuttleSystemV2026R0Headers = + new CreateShuttleSystemV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleSystemV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleSystemV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleSystemV2026R0OptionalsInput { + readonly headers?: CreateShuttleSystemV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleSystemByIdV2026R0Optionals { + readonly headers: GetShuttleSystemByIdV2026R0Headers = + new GetShuttleSystemByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleSystemByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttleSystemByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleSystemByIdV2026R0OptionalsInput { + readonly headers?: GetShuttleSystemByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class UpdateShuttleSystemByIdV2026R0Optionals { + readonly headers: UpdateShuttleSystemByIdV2026R0Headers = + new UpdateShuttleSystemByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + UpdateShuttleSystemByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + UpdateShuttleSystemByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface UpdateShuttleSystemByIdV2026R0OptionalsInput { + readonly headers?: UpdateShuttleSystemByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class DeleteShuttleSystemByIdV2026R0Optionals { + readonly headers: DeleteShuttleSystemByIdV2026R0Headers = + new DeleteShuttleSystemByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + DeleteShuttleSystemByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + DeleteShuttleSystemByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface DeleteShuttleSystemByIdV2026R0OptionalsInput { + readonly headers?: DeleteShuttleSystemByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleSystemIssueRegistrationTokenV2026R0Optionals { + readonly headers: CreateShuttleSystemIssueRegistrationTokenV2026R0Headers = + new CreateShuttleSystemIssueRegistrationTokenV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleSystemIssueRegistrationTokenV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleSystemIssueRegistrationTokenV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleSystemIssueRegistrationTokenV2026R0OptionalsInput { + readonly headers?: CreateShuttleSystemIssueRegistrationTokenV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleJobV2026R0Optionals { + readonly headers: CreateShuttleJobV2026R0Headers = + new CreateShuttleJobV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleJobV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleJobV2026R0OptionalsInput { + readonly headers?: CreateShuttleJobV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleJobByIdV2026R0Optionals { + readonly headers: GetShuttleJobByIdV2026R0Headers = + new GetShuttleJobByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleJobByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleJobByIdV2026R0OptionalsInput { + readonly headers?: GetShuttleJobByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class UpdateShuttleJobByIdV2026R0Optionals { + readonly headers: UpdateShuttleJobByIdV2026R0Headers = + new UpdateShuttleJobByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + UpdateShuttleJobByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + UpdateShuttleJobByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface UpdateShuttleJobByIdV2026R0OptionalsInput { + readonly headers?: UpdateShuttleJobByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class DeleteShuttleJobByIdV2026R0Optionals { + readonly headers: DeleteShuttleJobByIdV2026R0Headers = + new DeleteShuttleJobByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + DeleteShuttleJobByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + DeleteShuttleJobByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface DeleteShuttleJobByIdV2026R0OptionalsInput { + readonly headers?: DeleteShuttleJobByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleJobStartV2026R0Optionals { + readonly requestBody?: ShuttleJobStartRequestV2026R0 = void 0; + readonly headers: CreateShuttleJobStartV2026R0Headers = + new CreateShuttleJobStartV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleJobStartV2026R0Optionals, + 'requestBody' | 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleJobStartV2026R0Optionals, + 'requestBody' | 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.requestBody !== undefined) { + this.requestBody = fields.requestBody; + } + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleJobStartV2026R0OptionalsInput { + readonly requestBody?: ShuttleJobStartRequestV2026R0; + readonly headers?: CreateShuttleJobStartV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleJobStopV2026R0Optionals { + readonly headers: CreateShuttleJobStopV2026R0Headers = + new CreateShuttleJobStopV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleJobStopV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleJobStopV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleJobStopV2026R0OptionalsInput { + readonly headers?: CreateShuttleJobStopV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleJobPrepareMigrationV2026R0Optionals { + readonly headers: CreateShuttleJobPrepareMigrationV2026R0Headers = + new CreateShuttleJobPrepareMigrationV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleJobPrepareMigrationV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleJobPrepareMigrationV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleJobPrepareMigrationV2026R0OptionalsInput { + readonly headers?: CreateShuttleJobPrepareMigrationV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleRunsV2026R0Optionals { + readonly headers: GetShuttleRunsV2026R0Headers = + new GetShuttleRunsV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleRunsV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleRunsV2026R0OptionalsInput { + readonly headers?: GetShuttleRunsV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleRunByIdV2026R0Optionals { + readonly headers: GetShuttleRunByIdV2026R0Headers = + new GetShuttleRunByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleRunByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleRunByIdV2026R0OptionalsInput { + readonly headers?: GetShuttleRunByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleJobSchedulesV2026R0Optionals { + readonly headers: GetShuttleJobSchedulesV2026R0Headers = + new GetShuttleJobSchedulesV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleJobSchedulesV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttleJobSchedulesV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleJobSchedulesV2026R0OptionalsInput { + readonly headers?: GetShuttleJobSchedulesV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleJobScheduleV2026R0Optionals { + readonly headers: CreateShuttleJobScheduleV2026R0Headers = + new CreateShuttleJobScheduleV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleJobScheduleV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleJobScheduleV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleJobScheduleV2026R0OptionalsInput { + readonly headers?: CreateShuttleJobScheduleV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleJobScheduleByIdV2026R0Optionals { + readonly headers: GetShuttleJobScheduleByIdV2026R0Headers = + new GetShuttleJobScheduleByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleJobScheduleByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttleJobScheduleByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleJobScheduleByIdV2026R0OptionalsInput { + readonly headers?: GetShuttleJobScheduleByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class UpdateShuttleJobScheduleByIdV2026R0Optionals { + readonly headers: UpdateShuttleJobScheduleByIdV2026R0Headers = + new UpdateShuttleJobScheduleByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + UpdateShuttleJobScheduleByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + UpdateShuttleJobScheduleByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface UpdateShuttleJobScheduleByIdV2026R0OptionalsInput { + readonly headers?: UpdateShuttleJobScheduleByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class DeleteShuttleJobScheduleByIdV2026R0Optionals { + readonly headers: DeleteShuttleJobScheduleByIdV2026R0Headers = + new DeleteShuttleJobScheduleByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + DeleteShuttleJobScheduleByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + DeleteShuttleJobScheduleByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface DeleteShuttleJobScheduleByIdV2026R0OptionalsInput { + readonly headers?: DeleteShuttleJobScheduleByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttlePathMappingsV2026R0Optionals { + readonly headers: GetShuttlePathMappingsV2026R0Headers = + new GetShuttlePathMappingsV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttlePathMappingsV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttlePathMappingsV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttlePathMappingsV2026R0OptionalsInput { + readonly headers?: GetShuttlePathMappingsV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttlePathMappingV2026R0Optionals { + readonly headers: CreateShuttlePathMappingV2026R0Headers = + new CreateShuttlePathMappingV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttlePathMappingV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttlePathMappingV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttlePathMappingV2026R0OptionalsInput { + readonly headers?: CreateShuttlePathMappingV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttlePathMappingByIdV2026R0Optionals { + readonly headers: GetShuttlePathMappingByIdV2026R0Headers = + new GetShuttlePathMappingByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttlePathMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttlePathMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttlePathMappingByIdV2026R0OptionalsInput { + readonly headers?: GetShuttlePathMappingByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class UpdateShuttlePathMappingByIdV2026R0Optionals { + readonly headers: UpdateShuttlePathMappingByIdV2026R0Headers = + new UpdateShuttlePathMappingByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + UpdateShuttlePathMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + UpdateShuttlePathMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface UpdateShuttlePathMappingByIdV2026R0OptionalsInput { + readonly headers?: UpdateShuttlePathMappingByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class DeleteShuttlePathMappingByIdV2026R0Optionals { + readonly headers: DeleteShuttlePathMappingByIdV2026R0Headers = + new DeleteShuttlePathMappingByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + DeleteShuttlePathMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + DeleteShuttlePathMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface DeleteShuttlePathMappingByIdV2026R0OptionalsInput { + readonly headers?: DeleteShuttlePathMappingByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttlePathMappingImportV2026R0Optionals { + readonly headers: CreateShuttlePathMappingImportV2026R0Headers = + new CreateShuttlePathMappingImportV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttlePathMappingImportV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttlePathMappingImportV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttlePathMappingImportV2026R0OptionalsInput { + readonly headers?: CreateShuttlePathMappingImportV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleSubjectMappingImportV2026R0Optionals { + readonly headers: CreateShuttleSubjectMappingImportV2026R0Headers = + new CreateShuttleSubjectMappingImportV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleSubjectMappingImportV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleSubjectMappingImportV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleSubjectMappingImportV2026R0OptionalsInput { + readonly headers?: CreateShuttleSubjectMappingImportV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleSubjectMappingsV2026R0Optionals { + readonly headers: GetShuttleSubjectMappingsV2026R0Headers = + new GetShuttleSubjectMappingsV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleSubjectMappingsV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttleSubjectMappingsV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleSubjectMappingsV2026R0OptionalsInput { + readonly headers?: GetShuttleSubjectMappingsV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleSubjectMappingV2026R0Optionals { + readonly headers: CreateShuttleSubjectMappingV2026R0Headers = + new CreateShuttleSubjectMappingV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleSubjectMappingV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleSubjectMappingV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleSubjectMappingV2026R0OptionalsInput { + readonly headers?: CreateShuttleSubjectMappingV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleSubjectMappingByIdV2026R0Optionals { + readonly headers: GetShuttleSubjectMappingByIdV2026R0Headers = + new GetShuttleSubjectMappingByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleSubjectMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttleSubjectMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleSubjectMappingByIdV2026R0OptionalsInput { + readonly headers?: GetShuttleSubjectMappingByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class UpdateShuttleSubjectMappingByIdV2026R0Optionals { + readonly headers: UpdateShuttleSubjectMappingByIdV2026R0Headers = + new UpdateShuttleSubjectMappingByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + UpdateShuttleSubjectMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + UpdateShuttleSubjectMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface UpdateShuttleSubjectMappingByIdV2026R0OptionalsInput { + readonly headers?: UpdateShuttleSubjectMappingByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class DeleteShuttleSubjectMappingByIdV2026R0Optionals { + readonly headers: DeleteShuttleSubjectMappingByIdV2026R0Headers = + new DeleteShuttleSubjectMappingByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + DeleteShuttleSubjectMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + DeleteShuttleSubjectMappingByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface DeleteShuttleSubjectMappingByIdV2026R0OptionalsInput { + readonly headers?: DeleteShuttleSubjectMappingByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleDiscoveredSubjectsV2026R0Optionals { + readonly headers: GetShuttleDiscoveredSubjectsV2026R0Headers = + new GetShuttleDiscoveredSubjectsV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleDiscoveredSubjectsV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttleDiscoveredSubjectsV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleDiscoveredSubjectsV2026R0OptionalsInput { + readonly headers?: GetShuttleDiscoveredSubjectsV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttlePathEntriesV2026R0Optionals { + readonly headers: GetShuttlePathEntriesV2026R0Headers = + new GetShuttlePathEntriesV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttlePathEntriesV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttlePathEntriesV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttlePathEntriesV2026R0OptionalsInput { + readonly headers?: GetShuttlePathEntriesV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleMappingErrorsV2026R0Optionals { + readonly headers: GetShuttleMappingErrorsV2026R0Headers = + new GetShuttleMappingErrorsV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleMappingErrorsV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttleMappingErrorsV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleMappingErrorsV2026R0OptionalsInput { + readonly headers?: GetShuttleMappingErrorsV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleReportsV2026R0Optionals { + readonly headers: GetShuttleReportsV2026R0Headers = + new GetShuttleReportsV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleReportsV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleReportsV2026R0OptionalsInput { + readonly headers?: GetShuttleReportsV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class CreateShuttleReportV2026R0Optionals { + readonly headers: CreateShuttleReportV2026R0Headers = + new CreateShuttleReportV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateShuttleReportV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + CreateShuttleReportV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateShuttleReportV2026R0OptionalsInput { + readonly headers?: CreateShuttleReportV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export class GetShuttleReportByIdV2026R0Optionals { + readonly headers: GetShuttleReportByIdV2026R0Headers = + new GetShuttleReportByIdV2026R0Headers({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetShuttleReportByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetShuttleReportByIdV2026R0Optionals, + 'headers' | 'cancellationToken' + > + >, + ) { + if (fields.headers !== undefined) { + this.headers = fields.headers; + } + if (fields.cancellationToken !== undefined) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetShuttleReportByIdV2026R0OptionalsInput { + readonly headers?: GetShuttleReportByIdV2026R0Headers; + readonly cancellationToken?: CancellationToken; +} +export interface GetShuttleSystemsV2026R0QueryParams { + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttleSystemsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleSystemsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleSystemsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleSystemV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleSystemV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleSystemV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class GetShuttleSystemByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleSystemByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleSystemByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class UpdateShuttleSystemByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + UpdateShuttleSystemByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + UpdateShuttleSystemByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface UpdateShuttleSystemByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class DeleteShuttleSystemByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + DeleteShuttleSystemByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + DeleteShuttleSystemByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface DeleteShuttleSystemByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleSystemIssueRegistrationTokenV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleSystemIssueRegistrationTokenV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + CreateShuttleSystemIssueRegistrationTokenV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleSystemIssueRegistrationTokenV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetShuttleJobsV2026R0QueryParams { + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttleJobsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleJobsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleJobV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleJobV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleJobV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class GetShuttleJobByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleJobByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleJobByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class UpdateShuttleJobByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + UpdateShuttleJobByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface UpdateShuttleJobByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class DeleteShuttleJobByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + DeleteShuttleJobByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface DeleteShuttleJobByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleJobStartV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleJobStartV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleJobStartV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleJobStopV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleJobStopV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleJobStopV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleJobPrepareMigrationV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleJobPrepareMigrationV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + CreateShuttleJobPrepareMigrationV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleJobPrepareMigrationV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetShuttleRunsV2026R0QueryParams { + /** + * The unique identifier of the shuttle job whose runs to list. */ + readonly jobId: string; + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttleRunsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleRunsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class GetShuttleRunByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleRunByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleRunByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetShuttleJobSchedulesV2026R0QueryParams { + /** + * The unique identifier of the shuttle job whose schedules to list. */ + readonly jobId: string; + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttleJobSchedulesV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleJobSchedulesV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + GetShuttleJobSchedulesV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleJobSchedulesV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleJobScheduleV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleJobScheduleV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + CreateShuttleJobScheduleV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleJobScheduleV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class GetShuttleJobScheduleByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleJobScheduleByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + GetShuttleJobScheduleByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleJobScheduleByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class UpdateShuttleJobScheduleByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + UpdateShuttleJobScheduleByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + UpdateShuttleJobScheduleByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface UpdateShuttleJobScheduleByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class DeleteShuttleJobScheduleByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + DeleteShuttleJobScheduleByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + DeleteShuttleJobScheduleByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface DeleteShuttleJobScheduleByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetShuttlePathMappingsV2026R0QueryParams { + /** + * The unique identifier of the shuttle job whose path mappings to list. */ + readonly jobId: string; + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttlePathMappingsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttlePathMappingsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + GetShuttlePathMappingsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttlePathMappingsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttlePathMappingV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttlePathMappingV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + CreateShuttlePathMappingV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttlePathMappingV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class GetShuttlePathMappingByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttlePathMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + GetShuttlePathMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttlePathMappingByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class UpdateShuttlePathMappingByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + UpdateShuttlePathMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + UpdateShuttlePathMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface UpdateShuttlePathMappingByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class DeleteShuttlePathMappingByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + DeleteShuttlePathMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + DeleteShuttlePathMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface DeleteShuttlePathMappingByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttlePathMappingImportV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttlePathMappingImportV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + CreateShuttlePathMappingImportV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttlePathMappingImportV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleSubjectMappingImportV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleSubjectMappingImportV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + CreateShuttleSubjectMappingImportV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleSubjectMappingImportV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetShuttleSubjectMappingsV2026R0QueryParams { + /** + * The unique identifier of the shuttle job whose subject mappings to list. */ + readonly jobId: string; + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttleSubjectMappingsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleSubjectMappingsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + GetShuttleSubjectMappingsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleSubjectMappingsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleSubjectMappingV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleSubjectMappingV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + CreateShuttleSubjectMappingV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleSubjectMappingV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class GetShuttleSubjectMappingByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleSubjectMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + GetShuttleSubjectMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleSubjectMappingByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class UpdateShuttleSubjectMappingByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + UpdateShuttleSubjectMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + UpdateShuttleSubjectMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface UpdateShuttleSubjectMappingByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class DeleteShuttleSubjectMappingByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + DeleteShuttleSubjectMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + DeleteShuttleSubjectMappingByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface DeleteShuttleSubjectMappingByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetShuttleDiscoveredSubjectsV2026R0QueryParams { + /** + * The unique identifier of the shuttle job whose discovered subjects to list. */ + readonly jobId: string; + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttleDiscoveredSubjectsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleDiscoveredSubjectsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + GetShuttleDiscoveredSubjectsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleDiscoveredSubjectsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export type GetShuttlePathEntriesV2026R0QueryParamsSideField = + 'source' | 'target' | string; +export interface GetShuttlePathEntriesV2026R0QueryParams { + /** + * The unique identifier of the shuttle job whose path entries to list. */ + readonly jobId: string; + /** + * The side of the migration to browse. */ + readonly side: GetShuttlePathEntriesV2026R0QueryParamsSideField; + /** + * The human-readable parent path whose children are returned. This can + * be used with or without `path_id`. Omit both, or pass `/` as `path`, + * to list root entries. */ + readonly path?: string; + /** + * The `path_id` value of the parent entry whose children are + * returned. This can be used with or without `path`. It distinguishes + * paths with identical names on systems that support stable identifiers. */ + readonly pathId?: string; + /** + * The email of the account whose path entries are returned. This is a + * system-native identifier and is not always an RFC 5322 address. */ + readonly accountEmail?: string; + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttlePathEntriesV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttlePathEntriesV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttlePathEntriesV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetShuttleMappingErrorsV2026R0QueryParams { + /** + * The unique identifier of the shuttle job whose mapping errors to list. */ + readonly jobId: string; + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttleMappingErrorsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleMappingErrorsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick< + GetShuttleMappingErrorsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleMappingErrorsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export interface GetShuttleReportsV2026R0QueryParams { + /** + * The unique identifier of the shuttle run whose reports to list. */ + readonly runId: string; + /** + * Defines the position marker at which to begin returning results. This is + * used when paginating using marker-based pagination. + * + * This requires `usemarker` to be set to `true`. */ + readonly marker?: string; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetShuttleReportsV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleReportsV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleReportsV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class CreateShuttleReportV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + CreateShuttleReportV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateShuttleReportV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class GetShuttleReportByIdV2026R0Headers { + /** + * Version header. */ + readonly boxVersion: BoxVersionHeaderV2026R0 = + '2026.0' as BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit< + GetShuttleReportByIdV2026R0Headers, + 'boxVersion' | 'extraHeaders' + > & + Partial< + Pick + >, + ) { + if (fields.boxVersion !== undefined) { + this.boxVersion = fields.boxVersion; + } + if (fields.extraHeaders !== undefined) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetShuttleReportByIdV2026R0HeadersInput { + /** + * Version header. */ + readonly boxVersion?: BoxVersionHeaderV2026R0; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + }; +} +export class ShuttleManager { + readonly auth?: Authentication; + readonly networkSession: NetworkSession = new NetworkSession({}); + constructor( + fields: Omit< + ShuttleManager, + | 'networkSession' + | 'getShuttleSystemsV2026R0' + | 'createShuttleSystemV2026R0' + | 'getShuttleSystemByIdV2026R0' + | 'updateShuttleSystemByIdV2026R0' + | 'deleteShuttleSystemByIdV2026R0' + | 'createShuttleSystemIssueRegistrationTokenV2026R0' + | 'getShuttleJobsV2026R0' + | 'createShuttleJobV2026R0' + | 'getShuttleJobByIdV2026R0' + | 'updateShuttleJobByIdV2026R0' + | 'deleteShuttleJobByIdV2026R0' + | 'createShuttleJobStartV2026R0' + | 'createShuttleJobStopV2026R0' + | 'createShuttleJobPrepareMigrationV2026R0' + | 'getShuttleRunsV2026R0' + | 'getShuttleRunByIdV2026R0' + | 'getShuttleJobSchedulesV2026R0' + | 'createShuttleJobScheduleV2026R0' + | 'getShuttleJobScheduleByIdV2026R0' + | 'updateShuttleJobScheduleByIdV2026R0' + | 'deleteShuttleJobScheduleByIdV2026R0' + | 'getShuttlePathMappingsV2026R0' + | 'createShuttlePathMappingV2026R0' + | 'getShuttlePathMappingByIdV2026R0' + | 'updateShuttlePathMappingByIdV2026R0' + | 'deleteShuttlePathMappingByIdV2026R0' + | 'createShuttlePathMappingImportV2026R0' + | 'createShuttleSubjectMappingImportV2026R0' + | 'getShuttleSubjectMappingsV2026R0' + | 'createShuttleSubjectMappingV2026R0' + | 'getShuttleSubjectMappingByIdV2026R0' + | 'updateShuttleSubjectMappingByIdV2026R0' + | 'deleteShuttleSubjectMappingByIdV2026R0' + | 'getShuttleDiscoveredSubjectsV2026R0' + | 'getShuttlePathEntriesV2026R0' + | 'getShuttleMappingErrorsV2026R0' + | 'getShuttleReportsV2026R0' + | 'createShuttleReportV2026R0' + | 'getShuttleReportByIdV2026R0' + > & + Partial>, + ) { + if (fields.auth !== undefined) { + this.auth = fields.auth; + } + if (fields.networkSession !== undefined) { + this.networkSession = fields.networkSession; + } + } + /** + * Returns a paginated list of shuttle systems accessible to the + * authenticated user. + * @param {GetShuttleSystemsV2026R0QueryParams} queryParams Query parameters of getShuttleSystemsV2026R0 method + * @param {GetShuttleSystemsV2026R0HeadersInput} headersInput Headers of getShuttleSystemsV2026R0 method + * @param {CancellationToken} cancellationToken Token used for request cancellation. + * @returns {Promise} + */ + async getShuttleSystemsV2026R0( + queryParams: GetShuttleSystemsV2026R0QueryParams = {} satisfies GetShuttleSystemsV2026R0QueryParams, + headersInput: GetShuttleSystemsV2026R0HeadersInput = new GetShuttleSystemsV2026R0Headers( + {}, + ), + cancellationToken?: CancellationToken, + ): Promise { + const headers: GetShuttleSystemsV2026R0Headers = + new GetShuttleSystemsV2026R0Headers({ + boxVersion: headersInput.boxVersion, + extraHeaders: headersInput.extraHeaders, + }); + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_systems', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleSystemsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Creates a new shuttle system. Only Windows agent systems can be created + * through the public API; other system types must be configured through the + * Shuttle application. + * @param {ShuttleSystemCreateRequestV2026R0Input} requestBodyInput Request body of createShuttleSystemV2026R0 method + * @param {CreateShuttleSystemV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleSystemV2026R0( + requestBodyInput: ShuttleSystemCreateRequestV2026R0Input, + optionalsInput: CreateShuttleSystemV2026R0OptionalsInput = {}, + ): Promise { + const requestBody: ShuttleSystemCreateRequestV2026R0 = + new ShuttleSystemCreateRequestV2026R0({ + name: requestBodyInput.name, + systemType: requestBodyInput.systemType, + }); + const optionals: CreateShuttleSystemV2026R0Optionals = + new CreateShuttleSystemV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_systems', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeShuttleSystemCreateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleSystemV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns details for a single shuttle system identified by its ID, + * including its type and connection state. + * @param {string} shuttleSystemId The unique identifier for the shuttle system. + Example: "6a315c0754833bfc5df067bf" + * @param {GetShuttleSystemByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleSystemByIdV2026R0( + shuttleSystemId: string, + optionalsInput: GetShuttleSystemByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleSystemByIdV2026R0Optionals = + new GetShuttleSystemByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_systems/', + (toString(shuttleSystemId) as string)!, + ) as string, + method: 'GET', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleSystemV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Updates the mutable properties of an existing shuttle system identified by + * its ID. Only the fields supplied in the request body are changed. + * @param {string} shuttleSystemId The unique identifier for the shuttle system. + Example: "6a315c0754833bfc5df067bf" + * @param {ShuttleSystemUpdateRequestV2026R0} requestBody Request body of updateShuttleSystemByIdV2026R0 method + * @param {UpdateShuttleSystemByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async updateShuttleSystemByIdV2026R0( + shuttleSystemId: string, + requestBody: ShuttleSystemUpdateRequestV2026R0, + optionalsInput: UpdateShuttleSystemByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: UpdateShuttleSystemByIdV2026R0Optionals = + new UpdateShuttleSystemByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_systems/', + (toString(shuttleSystemId) as string)!, + ) as string, + method: 'PUT', + headers: headersMap, + data: serializeShuttleSystemUpdateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleSystemV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Permanently deletes the shuttle system identified by its ID. This does not + * affect content that has already been migrated. + * @param {string} shuttleSystemId The unique identifier for the shuttle system. + Example: "6a315c0754833bfc5df067bf" + * @param {DeleteShuttleSystemByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async deleteShuttleSystemByIdV2026R0( + shuttleSystemId: string, + optionalsInput: DeleteShuttleSystemByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: DeleteShuttleSystemByIdV2026R0Optionals = + new DeleteShuttleSystemByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_systems/', + (toString(shuttleSystemId) as string)!, + ) as string, + method: 'DELETE', + headers: headersMap, + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Issues a new installation token for the Windows shuttle system identified + * by its ID. Paste the returned token into the Windows agent installer to + * register the agent with this system. + * @param {string} shuttleSystemId The unique identifier for the shuttle system. + Example: "6a315c0754833bfc5df067bf" + * @param {CreateShuttleSystemIssueRegistrationTokenV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleSystemIssueRegistrationTokenV2026R0( + shuttleSystemId: string, + optionalsInput: CreateShuttleSystemIssueRegistrationTokenV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleSystemIssueRegistrationTokenV2026R0Optionals = + new CreateShuttleSystemIssueRegistrationTokenV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_systems/', + (toString(shuttleSystemId) as string)!, + '/issue_registration_token', + ) as string, + method: 'POST', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleAgentCredentialsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns a paginated list of shuttle jobs accessible to the authenticated + * user. + * @param {GetShuttleJobsV2026R0QueryParams} queryParams Query parameters of getShuttleJobsV2026R0 method + * @param {GetShuttleJobsV2026R0HeadersInput} headersInput Headers of getShuttleJobsV2026R0 method + * @param {CancellationToken} cancellationToken Token used for request cancellation. + * @returns {Promise} + */ + async getShuttleJobsV2026R0( + queryParams: GetShuttleJobsV2026R0QueryParams = {} satisfies GetShuttleJobsV2026R0QueryParams, + headersInput: GetShuttleJobsV2026R0HeadersInput = new GetShuttleJobsV2026R0Headers( + {}, + ), + cancellationToken?: CancellationToken, + ): Promise { + const headers: GetShuttleJobsV2026R0Headers = + new GetShuttleJobsV2026R0Headers({ + boxVersion: headersInput.boxVersion, + extraHeaders: headersInput.extraHeaders, + }); + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_jobs', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleJobsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Creates a new shuttle job that describes a migration from the given source + * system into Box. + * @param {ShuttleJobCreateRequestV2026R0} requestBody Request body of createShuttleJobV2026R0 method + * @param {CreateShuttleJobV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleJobV2026R0( + requestBody: ShuttleJobCreateRequestV2026R0, + optionalsInput: CreateShuttleJobV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleJobV2026R0Optionals = + new CreateShuttleJobV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_jobs', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeShuttleJobCreateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleJobV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns details for a single shuttle job identified by its ID, including + * its current state, mapping-preparation state, and configured source system. + * @param {string} shuttleJobId The unique identifier for the shuttle job. + Example: "6a3ba68e810d9156194530a1" + * @param {GetShuttleJobByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleJobByIdV2026R0( + shuttleJobId: string, + optionalsInput: GetShuttleJobByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleJobByIdV2026R0Optionals = + new GetShuttleJobByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_jobs/', + (toString(shuttleJobId) as string)!, + ) as string, + method: 'GET', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleJobV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Updates the mutable properties of an existing shuttle job identified by its + * ID. Only the fields supplied in the request body are changed. + * @param {string} shuttleJobId The unique identifier for the shuttle job. + Example: "6a3ba68e810d9156194530a1" + * @param {ShuttleJobUpdateRequestV2026R0} requestBody Request body of updateShuttleJobByIdV2026R0 method + * @param {UpdateShuttleJobByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async updateShuttleJobByIdV2026R0( + shuttleJobId: string, + requestBody: ShuttleJobUpdateRequestV2026R0, + optionalsInput: UpdateShuttleJobByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: UpdateShuttleJobByIdV2026R0Optionals = + new UpdateShuttleJobByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_jobs/', + (toString(shuttleJobId) as string)!, + ) as string, + method: 'PUT', + headers: headersMap, + data: serializeShuttleJobUpdateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleJobV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Permanently deletes the shuttle job identified by its ID. This does not + * affect content that has already been migrated. + * @param {string} shuttleJobId The unique identifier for the shuttle job. + Example: "6a3ba68e810d9156194530a1" + * @param {DeleteShuttleJobByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async deleteShuttleJobByIdV2026R0( + shuttleJobId: string, + optionalsInput: DeleteShuttleJobByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: DeleteShuttleJobByIdV2026R0Optionals = + new DeleteShuttleJobByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_jobs/', + (toString(shuttleJobId) as string)!, + ) as string, + method: 'DELETE', + headers: headersMap, + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Starts the job in the given mode. When no body is provided the job runs in + * simulation mode. + * @param {string} shuttleJobId The unique identifier for the shuttle job. + Example: "6a3ba68e810d9156194530a1" + * @param {CreateShuttleJobStartV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleJobStartV2026R0( + shuttleJobId: string, + optionalsInput: CreateShuttleJobStartV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleJobStartV2026R0Optionals = + new CreateShuttleJobStartV2026R0Optionals({ + requestBody: optionalsInput.requestBody, + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const requestBody: any = optionals.requestBody; + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_jobs/', + (toString(shuttleJobId) as string)!, + '/start', + ) as string, + method: 'POST', + headers: headersMap, + data: !(requestBody == void 0) + ? serializeShuttleJobStartRequestV2026R0(requestBody) + : void 0, + contentType: 'application/json', + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Stops a running shuttle job identified by its ID. Any work already in + * progress is allowed to finish before the job transitions to a stopped + * state. + * @param {string} shuttleJobId The unique identifier for the shuttle job. + Example: "6a3ba68e810d9156194530a1" + * @param {CreateShuttleJobStopV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleJobStopV2026R0( + shuttleJobId: string, + optionalsInput: CreateShuttleJobStopV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleJobStopV2026R0Optionals = + new CreateShuttleJobStopV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_jobs/', + (toString(shuttleJobId) as string)!, + '/stop', + ) as string, + method: 'POST', + headers: headersMap, + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Validates the configured account and path mappings before a transfer. Only + * relevant when account mapping is enabled. + * @param {string} shuttleJobId The unique identifier for the shuttle job. + Example: "6a3ba68e810d9156194530a1" + * @param {CreateShuttleJobPrepareMigrationV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleJobPrepareMigrationV2026R0( + shuttleJobId: string, + optionalsInput: CreateShuttleJobPrepareMigrationV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleJobPrepareMigrationV2026R0Optionals = + new CreateShuttleJobPrepareMigrationV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_jobs/', + (toString(shuttleJobId) as string)!, + '/prepare_migration', + ) as string, + method: 'POST', + headers: headersMap, + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Returns a paginated list of runs for the shuttle job identified by + * `job_id`. + * @param {GetShuttleRunsV2026R0QueryParams} queryParams Query parameters of getShuttleRunsV2026R0 method + * @param {GetShuttleRunsV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleRunsV2026R0( + queryParams: GetShuttleRunsV2026R0QueryParams, + optionalsInput: GetShuttleRunsV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleRunsV2026R0Optionals = + new GetShuttleRunsV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['job_id']: toString(queryParams.jobId) as string, + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_runs', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleRunsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns details for a single shuttle run identified by its ID, including + * its mode, state, timing, and transfer statistics. + * @param {string} shuttleRunId The unique identifier for the shuttle run, in the form + `{job_id}:{run_number}`. + Example: "6a3ba68e810d9156194530a1:42" + * @param {GetShuttleRunByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleRunByIdV2026R0( + shuttleRunId: string, + optionalsInput: GetShuttleRunByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleRunByIdV2026R0Optionals = + new GetShuttleRunByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_runs/', + (toString(shuttleRunId) as string)!, + ) as string, + method: 'GET', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleRunV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns a paginated list of schedules for the shuttle job identified by + * `job_id`. + * @param {GetShuttleJobSchedulesV2026R0QueryParams} queryParams Query parameters of getShuttleJobSchedulesV2026R0 method + * @param {GetShuttleJobSchedulesV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleJobSchedulesV2026R0( + queryParams: GetShuttleJobSchedulesV2026R0QueryParams, + optionalsInput: GetShuttleJobSchedulesV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleJobSchedulesV2026R0Optionals = + new GetShuttleJobSchedulesV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['job_id']: toString(queryParams.jobId) as string, + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_job_schedules', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleJobSchedulesV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Creates a schedule that starts runs of the shuttle job identified by + * `job_id`. The schedule starts a run either at a wall-clock time or after + * another job's run meets a condition. Schedules cannot start a run in + * `scan` mode. + * @param {ShuttleJobScheduleCreateRequestV2026R0} requestBody Request body of createShuttleJobScheduleV2026R0 method + * @param {CreateShuttleJobScheduleV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleJobScheduleV2026R0( + requestBody: ShuttleJobScheduleCreateRequestV2026R0, + optionalsInput: CreateShuttleJobScheduleV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleJobScheduleV2026R0Optionals = + new CreateShuttleJobScheduleV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_job_schedules', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeShuttleJobScheduleCreateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleJobScheduleV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Retrieves the shuttle job schedule identified by its ID. + * @param {string} shuttleJobScheduleId The unique identifier for the shuttle job schedule. + Example: "7c1ba68e810d9156194530b2" + * @param {GetShuttleJobScheduleByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleJobScheduleByIdV2026R0( + shuttleJobScheduleId: string, + optionalsInput: GetShuttleJobScheduleByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleJobScheduleByIdV2026R0Optionals = + new GetShuttleJobScheduleByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_job_schedules/', + (toString(shuttleJobScheduleId) as string)!, + ) as string, + method: 'GET', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleJobScheduleV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Updates the mutable properties of an existing shuttle job schedule + * identified by its ID. Only the fields supplied in the request body are + * changed. The owning job cannot be changed. + * @param {string} shuttleJobScheduleId The unique identifier for the shuttle job schedule. + Example: "7c1ba68e810d9156194530b2" + * @param {ShuttleJobScheduleUpdateRequestV2026R0} requestBody Request body of updateShuttleJobScheduleByIdV2026R0 method + * @param {UpdateShuttleJobScheduleByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async updateShuttleJobScheduleByIdV2026R0( + shuttleJobScheduleId: string, + requestBody: ShuttleJobScheduleUpdateRequestV2026R0, + optionalsInput: UpdateShuttleJobScheduleByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: UpdateShuttleJobScheduleByIdV2026R0Optionals = + new UpdateShuttleJobScheduleByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_job_schedules/', + (toString(shuttleJobScheduleId) as string)!, + ) as string, + method: 'PUT', + headers: headersMap, + data: serializeShuttleJobScheduleUpdateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleJobScheduleV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Permanently deletes the shuttle job schedule identified by its ID. This + * does not affect runs that have already started. + * @param {string} shuttleJobScheduleId The unique identifier for the shuttle job schedule. + Example: "7c1ba68e810d9156194530b2" + * @param {DeleteShuttleJobScheduleByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async deleteShuttleJobScheduleByIdV2026R0( + shuttleJobScheduleId: string, + optionalsInput: DeleteShuttleJobScheduleByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: DeleteShuttleJobScheduleByIdV2026R0Optionals = + new DeleteShuttleJobScheduleByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_job_schedules/', + (toString(shuttleJobScheduleId) as string)!, + ) as string, + method: 'DELETE', + headers: headersMap, + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Returns a paginated list of path mappings for the shuttle job identified + * by `job_id`. + * @param {GetShuttlePathMappingsV2026R0QueryParams} queryParams Query parameters of getShuttlePathMappingsV2026R0 method + * @param {GetShuttlePathMappingsV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttlePathMappingsV2026R0( + queryParams: GetShuttlePathMappingsV2026R0QueryParams, + optionalsInput: GetShuttlePathMappingsV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttlePathMappingsV2026R0Optionals = + new GetShuttlePathMappingsV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['job_id']: toString(queryParams.jobId) as string, + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_path_mappings', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttlePathMappingsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Creates a path mapping that connects a source location on the migrated + * system to a destination in Box for the given shuttle job. + * @param {ShuttlePathMappingCreateRequestV2026R0} requestBody Request body of createShuttlePathMappingV2026R0 method + * @param {CreateShuttlePathMappingV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttlePathMappingV2026R0( + requestBody: ShuttlePathMappingCreateRequestV2026R0, + optionalsInput: CreateShuttlePathMappingV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttlePathMappingV2026R0Optionals = + new CreateShuttlePathMappingV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_path_mappings', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeShuttlePathMappingCreateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttlePathMappingV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns details for a single shuttle path mapping identified by its ID, + * including the source location and destination, if any. + * @param {string} shuttlePathMappingId The unique identifier for the shuttle path mapping. + Example: "6a3ba7a24ea17bc9461eeacd" + * @param {GetShuttlePathMappingByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttlePathMappingByIdV2026R0( + shuttlePathMappingId: string, + optionalsInput: GetShuttlePathMappingByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttlePathMappingByIdV2026R0Optionals = + new GetShuttlePathMappingByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_path_mappings/', + (toString(shuttlePathMappingId) as string)!, + ) as string, + method: 'GET', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttlePathMappingV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Updates the mutable properties of an existing shuttle path mapping + * identified by its ID. Only the fields supplied in the request body are + * changed. + * @param {string} shuttlePathMappingId The unique identifier for the shuttle path mapping. + Example: "6a3ba7a24ea17bc9461eeacd" + * @param {ShuttlePathMappingUpdateRequestV2026R0} requestBody Request body of updateShuttlePathMappingByIdV2026R0 method + * @param {UpdateShuttlePathMappingByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async updateShuttlePathMappingByIdV2026R0( + shuttlePathMappingId: string, + requestBody: ShuttlePathMappingUpdateRequestV2026R0, + optionalsInput: UpdateShuttlePathMappingByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: UpdateShuttlePathMappingByIdV2026R0Optionals = + new UpdateShuttlePathMappingByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_path_mappings/', + (toString(shuttlePathMappingId) as string)!, + ) as string, + method: 'PUT', + headers: headersMap, + data: serializeShuttlePathMappingUpdateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttlePathMappingV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Permanently deletes the shuttle path mapping identified by its ID. This + * does not affect content that has already been migrated. + * @param {string} shuttlePathMappingId The unique identifier for the shuttle path mapping. + Example: "6a3ba7a24ea17bc9461eeacd" + * @param {DeleteShuttlePathMappingByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async deleteShuttlePathMappingByIdV2026R0( + shuttlePathMappingId: string, + optionalsInput: DeleteShuttlePathMappingByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: DeleteShuttlePathMappingByIdV2026R0Optionals = + new DeleteShuttlePathMappingByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_path_mappings/', + (toString(shuttlePathMappingId) as string)!, + ) as string, + method: 'DELETE', + headers: headersMap, + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Accepts a spreadsheet of path mappings, already stored in Box, and replaces + * the job's path mappings. + * A file that is not a mapping workbook, or that exceeds the size or row + * limits (10 MiB Box download limit; 100,000 mapping rows), returns `400` + * synchronously and leaves the job unchanged. + * An accepted import always replaces every path mapping on the job. When all + * rows are valid the workbook is deployed in full. When any row is invalid + * the job ends with no path mappings and `mapping_state` becomes + * `paths_import_rejected` until the next import or the next manual + * path-mapping change. Row problems are listed by + * `GET /shuttle_mapping_errors?job_id=…` with category `path_import`, messages + * of the form `Row N: …`, at most 500 entries plus one overflow entry. + * Validation and deployment are asynchronous after acceptance. Poll + * `GET /shuttle_jobs/{shuttle_job_id}` while `mapping_state` is + * `importing_paths`. Only one import may be in flight per job. + * @param {ShuttlePathMappingImportCreateRequestV2026R0} requestBody Request body of createShuttlePathMappingImportV2026R0 method + * @param {CreateShuttlePathMappingImportV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttlePathMappingImportV2026R0( + requestBody: ShuttlePathMappingImportCreateRequestV2026R0, + optionalsInput: CreateShuttlePathMappingImportV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttlePathMappingImportV2026R0Optionals = + new CreateShuttlePathMappingImportV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_path_mapping_imports', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeShuttlePathMappingImportCreateRequestV2026R0( + requestBody, + ), + contentType: 'application/json', + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Accepts a spreadsheet of subject (user and group) mappings, already stored + * in Box, and replaces the job's subject mappings. + * A file that is not a subject-mapping workbook, or that exceeds the size or + * row limits (10 MiB Box download limit; 50,000 mapping rows), returns `400` + * synchronously and leaves the job unchanged. + * An accepted import always replaces every subject mapping on the job. When + * all rows are valid the workbook is deployed in full. When any row is + * invalid the job ends with no subject mappings and `mapping_state` becomes + * `subjects_import_rejected` until the next import or the next manual + * subject-mapping change. Row problems are listed by + * `GET /shuttle_mapping_errors?job_id=…` with category `subject_import`, + * messages of the form `Row N: …`, at most 500 entries plus one overflow + * entry. + * Validation and deployment are asynchronous after acceptance. Poll + * `GET /shuttle_jobs/{shuttle_job_id}` while `mapping_state` is + * `importing_subjects`. Only one import may be in flight per job. The job + * must map subjects (`account_mapping` enabled) and its source scan must be + * finished; otherwise the request returns `409`. + * + * Expected workbook format (API clients cannot download the UI template): + * sheets `Users` and/or `Groups` (a sheet named `Subjects` is also accepted). + * Columns are `Source User `, `Target User `, `Skip` on `Users`, + * and `Source Group `, `Target Group `, `Skip` on `Groups`, where + * `` is the primary identifier for that role and system: + * - Users: `Email` for most systems; `ID` for `SharePoint` (2007/2010/2013); + * `Name` for Windows (`windows_union`, stored as the user id). + * - Groups: `Name` for most systems; `Email` for Google Drive admin groups. + * Source rows for a template can be taken from + * `GET /shuttle_discovered_subjects`. + * @param {ShuttleSubjectMappingImportCreateRequestV2026R0} requestBody Request body of createShuttleSubjectMappingImportV2026R0 method + * @param {CreateShuttleSubjectMappingImportV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleSubjectMappingImportV2026R0( + requestBody: ShuttleSubjectMappingImportCreateRequestV2026R0, + optionalsInput: CreateShuttleSubjectMappingImportV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleSubjectMappingImportV2026R0Optionals = + new CreateShuttleSubjectMappingImportV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_subject_mapping_imports', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeShuttleSubjectMappingImportCreateRequestV2026R0( + requestBody, + ), + contentType: 'application/json', + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Returns a paginated list of subject mappings for the shuttle job identified + * by `job_id`. + * @param {GetShuttleSubjectMappingsV2026R0QueryParams} queryParams Query parameters of getShuttleSubjectMappingsV2026R0 method + * @param {GetShuttleSubjectMappingsV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleSubjectMappingsV2026R0( + queryParams: GetShuttleSubjectMappingsV2026R0QueryParams, + optionalsInput: GetShuttleSubjectMappingsV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleSubjectMappingsV2026R0Optionals = + new GetShuttleSubjectMappingsV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['job_id']: toString(queryParams.jobId) as string, + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_subject_mappings', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleSubjectMappingsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Creates a subject mapping that connects a discovered source subject to a + * Box user or group for the given shuttle job. + * @param {ShuttleSubjectMappingCreateRequestV2026R0} requestBody Request body of createShuttleSubjectMappingV2026R0 method + * @param {CreateShuttleSubjectMappingV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleSubjectMappingV2026R0( + requestBody: ShuttleSubjectMappingCreateRequestV2026R0, + optionalsInput: CreateShuttleSubjectMappingV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleSubjectMappingV2026R0Optionals = + new CreateShuttleSubjectMappingV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_subject_mappings', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeShuttleSubjectMappingCreateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleSubjectMappingV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns details for a single shuttle subject mapping identified by its ID, + * including the source subject and Box target, if any. + * @param {string} shuttleSubjectMappingId The unique identifier for the shuttle subject mapping. + Example: "6a3ba7b12ea17bc9461eeace" + * @param {GetShuttleSubjectMappingByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleSubjectMappingByIdV2026R0( + shuttleSubjectMappingId: string, + optionalsInput: GetShuttleSubjectMappingByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleSubjectMappingByIdV2026R0Optionals = + new GetShuttleSubjectMappingByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_subject_mappings/', + (toString(shuttleSubjectMappingId) as string)!, + ) as string, + method: 'GET', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleSubjectMappingV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Updates the mutable properties of an existing shuttle subject mapping + * identified by its ID. Only the fields supplied in the request body are + * changed. + * @param {string} shuttleSubjectMappingId The unique identifier for the shuttle subject mapping. + Example: "6a3ba7b12ea17bc9461eeace" + * @param {ShuttleSubjectMappingUpdateRequestV2026R0} requestBody Request body of updateShuttleSubjectMappingByIdV2026R0 method + * @param {UpdateShuttleSubjectMappingByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async updateShuttleSubjectMappingByIdV2026R0( + shuttleSubjectMappingId: string, + requestBody: ShuttleSubjectMappingUpdateRequestV2026R0, + optionalsInput: UpdateShuttleSubjectMappingByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: UpdateShuttleSubjectMappingByIdV2026R0Optionals = + new UpdateShuttleSubjectMappingByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_subject_mappings/', + (toString(shuttleSubjectMappingId) as string)!, + ) as string, + method: 'PUT', + headers: headersMap, + data: serializeShuttleSubjectMappingUpdateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleSubjectMappingV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Permanently deletes the shuttle subject mapping identified by its ID. + * @param {string} shuttleSubjectMappingId The unique identifier for the shuttle subject mapping. + Example: "6a3ba7b12ea17bc9461eeace" + * @param {DeleteShuttleSubjectMappingByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async deleteShuttleSubjectMappingByIdV2026R0( + shuttleSubjectMappingId: string, + optionalsInput: DeleteShuttleSubjectMappingByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: DeleteShuttleSubjectMappingByIdV2026R0Optionals = + new DeleteShuttleSubjectMappingByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_subject_mappings/', + (toString(shuttleSubjectMappingId) as string)!, + ) as string, + method: 'DELETE', + headers: headersMap, + responseFormat: 'no_content' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return void 0; + } + /** + * Returns a paginated list of subjects discovered on the source system for + * the shuttle job identified by `job_id`. + * @param {GetShuttleDiscoveredSubjectsV2026R0QueryParams} queryParams Query parameters of getShuttleDiscoveredSubjectsV2026R0 method + * @param {GetShuttleDiscoveredSubjectsV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleDiscoveredSubjectsV2026R0( + queryParams: GetShuttleDiscoveredSubjectsV2026R0QueryParams, + optionalsInput: GetShuttleDiscoveredSubjectsV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleDiscoveredSubjectsV2026R0Optionals = + new GetShuttleDiscoveredSubjectsV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['job_id']: toString(queryParams.jobId) as string, + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_discovered_subjects', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleDiscoveredSubjectsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns a paginated list of source or target path entries for a shuttle + * job. Call with only `job_id` and `side` to list the roots, then browse one + * level at a time using `path`, `path_id`, or both. Each entry includes + * `path`, `path_id`, `is_directory`, and a `scope` object (`account` or + * `shared_space`) so a mapping can be created from that row without extra + * browse state. Valid values depend on the selected system. + * @param {GetShuttlePathEntriesV2026R0QueryParams} queryParams Query parameters of getShuttlePathEntriesV2026R0 method + * @param {GetShuttlePathEntriesV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttlePathEntriesV2026R0( + queryParams: GetShuttlePathEntriesV2026R0QueryParams, + optionalsInput: GetShuttlePathEntriesV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttlePathEntriesV2026R0Optionals = + new GetShuttlePathEntriesV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['job_id']: toString(queryParams.jobId) as string, + ['side']: toString(queryParams.side) as string, + ['path']: toString(queryParams.path) as string, + ['path_id']: toString(queryParams.pathId) as string, + ['account_email']: toString(queryParams.accountEmail) as string, + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_path_entries', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttlePathEntriesV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns a paginated list of mapping errors for a shuttle job. Only the latest + * record for each error is returned. The revision field identifies the mapping + * revision in which that error was generated. + * @param {GetShuttleMappingErrorsV2026R0QueryParams} queryParams Query parameters of getShuttleMappingErrorsV2026R0 method + * @param {GetShuttleMappingErrorsV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleMappingErrorsV2026R0( + queryParams: GetShuttleMappingErrorsV2026R0QueryParams, + optionalsInput: GetShuttleMappingErrorsV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleMappingErrorsV2026R0Optionals = + new GetShuttleMappingErrorsV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['job_id']: toString(queryParams.jobId) as string, + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_mapping_errors', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleMappingErrorsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns a paginated list of reports generated for the shuttle run + * identified by `run_id`. + * @param {GetShuttleReportsV2026R0QueryParams} queryParams Query parameters of getShuttleReportsV2026R0 method + * @param {GetShuttleReportsV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleReportsV2026R0( + queryParams: GetShuttleReportsV2026R0QueryParams, + optionalsInput: GetShuttleReportsV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleReportsV2026R0Optionals = + new GetShuttleReportsV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['run_id']: toString(queryParams.runId) as string, + ['marker']: toString(queryParams.marker) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_reports', + ) as string, + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleReportsV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Requests asynchronous generation of a report for a shuttle run. The + * report is returned immediately in `pending` or `processing` status. + * Poll `GET /shuttle_reports/{shuttle_report_id}` while `status` is + * `pending` or `processing`. Stop when `status` is `complete`, `failed`, + * `canceled`, or `unknown`. Repeating this request with the same + * parameters reuses the existing report instead of creating a duplicate. + * @param {ShuttleReportCreateRequestV2026R0} requestBody Request body of createShuttleReportV2026R0 method + * @param {CreateShuttleReportV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async createShuttleReportV2026R0( + requestBody: ShuttleReportCreateRequestV2026R0, + optionalsInput: CreateShuttleReportV2026R0OptionalsInput = {}, + ): Promise { + const optionals: CreateShuttleReportV2026R0Optionals = + new CreateShuttleReportV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_reports', + ) as string, + method: 'POST', + headers: headersMap, + data: serializeShuttleReportCreateRequestV2026R0(requestBody), + contentType: 'application/json', + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleReportV2026R0(response.data!), + rawData: response.data!, + }; + } + /** + * Returns details for a single shuttle report identified by its ID, + * including generation status and, once generation finishes, the Box + * output reference. + * @param {string} shuttleReportId The unique identifier for the shuttle report. + Example: "6a3ba8d14f2c91e8370b4d12" + * @param {GetShuttleReportByIdV2026R0OptionalsInput} optionalsInput + * @returns {Promise} + */ + async getShuttleReportByIdV2026R0( + shuttleReportId: string, + optionalsInput: GetShuttleReportByIdV2026R0OptionalsInput = {}, + ): Promise { + const optionals: GetShuttleReportByIdV2026R0Optionals = + new GetShuttleReportByIdV2026R0Optionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ ['box-version']: toString(headers.boxVersion) as string }, + ...headers.extraHeaders, + }); + const response: FetchResponse = + await this.networkSession.networkClient.fetch( + new FetchOptions({ + url: ''.concat( + this.networkSession.baseUrls.baseUrl, + '/2.0/shuttle_reports/', + (toString(shuttleReportId) as string)!, + ) as string, + method: 'GET', + headers: headersMap, + responseFormat: 'json' as ResponseFormat, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + }), + ); + return { + ...deserializeShuttleReportV2026R0(response.data!), + rawData: response.data!, + }; + } +} +export interface ShuttleManagerInput { + readonly auth?: Authentication; + readonly networkSession?: NetworkSession; +} +export function serializeGetShuttlePathEntriesV2026R0QueryParamsSideField( + val: GetShuttlePathEntriesV2026R0QueryParamsSideField, +): SerializedData { + return val; +} +export function deserializeGetShuttlePathEntriesV2026R0QueryParamsSideField( + val: SerializedData, +): GetShuttlePathEntriesV2026R0QueryParamsSideField { + if (val == 'source') { + return val; + } + if (val == 'target') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize GetShuttlePathEntriesV2026R0QueryParamsSideField", + }); +} diff --git a/src/schemas/event.ts b/src/schemas/event.ts index 23a6f64b..d56a5e13 100644 --- a/src/schemas/event.ts +++ b/src/schemas/event.ts @@ -175,6 +175,8 @@ export type EventEventTypeField = | 'RENAME' | 'RETENTION_POLICY_ASSIGNMENT_ADD' | 'SHARE' + | 'SHARED_LINK_ONE_TIME_PASSCODE_ACCESS' + | 'SHARED_LINK_ONE_TIME_PASSCODE_CHALLENGE' | 'SHARED_LINK_REDIRECT_OUT_OF_SHARED_CONTEXT' | 'SHARED_LINK_SEND' | 'SHARE_EXPIRATION' @@ -185,6 +187,7 @@ export type EventEventTypeField = | 'SHIELD_DOWNLOAD_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED_MISSING_JUSTIFICATION' + | 'SHIELD_EXTERNAL_COLLAB_ACCESS_JUSTIFIED' | 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED' | 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED_MISSING_JUSTIFICATION' | 'SHIELD_EXTERNAL_COLLAB_INVITE_JUSTIFIED' @@ -700,6 +703,12 @@ export function deserializeEventEventTypeField( if (val == 'SHARE') { return val; } + if (val == 'SHARED_LINK_ONE_TIME_PASSCODE_ACCESS') { + return val; + } + if (val == 'SHARED_LINK_ONE_TIME_PASSCODE_CHALLENGE') { + return val; + } if (val == 'SHARED_LINK_REDIRECT_OUT_OF_SHARED_CONTEXT') { return val; } @@ -730,6 +739,9 @@ export function deserializeEventEventTypeField( if (val == 'SHIELD_EXTERNAL_COLLAB_ACCESS_BLOCKED_MISSING_JUSTIFICATION') { return val; } + if (val == 'SHIELD_EXTERNAL_COLLAB_ACCESS_JUSTIFIED') { + return val; + } if (val == 'SHIELD_EXTERNAL_COLLAB_INVITE_BLOCKED') { return val; } diff --git a/src/schemas/v2025R0/archiveV2025R0.ts b/src/schemas/v2025R0/archiveV2025R0.ts index 2ed29a6e..9758b5a1 100644 --- a/src/schemas/v2025R0/archiveV2025R0.ts +++ b/src/schemas/v2025R0/archiveV2025R0.ts @@ -39,7 +39,7 @@ export class ArchiveV2025R0 { readonly description?: string | null; /** * The part of an archive API response that describes the user who owns the archive. */ - readonly ownedBy?: ArchiveV2025R0OwnedByField; + readonly ownedBy!: ArchiveV2025R0OwnedByField; readonly rawData?: SerializedData; constructor( fields: Omit & @@ -91,7 +91,7 @@ export interface ArchiveV2025R0Input { readonly description?: string | null; /** * The part of an archive API response that describes the user who owns the archive. */ - readonly ownedBy?: ArchiveV2025R0OwnedByField; + readonly ownedBy: ArchiveV2025R0OwnedByField; readonly rawData?: SerializedData; } export function serializeArchiveV2025R0TypeField( @@ -156,10 +156,7 @@ export function serializeArchiveV2025R0(val: ArchiveV2025R0): SerializedData { ['name']: val.name, ['size']: val.size, ['description']: val.description, - ['owned_by']: - val.ownedBy == void 0 - ? val.ownedBy - : serializeArchiveV2025R0OwnedByField(val.ownedBy), + ['owned_by']: serializeArchiveV2025R0OwnedByField(val.ownedBy), }; } export function deserializeArchiveV2025R0(val: SerializedData): ArchiveV2025R0 { @@ -214,10 +211,13 @@ export function deserializeArchiveV2025R0(val: SerializedData): ArchiveV2025R0 { } const description: undefined | string = val.description == void 0 ? void 0 : val.description; - const ownedBy: undefined | ArchiveV2025R0OwnedByField = - val.owned_by == void 0 - ? void 0 - : deserializeArchiveV2025R0OwnedByField(val.owned_by); + if (val.owned_by == void 0) { + throw new BoxSdkError({ + message: 'Expecting "owned_by" of type "ArchiveV2025R0" to be defined', + }); + } + const ownedBy: ArchiveV2025R0OwnedByField = + deserializeArchiveV2025R0OwnedByField(val.owned_by); return { id: id, type: type, @@ -239,10 +239,7 @@ export function serializeArchiveV2025R0Input( ['name']: val.name, ['size']: val.size, ['description']: val.description, - ['owned_by']: - val.ownedBy == void 0 - ? val.ownedBy - : serializeArchiveV2025R0OwnedByField(val.ownedBy), + ['owned_by']: serializeArchiveV2025R0OwnedByField(val.ownedBy), }; } export function deserializeArchiveV2025R0Input( @@ -296,10 +293,14 @@ export function deserializeArchiveV2025R0Input( } const description: undefined | string = val.description == void 0 ? void 0 : val.description; - const ownedBy: undefined | ArchiveV2025R0OwnedByField = - val.owned_by == void 0 - ? void 0 - : deserializeArchiveV2025R0OwnedByField(val.owned_by); + if (val.owned_by == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "owned_by" of type "ArchiveV2025R0Input" to be defined', + }); + } + const ownedBy: ArchiveV2025R0OwnedByField = + deserializeArchiveV2025R0OwnedByField(val.owned_by); return { id: id, type: type, diff --git a/src/schemas/v2026R0/index.ts b/src/schemas/v2026R0/index.ts index e7e31853..0a7ce690 100644 --- a/src/schemas/v2026R0/index.ts +++ b/src/schemas/v2026R0/index.ts @@ -32,9 +32,67 @@ export * from './queryOrderByV2026R0'; export * from './queryRequestBodyV2026R0'; export * from './queryResultEntryV2026R0'; export * from './queryResultsV2026R0'; +export * from './shuttleAgentCredentialsV2026R0'; +export * from './shuttleJobPermissionConflictStrategyV2026R0'; +export * from './shuttleJobUpdateRequestV2026R0'; +export * from './shuttleJobCreateRequestV2026R0'; +export * from './shuttleJobV2026R0'; +export * from './shuttleJobsV2026R0'; +export * from './shuttleJobScheduleTriggerByJobV2026R0'; +export * from './shuttleJobScheduleTriggerByTimeV2026R0'; +export * from './shuttleJobScheduleTriggerV2026R0'; +export * from './shuttleJobScheduleUpdateRequestV2026R0'; +export * from './shuttleJobScheduleCreateRequestV2026R0'; +export * from './shuttleJobScheduleV2026R0'; +export * from './shuttleJobSchedulesV2026R0'; +export * from './shuttleJobStartRequestV2026R0'; +export * from './shuttleMappingErrorV2026R0'; +export * from './shuttleMappingErrorsV2026R0'; +export * from './shuttlePathEntryAccountScopeV2026R0'; +export * from './shuttlePathEntrySharedSpaceScopeV2026R0'; +export * from './shuttlePathEntryScopeV2026R0'; +export * from './shuttlePathEntryV2026R0'; +export * from './shuttlePathEntriesV2026R0'; +export * from './shuttlePathMappingAccountV2026R0'; +export * from './shuttlePathMappingAccountLocationV2026R0'; +export * from './shuttlePathMappingAccountInputV2026R0'; +export * from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +export * from './shuttlePathMappingAccountLocationInputV2026R0'; +export * from './shuttlePathMappingImportCreateRequestV2026R0'; +export * from './shuttlePathMappingSharedSpaceLocationV2026R0'; +export * from './shuttlePathMappingLocationV2026R0'; +export * from './shuttlePathMappingV2026R0'; +export * from './shuttlePathMappingsV2026R0'; +export * from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +export * from './shuttlePathMappingLocationInputV2026R0'; +export * from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +export * from './shuttlePathMappingTargetLocationInputV2026R0'; +export * from './shuttlePathMappingUpdateRequestV2026R0'; +export * from './shuttlePathMappingCreateRequestV2026R0'; +export * from './shuttleReportCreateRequestV2026R0'; +export * from './shuttleReportOutputV2026R0'; +export * from './shuttleReportV2026R0'; +export * from './shuttleReportsV2026R0'; +export * from './shuttleSubjectMappingImportCreateRequestV2026R0'; +export * from './shuttleSubjectRoleV2026R0'; +export * from './shuttleSubjectV2026R0'; +export * from './shuttleSystemV2026R0'; +export * from './shuttleSystemsV2026R0'; +export * from './shuttleSystemCreateRequestV2026R0'; +export * from './shuttleSystemUpdateRequestV2026R0'; +export * from './shuttleTargetSubjectV2026R0'; +export * from './shuttleSubjectMappingV2026R0'; +export * from './shuttleSubjectMappingsV2026R0'; +export * from './shuttleDiscoveredSubjectV2026R0'; +export * from './shuttleDiscoveredSubjectsV2026R0'; +export * from './shuttleTargetSubjectInputV2026R0'; +export * from './shuttleSubjectMappingUpdateRequestV2026R0'; +export * from './shuttleSubjectMappingCreateRequestV2026R0'; export * from './userBaseV2026R0'; export * from './userMiniV2026R0'; export * from './documentSplitV2026R0'; export * from './documentSplitsV2026R0'; export * from './automateWorkflowActionV2026R0'; export * from './automateWorkflowsV2026R0'; +export * from './shuttleRunV2026R0'; +export * from './shuttleRunsV2026R0'; diff --git a/src/schemas/v2026R0/shuttleAgentCredentialsV2026R0.ts b/src/schemas/v2026R0/shuttleAgentCredentialsV2026R0.ts new file mode 100644 index 00000000..80af6828 --- /dev/null +++ b/src/schemas/v2026R0/shuttleAgentCredentialsV2026R0.ts @@ -0,0 +1,68 @@ +import { serializeDateTime } from '../../internal/utils'; +import { deserializeDateTime } from '../../internal/utils'; +import { BoxSdkError } from '../../box/errors'; +import { DateTime } from '../../internal/utils'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleAgentCredentialsV2026R0 { + /** + * The installation token to paste into the Windows agent installer to + * register the agent. */ + readonly registrationToken: string; + /** + * When the registration token expires and can no longer be used. */ + readonly expiresAt: DateTime; + readonly rawData?: SerializedData; +} +export function serializeShuttleAgentCredentialsV2026R0( + val: ShuttleAgentCredentialsV2026R0, +): SerializedData { + return { + ['registration_token']: val.registrationToken, + ['expires_at']: serializeDateTime(val.expiresAt), + }; +} +export function deserializeShuttleAgentCredentialsV2026R0( + val: SerializedData, +): ShuttleAgentCredentialsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleAgentCredentialsV2026R0"', + }); + } + if (val.registration_token == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "registration_token" of type "ShuttleAgentCredentialsV2026R0" to be defined', + }); + } + if (!sdIsString(val.registration_token)) { + throw new BoxSdkError({ + message: + 'Expecting string for "registration_token" of type "ShuttleAgentCredentialsV2026R0"', + }); + } + const registrationToken: string = val.registration_token; + if (val.expires_at == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "expires_at" of type "ShuttleAgentCredentialsV2026R0" to be defined', + }); + } + if (!sdIsString(val.expires_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "expires_at" of type "ShuttleAgentCredentialsV2026R0"', + }); + } + const expiresAt: DateTime = deserializeDateTime(val.expires_at); + return { + registrationToken: registrationToken, + expiresAt: expiresAt, + } satisfies ShuttleAgentCredentialsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleDiscoveredSubjectV2026R0.ts b/src/schemas/v2026R0/shuttleDiscoveredSubjectV2026R0.ts new file mode 100644 index 00000000..9e84fa1e --- /dev/null +++ b/src/schemas/v2026R0/shuttleDiscoveredSubjectV2026R0.ts @@ -0,0 +1,281 @@ +import { serializeShuttleSubjectV2026R0 } from './shuttleSubjectV2026R0'; +import { deserializeShuttleSubjectV2026R0 } from './shuttleSubjectV2026R0'; +import { serializeShuttleTargetSubjectV2026R0 } from './shuttleTargetSubjectV2026R0'; +import { deserializeShuttleTargetSubjectV2026R0 } from './shuttleTargetSubjectV2026R0'; +import { ShuttleSubjectV2026R0 } from './shuttleSubjectV2026R0'; +import { ShuttleTargetSubjectV2026R0 } from './shuttleTargetSubjectV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleDiscoveredSubjectV2026R0TypeField = + 'shuttle_discovered_subject'; +export class ShuttleDiscoveredSubjectV2026R0 { + /** + * The unique identifier for the discovered subject. */ + readonly id!: string; + /** + * The value will always be `shuttle_discovered_subject`. */ + readonly type: ShuttleDiscoveredSubjectV2026R0TypeField = + 'shuttle_discovered_subject' as ShuttleDiscoveredSubjectV2026R0TypeField; + /** + * The unique identifier of the shuttle job this subject belongs to. */ + readonly jobId!: string; + /** + * The scan revision this discovered subject belongs to. */ + readonly revision!: number; + readonly source!: ShuttleSubjectV2026R0; + /** + * A suggested Box target inferred during the scan. `null` when no + * suggestion was made. */ + readonly suggestedTarget?: ShuttleTargetSubjectV2026R0; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.jobId !== undefined) { + this.jobId = fields.jobId; + } + if (fields.revision !== undefined) { + this.revision = fields.revision; + } + if (fields.source !== undefined) { + this.source = fields.source; + } + if (fields.suggestedTarget !== undefined) { + this.suggestedTarget = fields.suggestedTarget; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleDiscoveredSubjectV2026R0Input { + /** + * The unique identifier for the discovered subject. */ + readonly id: string; + /** + * The value will always be `shuttle_discovered_subject`. */ + readonly type?: ShuttleDiscoveredSubjectV2026R0TypeField; + /** + * The unique identifier of the shuttle job this subject belongs to. */ + readonly jobId: string; + /** + * The scan revision this discovered subject belongs to. */ + readonly revision: number; + readonly source: ShuttleSubjectV2026R0; + /** + * A suggested Box target inferred during the scan. `null` when no + * suggestion was made. */ + readonly suggestedTarget?: ShuttleTargetSubjectV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttleDiscoveredSubjectV2026R0TypeField( + val: ShuttleDiscoveredSubjectV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleDiscoveredSubjectV2026R0TypeField( + val: SerializedData, +): ShuttleDiscoveredSubjectV2026R0TypeField { + if (val == 'shuttle_discovered_subject') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleDiscoveredSubjectV2026R0TypeField", + }); +} +export function serializeShuttleDiscoveredSubjectV2026R0( + val: ShuttleDiscoveredSubjectV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleDiscoveredSubjectV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['revision']: val.revision, + ['source']: serializeShuttleSubjectV2026R0(val.source), + ['suggested_target']: + val.suggestedTarget == void 0 + ? val.suggestedTarget + : serializeShuttleTargetSubjectV2026R0(val.suggestedTarget), + }; +} +export function deserializeShuttleDiscoveredSubjectV2026R0( + val: SerializedData, +): ShuttleDiscoveredSubjectV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleDiscoveredSubjectV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleDiscoveredSubjectV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleDiscoveredSubjectV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleDiscoveredSubjectV2026R0" to be defined', + }); + } + const type: ShuttleDiscoveredSubjectV2026R0TypeField = + deserializeShuttleDiscoveredSubjectV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleDiscoveredSubjectV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleDiscoveredSubjectV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.revision == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "revision" of type "ShuttleDiscoveredSubjectV2026R0" to be defined', + }); + } + if (!sdIsNumber(val.revision)) { + throw new BoxSdkError({ + message: + 'Expecting number for "revision" of type "ShuttleDiscoveredSubjectV2026R0"', + }); + } + const revision: number = val.revision; + if (val.source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source" of type "ShuttleDiscoveredSubjectV2026R0" to be defined', + }); + } + const source: ShuttleSubjectV2026R0 = deserializeShuttleSubjectV2026R0( + val.source, + ); + const suggestedTarget: ShuttleTargetSubjectV2026R0 | undefined = + val.suggested_target == void 0 + ? void 0 + : deserializeShuttleTargetSubjectV2026R0(val.suggested_target); + return { + id: id, + type: type, + jobId: jobId, + revision: revision, + source: source, + suggestedTarget: suggestedTarget, + } satisfies ShuttleDiscoveredSubjectV2026R0; +} +export function serializeShuttleDiscoveredSubjectV2026R0Input( + val: ShuttleDiscoveredSubjectV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleDiscoveredSubjectV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['revision']: val.revision, + ['source']: serializeShuttleSubjectV2026R0(val.source), + ['suggested_target']: + val.suggestedTarget == void 0 + ? val.suggestedTarget + : serializeShuttleTargetSubjectV2026R0(val.suggestedTarget), + }; +} +export function deserializeShuttleDiscoveredSubjectV2026R0Input( + val: SerializedData, +): ShuttleDiscoveredSubjectV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleDiscoveredSubjectV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleDiscoveredSubjectV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleDiscoveredSubjectV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttleDiscoveredSubjectV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleDiscoveredSubjectV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleDiscoveredSubjectV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleDiscoveredSubjectV2026R0Input"', + }); + } + const jobId: string = val.job_id; + if (val.revision == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "revision" of type "ShuttleDiscoveredSubjectV2026R0Input" to be defined', + }); + } + if (!sdIsNumber(val.revision)) { + throw new BoxSdkError({ + message: + 'Expecting number for "revision" of type "ShuttleDiscoveredSubjectV2026R0Input"', + }); + } + const revision: number = val.revision; + if (val.source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source" of type "ShuttleDiscoveredSubjectV2026R0Input" to be defined', + }); + } + const source: ShuttleSubjectV2026R0 = deserializeShuttleSubjectV2026R0( + val.source, + ); + const suggestedTarget: ShuttleTargetSubjectV2026R0 | undefined = + val.suggested_target == void 0 + ? void 0 + : deserializeShuttleTargetSubjectV2026R0(val.suggested_target); + return { + id: id, + type: type, + jobId: jobId, + revision: revision, + source: source, + suggestedTarget: suggestedTarget, + } satisfies ShuttleDiscoveredSubjectV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleDiscoveredSubjectsV2026R0.ts b/src/schemas/v2026R0/shuttleDiscoveredSubjectsV2026R0.ts new file mode 100644 index 00000000..89569680 --- /dev/null +++ b/src/schemas/v2026R0/shuttleDiscoveredSubjectsV2026R0.ts @@ -0,0 +1,101 @@ +import { serializeShuttleDiscoveredSubjectV2026R0 } from './shuttleDiscoveredSubjectV2026R0'; +import { deserializeShuttleDiscoveredSubjectV2026R0 } from './shuttleDiscoveredSubjectV2026R0'; +import { ShuttleDiscoveredSubjectV2026R0 } from './shuttleDiscoveredSubjectV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleDiscoveredSubjectsV2026R0 { + /** + * A list of discovered subjects. */ + readonly entries: readonly ShuttleDiscoveredSubjectV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleDiscoveredSubjectsV2026R0( + val: ShuttleDiscoveredSubjectsV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttleDiscoveredSubjectV2026R0, + ): SerializedData { + return serializeShuttleDiscoveredSubjectV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttleDiscoveredSubjectsV2026R0( + val: SerializedData, +): ShuttleDiscoveredSubjectsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleDiscoveredSubjectsV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "entries" of type "ShuttleDiscoveredSubjectsV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: + 'Expecting array for "entries" of type "ShuttleDiscoveredSubjectsV2026R0"', + }); + } + const entries: readonly ShuttleDiscoveredSubjectV2026R0[] = sdIsList( + val.entries, + ) + ? (val.entries.map(function ( + itm: SerializedData, + ): ShuttleDiscoveredSubjectV2026R0 { + return deserializeShuttleDiscoveredSubjectV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: + 'Expecting number for "limit" of type "ShuttleDiscoveredSubjectsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttleDiscoveredSubjectsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttleDiscoveredSubjectsV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttleDiscoveredSubjectsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleJobCreateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleJobCreateRequestV2026R0.ts new file mode 100644 index 00000000..edba4181 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobCreateRequestV2026R0.ts @@ -0,0 +1,452 @@ +import { serializeShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { deserializeShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { ShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobCreateRequestV2026R0JobTypeField = + 'transfer' | 'analysis' | string; +export interface ShuttleJobCreateRequestV2026R0AccountMappingField { + /** + * Whether account mapping is enabled for the shuttle job. Defaults to + * `false` when `account_mapping` is omitted on create. */ + readonly isEnabled?: boolean; + /** + * The strategy used to resolve permission conflicts. `null` when + * unset. */ + readonly permissionConflictStrategy?: ShuttleJobPermissionConflictStrategyV2026R0; + /** + * Whether external shares are mapped during the migration. */ + readonly areExternalSharesMapped?: boolean; + /** + * Whether permissions are mapped during the migration. */ + readonly arePermissionsMapped?: boolean; + readonly rawData?: SerializedData; +} +export interface ShuttleJobCreateRequestV2026R0SettingsField { + /** + * The maximum transfer bandwidth in bytes per second. `null` when + * unlimited. */ + readonly bandwidthLimitBytesPerSec?: number | null; + /** + * Whether deletions in the source system are mirrored in Box. */ + readonly areDeletionsMirrored?: boolean; + /** + * Whether prior file versions are synced during the migration. */ + readonly areFileVersionsSynced?: boolean; + /** + * The maximum number of file versions to sync. `null` when unlimited. */ + readonly maxFileVersions?: number | null; + /** + * Whether existing files in Box are overwritten. */ + readonly isOverwriteEnabled?: boolean; + /** + * Whether mappings that already completed successfully are skipped when + * the job is rerun. */ + readonly areCompletedMappingsSkippedOnRerun?: boolean; + /** + * Whether migrated content is scanned during the migration. Applies + * only when the source system supports content scanning; ignored + * otherwise. */ + readonly isContentScanningEnabled?: boolean; + /** + * Whether shared folders on the source are included in the migration. + * Applies only when the source system supports shared folders; ignored + * otherwise. */ + readonly includeSharedSourceFolders?: boolean; + /** + * Whether shared folders on the destination are included in the + * migration. Applies only when the destination system supports shared + * folders; ignored otherwise. */ + readonly includeSharedDestinationFolders?: boolean; + readonly rawData?: SerializedData; +} +export interface ShuttleJobCreateRequestV2026R0 { + /** + * The human-readable name of the shuttle job. */ + readonly name: string; + /** + * The type of work the shuttle job performs. */ + readonly jobType: ShuttleJobCreateRequestV2026R0JobTypeField; + /** + * The unique identifier of the source system to migrate from. */ + readonly sourceSystemId: string; + /** + * An optional free-form comment describing the shuttle job. */ + readonly comment?: string; + /** + * A list of free-form tags associated with the shuttle job. */ + readonly tags?: readonly string[]; + /** + * The account mapping configuration that controls how source identities + * and permissions are translated into Box. When this object is omitted, + * the job is created with `is_enabled` set to `false`. */ + readonly accountMapping?: ShuttleJobCreateRequestV2026R0AccountMappingField; + /** + * The tunable settings that control how the shuttle job runs. */ + readonly settings?: ShuttleJobCreateRequestV2026R0SettingsField; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobCreateRequestV2026R0JobTypeField( + val: ShuttleJobCreateRequestV2026R0JobTypeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobCreateRequestV2026R0JobTypeField( + val: SerializedData, +): ShuttleJobCreateRequestV2026R0JobTypeField { + if (val == 'transfer') { + return val; + } + if (val == 'analysis') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobCreateRequestV2026R0JobTypeField", + }); +} +export function serializeShuttleJobCreateRequestV2026R0AccountMappingField( + val: ShuttleJobCreateRequestV2026R0AccountMappingField, +): SerializedData { + return { + ['is_enabled']: val.isEnabled, + ['permission_conflict_strategy']: + val.permissionConflictStrategy == void 0 + ? val.permissionConflictStrategy + : serializeShuttleJobPermissionConflictStrategyV2026R0( + val.permissionConflictStrategy, + ), + ['are_external_shares_mapped']: val.areExternalSharesMapped, + ['are_permissions_mapped']: val.arePermissionsMapped, + }; +} +export function deserializeShuttleJobCreateRequestV2026R0AccountMappingField( + val: SerializedData, +): ShuttleJobCreateRequestV2026R0AccountMappingField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleJobCreateRequestV2026R0AccountMappingField"', + }); + } + if (!(val.is_enabled == void 0) && !sdIsBoolean(val.is_enabled)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_enabled" of type "ShuttleJobCreateRequestV2026R0AccountMappingField"', + }); + } + const isEnabled: undefined | boolean = + val.is_enabled == void 0 ? void 0 : val.is_enabled; + const permissionConflictStrategy: + ShuttleJobPermissionConflictStrategyV2026R0 | undefined = + val.permission_conflict_strategy == void 0 + ? void 0 + : deserializeShuttleJobPermissionConflictStrategyV2026R0( + val.permission_conflict_strategy, + ); + if ( + !(val.are_external_shares_mapped == void 0) && + !sdIsBoolean(val.are_external_shares_mapped) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_external_shares_mapped" of type "ShuttleJobCreateRequestV2026R0AccountMappingField"', + }); + } + const areExternalSharesMapped: undefined | boolean = + val.are_external_shares_mapped == void 0 + ? void 0 + : val.are_external_shares_mapped; + if ( + !(val.are_permissions_mapped == void 0) && + !sdIsBoolean(val.are_permissions_mapped) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_permissions_mapped" of type "ShuttleJobCreateRequestV2026R0AccountMappingField"', + }); + } + const arePermissionsMapped: undefined | boolean = + val.are_permissions_mapped == void 0 ? void 0 : val.are_permissions_mapped; + return { + isEnabled: isEnabled, + permissionConflictStrategy: permissionConflictStrategy, + areExternalSharesMapped: areExternalSharesMapped, + arePermissionsMapped: arePermissionsMapped, + } satisfies ShuttleJobCreateRequestV2026R0AccountMappingField; +} +export function serializeShuttleJobCreateRequestV2026R0SettingsField( + val: ShuttleJobCreateRequestV2026R0SettingsField, +): SerializedData { + return { + ['bandwidth_limit_bytes_per_sec']: val.bandwidthLimitBytesPerSec, + ['are_deletions_mirrored']: val.areDeletionsMirrored, + ['are_file_versions_synced']: val.areFileVersionsSynced, + ['max_file_versions']: val.maxFileVersions, + ['is_overwrite_enabled']: val.isOverwriteEnabled, + ['are_completed_mappings_skipped_on_rerun']: + val.areCompletedMappingsSkippedOnRerun, + ['is_content_scanning_enabled']: val.isContentScanningEnabled, + ['include_shared_source_folders']: val.includeSharedSourceFolders, + ['include_shared_destination_folders']: val.includeSharedDestinationFolders, + }; +} +export function deserializeShuttleJobCreateRequestV2026R0SettingsField( + val: SerializedData, +): ShuttleJobCreateRequestV2026R0SettingsField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + if ( + !(val.bandwidth_limit_bytes_per_sec == void 0) && + !sdIsNumber(val.bandwidth_limit_bytes_per_sec) + ) { + throw new BoxSdkError({ + message: + 'Expecting number for "bandwidth_limit_bytes_per_sec" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const bandwidthLimitBytesPerSec: undefined | number = + val.bandwidth_limit_bytes_per_sec == void 0 + ? void 0 + : val.bandwidth_limit_bytes_per_sec; + if ( + !(val.are_deletions_mirrored == void 0) && + !sdIsBoolean(val.are_deletions_mirrored) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_deletions_mirrored" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const areDeletionsMirrored: undefined | boolean = + val.are_deletions_mirrored == void 0 ? void 0 : val.are_deletions_mirrored; + if ( + !(val.are_file_versions_synced == void 0) && + !sdIsBoolean(val.are_file_versions_synced) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_file_versions_synced" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const areFileVersionsSynced: undefined | boolean = + val.are_file_versions_synced == void 0 + ? void 0 + : val.are_file_versions_synced; + if ( + !(val.max_file_versions == void 0) && + !sdIsNumber(val.max_file_versions) + ) { + throw new BoxSdkError({ + message: + 'Expecting number for "max_file_versions" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const maxFileVersions: undefined | number = + val.max_file_versions == void 0 ? void 0 : val.max_file_versions; + if ( + !(val.is_overwrite_enabled == void 0) && + !sdIsBoolean(val.is_overwrite_enabled) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_overwrite_enabled" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const isOverwriteEnabled: undefined | boolean = + val.is_overwrite_enabled == void 0 ? void 0 : val.is_overwrite_enabled; + if ( + !(val.are_completed_mappings_skipped_on_rerun == void 0) && + !sdIsBoolean(val.are_completed_mappings_skipped_on_rerun) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_completed_mappings_skipped_on_rerun" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const areCompletedMappingsSkippedOnRerun: undefined | boolean = + val.are_completed_mappings_skipped_on_rerun == void 0 + ? void 0 + : val.are_completed_mappings_skipped_on_rerun; + if ( + !(val.is_content_scanning_enabled == void 0) && + !sdIsBoolean(val.is_content_scanning_enabled) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_content_scanning_enabled" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const isContentScanningEnabled: undefined | boolean = + val.is_content_scanning_enabled == void 0 + ? void 0 + : val.is_content_scanning_enabled; + if ( + !(val.include_shared_source_folders == void 0) && + !sdIsBoolean(val.include_shared_source_folders) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "include_shared_source_folders" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const includeSharedSourceFolders: undefined | boolean = + val.include_shared_source_folders == void 0 + ? void 0 + : val.include_shared_source_folders; + if ( + !(val.include_shared_destination_folders == void 0) && + !sdIsBoolean(val.include_shared_destination_folders) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "include_shared_destination_folders" of type "ShuttleJobCreateRequestV2026R0SettingsField"', + }); + } + const includeSharedDestinationFolders: undefined | boolean = + val.include_shared_destination_folders == void 0 + ? void 0 + : val.include_shared_destination_folders; + return { + bandwidthLimitBytesPerSec: bandwidthLimitBytesPerSec, + areDeletionsMirrored: areDeletionsMirrored, + areFileVersionsSynced: areFileVersionsSynced, + maxFileVersions: maxFileVersions, + isOverwriteEnabled: isOverwriteEnabled, + areCompletedMappingsSkippedOnRerun: areCompletedMappingsSkippedOnRerun, + isContentScanningEnabled: isContentScanningEnabled, + includeSharedSourceFolders: includeSharedSourceFolders, + includeSharedDestinationFolders: includeSharedDestinationFolders, + } satisfies ShuttleJobCreateRequestV2026R0SettingsField; +} +export function serializeShuttleJobCreateRequestV2026R0( + val: ShuttleJobCreateRequestV2026R0, +): SerializedData { + return { + ['name']: val.name, + ['job_type']: serializeShuttleJobCreateRequestV2026R0JobTypeField( + val.jobType, + ), + ['source_system_id']: val.sourceSystemId, + ['comment']: val.comment, + ['tags']: + val.tags == void 0 + ? val.tags + : (val.tags.map(function (item: string): SerializedData { + return item; + }) as readonly any[]), + ['account_mapping']: + val.accountMapping == void 0 + ? val.accountMapping + : serializeShuttleJobCreateRequestV2026R0AccountMappingField( + val.accountMapping, + ), + ['settings']: + val.settings == void 0 + ? val.settings + : serializeShuttleJobCreateRequestV2026R0SettingsField(val.settings), + }; +} +export function deserializeShuttleJobCreateRequestV2026R0( + val: SerializedData, +): ShuttleJobCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobCreateRequestV2026R0"', + }); + } + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttleJobCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleJobCreateRequestV2026R0"', + }); + } + const name: string = val.name; + if (val.job_type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_type" of type "ShuttleJobCreateRequestV2026R0" to be defined', + }); + } + const jobType: ShuttleJobCreateRequestV2026R0JobTypeField = + deserializeShuttleJobCreateRequestV2026R0JobTypeField(val.job_type); + if (val.source_system_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source_system_id" of type "ShuttleJobCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.source_system_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "source_system_id" of type "ShuttleJobCreateRequestV2026R0"', + }); + } + const sourceSystemId: string = val.source_system_id; + if (!(val.comment == void 0) && !sdIsString(val.comment)) { + throw new BoxSdkError({ + message: + 'Expecting string for "comment" of type "ShuttleJobCreateRequestV2026R0"', + }); + } + const comment: undefined | string = + val.comment == void 0 ? void 0 : val.comment; + if (!(val.tags == void 0) && !sdIsList(val.tags)) { + throw new BoxSdkError({ + message: + 'Expecting array for "tags" of type "ShuttleJobCreateRequestV2026R0"', + }); + } + const tags: undefined | readonly string[] = + val.tags == void 0 + ? void 0 + : sdIsList(val.tags) + ? (val.tags.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: + 'Expecting string for "ShuttleJobCreateRequestV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + const accountMapping: + undefined | ShuttleJobCreateRequestV2026R0AccountMappingField = + val.account_mapping == void 0 + ? void 0 + : deserializeShuttleJobCreateRequestV2026R0AccountMappingField( + val.account_mapping, + ); + const settings: undefined | ShuttleJobCreateRequestV2026R0SettingsField = + val.settings == void 0 + ? void 0 + : deserializeShuttleJobCreateRequestV2026R0SettingsField(val.settings); + return { + name: name, + jobType: jobType, + sourceSystemId: sourceSystemId, + comment: comment, + tags: tags, + accountMapping: accountMapping, + settings: settings, + } satisfies ShuttleJobCreateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleJobPermissionConflictStrategyV2026R0.ts b/src/schemas/v2026R0/shuttleJobPermissionConflictStrategyV2026R0.ts new file mode 100644 index 00000000..619e96e9 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobPermissionConflictStrategyV2026R0.ts @@ -0,0 +1,41 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobPermissionConflictStrategyV2026R0 = + | 'preserve_structure_restrict_sharing' + | 'preserve_structure_expand_sharing' + | 'preserve_sharing_modify_structure' + | 'warn_permissions_conflicts' + | string; +export function serializeShuttleJobPermissionConflictStrategyV2026R0( + val: ShuttleJobPermissionConflictStrategyV2026R0, +): SerializedData { + return val; +} +export function deserializeShuttleJobPermissionConflictStrategyV2026R0( + val: SerializedData, +): ShuttleJobPermissionConflictStrategyV2026R0 { + if (val == 'preserve_structure_restrict_sharing') { + return val; + } + if (val == 'preserve_structure_expand_sharing') { + return val; + } + if (val == 'preserve_sharing_modify_structure') { + return val; + } + if (val == 'warn_permissions_conflicts') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobPermissionConflictStrategyV2026R0", + }); +} diff --git a/src/schemas/v2026R0/shuttleJobScheduleCreateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleJobScheduleCreateRequestV2026R0.ts new file mode 100644 index 00000000..23591307 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobScheduleCreateRequestV2026R0.ts @@ -0,0 +1,158 @@ +import { serializeShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { deserializeShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { serializeShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { deserializeShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { serializeShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { deserializeShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { ShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { ShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { ShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobScheduleCreateRequestV2026R0RunModeField = + 'transfer' | 'simulation' | 'analysis' | string; +export type ShuttleJobScheduleCreateRequestV2026R0StateField = + 'enabled' | 'paused' | string; +export interface ShuttleJobScheduleCreateRequestV2026R0 { + /** + * The unique identifier of the shuttle job this schedule belongs to. */ + readonly jobId: string; + /** + * The kind of run the schedule starts. `scan` is not a valid schedule + * run mode. */ + readonly runMode: ShuttleJobScheduleCreateRequestV2026R0RunModeField; + /** + * Whether the schedule is active. When omitted, defaults to `enabled`. */ + readonly state?: ShuttleJobScheduleCreateRequestV2026R0StateField; + /** + * An optional human-readable description of the schedule. */ + readonly description?: string | null; + readonly trigger: ShuttleJobScheduleTriggerV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobScheduleCreateRequestV2026R0RunModeField( + val: ShuttleJobScheduleCreateRequestV2026R0RunModeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleCreateRequestV2026R0RunModeField( + val: SerializedData, +): ShuttleJobScheduleCreateRequestV2026R0RunModeField { + if (val == 'transfer') { + return val; + } + if (val == 'simulation') { + return val; + } + if (val == 'analysis') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleJobScheduleCreateRequestV2026R0RunModeField", + }); +} +export function serializeShuttleJobScheduleCreateRequestV2026R0StateField( + val: ShuttleJobScheduleCreateRequestV2026R0StateField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleCreateRequestV2026R0StateField( + val: SerializedData, +): ShuttleJobScheduleCreateRequestV2026R0StateField { + if (val == 'enabled') { + return val; + } + if (val == 'paused') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleJobScheduleCreateRequestV2026R0StateField", + }); +} +export function serializeShuttleJobScheduleCreateRequestV2026R0( + val: ShuttleJobScheduleCreateRequestV2026R0, +): SerializedData { + return { + ['job_id']: val.jobId, + ['run_mode']: serializeShuttleJobScheduleCreateRequestV2026R0RunModeField( + val.runMode, + ), + ['state']: + val.state == void 0 + ? val.state + : serializeShuttleJobScheduleCreateRequestV2026R0StateField(val.state), + ['description']: val.description, + ['trigger']: serializeShuttleJobScheduleTriggerV2026R0(val.trigger), + }; +} +export function deserializeShuttleJobScheduleCreateRequestV2026R0( + val: SerializedData, +): ShuttleJobScheduleCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobScheduleCreateRequestV2026R0"', + }); + } + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleJobScheduleCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleJobScheduleCreateRequestV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.run_mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "run_mode" of type "ShuttleJobScheduleCreateRequestV2026R0" to be defined', + }); + } + const runMode: ShuttleJobScheduleCreateRequestV2026R0RunModeField = + deserializeShuttleJobScheduleCreateRequestV2026R0RunModeField(val.run_mode); + const state: undefined | ShuttleJobScheduleCreateRequestV2026R0StateField = + val.state == void 0 + ? void 0 + : deserializeShuttleJobScheduleCreateRequestV2026R0StateField(val.state); + if (!(val.description == void 0) && !sdIsString(val.description)) { + throw new BoxSdkError({ + message: + 'Expecting string for "description" of type "ShuttleJobScheduleCreateRequestV2026R0"', + }); + } + const description: undefined | string = + val.description == void 0 ? void 0 : val.description; + if (val.trigger == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "trigger" of type "ShuttleJobScheduleCreateRequestV2026R0" to be defined', + }); + } + const trigger: ShuttleJobScheduleTriggerV2026R0 = + deserializeShuttleJobScheduleTriggerV2026R0(val.trigger); + return { + jobId: jobId, + runMode: runMode, + state: state, + description: description, + trigger: trigger, + } satisfies ShuttleJobScheduleCreateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleJobScheduleTriggerByJobV2026R0.ts b/src/schemas/v2026R0/shuttleJobScheduleTriggerByJobV2026R0.ts new file mode 100644 index 00000000..2243e70f --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobScheduleTriggerByJobV2026R0.ts @@ -0,0 +1,211 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobScheduleTriggerByJobV2026R0TypeField = 'by_job'; +export type ShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField = + 'always' | 'on_success' | 'on_finish' | string; +export class ShuttleJobScheduleTriggerByJobV2026R0 { + /** + * The value will always be `by_job`. */ + readonly type: ShuttleJobScheduleTriggerByJobV2026R0TypeField = + 'by_job' as ShuttleJobScheduleTriggerByJobV2026R0TypeField; + /** + * The unique identifier of the shuttle job whose run starts this + * schedule. */ + readonly triggeredByJobId!: string; + /** + * When this schedule should start a run relative to the last run of + * the triggering job. */ + readonly lastRunCondition!: ShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.triggeredByJobId !== undefined) { + this.triggeredByJobId = fields.triggeredByJobId; + } + if (fields.lastRunCondition !== undefined) { + this.lastRunCondition = fields.lastRunCondition; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleJobScheduleTriggerByJobV2026R0Input { + /** + * The value will always be `by_job`. */ + readonly type?: ShuttleJobScheduleTriggerByJobV2026R0TypeField; + /** + * The unique identifier of the shuttle job whose run starts this + * schedule. */ + readonly triggeredByJobId: string; + /** + * When this schedule should start a run relative to the last run of + * the triggering job. */ + readonly lastRunCondition: ShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobScheduleTriggerByJobV2026R0TypeField( + val: ShuttleJobScheduleTriggerByJobV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleTriggerByJobV2026R0TypeField( + val: SerializedData, +): ShuttleJobScheduleTriggerByJobV2026R0TypeField { + if (val == 'by_job') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobScheduleTriggerByJobV2026R0TypeField", + }); +} +export function serializeShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField( + val: ShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField( + val: SerializedData, +): ShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField { + if (val == 'always') { + return val; + } + if (val == 'on_success') { + return val; + } + if (val == 'on_finish') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField", + }); +} +export function serializeShuttleJobScheduleTriggerByJobV2026R0( + val: ShuttleJobScheduleTriggerByJobV2026R0, +): SerializedData { + return { + ['type']: serializeShuttleJobScheduleTriggerByJobV2026R0TypeField(val.type), + ['triggered_by_job_id']: val.triggeredByJobId, + ['last_run_condition']: + serializeShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField( + val.lastRunCondition, + ), + }; +} +export function deserializeShuttleJobScheduleTriggerByJobV2026R0( + val: SerializedData, +): ShuttleJobScheduleTriggerByJobV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobScheduleTriggerByJobV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleJobScheduleTriggerByJobV2026R0" to be defined', + }); + } + const type: ShuttleJobScheduleTriggerByJobV2026R0TypeField = + deserializeShuttleJobScheduleTriggerByJobV2026R0TypeField(val.type); + if (val.triggered_by_job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "triggered_by_job_id" of type "ShuttleJobScheduleTriggerByJobV2026R0" to be defined', + }); + } + if (!sdIsString(val.triggered_by_job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "triggered_by_job_id" of type "ShuttleJobScheduleTriggerByJobV2026R0"', + }); + } + const triggeredByJobId: string = val.triggered_by_job_id; + if (val.last_run_condition == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "last_run_condition" of type "ShuttleJobScheduleTriggerByJobV2026R0" to be defined', + }); + } + const lastRunCondition: ShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField = + deserializeShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField( + val.last_run_condition, + ); + return { + type: type, + triggeredByJobId: triggeredByJobId, + lastRunCondition: lastRunCondition, + } satisfies ShuttleJobScheduleTriggerByJobV2026R0; +} +export function serializeShuttleJobScheduleTriggerByJobV2026R0Input( + val: ShuttleJobScheduleTriggerByJobV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleJobScheduleTriggerByJobV2026R0TypeField(val.type), + ['triggered_by_job_id']: val.triggeredByJobId, + ['last_run_condition']: + serializeShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField( + val.lastRunCondition, + ), + }; +} +export function deserializeShuttleJobScheduleTriggerByJobV2026R0Input( + val: SerializedData, +): ShuttleJobScheduleTriggerByJobV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleJobScheduleTriggerByJobV2026R0Input"', + }); + } + const type: undefined | ShuttleJobScheduleTriggerByJobV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleJobScheduleTriggerByJobV2026R0TypeField(val.type); + if (val.triggered_by_job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "triggered_by_job_id" of type "ShuttleJobScheduleTriggerByJobV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.triggered_by_job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "triggered_by_job_id" of type "ShuttleJobScheduleTriggerByJobV2026R0Input"', + }); + } + const triggeredByJobId: string = val.triggered_by_job_id; + if (val.last_run_condition == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "last_run_condition" of type "ShuttleJobScheduleTriggerByJobV2026R0Input" to be defined', + }); + } + const lastRunCondition: ShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField = + deserializeShuttleJobScheduleTriggerByJobV2026R0LastRunConditionField( + val.last_run_condition, + ); + return { + type: type, + triggeredByJobId: triggeredByJobId, + lastRunCondition: lastRunCondition, + } satisfies ShuttleJobScheduleTriggerByJobV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleJobScheduleTriggerByTimeV2026R0.ts b/src/schemas/v2026R0/shuttleJobScheduleTriggerByTimeV2026R0.ts new file mode 100644 index 00000000..2af0b5fd --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobScheduleTriggerByTimeV2026R0.ts @@ -0,0 +1,257 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobScheduleTriggerByTimeV2026R0TypeField = 'by_time'; +export type ShuttleJobScheduleTriggerByTimeV2026R0RepeatField = + 'none' | 'daily' | 'weekly' | 'weekdays' | 'weekends' | string; +export class ShuttleJobScheduleTriggerByTimeV2026R0 { + /** + * The value will always be `by_time`. */ + readonly type: ShuttleJobScheduleTriggerByTimeV2026R0TypeField = + 'by_time' as ShuttleJobScheduleTriggerByTimeV2026R0TypeField; + /** + * The local wall-clock time when the schedule should first start a + * run, without an offset or `Z` suffix. Combined with `time_zone` to + * determine the instant, including DST. */ + readonly startAt!: string; + /** + * The IANA time zone that gives `start_at` its calendar meaning (for + * example `America/Los_Angeles`). Recurrence and DST transitions are + * evaluated in this zone. */ + readonly timeZone!: string; + /** + * How often the schedule repeats after `start_at`. */ + readonly repeat!: ShuttleJobScheduleTriggerByTimeV2026R0RepeatField; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.startAt !== undefined) { + this.startAt = fields.startAt; + } + if (fields.timeZone !== undefined) { + this.timeZone = fields.timeZone; + } + if (fields.repeat !== undefined) { + this.repeat = fields.repeat; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleJobScheduleTriggerByTimeV2026R0Input { + /** + * The value will always be `by_time`. */ + readonly type?: ShuttleJobScheduleTriggerByTimeV2026R0TypeField; + /** + * The local wall-clock time when the schedule should first start a + * run, without an offset or `Z` suffix. Combined with `time_zone` to + * determine the instant, including DST. */ + readonly startAt: string; + /** + * The IANA time zone that gives `start_at` its calendar meaning (for + * example `America/Los_Angeles`). Recurrence and DST transitions are + * evaluated in this zone. */ + readonly timeZone: string; + /** + * How often the schedule repeats after `start_at`. */ + readonly repeat: ShuttleJobScheduleTriggerByTimeV2026R0RepeatField; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobScheduleTriggerByTimeV2026R0TypeField( + val: ShuttleJobScheduleTriggerByTimeV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleTriggerByTimeV2026R0TypeField( + val: SerializedData, +): ShuttleJobScheduleTriggerByTimeV2026R0TypeField { + if (val == 'by_time') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleJobScheduleTriggerByTimeV2026R0TypeField", + }); +} +export function serializeShuttleJobScheduleTriggerByTimeV2026R0RepeatField( + val: ShuttleJobScheduleTriggerByTimeV2026R0RepeatField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleTriggerByTimeV2026R0RepeatField( + val: SerializedData, +): ShuttleJobScheduleTriggerByTimeV2026R0RepeatField { + if (val == 'none') { + return val; + } + if (val == 'daily') { + return val; + } + if (val == 'weekly') { + return val; + } + if (val == 'weekdays') { + return val; + } + if (val == 'weekends') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleJobScheduleTriggerByTimeV2026R0RepeatField", + }); +} +export function serializeShuttleJobScheduleTriggerByTimeV2026R0( + val: ShuttleJobScheduleTriggerByTimeV2026R0, +): SerializedData { + return { + ['type']: serializeShuttleJobScheduleTriggerByTimeV2026R0TypeField( + val.type, + ), + ['start_at']: val.startAt, + ['time_zone']: val.timeZone, + ['repeat']: serializeShuttleJobScheduleTriggerByTimeV2026R0RepeatField( + val.repeat, + ), + }; +} +export function deserializeShuttleJobScheduleTriggerByTimeV2026R0( + val: SerializedData, +): ShuttleJobScheduleTriggerByTimeV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobScheduleTriggerByTimeV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleJobScheduleTriggerByTimeV2026R0" to be defined', + }); + } + const type: ShuttleJobScheduleTriggerByTimeV2026R0TypeField = + deserializeShuttleJobScheduleTriggerByTimeV2026R0TypeField(val.type); + if (val.start_at == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "start_at" of type "ShuttleJobScheduleTriggerByTimeV2026R0" to be defined', + }); + } + if (!sdIsString(val.start_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "start_at" of type "ShuttleJobScheduleTriggerByTimeV2026R0"', + }); + } + const startAt: string = val.start_at; + if (val.time_zone == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "time_zone" of type "ShuttleJobScheduleTriggerByTimeV2026R0" to be defined', + }); + } + if (!sdIsString(val.time_zone)) { + throw new BoxSdkError({ + message: + 'Expecting string for "time_zone" of type "ShuttleJobScheduleTriggerByTimeV2026R0"', + }); + } + const timeZone: string = val.time_zone; + if (val.repeat == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "repeat" of type "ShuttleJobScheduleTriggerByTimeV2026R0" to be defined', + }); + } + const repeat: ShuttleJobScheduleTriggerByTimeV2026R0RepeatField = + deserializeShuttleJobScheduleTriggerByTimeV2026R0RepeatField(val.repeat); + return { + type: type, + startAt: startAt, + timeZone: timeZone, + repeat: repeat, + } satisfies ShuttleJobScheduleTriggerByTimeV2026R0; +} +export function serializeShuttleJobScheduleTriggerByTimeV2026R0Input( + val: ShuttleJobScheduleTriggerByTimeV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleJobScheduleTriggerByTimeV2026R0TypeField(val.type), + ['start_at']: val.startAt, + ['time_zone']: val.timeZone, + ['repeat']: serializeShuttleJobScheduleTriggerByTimeV2026R0RepeatField( + val.repeat, + ), + }; +} +export function deserializeShuttleJobScheduleTriggerByTimeV2026R0Input( + val: SerializedData, +): ShuttleJobScheduleTriggerByTimeV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleJobScheduleTriggerByTimeV2026R0Input"', + }); + } + const type: undefined | ShuttleJobScheduleTriggerByTimeV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleJobScheduleTriggerByTimeV2026R0TypeField(val.type); + if (val.start_at == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "start_at" of type "ShuttleJobScheduleTriggerByTimeV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.start_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "start_at" of type "ShuttleJobScheduleTriggerByTimeV2026R0Input"', + }); + } + const startAt: string = val.start_at; + if (val.time_zone == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "time_zone" of type "ShuttleJobScheduleTriggerByTimeV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.time_zone)) { + throw new BoxSdkError({ + message: + 'Expecting string for "time_zone" of type "ShuttleJobScheduleTriggerByTimeV2026R0Input"', + }); + } + const timeZone: string = val.time_zone; + if (val.repeat == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "repeat" of type "ShuttleJobScheduleTriggerByTimeV2026R0Input" to be defined', + }); + } + const repeat: ShuttleJobScheduleTriggerByTimeV2026R0RepeatField = + deserializeShuttleJobScheduleTriggerByTimeV2026R0RepeatField(val.repeat); + return { + type: type, + startAt: startAt, + timeZone: timeZone, + repeat: repeat, + } satisfies ShuttleJobScheduleTriggerByTimeV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleJobScheduleTriggerV2026R0.ts b/src/schemas/v2026R0/shuttleJobScheduleTriggerV2026R0.ts new file mode 100644 index 00000000..c1e95056 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobScheduleTriggerV2026R0.ts @@ -0,0 +1,46 @@ +import { serializeShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { deserializeShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { serializeShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { deserializeShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { ShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { ShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobScheduleTriggerV2026R0 = + | ShuttleJobScheduleTriggerByTimeV2026R0 + | ShuttleJobScheduleTriggerByJobV2026R0; +export function serializeShuttleJobScheduleTriggerV2026R0( + val: any, +): SerializedData { + if (val.type == 'by_time') { + return serializeShuttleJobScheduleTriggerByTimeV2026R0(val); + } + if (val.type == 'by_job') { + return serializeShuttleJobScheduleTriggerByJobV2026R0(val); + } + throw new BoxSdkError({ message: 'unknown type' }); +} +export function deserializeShuttleJobScheduleTriggerV2026R0( + val: SerializedData, +): ShuttleJobScheduleTriggerV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobScheduleTriggerV2026R0"', + }); + } + if (val.type == 'by_time') { + return deserializeShuttleJobScheduleTriggerByTimeV2026R0(val); + } + if (val.type == 'by_job') { + return deserializeShuttleJobScheduleTriggerByJobV2026R0(val); + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobScheduleTriggerV2026R0", + }); +} diff --git a/src/schemas/v2026R0/shuttleJobScheduleUpdateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleJobScheduleUpdateRequestV2026R0.ts new file mode 100644 index 00000000..8dc70978 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobScheduleUpdateRequestV2026R0.ts @@ -0,0 +1,141 @@ +import { serializeShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { deserializeShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { serializeShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { deserializeShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { serializeShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { deserializeShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { ShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { ShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { ShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobScheduleUpdateRequestV2026R0StateField = + 'enabled' | 'paused' | string; +export type ShuttleJobScheduleUpdateRequestV2026R0RunModeField = + 'transfer' | 'simulation' | 'analysis' | string; +export interface ShuttleJobScheduleUpdateRequestV2026R0 { + /** + * Whether the schedule is active. */ + readonly state?: ShuttleJobScheduleUpdateRequestV2026R0StateField; + /** + * The kind of run the schedule starts. `scan` is not a valid schedule + * run mode. */ + readonly runMode?: ShuttleJobScheduleUpdateRequestV2026R0RunModeField; + /** + * An optional human-readable description of the schedule. */ + readonly description?: string | null; + readonly trigger?: ShuttleJobScheduleTriggerV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobScheduleUpdateRequestV2026R0StateField( + val: ShuttleJobScheduleUpdateRequestV2026R0StateField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleUpdateRequestV2026R0StateField( + val: SerializedData, +): ShuttleJobScheduleUpdateRequestV2026R0StateField { + if (val == 'enabled') { + return val; + } + if (val == 'paused') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleJobScheduleUpdateRequestV2026R0StateField", + }); +} +export function serializeShuttleJobScheduleUpdateRequestV2026R0RunModeField( + val: ShuttleJobScheduleUpdateRequestV2026R0RunModeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleUpdateRequestV2026R0RunModeField( + val: SerializedData, +): ShuttleJobScheduleUpdateRequestV2026R0RunModeField { + if (val == 'transfer') { + return val; + } + if (val == 'simulation') { + return val; + } + if (val == 'analysis') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleJobScheduleUpdateRequestV2026R0RunModeField", + }); +} +export function serializeShuttleJobScheduleUpdateRequestV2026R0( + val: ShuttleJobScheduleUpdateRequestV2026R0, +): SerializedData { + return { + ['state']: + val.state == void 0 + ? val.state + : serializeShuttleJobScheduleUpdateRequestV2026R0StateField(val.state), + ['run_mode']: + val.runMode == void 0 + ? val.runMode + : serializeShuttleJobScheduleUpdateRequestV2026R0RunModeField( + val.runMode, + ), + ['description']: val.description, + ['trigger']: + val.trigger == void 0 + ? val.trigger + : serializeShuttleJobScheduleTriggerV2026R0(val.trigger), + }; +} +export function deserializeShuttleJobScheduleUpdateRequestV2026R0( + val: SerializedData, +): ShuttleJobScheduleUpdateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobScheduleUpdateRequestV2026R0"', + }); + } + const state: undefined | ShuttleJobScheduleUpdateRequestV2026R0StateField = + val.state == void 0 + ? void 0 + : deserializeShuttleJobScheduleUpdateRequestV2026R0StateField(val.state); + const runMode: + undefined | ShuttleJobScheduleUpdateRequestV2026R0RunModeField = + val.run_mode == void 0 + ? void 0 + : deserializeShuttleJobScheduleUpdateRequestV2026R0RunModeField( + val.run_mode, + ); + if (!(val.description == void 0) && !sdIsString(val.description)) { + throw new BoxSdkError({ + message: + 'Expecting string for "description" of type "ShuttleJobScheduleUpdateRequestV2026R0"', + }); + } + const description: undefined | string = + val.description == void 0 ? void 0 : val.description; + const trigger: undefined | ShuttleJobScheduleTriggerV2026R0 = + val.trigger == void 0 + ? void 0 + : deserializeShuttleJobScheduleTriggerV2026R0(val.trigger); + return { + state: state, + runMode: runMode, + description: description, + trigger: trigger, + } satisfies ShuttleJobScheduleUpdateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleJobScheduleV2026R0.ts b/src/schemas/v2026R0/shuttleJobScheduleV2026R0.ts new file mode 100644 index 00000000..1a59e8e3 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobScheduleV2026R0.ts @@ -0,0 +1,393 @@ +import { serializeShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { deserializeShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { serializeShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { deserializeShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { serializeShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { deserializeShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { serializeDateTime } from '../../internal/utils'; +import { deserializeDateTime } from '../../internal/utils'; +import { ShuttleJobScheduleTriggerByTimeV2026R0 } from './shuttleJobScheduleTriggerByTimeV2026R0'; +import { ShuttleJobScheduleTriggerByJobV2026R0 } from './shuttleJobScheduleTriggerByJobV2026R0'; +import { ShuttleJobScheduleTriggerV2026R0 } from './shuttleJobScheduleTriggerV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { DateTime } from '../../internal/utils'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobScheduleV2026R0TypeField = 'shuttle_job_schedule'; +export type ShuttleJobScheduleV2026R0StateField = 'enabled' | 'paused' | string; +export type ShuttleJobScheduleV2026R0RunModeField = + 'transfer' | 'simulation' | 'analysis' | string; +export class ShuttleJobScheduleV2026R0 { + /** + * The unique identifier for the shuttle job schedule. */ + readonly id!: string; + /** + * The value will always be `shuttle_job_schedule`. */ + readonly type: ShuttleJobScheduleV2026R0TypeField = + 'shuttle_job_schedule' as ShuttleJobScheduleV2026R0TypeField; + /** + * The unique identifier of the shuttle job this schedule belongs to. */ + readonly jobId!: string; + /** + * Whether the schedule is active. */ + readonly state!: ShuttleJobScheduleV2026R0StateField; + /** + * The kind of run the schedule starts. `scan` is not a valid schedule + * run mode. */ + readonly runMode!: ShuttleJobScheduleV2026R0RunModeField; + /** + * An optional human-readable description of the schedule. */ + readonly description?: string | null; + /** + * When the schedule last attempted to start a run. `null` when the + * schedule has never started a run. */ + readonly lastAttemptAt?: DateTime | null; + readonly trigger!: ShuttleJobScheduleTriggerV2026R0; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.jobId !== undefined) { + this.jobId = fields.jobId; + } + if (fields.state !== undefined) { + this.state = fields.state; + } + if (fields.runMode !== undefined) { + this.runMode = fields.runMode; + } + if (fields.description !== undefined) { + this.description = fields.description; + } + if (fields.lastAttemptAt !== undefined) { + this.lastAttemptAt = fields.lastAttemptAt; + } + if (fields.trigger !== undefined) { + this.trigger = fields.trigger; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleJobScheduleV2026R0Input { + /** + * The unique identifier for the shuttle job schedule. */ + readonly id: string; + /** + * The value will always be `shuttle_job_schedule`. */ + readonly type?: ShuttleJobScheduleV2026R0TypeField; + /** + * The unique identifier of the shuttle job this schedule belongs to. */ + readonly jobId: string; + /** + * Whether the schedule is active. */ + readonly state: ShuttleJobScheduleV2026R0StateField; + /** + * The kind of run the schedule starts. `scan` is not a valid schedule + * run mode. */ + readonly runMode: ShuttleJobScheduleV2026R0RunModeField; + /** + * An optional human-readable description of the schedule. */ + readonly description?: string | null; + /** + * When the schedule last attempted to start a run. `null` when the + * schedule has never started a run. */ + readonly lastAttemptAt?: DateTime | null; + readonly trigger: ShuttleJobScheduleTriggerV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobScheduleV2026R0TypeField( + val: ShuttleJobScheduleV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleV2026R0TypeField( + val: SerializedData, +): ShuttleJobScheduleV2026R0TypeField { + if (val == 'shuttle_job_schedule') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobScheduleV2026R0TypeField", + }); +} +export function serializeShuttleJobScheduleV2026R0StateField( + val: ShuttleJobScheduleV2026R0StateField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleV2026R0StateField( + val: SerializedData, +): ShuttleJobScheduleV2026R0StateField { + if (val == 'enabled') { + return val; + } + if (val == 'paused') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobScheduleV2026R0StateField", + }); +} +export function serializeShuttleJobScheduleV2026R0RunModeField( + val: ShuttleJobScheduleV2026R0RunModeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobScheduleV2026R0RunModeField( + val: SerializedData, +): ShuttleJobScheduleV2026R0RunModeField { + if (val == 'transfer') { + return val; + } + if (val == 'simulation') { + return val; + } + if (val == 'analysis') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobScheduleV2026R0RunModeField", + }); +} +export function serializeShuttleJobScheduleV2026R0( + val: ShuttleJobScheduleV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleJobScheduleV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['state']: serializeShuttleJobScheduleV2026R0StateField(val.state), + ['run_mode']: serializeShuttleJobScheduleV2026R0RunModeField(val.runMode), + ['description']: val.description, + ['last_attempt_at']: + val.lastAttemptAt == void 0 + ? val.lastAttemptAt + : serializeDateTime(val.lastAttemptAt), + ['trigger']: serializeShuttleJobScheduleTriggerV2026R0(val.trigger), + }; +} +export function deserializeShuttleJobScheduleV2026R0( + val: SerializedData, +): ShuttleJobScheduleV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobScheduleV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleJobScheduleV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleJobScheduleV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleJobScheduleV2026R0" to be defined', + }); + } + const type: ShuttleJobScheduleV2026R0TypeField = + deserializeShuttleJobScheduleV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleJobScheduleV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleJobScheduleV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.state == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "state" of type "ShuttleJobScheduleV2026R0" to be defined', + }); + } + const state: ShuttleJobScheduleV2026R0StateField = + deserializeShuttleJobScheduleV2026R0StateField(val.state); + if (val.run_mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "run_mode" of type "ShuttleJobScheduleV2026R0" to be defined', + }); + } + const runMode: ShuttleJobScheduleV2026R0RunModeField = + deserializeShuttleJobScheduleV2026R0RunModeField(val.run_mode); + if (!(val.description == void 0) && !sdIsString(val.description)) { + throw new BoxSdkError({ + message: + 'Expecting string for "description" of type "ShuttleJobScheduleV2026R0"', + }); + } + const description: undefined | string = + val.description == void 0 ? void 0 : val.description; + if (!(val.last_attempt_at == void 0) && !sdIsString(val.last_attempt_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "last_attempt_at" of type "ShuttleJobScheduleV2026R0"', + }); + } + const lastAttemptAt: undefined | DateTime = + val.last_attempt_at == void 0 + ? void 0 + : deserializeDateTime(val.last_attempt_at); + if (val.trigger == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "trigger" of type "ShuttleJobScheduleV2026R0" to be defined', + }); + } + const trigger: ShuttleJobScheduleTriggerV2026R0 = + deserializeShuttleJobScheduleTriggerV2026R0(val.trigger); + return { + id: id, + type: type, + jobId: jobId, + state: state, + runMode: runMode, + description: description, + lastAttemptAt: lastAttemptAt, + trigger: trigger, + } satisfies ShuttleJobScheduleV2026R0; +} +export function serializeShuttleJobScheduleV2026R0Input( + val: ShuttleJobScheduleV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleJobScheduleV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['state']: serializeShuttleJobScheduleV2026R0StateField(val.state), + ['run_mode']: serializeShuttleJobScheduleV2026R0RunModeField(val.runMode), + ['description']: val.description, + ['last_attempt_at']: + val.lastAttemptAt == void 0 + ? val.lastAttemptAt + : serializeDateTime(val.lastAttemptAt), + ['trigger']: serializeShuttleJobScheduleTriggerV2026R0(val.trigger), + }; +} +export function deserializeShuttleJobScheduleV2026R0Input( + val: SerializedData, +): ShuttleJobScheduleV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobScheduleV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleJobScheduleV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleJobScheduleV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttleJobScheduleV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleJobScheduleV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleJobScheduleV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleJobScheduleV2026R0Input"', + }); + } + const jobId: string = val.job_id; + if (val.state == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "state" of type "ShuttleJobScheduleV2026R0Input" to be defined', + }); + } + const state: ShuttleJobScheduleV2026R0StateField = + deserializeShuttleJobScheduleV2026R0StateField(val.state); + if (val.run_mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "run_mode" of type "ShuttleJobScheduleV2026R0Input" to be defined', + }); + } + const runMode: ShuttleJobScheduleV2026R0RunModeField = + deserializeShuttleJobScheduleV2026R0RunModeField(val.run_mode); + if (!(val.description == void 0) && !sdIsString(val.description)) { + throw new BoxSdkError({ + message: + 'Expecting string for "description" of type "ShuttleJobScheduleV2026R0Input"', + }); + } + const description: undefined | string = + val.description == void 0 ? void 0 : val.description; + if (!(val.last_attempt_at == void 0) && !sdIsString(val.last_attempt_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "last_attempt_at" of type "ShuttleJobScheduleV2026R0Input"', + }); + } + const lastAttemptAt: undefined | DateTime = + val.last_attempt_at == void 0 + ? void 0 + : deserializeDateTime(val.last_attempt_at); + if (val.trigger == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "trigger" of type "ShuttleJobScheduleV2026R0Input" to be defined', + }); + } + const trigger: ShuttleJobScheduleTriggerV2026R0 = + deserializeShuttleJobScheduleTriggerV2026R0(val.trigger); + return { + id: id, + type: type, + jobId: jobId, + state: state, + runMode: runMode, + description: description, + lastAttemptAt: lastAttemptAt, + trigger: trigger, + } satisfies ShuttleJobScheduleV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleJobSchedulesV2026R0.ts b/src/schemas/v2026R0/shuttleJobSchedulesV2026R0.ts new file mode 100644 index 00000000..0bf396e2 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobSchedulesV2026R0.ts @@ -0,0 +1,99 @@ +import { serializeShuttleJobScheduleV2026R0 } from './shuttleJobScheduleV2026R0'; +import { deserializeShuttleJobScheduleV2026R0 } from './shuttleJobScheduleV2026R0'; +import { ShuttleJobScheduleV2026R0 } from './shuttleJobScheduleV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleJobSchedulesV2026R0 { + /** + * A list of shuttle job schedules. */ + readonly entries: readonly ShuttleJobScheduleV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobSchedulesV2026R0( + val: ShuttleJobSchedulesV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttleJobScheduleV2026R0, + ): SerializedData { + return serializeShuttleJobScheduleV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttleJobSchedulesV2026R0( + val: SerializedData, +): ShuttleJobSchedulesV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobSchedulesV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "entries" of type "ShuttleJobSchedulesV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: + 'Expecting array for "entries" of type "ShuttleJobSchedulesV2026R0"', + }); + } + const entries: readonly ShuttleJobScheduleV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function ( + itm: SerializedData, + ): ShuttleJobScheduleV2026R0 { + return deserializeShuttleJobScheduleV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: + 'Expecting number for "limit" of type "ShuttleJobSchedulesV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttleJobSchedulesV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttleJobSchedulesV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttleJobSchedulesV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleJobStartRequestV2026R0.ts b/src/schemas/v2026R0/shuttleJobStartRequestV2026R0.ts new file mode 100644 index 00000000..223619e5 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobStartRequestV2026R0.ts @@ -0,0 +1,67 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobStartRequestV2026R0ModeField = + 'transfer' | 'simulation' | 'scan' | 'analysis' | string; +export interface ShuttleJobStartRequestV2026R0 { + /** + * The run mode. Defaults to simulation when omitted. */ + readonly mode?: ShuttleJobStartRequestV2026R0ModeField; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobStartRequestV2026R0ModeField( + val: ShuttleJobStartRequestV2026R0ModeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobStartRequestV2026R0ModeField( + val: SerializedData, +): ShuttleJobStartRequestV2026R0ModeField { + if (val == 'transfer') { + return val; + } + if (val == 'simulation') { + return val; + } + if (val == 'scan') { + return val; + } + if (val == 'analysis') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobStartRequestV2026R0ModeField", + }); +} +export function serializeShuttleJobStartRequestV2026R0( + val: ShuttleJobStartRequestV2026R0, +): SerializedData { + return { + ['mode']: + val.mode == void 0 + ? val.mode + : serializeShuttleJobStartRequestV2026R0ModeField(val.mode), + }; +} +export function deserializeShuttleJobStartRequestV2026R0( + val: SerializedData, +): ShuttleJobStartRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobStartRequestV2026R0"', + }); + } + const mode: undefined | ShuttleJobStartRequestV2026R0ModeField = + val.mode == void 0 + ? void 0 + : deserializeShuttleJobStartRequestV2026R0ModeField(val.mode); + return { mode: mode } satisfies ShuttleJobStartRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleJobUpdateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleJobUpdateRequestV2026R0.ts new file mode 100644 index 00000000..056999c6 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobUpdateRequestV2026R0.ts @@ -0,0 +1,388 @@ +import { serializeShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { deserializeShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { ShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleJobUpdateRequestV2026R0AccountMappingField { + /** + * Whether account mapping is enabled for the shuttle job. */ + readonly isEnabled?: boolean; + /** + * The strategy used to resolve permission conflicts. `null` when + * unset. */ + readonly permissionConflictStrategy?: ShuttleJobPermissionConflictStrategyV2026R0; + /** + * Whether external shares are mapped during the migration. */ + readonly areExternalSharesMapped?: boolean; + /** + * Whether permissions are mapped during the migration. */ + readonly arePermissionsMapped?: boolean; + readonly rawData?: SerializedData; +} +export interface ShuttleJobUpdateRequestV2026R0SettingsField { + /** + * The maximum transfer bandwidth in bytes per second. `null` when + * unlimited. */ + readonly bandwidthLimitBytesPerSec?: number | null; + /** + * Whether deletions in the source system are mirrored in Box. */ + readonly areDeletionsMirrored?: boolean; + /** + * Whether prior file versions are synced during the migration. */ + readonly areFileVersionsSynced?: boolean; + /** + * The maximum number of file versions to sync. `null` when unlimited. */ + readonly maxFileVersions?: number | null; + /** + * Whether existing files in Box are overwritten. */ + readonly isOverwriteEnabled?: boolean; + /** + * Whether mappings that already completed successfully are skipped when + * the job is rerun. */ + readonly areCompletedMappingsSkippedOnRerun?: boolean; + /** + * Whether migrated content is scanned during the migration. Applies + * only when the source system supports content scanning; ignored + * otherwise. */ + readonly isContentScanningEnabled?: boolean; + /** + * Whether shared folders on the source are included in the migration. + * Applies only when the source system supports shared folders; ignored + * otherwise. */ + readonly includeSharedSourceFolders?: boolean; + /** + * Whether shared folders on the destination are included in the + * migration. Applies only when the destination system supports shared + * folders; ignored otherwise. */ + readonly includeSharedDestinationFolders?: boolean; + readonly rawData?: SerializedData; +} +export interface ShuttleJobUpdateRequestV2026R0 { + /** + * The human-readable name of the shuttle job. */ + readonly name?: string; + /** + * An optional free-form comment describing the shuttle job. */ + readonly comment?: string | null; + /** + * A list of free-form tags associated with the shuttle job. */ + readonly tags?: readonly string[]; + /** + * The account mapping configuration that controls how source identities + * and permissions are translated into Box. */ + readonly accountMapping?: ShuttleJobUpdateRequestV2026R0AccountMappingField; + /** + * The tunable settings that control how the shuttle job runs. */ + readonly settings?: ShuttleJobUpdateRequestV2026R0SettingsField; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobUpdateRequestV2026R0AccountMappingField( + val: ShuttleJobUpdateRequestV2026R0AccountMappingField, +): SerializedData { + return { + ['is_enabled']: val.isEnabled, + ['permission_conflict_strategy']: + val.permissionConflictStrategy == void 0 + ? val.permissionConflictStrategy + : serializeShuttleJobPermissionConflictStrategyV2026R0( + val.permissionConflictStrategy, + ), + ['are_external_shares_mapped']: val.areExternalSharesMapped, + ['are_permissions_mapped']: val.arePermissionsMapped, + }; +} +export function deserializeShuttleJobUpdateRequestV2026R0AccountMappingField( + val: SerializedData, +): ShuttleJobUpdateRequestV2026R0AccountMappingField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleJobUpdateRequestV2026R0AccountMappingField"', + }); + } + if (!(val.is_enabled == void 0) && !sdIsBoolean(val.is_enabled)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_enabled" of type "ShuttleJobUpdateRequestV2026R0AccountMappingField"', + }); + } + const isEnabled: undefined | boolean = + val.is_enabled == void 0 ? void 0 : val.is_enabled; + const permissionConflictStrategy: + ShuttleJobPermissionConflictStrategyV2026R0 | undefined = + val.permission_conflict_strategy == void 0 + ? void 0 + : deserializeShuttleJobPermissionConflictStrategyV2026R0( + val.permission_conflict_strategy, + ); + if ( + !(val.are_external_shares_mapped == void 0) && + !sdIsBoolean(val.are_external_shares_mapped) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_external_shares_mapped" of type "ShuttleJobUpdateRequestV2026R0AccountMappingField"', + }); + } + const areExternalSharesMapped: undefined | boolean = + val.are_external_shares_mapped == void 0 + ? void 0 + : val.are_external_shares_mapped; + if ( + !(val.are_permissions_mapped == void 0) && + !sdIsBoolean(val.are_permissions_mapped) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_permissions_mapped" of type "ShuttleJobUpdateRequestV2026R0AccountMappingField"', + }); + } + const arePermissionsMapped: undefined | boolean = + val.are_permissions_mapped == void 0 ? void 0 : val.are_permissions_mapped; + return { + isEnabled: isEnabled, + permissionConflictStrategy: permissionConflictStrategy, + areExternalSharesMapped: areExternalSharesMapped, + arePermissionsMapped: arePermissionsMapped, + } satisfies ShuttleJobUpdateRequestV2026R0AccountMappingField; +} +export function serializeShuttleJobUpdateRequestV2026R0SettingsField( + val: ShuttleJobUpdateRequestV2026R0SettingsField, +): SerializedData { + return { + ['bandwidth_limit_bytes_per_sec']: val.bandwidthLimitBytesPerSec, + ['are_deletions_mirrored']: val.areDeletionsMirrored, + ['are_file_versions_synced']: val.areFileVersionsSynced, + ['max_file_versions']: val.maxFileVersions, + ['is_overwrite_enabled']: val.isOverwriteEnabled, + ['are_completed_mappings_skipped_on_rerun']: + val.areCompletedMappingsSkippedOnRerun, + ['is_content_scanning_enabled']: val.isContentScanningEnabled, + ['include_shared_source_folders']: val.includeSharedSourceFolders, + ['include_shared_destination_folders']: val.includeSharedDestinationFolders, + }; +} +export function deserializeShuttleJobUpdateRequestV2026R0SettingsField( + val: SerializedData, +): ShuttleJobUpdateRequestV2026R0SettingsField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + if ( + !(val.bandwidth_limit_bytes_per_sec == void 0) && + !sdIsNumber(val.bandwidth_limit_bytes_per_sec) + ) { + throw new BoxSdkError({ + message: + 'Expecting number for "bandwidth_limit_bytes_per_sec" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const bandwidthLimitBytesPerSec: undefined | number = + val.bandwidth_limit_bytes_per_sec == void 0 + ? void 0 + : val.bandwidth_limit_bytes_per_sec; + if ( + !(val.are_deletions_mirrored == void 0) && + !sdIsBoolean(val.are_deletions_mirrored) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_deletions_mirrored" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const areDeletionsMirrored: undefined | boolean = + val.are_deletions_mirrored == void 0 ? void 0 : val.are_deletions_mirrored; + if ( + !(val.are_file_versions_synced == void 0) && + !sdIsBoolean(val.are_file_versions_synced) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_file_versions_synced" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const areFileVersionsSynced: undefined | boolean = + val.are_file_versions_synced == void 0 + ? void 0 + : val.are_file_versions_synced; + if ( + !(val.max_file_versions == void 0) && + !sdIsNumber(val.max_file_versions) + ) { + throw new BoxSdkError({ + message: + 'Expecting number for "max_file_versions" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const maxFileVersions: undefined | number = + val.max_file_versions == void 0 ? void 0 : val.max_file_versions; + if ( + !(val.is_overwrite_enabled == void 0) && + !sdIsBoolean(val.is_overwrite_enabled) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_overwrite_enabled" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const isOverwriteEnabled: undefined | boolean = + val.is_overwrite_enabled == void 0 ? void 0 : val.is_overwrite_enabled; + if ( + !(val.are_completed_mappings_skipped_on_rerun == void 0) && + !sdIsBoolean(val.are_completed_mappings_skipped_on_rerun) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_completed_mappings_skipped_on_rerun" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const areCompletedMappingsSkippedOnRerun: undefined | boolean = + val.are_completed_mappings_skipped_on_rerun == void 0 + ? void 0 + : val.are_completed_mappings_skipped_on_rerun; + if ( + !(val.is_content_scanning_enabled == void 0) && + !sdIsBoolean(val.is_content_scanning_enabled) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_content_scanning_enabled" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const isContentScanningEnabled: undefined | boolean = + val.is_content_scanning_enabled == void 0 + ? void 0 + : val.is_content_scanning_enabled; + if ( + !(val.include_shared_source_folders == void 0) && + !sdIsBoolean(val.include_shared_source_folders) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "include_shared_source_folders" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const includeSharedSourceFolders: undefined | boolean = + val.include_shared_source_folders == void 0 + ? void 0 + : val.include_shared_source_folders; + if ( + !(val.include_shared_destination_folders == void 0) && + !sdIsBoolean(val.include_shared_destination_folders) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "include_shared_destination_folders" of type "ShuttleJobUpdateRequestV2026R0SettingsField"', + }); + } + const includeSharedDestinationFolders: undefined | boolean = + val.include_shared_destination_folders == void 0 + ? void 0 + : val.include_shared_destination_folders; + return { + bandwidthLimitBytesPerSec: bandwidthLimitBytesPerSec, + areDeletionsMirrored: areDeletionsMirrored, + areFileVersionsSynced: areFileVersionsSynced, + maxFileVersions: maxFileVersions, + isOverwriteEnabled: isOverwriteEnabled, + areCompletedMappingsSkippedOnRerun: areCompletedMappingsSkippedOnRerun, + isContentScanningEnabled: isContentScanningEnabled, + includeSharedSourceFolders: includeSharedSourceFolders, + includeSharedDestinationFolders: includeSharedDestinationFolders, + } satisfies ShuttleJobUpdateRequestV2026R0SettingsField; +} +export function serializeShuttleJobUpdateRequestV2026R0( + val: ShuttleJobUpdateRequestV2026R0, +): SerializedData { + return { + ['name']: val.name, + ['comment']: val.comment, + ['tags']: + val.tags == void 0 + ? val.tags + : (val.tags.map(function (item: string): SerializedData { + return item; + }) as readonly any[]), + ['account_mapping']: + val.accountMapping == void 0 + ? val.accountMapping + : serializeShuttleJobUpdateRequestV2026R0AccountMappingField( + val.accountMapping, + ), + ['settings']: + val.settings == void 0 + ? val.settings + : serializeShuttleJobUpdateRequestV2026R0SettingsField(val.settings), + }; +} +export function deserializeShuttleJobUpdateRequestV2026R0( + val: SerializedData, +): ShuttleJobUpdateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobUpdateRequestV2026R0"', + }); + } + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleJobUpdateRequestV2026R0"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + if (!(val.comment == void 0) && !sdIsString(val.comment)) { + throw new BoxSdkError({ + message: + 'Expecting string for "comment" of type "ShuttleJobUpdateRequestV2026R0"', + }); + } + const comment: undefined | string = + val.comment == void 0 ? void 0 : val.comment; + if (!(val.tags == void 0) && !sdIsList(val.tags)) { + throw new BoxSdkError({ + message: + 'Expecting array for "tags" of type "ShuttleJobUpdateRequestV2026R0"', + }); + } + const tags: undefined | readonly string[] = + val.tags == void 0 + ? void 0 + : sdIsList(val.tags) + ? (val.tags.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: + 'Expecting string for "ShuttleJobUpdateRequestV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + const accountMapping: + undefined | ShuttleJobUpdateRequestV2026R0AccountMappingField = + val.account_mapping == void 0 + ? void 0 + : deserializeShuttleJobUpdateRequestV2026R0AccountMappingField( + val.account_mapping, + ); + const settings: undefined | ShuttleJobUpdateRequestV2026R0SettingsField = + val.settings == void 0 + ? void 0 + : deserializeShuttleJobUpdateRequestV2026R0SettingsField(val.settings); + return { + name: name, + comment: comment, + tags: tags, + accountMapping: accountMapping, + settings: settings, + } satisfies ShuttleJobUpdateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleJobV2026R0.ts b/src/schemas/v2026R0/shuttleJobV2026R0.ts new file mode 100644 index 00000000..3d07d185 --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobV2026R0.ts @@ -0,0 +1,957 @@ +import { serializeShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { deserializeShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { ShuttleJobPermissionConflictStrategyV2026R0 } from './shuttleJobPermissionConflictStrategyV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleJobV2026R0TypeField = 'shuttle_job'; +export type ShuttleJobV2026R0JobTypeField = 'transfer' | 'analysis' | string; +export type ShuttleJobV2026R0SourceSystemTypeField = 'shuttle_system'; +export class ShuttleJobV2026R0SourceSystemField { + /** + * The value will always be `shuttle_system`. */ + readonly type: ShuttleJobV2026R0SourceSystemTypeField = + 'shuttle_system' as ShuttleJobV2026R0SourceSystemTypeField; + /** + * The unique identifier for the source system. */ + readonly id!: string; + /** + * The human-readable name of the source system. */ + readonly name!: string; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.name !== undefined) { + this.name = fields.name; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleJobV2026R0SourceSystemFieldInput { + /** + * The value will always be `shuttle_system`. */ + readonly type?: ShuttleJobV2026R0SourceSystemTypeField; + /** + * The unique identifier for the source system. */ + readonly id: string; + /** + * The human-readable name of the source system. */ + readonly name: string; + readonly rawData?: SerializedData; +} +export interface ShuttleJobV2026R0AccountMappingField { + /** + * Whether account mapping is enabled for the shuttle job. */ + readonly isEnabled: boolean; + /** + * The strategy used to resolve permission conflicts. `null` when + * unset. */ + readonly permissionConflictStrategy?: ShuttleJobPermissionConflictStrategyV2026R0; + /** + * Whether external shares are mapped during the migration. */ + readonly areExternalSharesMapped?: boolean; + /** + * Whether permissions are mapped during the migration. */ + readonly arePermissionsMapped?: boolean; + readonly rawData?: SerializedData; +} +export interface ShuttleJobV2026R0SettingsField { + /** + * The maximum transfer bandwidth in bytes per second. `null` when + * unlimited. */ + readonly bandwidthLimitBytesPerSec?: number | null; + /** + * Whether deletions in the source system are mirrored in Box. */ + readonly areDeletionsMirrored?: boolean; + /** + * Whether prior file versions are synced during the migration. */ + readonly areFileVersionsSynced?: boolean; + /** + * The maximum number of file versions to sync. `null` when unlimited. */ + readonly maxFileVersions?: number | null; + /** + * Whether existing files in Box are overwritten. */ + readonly isOverwriteEnabled?: boolean; + /** + * Whether mappings that already completed successfully are skipped when + * the job is rerun. */ + readonly areCompletedMappingsSkippedOnRerun?: boolean; + /** + * Whether migrated content is scanned during the migration. Applies + * only when the source system supports content scanning; ignored + * otherwise. */ + readonly isContentScanningEnabled?: boolean; + /** + * Whether shared folders on the source are included in the migration. + * Applies only when the source system supports shared folders; ignored + * otherwise. */ + readonly includeSharedSourceFolders?: boolean; + /** + * Whether shared folders on the destination are included in the + * migration. Applies only when the destination system supports shared + * folders; ignored otherwise. */ + readonly includeSharedDestinationFolders?: boolean; + readonly rawData?: SerializedData; +} +export class ShuttleJobV2026R0 { + /** + * The unique identifier for the shuttle job. */ + readonly id!: string; + /** + * The value will always be `shuttle_job`. */ + readonly type: ShuttleJobV2026R0TypeField = + 'shuttle_job' as ShuttleJobV2026R0TypeField; + /** + * The human-readable name of the shuttle job. */ + readonly name!: string; + /** + * An optional free-form comment describing the shuttle job. */ + readonly comment?: string | null; + /** + * The type of work the shuttle job performs. */ + readonly jobType!: ShuttleJobV2026R0JobTypeField; + /** + * The current state of the shuttle job. This is an open string whose set + * of values is expected to grow; the currently documented values include + * `created`, `started`, `stopped`, `completed`, `failed`, `invalid`, and + * `unknown`. Clients should treat any value they do not recognize as + * `unknown`. */ + readonly state!: string; + /** + * The current mapping-preparation state of the job. This is an open string + * whose set of values is expected to grow; the currently documented values + * include `awaiting_path_mapping`, `importing_paths`, + * `paths_import_rejected`, `paths_invalid`, `paths_ready`, + * `scanning_source`, `source_scan_failed`, `source_scan_out_of_date`, + * `awaiting_subject_mapping`, `importing_subjects`, + * `subjects_import_rejected`, `mapping_complete`, `building_map`, + * `map_build_failed`, `map_out_of_date`, and `ready`. + * `paths_import_rejected` means the last path-mapping spreadsheet was + * rejected or failed and the path mappings have not been changed since; + * it clears on the next import or the next manual path-mapping change. + * `subjects_import_rejected` means the last subject-mapping spreadsheet + * was rejected or failed and the subject mappings have not been changed + * since; it clears on the next import or the next manual subject-mapping + * change. */ + readonly mappingState!: string; + /** + * The source system the shuttle job migrates content from. */ + readonly sourceSystem!: ShuttleJobV2026R0SourceSystemField; + /** + * The account mapping configuration that controls how source identities + * and permissions are translated into Box. */ + readonly accountMapping?: ShuttleJobV2026R0AccountMappingField; + /** + * A list of free-form tags associated with the shuttle job. */ + readonly tags?: readonly string[]; + /** + * The tunable settings that control how the shuttle job runs. */ + readonly settings?: ShuttleJobV2026R0SettingsField; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.name !== undefined) { + this.name = fields.name; + } + if (fields.comment !== undefined) { + this.comment = fields.comment; + } + if (fields.jobType !== undefined) { + this.jobType = fields.jobType; + } + if (fields.state !== undefined) { + this.state = fields.state; + } + if (fields.mappingState !== undefined) { + this.mappingState = fields.mappingState; + } + if (fields.sourceSystem !== undefined) { + this.sourceSystem = fields.sourceSystem; + } + if (fields.accountMapping !== undefined) { + this.accountMapping = fields.accountMapping; + } + if (fields.tags !== undefined) { + this.tags = fields.tags; + } + if (fields.settings !== undefined) { + this.settings = fields.settings; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleJobV2026R0Input { + /** + * The unique identifier for the shuttle job. */ + readonly id: string; + /** + * The value will always be `shuttle_job`. */ + readonly type?: ShuttleJobV2026R0TypeField; + /** + * The human-readable name of the shuttle job. */ + readonly name: string; + /** + * An optional free-form comment describing the shuttle job. */ + readonly comment?: string | null; + /** + * The type of work the shuttle job performs. */ + readonly jobType: ShuttleJobV2026R0JobTypeField; + /** + * The current state of the shuttle job. This is an open string whose set + * of values is expected to grow; the currently documented values include + * `created`, `started`, `stopped`, `completed`, `failed`, `invalid`, and + * `unknown`. Clients should treat any value they do not recognize as + * `unknown`. */ + readonly state: string; + /** + * The current mapping-preparation state of the job. This is an open string + * whose set of values is expected to grow; the currently documented values + * include `awaiting_path_mapping`, `importing_paths`, + * `paths_import_rejected`, `paths_invalid`, `paths_ready`, + * `scanning_source`, `source_scan_failed`, `source_scan_out_of_date`, + * `awaiting_subject_mapping`, `importing_subjects`, + * `subjects_import_rejected`, `mapping_complete`, `building_map`, + * `map_build_failed`, `map_out_of_date`, and `ready`. + * `paths_import_rejected` means the last path-mapping spreadsheet was + * rejected or failed and the path mappings have not been changed since; + * it clears on the next import or the next manual path-mapping change. + * `subjects_import_rejected` means the last subject-mapping spreadsheet + * was rejected or failed and the subject mappings have not been changed + * since; it clears on the next import or the next manual subject-mapping + * change. */ + readonly mappingState: string; + /** + * The source system the shuttle job migrates content from. */ + readonly sourceSystem: ShuttleJobV2026R0SourceSystemField; + /** + * The account mapping configuration that controls how source identities + * and permissions are translated into Box. */ + readonly accountMapping?: ShuttleJobV2026R0AccountMappingField; + /** + * A list of free-form tags associated with the shuttle job. */ + readonly tags?: readonly string[]; + /** + * The tunable settings that control how the shuttle job runs. */ + readonly settings?: ShuttleJobV2026R0SettingsField; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobV2026R0TypeField( + val: ShuttleJobV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobV2026R0TypeField( + val: SerializedData, +): ShuttleJobV2026R0TypeField { + if (val == 'shuttle_job') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobV2026R0TypeField", + }); +} +export function serializeShuttleJobV2026R0JobTypeField( + val: ShuttleJobV2026R0JobTypeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobV2026R0JobTypeField( + val: SerializedData, +): ShuttleJobV2026R0JobTypeField { + if (val == 'transfer') { + return val; + } + if (val == 'analysis') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobV2026R0JobTypeField", + }); +} +export function serializeShuttleJobV2026R0SourceSystemTypeField( + val: ShuttleJobV2026R0SourceSystemTypeField, +): SerializedData { + return val; +} +export function deserializeShuttleJobV2026R0SourceSystemTypeField( + val: SerializedData, +): ShuttleJobV2026R0SourceSystemTypeField { + if (val == 'shuttle_system') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleJobV2026R0SourceSystemTypeField", + }); +} +export function serializeShuttleJobV2026R0SourceSystemField( + val: ShuttleJobV2026R0SourceSystemField, +): SerializedData { + return { + ['type']: serializeShuttleJobV2026R0SourceSystemTypeField(val.type), + ['id']: val.id, + ['name']: val.name, + }; +} +export function deserializeShuttleJobV2026R0SourceSystemField( + val: SerializedData, +): ShuttleJobV2026R0SourceSystemField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobV2026R0SourceSystemField"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleJobV2026R0SourceSystemField" to be defined', + }); + } + const type: ShuttleJobV2026R0SourceSystemTypeField = + deserializeShuttleJobV2026R0SourceSystemTypeField(val.type); + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleJobV2026R0SourceSystemField" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleJobV2026R0SourceSystemField"', + }); + } + const id: string = val.id; + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttleJobV2026R0SourceSystemField" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleJobV2026R0SourceSystemField"', + }); + } + const name: string = val.name; + return { + type: type, + id: id, + name: name, + } satisfies ShuttleJobV2026R0SourceSystemField; +} +export function serializeShuttleJobV2026R0SourceSystemFieldInput( + val: ShuttleJobV2026R0SourceSystemFieldInput, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleJobV2026R0SourceSystemTypeField(val.type), + ['id']: val.id, + ['name']: val.name, + }; +} +export function deserializeShuttleJobV2026R0SourceSystemFieldInput( + val: SerializedData, +): ShuttleJobV2026R0SourceSystemFieldInput { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobV2026R0SourceSystemFieldInput"', + }); + } + const type: undefined | ShuttleJobV2026R0SourceSystemTypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleJobV2026R0SourceSystemTypeField(val.type); + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleJobV2026R0SourceSystemFieldInput" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleJobV2026R0SourceSystemFieldInput"', + }); + } + const id: string = val.id; + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttleJobV2026R0SourceSystemFieldInput" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleJobV2026R0SourceSystemFieldInput"', + }); + } + const name: string = val.name; + return { + type: type, + id: id, + name: name, + } satisfies ShuttleJobV2026R0SourceSystemFieldInput; +} +export function serializeShuttleJobV2026R0AccountMappingField( + val: ShuttleJobV2026R0AccountMappingField, +): SerializedData { + return { + ['is_enabled']: val.isEnabled, + ['permission_conflict_strategy']: + val.permissionConflictStrategy == void 0 + ? val.permissionConflictStrategy + : serializeShuttleJobPermissionConflictStrategyV2026R0( + val.permissionConflictStrategy, + ), + ['are_external_shares_mapped']: val.areExternalSharesMapped, + ['are_permissions_mapped']: val.arePermissionsMapped, + }; +} +export function deserializeShuttleJobV2026R0AccountMappingField( + val: SerializedData, +): ShuttleJobV2026R0AccountMappingField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobV2026R0AccountMappingField"', + }); + } + if (val.is_enabled == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "is_enabled" of type "ShuttleJobV2026R0AccountMappingField" to be defined', + }); + } + if (!sdIsBoolean(val.is_enabled)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_enabled" of type "ShuttleJobV2026R0AccountMappingField"', + }); + } + const isEnabled: boolean = val.is_enabled; + const permissionConflictStrategy: + ShuttleJobPermissionConflictStrategyV2026R0 | undefined = + val.permission_conflict_strategy == void 0 + ? void 0 + : deserializeShuttleJobPermissionConflictStrategyV2026R0( + val.permission_conflict_strategy, + ); + if ( + !(val.are_external_shares_mapped == void 0) && + !sdIsBoolean(val.are_external_shares_mapped) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_external_shares_mapped" of type "ShuttleJobV2026R0AccountMappingField"', + }); + } + const areExternalSharesMapped: undefined | boolean = + val.are_external_shares_mapped == void 0 + ? void 0 + : val.are_external_shares_mapped; + if ( + !(val.are_permissions_mapped == void 0) && + !sdIsBoolean(val.are_permissions_mapped) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_permissions_mapped" of type "ShuttleJobV2026R0AccountMappingField"', + }); + } + const arePermissionsMapped: undefined | boolean = + val.are_permissions_mapped == void 0 ? void 0 : val.are_permissions_mapped; + return { + isEnabled: isEnabled, + permissionConflictStrategy: permissionConflictStrategy, + areExternalSharesMapped: areExternalSharesMapped, + arePermissionsMapped: arePermissionsMapped, + } satisfies ShuttleJobV2026R0AccountMappingField; +} +export function serializeShuttleJobV2026R0SettingsField( + val: ShuttleJobV2026R0SettingsField, +): SerializedData { + return { + ['bandwidth_limit_bytes_per_sec']: val.bandwidthLimitBytesPerSec, + ['are_deletions_mirrored']: val.areDeletionsMirrored, + ['are_file_versions_synced']: val.areFileVersionsSynced, + ['max_file_versions']: val.maxFileVersions, + ['is_overwrite_enabled']: val.isOverwriteEnabled, + ['are_completed_mappings_skipped_on_rerun']: + val.areCompletedMappingsSkippedOnRerun, + ['is_content_scanning_enabled']: val.isContentScanningEnabled, + ['include_shared_source_folders']: val.includeSharedSourceFolders, + ['include_shared_destination_folders']: val.includeSharedDestinationFolders, + }; +} +export function deserializeShuttleJobV2026R0SettingsField( + val: SerializedData, +): ShuttleJobV2026R0SettingsField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobV2026R0SettingsField"', + }); + } + if ( + !(val.bandwidth_limit_bytes_per_sec == void 0) && + !sdIsNumber(val.bandwidth_limit_bytes_per_sec) + ) { + throw new BoxSdkError({ + message: + 'Expecting number for "bandwidth_limit_bytes_per_sec" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const bandwidthLimitBytesPerSec: undefined | number = + val.bandwidth_limit_bytes_per_sec == void 0 + ? void 0 + : val.bandwidth_limit_bytes_per_sec; + if ( + !(val.are_deletions_mirrored == void 0) && + !sdIsBoolean(val.are_deletions_mirrored) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_deletions_mirrored" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const areDeletionsMirrored: undefined | boolean = + val.are_deletions_mirrored == void 0 ? void 0 : val.are_deletions_mirrored; + if ( + !(val.are_file_versions_synced == void 0) && + !sdIsBoolean(val.are_file_versions_synced) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_file_versions_synced" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const areFileVersionsSynced: undefined | boolean = + val.are_file_versions_synced == void 0 + ? void 0 + : val.are_file_versions_synced; + if ( + !(val.max_file_versions == void 0) && + !sdIsNumber(val.max_file_versions) + ) { + throw new BoxSdkError({ + message: + 'Expecting number for "max_file_versions" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const maxFileVersions: undefined | number = + val.max_file_versions == void 0 ? void 0 : val.max_file_versions; + if ( + !(val.is_overwrite_enabled == void 0) && + !sdIsBoolean(val.is_overwrite_enabled) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_overwrite_enabled" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const isOverwriteEnabled: undefined | boolean = + val.is_overwrite_enabled == void 0 ? void 0 : val.is_overwrite_enabled; + if ( + !(val.are_completed_mappings_skipped_on_rerun == void 0) && + !sdIsBoolean(val.are_completed_mappings_skipped_on_rerun) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "are_completed_mappings_skipped_on_rerun" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const areCompletedMappingsSkippedOnRerun: undefined | boolean = + val.are_completed_mappings_skipped_on_rerun == void 0 + ? void 0 + : val.are_completed_mappings_skipped_on_rerun; + if ( + !(val.is_content_scanning_enabled == void 0) && + !sdIsBoolean(val.is_content_scanning_enabled) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_content_scanning_enabled" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const isContentScanningEnabled: undefined | boolean = + val.is_content_scanning_enabled == void 0 + ? void 0 + : val.is_content_scanning_enabled; + if ( + !(val.include_shared_source_folders == void 0) && + !sdIsBoolean(val.include_shared_source_folders) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "include_shared_source_folders" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const includeSharedSourceFolders: undefined | boolean = + val.include_shared_source_folders == void 0 + ? void 0 + : val.include_shared_source_folders; + if ( + !(val.include_shared_destination_folders == void 0) && + !sdIsBoolean(val.include_shared_destination_folders) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "include_shared_destination_folders" of type "ShuttleJobV2026R0SettingsField"', + }); + } + const includeSharedDestinationFolders: undefined | boolean = + val.include_shared_destination_folders == void 0 + ? void 0 + : val.include_shared_destination_folders; + return { + bandwidthLimitBytesPerSec: bandwidthLimitBytesPerSec, + areDeletionsMirrored: areDeletionsMirrored, + areFileVersionsSynced: areFileVersionsSynced, + maxFileVersions: maxFileVersions, + isOverwriteEnabled: isOverwriteEnabled, + areCompletedMappingsSkippedOnRerun: areCompletedMappingsSkippedOnRerun, + isContentScanningEnabled: isContentScanningEnabled, + includeSharedSourceFolders: includeSharedSourceFolders, + includeSharedDestinationFolders: includeSharedDestinationFolders, + } satisfies ShuttleJobV2026R0SettingsField; +} +export function serializeShuttleJobV2026R0( + val: ShuttleJobV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleJobV2026R0TypeField(val.type), + ['name']: val.name, + ['comment']: val.comment, + ['job_type']: serializeShuttleJobV2026R0JobTypeField(val.jobType), + ['state']: val.state, + ['mapping_state']: val.mappingState, + ['source_system']: serializeShuttleJobV2026R0SourceSystemField( + val.sourceSystem, + ), + ['account_mapping']: + val.accountMapping == void 0 + ? val.accountMapping + : serializeShuttleJobV2026R0AccountMappingField(val.accountMapping), + ['tags']: + val.tags == void 0 + ? val.tags + : (val.tags.map(function (item: string): SerializedData { + return item; + }) as readonly any[]), + ['settings']: + val.settings == void 0 + ? val.settings + : serializeShuttleJobV2026R0SettingsField(val.settings), + }; +} +export function deserializeShuttleJobV2026R0( + val: SerializedData, +): ShuttleJobV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "ShuttleJobV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleJobV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "ShuttleJobV2026R0" to be defined', + }); + } + const type: ShuttleJobV2026R0TypeField = + deserializeShuttleJobV2026R0TypeField(val.type); + if (val.name == void 0) { + throw new BoxSdkError({ + message: 'Expecting "name" of type "ShuttleJobV2026R0" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: 'Expecting string for "name" of type "ShuttleJobV2026R0"', + }); + } + const name: string = val.name; + if (!(val.comment == void 0) && !sdIsString(val.comment)) { + throw new BoxSdkError({ + message: 'Expecting string for "comment" of type "ShuttleJobV2026R0"', + }); + } + const comment: undefined | string = + val.comment == void 0 ? void 0 : val.comment; + if (val.job_type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "job_type" of type "ShuttleJobV2026R0" to be defined', + }); + } + const jobType: ShuttleJobV2026R0JobTypeField = + deserializeShuttleJobV2026R0JobTypeField(val.job_type); + if (val.state == void 0) { + throw new BoxSdkError({ + message: 'Expecting "state" of type "ShuttleJobV2026R0" to be defined', + }); + } + if (!sdIsString(val.state)) { + throw new BoxSdkError({ + message: 'Expecting string for "state" of type "ShuttleJobV2026R0"', + }); + } + const state: string = val.state; + if (val.mapping_state == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mapping_state" of type "ShuttleJobV2026R0" to be defined', + }); + } + if (!sdIsString(val.mapping_state)) { + throw new BoxSdkError({ + message: + 'Expecting string for "mapping_state" of type "ShuttleJobV2026R0"', + }); + } + const mappingState: string = val.mapping_state; + if (val.source_system == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source_system" of type "ShuttleJobV2026R0" to be defined', + }); + } + const sourceSystem: ShuttleJobV2026R0SourceSystemField = + deserializeShuttleJobV2026R0SourceSystemField(val.source_system); + const accountMapping: undefined | ShuttleJobV2026R0AccountMappingField = + val.account_mapping == void 0 + ? void 0 + : deserializeShuttleJobV2026R0AccountMappingField(val.account_mapping); + if (!(val.tags == void 0) && !sdIsList(val.tags)) { + throw new BoxSdkError({ + message: 'Expecting array for "tags" of type "ShuttleJobV2026R0"', + }); + } + const tags: undefined | readonly string[] = + val.tags == void 0 + ? void 0 + : sdIsList(val.tags) + ? (val.tags.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleJobV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + const settings: undefined | ShuttleJobV2026R0SettingsField = + val.settings == void 0 + ? void 0 + : deserializeShuttleJobV2026R0SettingsField(val.settings); + return { + id: id, + type: type, + name: name, + comment: comment, + jobType: jobType, + state: state, + mappingState: mappingState, + sourceSystem: sourceSystem, + accountMapping: accountMapping, + tags: tags, + settings: settings, + } satisfies ShuttleJobV2026R0; +} +export function serializeShuttleJobV2026R0Input( + val: ShuttleJobV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleJobV2026R0TypeField(val.type), + ['name']: val.name, + ['comment']: val.comment, + ['job_type']: serializeShuttleJobV2026R0JobTypeField(val.jobType), + ['state']: val.state, + ['mapping_state']: val.mappingState, + ['source_system']: serializeShuttleJobV2026R0SourceSystemField( + val.sourceSystem, + ), + ['account_mapping']: + val.accountMapping == void 0 + ? val.accountMapping + : serializeShuttleJobV2026R0AccountMappingField(val.accountMapping), + ['tags']: + val.tags == void 0 + ? val.tags + : (val.tags.map(function (item: string): SerializedData { + return item; + }) as readonly any[]), + ['settings']: + val.settings == void 0 + ? val.settings + : serializeShuttleJobV2026R0SettingsField(val.settings), + }; +} +export function deserializeShuttleJobV2026R0Input( + val: SerializedData, +): ShuttleJobV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "ShuttleJobV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleJobV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttleJobV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleJobV2026R0TypeField(val.type); + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttleJobV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: 'Expecting string for "name" of type "ShuttleJobV2026R0Input"', + }); + } + const name: string = val.name; + if (!(val.comment == void 0) && !sdIsString(val.comment)) { + throw new BoxSdkError({ + message: + 'Expecting string for "comment" of type "ShuttleJobV2026R0Input"', + }); + } + const comment: undefined | string = + val.comment == void 0 ? void 0 : val.comment; + if (val.job_type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_type" of type "ShuttleJobV2026R0Input" to be defined', + }); + } + const jobType: ShuttleJobV2026R0JobTypeField = + deserializeShuttleJobV2026R0JobTypeField(val.job_type); + if (val.state == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "state" of type "ShuttleJobV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.state)) { + throw new BoxSdkError({ + message: 'Expecting string for "state" of type "ShuttleJobV2026R0Input"', + }); + } + const state: string = val.state; + if (val.mapping_state == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "mapping_state" of type "ShuttleJobV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.mapping_state)) { + throw new BoxSdkError({ + message: + 'Expecting string for "mapping_state" of type "ShuttleJobV2026R0Input"', + }); + } + const mappingState: string = val.mapping_state; + if (val.source_system == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source_system" of type "ShuttleJobV2026R0Input" to be defined', + }); + } + const sourceSystem: ShuttleJobV2026R0SourceSystemField = + deserializeShuttleJobV2026R0SourceSystemField(val.source_system); + const accountMapping: undefined | ShuttleJobV2026R0AccountMappingField = + val.account_mapping == void 0 + ? void 0 + : deserializeShuttleJobV2026R0AccountMappingField(val.account_mapping); + if (!(val.tags == void 0) && !sdIsList(val.tags)) { + throw new BoxSdkError({ + message: 'Expecting array for "tags" of type "ShuttleJobV2026R0Input"', + }); + } + const tags: undefined | readonly string[] = + val.tags == void 0 + ? void 0 + : sdIsList(val.tags) + ? (val.tags.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleJobV2026R0Input"', + }); + } + return itm; + }) as readonly any[]) + : []; + const settings: undefined | ShuttleJobV2026R0SettingsField = + val.settings == void 0 + ? void 0 + : deserializeShuttleJobV2026R0SettingsField(val.settings); + return { + id: id, + type: type, + name: name, + comment: comment, + jobType: jobType, + state: state, + mappingState: mappingState, + sourceSystem: sourceSystem, + accountMapping: accountMapping, + tags: tags, + settings: settings, + } satisfies ShuttleJobV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleJobsV2026R0.ts b/src/schemas/v2026R0/shuttleJobsV2026R0.ts new file mode 100644 index 00000000..7af118fb --- /dev/null +++ b/src/schemas/v2026R0/shuttleJobsV2026R0.ts @@ -0,0 +1,94 @@ +import { serializeShuttleJobV2026R0 } from './shuttleJobV2026R0'; +import { deserializeShuttleJobV2026R0 } from './shuttleJobV2026R0'; +import { ShuttleJobV2026R0 } from './shuttleJobV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleJobsV2026R0 { + /** + * A list of shuttle jobs. */ + readonly entries: readonly ShuttleJobV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleJobsV2026R0( + val: ShuttleJobsV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttleJobV2026R0, + ): SerializedData { + return serializeShuttleJobV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttleJobsV2026R0( + val: SerializedData, +): ShuttleJobsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleJobsV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: 'Expecting "entries" of type "ShuttleJobsV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: 'Expecting array for "entries" of type "ShuttleJobsV2026R0"', + }); + } + const entries: readonly ShuttleJobV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function (itm: SerializedData): ShuttleJobV2026R0 { + return deserializeShuttleJobV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: 'Expecting number for "limit" of type "ShuttleJobsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttleJobsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttleJobsV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttleJobsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleMappingErrorV2026R0.ts b/src/schemas/v2026R0/shuttleMappingErrorV2026R0.ts new file mode 100644 index 00000000..1d4ac6aa --- /dev/null +++ b/src/schemas/v2026R0/shuttleMappingErrorV2026R0.ts @@ -0,0 +1,358 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleMappingErrorV2026R0TypeField = 'shuttle_mapping_error'; +export class ShuttleMappingErrorV2026R0 { + /** + * The unique identifier for the mapping error. */ + readonly id!: string; + /** + * The value will always be `shuttle_mapping_error`. */ + readonly type: ShuttleMappingErrorV2026R0TypeField = + 'shuttle_mapping_error' as ShuttleMappingErrorV2026R0TypeField; + /** + * The unique identifier of the shuttle job this error belongs to. */ + readonly jobId!: string; + /** + * The mapping revision this error belongs to. */ + readonly revision!: number; + /** + * The category of mapping work that produced the error. This is an open + * string whose set of values can grow. */ + readonly category!: string; + /** + * The path or subject that the mapping error refers to. */ + readonly path!: string; + /** + * Human-readable messages describing the mapping error. */ + readonly messages!: readonly string[]; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.jobId !== undefined) { + this.jobId = fields.jobId; + } + if (fields.revision !== undefined) { + this.revision = fields.revision; + } + if (fields.category !== undefined) { + this.category = fields.category; + } + if (fields.path !== undefined) { + this.path = fields.path; + } + if (fields.messages !== undefined) { + this.messages = fields.messages; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleMappingErrorV2026R0Input { + /** + * The unique identifier for the mapping error. */ + readonly id: string; + /** + * The value will always be `shuttle_mapping_error`. */ + readonly type?: ShuttleMappingErrorV2026R0TypeField; + /** + * The unique identifier of the shuttle job this error belongs to. */ + readonly jobId: string; + /** + * The mapping revision this error belongs to. */ + readonly revision: number; + /** + * The category of mapping work that produced the error. This is an open + * string whose set of values can grow. */ + readonly category: string; + /** + * The path or subject that the mapping error refers to. */ + readonly path: string; + /** + * Human-readable messages describing the mapping error. */ + readonly messages: readonly string[]; + readonly rawData?: SerializedData; +} +export function serializeShuttleMappingErrorV2026R0TypeField( + val: ShuttleMappingErrorV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleMappingErrorV2026R0TypeField( + val: SerializedData, +): ShuttleMappingErrorV2026R0TypeField { + if (val == 'shuttle_mapping_error') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleMappingErrorV2026R0TypeField", + }); +} +export function serializeShuttleMappingErrorV2026R0( + val: ShuttleMappingErrorV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleMappingErrorV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['revision']: val.revision, + ['category']: val.category, + ['path']: val.path, + ['messages']: val.messages.map(function (item: string): SerializedData { + return item; + }) as readonly any[], + }; +} +export function deserializeShuttleMappingErrorV2026R0( + val: SerializedData, +): ShuttleMappingErrorV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleMappingErrorV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleMappingErrorV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleMappingErrorV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleMappingErrorV2026R0" to be defined', + }); + } + const type: ShuttleMappingErrorV2026R0TypeField = + deserializeShuttleMappingErrorV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleMappingErrorV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleMappingErrorV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.revision == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "revision" of type "ShuttleMappingErrorV2026R0" to be defined', + }); + } + if (!sdIsNumber(val.revision)) { + throw new BoxSdkError({ + message: + 'Expecting number for "revision" of type "ShuttleMappingErrorV2026R0"', + }); + } + const revision: number = val.revision; + if (val.category == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "category" of type "ShuttleMappingErrorV2026R0" to be defined', + }); + } + if (!sdIsString(val.category)) { + throw new BoxSdkError({ + message: + 'Expecting string for "category" of type "ShuttleMappingErrorV2026R0"', + }); + } + const category: string = val.category; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttleMappingErrorV2026R0" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttleMappingErrorV2026R0"', + }); + } + const path: string = val.path; + if (val.messages == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "messages" of type "ShuttleMappingErrorV2026R0" to be defined', + }); + } + if (!sdIsList(val.messages)) { + throw new BoxSdkError({ + message: + 'Expecting array for "messages" of type "ShuttleMappingErrorV2026R0"', + }); + } + const messages: readonly string[] = sdIsList(val.messages) + ? (val.messages.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleMappingErrorV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + return { + id: id, + type: type, + jobId: jobId, + revision: revision, + category: category, + path: path, + messages: messages, + } satisfies ShuttleMappingErrorV2026R0; +} +export function serializeShuttleMappingErrorV2026R0Input( + val: ShuttleMappingErrorV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleMappingErrorV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['revision']: val.revision, + ['category']: val.category, + ['path']: val.path, + ['messages']: val.messages.map(function (item: string): SerializedData { + return item; + }) as readonly any[], + }; +} +export function deserializeShuttleMappingErrorV2026R0Input( + val: SerializedData, +): ShuttleMappingErrorV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleMappingErrorV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleMappingErrorV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleMappingErrorV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttleMappingErrorV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleMappingErrorV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleMappingErrorV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleMappingErrorV2026R0Input"', + }); + } + const jobId: string = val.job_id; + if (val.revision == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "revision" of type "ShuttleMappingErrorV2026R0Input" to be defined', + }); + } + if (!sdIsNumber(val.revision)) { + throw new BoxSdkError({ + message: + 'Expecting number for "revision" of type "ShuttleMappingErrorV2026R0Input"', + }); + } + const revision: number = val.revision; + if (val.category == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "category" of type "ShuttleMappingErrorV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.category)) { + throw new BoxSdkError({ + message: + 'Expecting string for "category" of type "ShuttleMappingErrorV2026R0Input"', + }); + } + const category: string = val.category; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttleMappingErrorV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttleMappingErrorV2026R0Input"', + }); + } + const path: string = val.path; + if (val.messages == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "messages" of type "ShuttleMappingErrorV2026R0Input" to be defined', + }); + } + if (!sdIsList(val.messages)) { + throw new BoxSdkError({ + message: + 'Expecting array for "messages" of type "ShuttleMappingErrorV2026R0Input"', + }); + } + const messages: readonly string[] = sdIsList(val.messages) + ? (val.messages.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleMappingErrorV2026R0Input"', + }); + } + return itm; + }) as readonly any[]) + : []; + return { + id: id, + type: type, + jobId: jobId, + revision: revision, + category: category, + path: path, + messages: messages, + } satisfies ShuttleMappingErrorV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleMappingErrorsV2026R0.ts b/src/schemas/v2026R0/shuttleMappingErrorsV2026R0.ts new file mode 100644 index 00000000..c52c3768 --- /dev/null +++ b/src/schemas/v2026R0/shuttleMappingErrorsV2026R0.ts @@ -0,0 +1,99 @@ +import { serializeShuttleMappingErrorV2026R0 } from './shuttleMappingErrorV2026R0'; +import { deserializeShuttleMappingErrorV2026R0 } from './shuttleMappingErrorV2026R0'; +import { ShuttleMappingErrorV2026R0 } from './shuttleMappingErrorV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleMappingErrorsV2026R0 { + /** + * A list of shuttle mapping errors. */ + readonly entries: readonly ShuttleMappingErrorV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleMappingErrorsV2026R0( + val: ShuttleMappingErrorsV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttleMappingErrorV2026R0, + ): SerializedData { + return serializeShuttleMappingErrorV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttleMappingErrorsV2026R0( + val: SerializedData, +): ShuttleMappingErrorsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleMappingErrorsV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "entries" of type "ShuttleMappingErrorsV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: + 'Expecting array for "entries" of type "ShuttleMappingErrorsV2026R0"', + }); + } + const entries: readonly ShuttleMappingErrorV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function ( + itm: SerializedData, + ): ShuttleMappingErrorV2026R0 { + return deserializeShuttleMappingErrorV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: + 'Expecting number for "limit" of type "ShuttleMappingErrorsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttleMappingErrorsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttleMappingErrorsV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttleMappingErrorsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttlePathEntriesV2026R0.ts b/src/schemas/v2026R0/shuttlePathEntriesV2026R0.ts new file mode 100644 index 00000000..b974ce72 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathEntriesV2026R0.ts @@ -0,0 +1,97 @@ +import { serializeShuttlePathEntryV2026R0 } from './shuttlePathEntryV2026R0'; +import { deserializeShuttlePathEntryV2026R0 } from './shuttlePathEntryV2026R0'; +import { ShuttlePathEntryV2026R0 } from './shuttlePathEntryV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttlePathEntriesV2026R0 { + /** + * A list of shuttle path entries. */ + readonly entries: readonly ShuttlePathEntryV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathEntriesV2026R0( + val: ShuttlePathEntriesV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttlePathEntryV2026R0, + ): SerializedData { + return serializeShuttlePathEntryV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttlePathEntriesV2026R0( + val: SerializedData, +): ShuttlePathEntriesV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathEntriesV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "entries" of type "ShuttlePathEntriesV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: + 'Expecting array for "entries" of type "ShuttlePathEntriesV2026R0"', + }); + } + const entries: readonly ShuttlePathEntryV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function (itm: SerializedData): ShuttlePathEntryV2026R0 { + return deserializeShuttlePathEntryV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: + 'Expecting number for "limit" of type "ShuttlePathEntriesV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttlePathEntriesV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttlePathEntriesV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttlePathEntriesV2026R0; +} diff --git a/src/schemas/v2026R0/shuttlePathEntryAccountScopeV2026R0.ts b/src/schemas/v2026R0/shuttlePathEntryAccountScopeV2026R0.ts new file mode 100644 index 00000000..bea71d00 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathEntryAccountScopeV2026R0.ts @@ -0,0 +1,198 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathEntryAccountScopeV2026R0TypeField = 'account'; +export class ShuttlePathEntryAccountScopeV2026R0 { + /** + * The value will always be `account`. */ + readonly type: ShuttlePathEntryAccountScopeV2026R0TypeField = + 'account' as ShuttlePathEntryAccountScopeV2026R0TypeField; + /** + * The platform-native identifier of the account that owns this entry. + * `null` when the system does not provide one. This is not the path + * entry `id`. Maps to `account.id` on an account-scoped path mapping + * location. */ + readonly id?: string | null; + /** + * The email of the account that owns this entry. This is a + * system-native identifier and is not always an RFC 5322 address. + * `null` when unknown. Maps to `account.email` on an account-scoped + * path mapping location. */ + readonly email?: string | null; + /** + * The display name of the account that owns this entry. `null` when + * unknown. Maps to `account.name` on an account-scoped path mapping + * location. */ + readonly name?: string | null; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.email !== undefined) { + this.email = fields.email; + } + if (fields.name !== undefined) { + this.name = fields.name; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathEntryAccountScopeV2026R0Input { + /** + * The value will always be `account`. */ + readonly type?: ShuttlePathEntryAccountScopeV2026R0TypeField; + /** + * The platform-native identifier of the account that owns this entry. + * `null` when the system does not provide one. This is not the path + * entry `id`. Maps to `account.id` on an account-scoped path mapping + * location. */ + readonly id?: string | null; + /** + * The email of the account that owns this entry. This is a + * system-native identifier and is not always an RFC 5322 address. + * `null` when unknown. Maps to `account.email` on an account-scoped + * path mapping location. */ + readonly email?: string | null; + /** + * The display name of the account that owns this entry. `null` when + * unknown. Maps to `account.name` on an account-scoped path mapping + * location. */ + readonly name?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathEntryAccountScopeV2026R0TypeField( + val: ShuttlePathEntryAccountScopeV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathEntryAccountScopeV2026R0TypeField( + val: SerializedData, +): ShuttlePathEntryAccountScopeV2026R0TypeField { + if (val == 'account') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttlePathEntryAccountScopeV2026R0TypeField", + }); +} +export function serializeShuttlePathEntryAccountScopeV2026R0( + val: ShuttlePathEntryAccountScopeV2026R0, +): SerializedData { + return { + ['type']: serializeShuttlePathEntryAccountScopeV2026R0TypeField(val.type), + ['id']: val.id, + ['email']: val.email, + ['name']: val.name, + }; +} +export function deserializeShuttlePathEntryAccountScopeV2026R0( + val: SerializedData, +): ShuttlePathEntryAccountScopeV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathEntryAccountScopeV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathEntryAccountScopeV2026R0" to be defined', + }); + } + const type: ShuttlePathEntryAccountScopeV2026R0TypeField = + deserializeShuttlePathEntryAccountScopeV2026R0TypeField(val.type); + if (!(val.id == void 0) && !sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttlePathEntryAccountScopeV2026R0"', + }); + } + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + if (!(val.email == void 0) && !sdIsString(val.email)) { + throw new BoxSdkError({ + message: + 'Expecting string for "email" of type "ShuttlePathEntryAccountScopeV2026R0"', + }); + } + const email: undefined | string = val.email == void 0 ? void 0 : val.email; + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttlePathEntryAccountScopeV2026R0"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + return { + type: type, + id: id, + email: email, + name: name, + } satisfies ShuttlePathEntryAccountScopeV2026R0; +} +export function serializeShuttlePathEntryAccountScopeV2026R0Input( + val: ShuttlePathEntryAccountScopeV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathEntryAccountScopeV2026R0TypeField(val.type), + ['id']: val.id, + ['email']: val.email, + ['name']: val.name, + }; +} +export function deserializeShuttlePathEntryAccountScopeV2026R0Input( + val: SerializedData, +): ShuttlePathEntryAccountScopeV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathEntryAccountScopeV2026R0Input"', + }); + } + const type: undefined | ShuttlePathEntryAccountScopeV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathEntryAccountScopeV2026R0TypeField(val.type); + if (!(val.id == void 0) && !sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttlePathEntryAccountScopeV2026R0Input"', + }); + } + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + if (!(val.email == void 0) && !sdIsString(val.email)) { + throw new BoxSdkError({ + message: + 'Expecting string for "email" of type "ShuttlePathEntryAccountScopeV2026R0Input"', + }); + } + const email: undefined | string = val.email == void 0 ? void 0 : val.email; + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttlePathEntryAccountScopeV2026R0Input"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + return { + type: type, + id: id, + email: email, + name: name, + } satisfies ShuttlePathEntryAccountScopeV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathEntryScopeV2026R0.ts b/src/schemas/v2026R0/shuttlePathEntryScopeV2026R0.ts new file mode 100644 index 00000000..44bbe1d6 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathEntryScopeV2026R0.ts @@ -0,0 +1,45 @@ +import { serializeShuttlePathEntryAccountScopeV2026R0 } from './shuttlePathEntryAccountScopeV2026R0'; +import { deserializeShuttlePathEntryAccountScopeV2026R0 } from './shuttlePathEntryAccountScopeV2026R0'; +import { serializeShuttlePathEntrySharedSpaceScopeV2026R0 } from './shuttlePathEntrySharedSpaceScopeV2026R0'; +import { deserializeShuttlePathEntrySharedSpaceScopeV2026R0 } from './shuttlePathEntrySharedSpaceScopeV2026R0'; +import { ShuttlePathEntryAccountScopeV2026R0 } from './shuttlePathEntryAccountScopeV2026R0'; +import { ShuttlePathEntrySharedSpaceScopeV2026R0 } from './shuttlePathEntrySharedSpaceScopeV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathEntryScopeV2026R0 = + ShuttlePathEntryAccountScopeV2026R0 | ShuttlePathEntrySharedSpaceScopeV2026R0; +export function serializeShuttlePathEntryScopeV2026R0( + val: any, +): SerializedData { + if (val.type == 'account') { + return serializeShuttlePathEntryAccountScopeV2026R0(val); + } + if (val.type == 'shared_space') { + return serializeShuttlePathEntrySharedSpaceScopeV2026R0(val); + } + throw new BoxSdkError({ message: 'unknown type' }); +} +export function deserializeShuttlePathEntryScopeV2026R0( + val: SerializedData, +): ShuttlePathEntryScopeV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathEntryScopeV2026R0"', + }); + } + if (val.type == 'account') { + return deserializeShuttlePathEntryAccountScopeV2026R0(val); + } + if (val.type == 'shared_space') { + return deserializeShuttlePathEntrySharedSpaceScopeV2026R0(val); + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttlePathEntryScopeV2026R0", + }); +} diff --git a/src/schemas/v2026R0/shuttlePathEntrySharedSpaceScopeV2026R0.ts b/src/schemas/v2026R0/shuttlePathEntrySharedSpaceScopeV2026R0.ts new file mode 100644 index 00000000..df1e6398 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathEntrySharedSpaceScopeV2026R0.ts @@ -0,0 +1,136 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathEntrySharedSpaceScopeV2026R0TypeField = 'shared_space'; +export class ShuttlePathEntrySharedSpaceScopeV2026R0 { + /** + * The value will always be `shared_space`. */ + readonly type: ShuttlePathEntrySharedSpaceScopeV2026R0TypeField = + 'shared_space' as ShuttlePathEntrySharedSpaceScopeV2026R0TypeField; + /** + * The display name of the shared container this entry belongs to. + * `null` when the system has a single implicit container. Maps to + * `space` on a shared-space path mapping location. */ + readonly space?: string | null; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.space !== undefined) { + this.space = fields.space; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathEntrySharedSpaceScopeV2026R0Input { + /** + * The value will always be `shared_space`. */ + readonly type?: ShuttlePathEntrySharedSpaceScopeV2026R0TypeField; + /** + * The display name of the shared container this entry belongs to. + * `null` when the system has a single implicit container. Maps to + * `space` on a shared-space path mapping location. */ + readonly space?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathEntrySharedSpaceScopeV2026R0TypeField( + val: ShuttlePathEntrySharedSpaceScopeV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathEntrySharedSpaceScopeV2026R0TypeField( + val: SerializedData, +): ShuttlePathEntrySharedSpaceScopeV2026R0TypeField { + if (val == 'shared_space') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttlePathEntrySharedSpaceScopeV2026R0TypeField", + }); +} +export function serializeShuttlePathEntrySharedSpaceScopeV2026R0( + val: ShuttlePathEntrySharedSpaceScopeV2026R0, +): SerializedData { + return { + ['type']: serializeShuttlePathEntrySharedSpaceScopeV2026R0TypeField( + val.type, + ), + ['space']: val.space, + }; +} +export function deserializeShuttlePathEntrySharedSpaceScopeV2026R0( + val: SerializedData, +): ShuttlePathEntrySharedSpaceScopeV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathEntrySharedSpaceScopeV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathEntrySharedSpaceScopeV2026R0" to be defined', + }); + } + const type: ShuttlePathEntrySharedSpaceScopeV2026R0TypeField = + deserializeShuttlePathEntrySharedSpaceScopeV2026R0TypeField(val.type); + if (!(val.space == void 0) && !sdIsString(val.space)) { + throw new BoxSdkError({ + message: + 'Expecting string for "space" of type "ShuttlePathEntrySharedSpaceScopeV2026R0"', + }); + } + const space: undefined | string = val.space == void 0 ? void 0 : val.space; + return { + type: type, + space: space, + } satisfies ShuttlePathEntrySharedSpaceScopeV2026R0; +} +export function serializeShuttlePathEntrySharedSpaceScopeV2026R0Input( + val: ShuttlePathEntrySharedSpaceScopeV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathEntrySharedSpaceScopeV2026R0TypeField(val.type), + ['space']: val.space, + }; +} +export function deserializeShuttlePathEntrySharedSpaceScopeV2026R0Input( + val: SerializedData, +): ShuttlePathEntrySharedSpaceScopeV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathEntrySharedSpaceScopeV2026R0Input"', + }); + } + const type: undefined | ShuttlePathEntrySharedSpaceScopeV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathEntrySharedSpaceScopeV2026R0TypeField(val.type); + if (!(val.space == void 0) && !sdIsString(val.space)) { + throw new BoxSdkError({ + message: + 'Expecting string for "space" of type "ShuttlePathEntrySharedSpaceScopeV2026R0Input"', + }); + } + const space: undefined | string = val.space == void 0 ? void 0 : val.space; + return { + type: type, + space: space, + } satisfies ShuttlePathEntrySharedSpaceScopeV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathEntryV2026R0.ts b/src/schemas/v2026R0/shuttlePathEntryV2026R0.ts new file mode 100644 index 00000000..aa6080d5 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathEntryV2026R0.ts @@ -0,0 +1,396 @@ +import { serializeShuttlePathEntryAccountScopeV2026R0 } from './shuttlePathEntryAccountScopeV2026R0'; +import { deserializeShuttlePathEntryAccountScopeV2026R0 } from './shuttlePathEntryAccountScopeV2026R0'; +import { serializeShuttlePathEntrySharedSpaceScopeV2026R0 } from './shuttlePathEntrySharedSpaceScopeV2026R0'; +import { deserializeShuttlePathEntrySharedSpaceScopeV2026R0 } from './shuttlePathEntrySharedSpaceScopeV2026R0'; +import { serializeShuttlePathEntryScopeV2026R0 } from './shuttlePathEntryScopeV2026R0'; +import { deserializeShuttlePathEntryScopeV2026R0 } from './shuttlePathEntryScopeV2026R0'; +import { ShuttlePathEntryAccountScopeV2026R0 } from './shuttlePathEntryAccountScopeV2026R0'; +import { ShuttlePathEntrySharedSpaceScopeV2026R0 } from './shuttlePathEntrySharedSpaceScopeV2026R0'; +import { ShuttlePathEntryScopeV2026R0 } from './shuttlePathEntryScopeV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathEntryV2026R0TypeField = 'shuttle_path_entry'; +export class ShuttlePathEntryV2026R0 { + /** + * The unique identifier of this browse row. This is not the account + * identifier; when `scope.type` is `account`, the account identifier is + * `scope.id`. */ + readonly id!: string; + /** + * The value will always be `shuttle_path_entry`. */ + readonly type: ShuttlePathEntryV2026R0TypeField = + 'shuttle_path_entry' as ShuttlePathEntryV2026R0TypeField; + /** + * The display name of the path entry. */ + readonly name!: string; + /** + * The human-readable path of the entry. */ + readonly path!: string; + /** + * The system-native identifier of the path. `null` when the selected + * system does not provide one. Maps to `path_id` on a path mapping + * location. */ + readonly pathId?: string | null; + /** + * The human-readable path of the parent entry, or `null` for a root + * entry. */ + readonly parentPath?: string | null; + readonly scope!: ShuttlePathEntryScopeV2026R0; + /** + * Whether the entry is a directory (`true`) or a single file + * (`false`). Maps to `is_directory` on a path mapping location. */ + readonly isDirectory!: boolean; + /** + * Whether the entry can be selected in a path mapping. */ + readonly canMap!: boolean; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.name !== undefined) { + this.name = fields.name; + } + if (fields.path !== undefined) { + this.path = fields.path; + } + if (fields.pathId !== undefined) { + this.pathId = fields.pathId; + } + if (fields.parentPath !== undefined) { + this.parentPath = fields.parentPath; + } + if (fields.scope !== undefined) { + this.scope = fields.scope; + } + if (fields.isDirectory !== undefined) { + this.isDirectory = fields.isDirectory; + } + if (fields.canMap !== undefined) { + this.canMap = fields.canMap; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathEntryV2026R0Input { + /** + * The unique identifier of this browse row. This is not the account + * identifier; when `scope.type` is `account`, the account identifier is + * `scope.id`. */ + readonly id: string; + /** + * The value will always be `shuttle_path_entry`. */ + readonly type?: ShuttlePathEntryV2026R0TypeField; + /** + * The display name of the path entry. */ + readonly name: string; + /** + * The human-readable path of the entry. */ + readonly path: string; + /** + * The system-native identifier of the path. `null` when the selected + * system does not provide one. Maps to `path_id` on a path mapping + * location. */ + readonly pathId?: string | null; + /** + * The human-readable path of the parent entry, or `null` for a root + * entry. */ + readonly parentPath?: string | null; + readonly scope: ShuttlePathEntryScopeV2026R0; + /** + * Whether the entry is a directory (`true`) or a single file + * (`false`). Maps to `is_directory` on a path mapping location. */ + readonly isDirectory: boolean; + /** + * Whether the entry can be selected in a path mapping. */ + readonly canMap: boolean; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathEntryV2026R0TypeField( + val: ShuttlePathEntryV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathEntryV2026R0TypeField( + val: SerializedData, +): ShuttlePathEntryV2026R0TypeField { + if (val == 'shuttle_path_entry') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttlePathEntryV2026R0TypeField", + }); +} +export function serializeShuttlePathEntryV2026R0( + val: ShuttlePathEntryV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttlePathEntryV2026R0TypeField(val.type), + ['name']: val.name, + ['path']: val.path, + ['path_id']: val.pathId, + ['parent_path']: val.parentPath, + ['scope']: serializeShuttlePathEntryScopeV2026R0(val.scope), + ['is_directory']: val.isDirectory, + ['can_map']: val.canMap, + }; +} +export function deserializeShuttlePathEntryV2026R0( + val: SerializedData, +): ShuttlePathEntryV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathEntryV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "ShuttlePathEntryV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttlePathEntryV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathEntryV2026R0" to be defined', + }); + } + const type: ShuttlePathEntryV2026R0TypeField = + deserializeShuttlePathEntryV2026R0TypeField(val.type); + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttlePathEntryV2026R0" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: 'Expecting string for "name" of type "ShuttlePathEntryV2026R0"', + }); + } + const name: string = val.name; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathEntryV2026R0" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: 'Expecting string for "path" of type "ShuttlePathEntryV2026R0"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathEntryV2026R0"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (!(val.parent_path == void 0) && !sdIsString(val.parent_path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "parent_path" of type "ShuttlePathEntryV2026R0"', + }); + } + const parentPath: undefined | string = + val.parent_path == void 0 ? void 0 : val.parent_path; + if (val.scope == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "scope" of type "ShuttlePathEntryV2026R0" to be defined', + }); + } + const scope: ShuttlePathEntryScopeV2026R0 = + deserializeShuttlePathEntryScopeV2026R0(val.scope); + if (val.is_directory == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "is_directory" of type "ShuttlePathEntryV2026R0" to be defined', + }); + } + if (!sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathEntryV2026R0"', + }); + } + const isDirectory: boolean = val.is_directory; + if (val.can_map == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "can_map" of type "ShuttlePathEntryV2026R0" to be defined', + }); + } + if (!sdIsBoolean(val.can_map)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "can_map" of type "ShuttlePathEntryV2026R0"', + }); + } + const canMap: boolean = val.can_map; + return { + id: id, + type: type, + name: name, + path: path, + pathId: pathId, + parentPath: parentPath, + scope: scope, + isDirectory: isDirectory, + canMap: canMap, + } satisfies ShuttlePathEntryV2026R0; +} +export function serializeShuttlePathEntryV2026R0Input( + val: ShuttlePathEntryV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathEntryV2026R0TypeField(val.type), + ['name']: val.name, + ['path']: val.path, + ['path_id']: val.pathId, + ['parent_path']: val.parentPath, + ['scope']: serializeShuttlePathEntryScopeV2026R0(val.scope), + ['is_directory']: val.isDirectory, + ['can_map']: val.canMap, + }; +} +export function deserializeShuttlePathEntryV2026R0Input( + val: SerializedData, +): ShuttlePathEntryV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathEntryV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttlePathEntryV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttlePathEntryV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttlePathEntryV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathEntryV2026R0TypeField(val.type); + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttlePathEntryV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttlePathEntryV2026R0Input"', + }); + } + const name: string = val.name; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathEntryV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathEntryV2026R0Input"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathEntryV2026R0Input"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (!(val.parent_path == void 0) && !sdIsString(val.parent_path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "parent_path" of type "ShuttlePathEntryV2026R0Input"', + }); + } + const parentPath: undefined | string = + val.parent_path == void 0 ? void 0 : val.parent_path; + if (val.scope == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "scope" of type "ShuttlePathEntryV2026R0Input" to be defined', + }); + } + const scope: ShuttlePathEntryScopeV2026R0 = + deserializeShuttlePathEntryScopeV2026R0(val.scope); + if (val.is_directory == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "is_directory" of type "ShuttlePathEntryV2026R0Input" to be defined', + }); + } + if (!sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathEntryV2026R0Input"', + }); + } + const isDirectory: boolean = val.is_directory; + if (val.can_map == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "can_map" of type "ShuttlePathEntryV2026R0Input" to be defined', + }); + } + if (!sdIsBoolean(val.can_map)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "can_map" of type "ShuttlePathEntryV2026R0Input"', + }); + } + const canMap: boolean = val.can_map; + return { + id: id, + type: type, + name: name, + path: path, + pathId: pathId, + parentPath: parentPath, + scope: scope, + isDirectory: isDirectory, + canMap: canMap, + } satisfies ShuttlePathEntryV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingAccountInputV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingAccountInputV2026R0.ts new file mode 100644 index 00000000..f396973f --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingAccountInputV2026R0.ts @@ -0,0 +1,49 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttlePathMappingAccountInputV2026R0 { + /** + * The platform-native identifier of the account. */ + readonly id?: string; + /** + * The email address of the account. */ + readonly email?: string; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingAccountInputV2026R0( + val: ShuttlePathMappingAccountInputV2026R0, +): SerializedData { + return { ['id']: val.id, ['email']: val.email }; +} +export function deserializeShuttlePathMappingAccountInputV2026R0( + val: SerializedData, +): ShuttlePathMappingAccountInputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingAccountInputV2026R0"', + }); + } + if (!(val.id == void 0) && !sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttlePathMappingAccountInputV2026R0"', + }); + } + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + if (!(val.email == void 0) && !sdIsString(val.email)) { + throw new BoxSdkError({ + message: + 'Expecting string for "email" of type "ShuttlePathMappingAccountInputV2026R0"', + }); + } + const email: undefined | string = val.email == void 0 ? void 0 : val.email; + return { + id: id, + email: email, + } satisfies ShuttlePathMappingAccountInputV2026R0; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingAccountLocationInputV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingAccountLocationInputV2026R0.ts new file mode 100644 index 00000000..ce047480 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingAccountLocationInputV2026R0.ts @@ -0,0 +1,240 @@ +import { serializeShuttlePathMappingAccountInputV2026R0 } from './shuttlePathMappingAccountInputV2026R0'; +import { deserializeShuttlePathMappingAccountInputV2026R0 } from './shuttlePathMappingAccountInputV2026R0'; +import { ShuttlePathMappingAccountInputV2026R0 } from './shuttlePathMappingAccountInputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingAccountLocationInputV2026R0TypeField = 'account'; +export class ShuttlePathMappingAccountLocationInputV2026R0 { + /** + * The value will always be `account`. */ + readonly type: ShuttlePathMappingAccountLocationInputV2026R0TypeField = + 'account' as ShuttlePathMappingAccountLocationInputV2026R0TypeField; + /** + * The human-readable path relative to the account root. */ + readonly path!: string; + /** + * An optional stable identifier of the location, when obtained from + * browsing. */ + readonly pathId?: string; + readonly account!: ShuttlePathMappingAccountInputV2026R0; + /** + * Whether the location is a directory. When set, the destination must be + * the same kind of object. */ + readonly isDirectory?: boolean; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.path !== undefined) { + this.path = fields.path; + } + if (fields.pathId !== undefined) { + this.pathId = fields.pathId; + } + if (fields.account !== undefined) { + this.account = fields.account; + } + if (fields.isDirectory !== undefined) { + this.isDirectory = fields.isDirectory; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathMappingAccountLocationInputV2026R0Input { + /** + * The value will always be `account`. */ + readonly type?: ShuttlePathMappingAccountLocationInputV2026R0TypeField; + /** + * The human-readable path relative to the account root. */ + readonly path: string; + /** + * An optional stable identifier of the location, when obtained from + * browsing. */ + readonly pathId?: string; + readonly account: ShuttlePathMappingAccountInputV2026R0; + /** + * Whether the location is a directory. When set, the destination must be + * the same kind of object. */ + readonly isDirectory?: boolean; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingAccountLocationInputV2026R0TypeField( + val: ShuttlePathMappingAccountLocationInputV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathMappingAccountLocationInputV2026R0TypeField( + val: SerializedData, +): ShuttlePathMappingAccountLocationInputV2026R0TypeField { + if (val == 'account') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttlePathMappingAccountLocationInputV2026R0TypeField", + }); +} +export function serializeShuttlePathMappingAccountLocationInputV2026R0( + val: ShuttlePathMappingAccountLocationInputV2026R0, +): SerializedData { + return { + ['type']: serializeShuttlePathMappingAccountLocationInputV2026R0TypeField( + val.type, + ), + ['path']: val.path, + ['path_id']: val.pathId, + ['account']: serializeShuttlePathMappingAccountInputV2026R0(val.account), + ['is_directory']: val.isDirectory, + }; +} +export function deserializeShuttlePathMappingAccountLocationInputV2026R0( + val: SerializedData, +): ShuttlePathMappingAccountLocationInputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingAccountLocationInputV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathMappingAccountLocationInputV2026R0" to be defined', + }); + } + const type: ShuttlePathMappingAccountLocationInputV2026R0TypeField = + deserializeShuttlePathMappingAccountLocationInputV2026R0TypeField(val.type); + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingAccountLocationInputV2026R0" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingAccountLocationInputV2026R0"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingAccountLocationInputV2026R0"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (val.account == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "account" of type "ShuttlePathMappingAccountLocationInputV2026R0" to be defined', + }); + } + const account: ShuttlePathMappingAccountInputV2026R0 = + deserializeShuttlePathMappingAccountInputV2026R0(val.account); + if (!(val.is_directory == void 0) && !sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathMappingAccountLocationInputV2026R0"', + }); + } + const isDirectory: undefined | boolean = + val.is_directory == void 0 ? void 0 : val.is_directory; + return { + type: type, + path: path, + pathId: pathId, + account: account, + isDirectory: isDirectory, + } satisfies ShuttlePathMappingAccountLocationInputV2026R0; +} +export function serializeShuttlePathMappingAccountLocationInputV2026R0Input( + val: ShuttlePathMappingAccountLocationInputV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathMappingAccountLocationInputV2026R0TypeField( + val.type, + ), + ['path']: val.path, + ['path_id']: val.pathId, + ['account']: serializeShuttlePathMappingAccountInputV2026R0(val.account), + ['is_directory']: val.isDirectory, + }; +} +export function deserializeShuttlePathMappingAccountLocationInputV2026R0Input( + val: SerializedData, +): ShuttlePathMappingAccountLocationInputV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingAccountLocationInputV2026R0Input"', + }); + } + const type: + undefined | ShuttlePathMappingAccountLocationInputV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathMappingAccountLocationInputV2026R0TypeField( + val.type, + ); + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingAccountLocationInputV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingAccountLocationInputV2026R0Input"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingAccountLocationInputV2026R0Input"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (val.account == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "account" of type "ShuttlePathMappingAccountLocationInputV2026R0Input" to be defined', + }); + } + const account: ShuttlePathMappingAccountInputV2026R0 = + deserializeShuttlePathMappingAccountInputV2026R0(val.account); + if (!(val.is_directory == void 0) && !sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathMappingAccountLocationInputV2026R0Input"', + }); + } + const isDirectory: undefined | boolean = + val.is_directory == void 0 ? void 0 : val.is_directory; + return { + type: type, + path: path, + pathId: pathId, + account: account, + isDirectory: isDirectory, + } satisfies ShuttlePathMappingAccountLocationInputV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingAccountLocationTargetInputV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingAccountLocationTargetInputV2026R0.ts new file mode 100644 index 00000000..cefd5813 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingAccountLocationTargetInputV2026R0.ts @@ -0,0 +1,215 @@ +import { serializeShuttlePathMappingAccountInputV2026R0 } from './shuttlePathMappingAccountInputV2026R0'; +import { deserializeShuttlePathMappingAccountInputV2026R0 } from './shuttlePathMappingAccountInputV2026R0'; +import { ShuttlePathMappingAccountInputV2026R0 } from './shuttlePathMappingAccountInputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField = + 'account'; +export class ShuttlePathMappingAccountLocationTargetInputV2026R0 { + /** + * The value will always be `account`. */ + readonly type: ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField = + 'account' as ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField; + /** + * The human-readable path relative to the account root. */ + readonly path!: string; + /** + * An optional stable identifier of the location, when obtained from + * browsing. */ + readonly pathId?: string; + readonly account!: ShuttlePathMappingAccountInputV2026R0; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial< + Pick + >, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.path !== undefined) { + this.path = fields.path; + } + if (fields.pathId !== undefined) { + this.pathId = fields.pathId; + } + if (fields.account !== undefined) { + this.account = fields.account; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathMappingAccountLocationTargetInputV2026R0Input { + /** + * The value will always be `account`. */ + readonly type?: ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField; + /** + * The human-readable path relative to the account root. */ + readonly path: string; + /** + * An optional stable identifier of the location, when obtained from + * browsing. */ + readonly pathId?: string; + readonly account: ShuttlePathMappingAccountInputV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingAccountLocationTargetInputV2026R0TypeField( + val: ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathMappingAccountLocationTargetInputV2026R0TypeField( + val: SerializedData, +): ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField { + if (val == 'account') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField", + }); +} +export function serializeShuttlePathMappingAccountLocationTargetInputV2026R0( + val: ShuttlePathMappingAccountLocationTargetInputV2026R0, +): SerializedData { + return { + ['type']: + serializeShuttlePathMappingAccountLocationTargetInputV2026R0TypeField( + val.type, + ), + ['path']: val.path, + ['path_id']: val.pathId, + ['account']: serializeShuttlePathMappingAccountInputV2026R0(val.account), + }; +} +export function deserializeShuttlePathMappingAccountLocationTargetInputV2026R0( + val: SerializedData, +): ShuttlePathMappingAccountLocationTargetInputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingAccountLocationTargetInputV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0" to be defined', + }); + } + const type: ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField = + deserializeShuttlePathMappingAccountLocationTargetInputV2026R0TypeField( + val.type, + ); + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (val.account == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "account" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0" to be defined', + }); + } + const account: ShuttlePathMappingAccountInputV2026R0 = + deserializeShuttlePathMappingAccountInputV2026R0(val.account); + return { + type: type, + path: path, + pathId: pathId, + account: account, + } satisfies ShuttlePathMappingAccountLocationTargetInputV2026R0; +} +export function serializeShuttlePathMappingAccountLocationTargetInputV2026R0Input( + val: ShuttlePathMappingAccountLocationTargetInputV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathMappingAccountLocationTargetInputV2026R0TypeField( + val.type, + ), + ['path']: val.path, + ['path_id']: val.pathId, + ['account']: serializeShuttlePathMappingAccountInputV2026R0(val.account), + }; +} +export function deserializeShuttlePathMappingAccountLocationTargetInputV2026R0Input( + val: SerializedData, +): ShuttlePathMappingAccountLocationTargetInputV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingAccountLocationTargetInputV2026R0Input"', + }); + } + const type: + undefined | ShuttlePathMappingAccountLocationTargetInputV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathMappingAccountLocationTargetInputV2026R0TypeField( + val.type, + ); + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0Input"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0Input"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (val.account == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "account" of type "ShuttlePathMappingAccountLocationTargetInputV2026R0Input" to be defined', + }); + } + const account: ShuttlePathMappingAccountInputV2026R0 = + deserializeShuttlePathMappingAccountInputV2026R0(val.account); + return { + type: type, + path: path, + pathId: pathId, + account: account, + } satisfies ShuttlePathMappingAccountLocationTargetInputV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingAccountLocationV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingAccountLocationV2026R0.ts new file mode 100644 index 00000000..00afde73 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingAccountLocationV2026R0.ts @@ -0,0 +1,230 @@ +import { serializeShuttlePathMappingAccountV2026R0 } from './shuttlePathMappingAccountV2026R0'; +import { deserializeShuttlePathMappingAccountV2026R0 } from './shuttlePathMappingAccountV2026R0'; +import { ShuttlePathMappingAccountV2026R0 } from './shuttlePathMappingAccountV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingAccountLocationV2026R0TypeField = 'account'; +export class ShuttlePathMappingAccountLocationV2026R0 { + /** + * The value will always be `account`. */ + readonly type: ShuttlePathMappingAccountLocationV2026R0TypeField = + 'account' as ShuttlePathMappingAccountLocationV2026R0TypeField; + /** + * The human-readable path relative to the account root. */ + readonly path!: string; + /** + * The stable identifier of the location. `null` when the system does not + * provide one. */ + readonly pathId?: string | null; + readonly account?: ShuttlePathMappingAccountV2026R0; + /** + * Whether the location is a directory. `null` when unknown. */ + readonly isDirectory?: boolean | null; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.path !== undefined) { + this.path = fields.path; + } + if (fields.pathId !== undefined) { + this.pathId = fields.pathId; + } + if (fields.account !== undefined) { + this.account = fields.account; + } + if (fields.isDirectory !== undefined) { + this.isDirectory = fields.isDirectory; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathMappingAccountLocationV2026R0Input { + /** + * The value will always be `account`. */ + readonly type?: ShuttlePathMappingAccountLocationV2026R0TypeField; + /** + * The human-readable path relative to the account root. */ + readonly path: string; + /** + * The stable identifier of the location. `null` when the system does not + * provide one. */ + readonly pathId?: string | null; + readonly account?: ShuttlePathMappingAccountV2026R0; + /** + * Whether the location is a directory. `null` when unknown. */ + readonly isDirectory?: boolean | null; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingAccountLocationV2026R0TypeField( + val: ShuttlePathMappingAccountLocationV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathMappingAccountLocationV2026R0TypeField( + val: SerializedData, +): ShuttlePathMappingAccountLocationV2026R0TypeField { + if (val == 'account') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttlePathMappingAccountLocationV2026R0TypeField", + }); +} +export function serializeShuttlePathMappingAccountLocationV2026R0( + val: ShuttlePathMappingAccountLocationV2026R0, +): SerializedData { + return { + ['type']: serializeShuttlePathMappingAccountLocationV2026R0TypeField( + val.type, + ), + ['path']: val.path, + ['path_id']: val.pathId, + ['account']: + val.account == void 0 + ? val.account + : serializeShuttlePathMappingAccountV2026R0(val.account), + ['is_directory']: val.isDirectory, + }; +} +export function deserializeShuttlePathMappingAccountLocationV2026R0( + val: SerializedData, +): ShuttlePathMappingAccountLocationV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingAccountLocationV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathMappingAccountLocationV2026R0" to be defined', + }); + } + const type: ShuttlePathMappingAccountLocationV2026R0TypeField = + deserializeShuttlePathMappingAccountLocationV2026R0TypeField(val.type); + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingAccountLocationV2026R0" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingAccountLocationV2026R0"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingAccountLocationV2026R0"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + const account: undefined | ShuttlePathMappingAccountV2026R0 = + val.account == void 0 + ? void 0 + : deserializeShuttlePathMappingAccountV2026R0(val.account); + if (!(val.is_directory == void 0) && !sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathMappingAccountLocationV2026R0"', + }); + } + const isDirectory: undefined | boolean = + val.is_directory == void 0 ? void 0 : val.is_directory; + return { + type: type, + path: path, + pathId: pathId, + account: account, + isDirectory: isDirectory, + } satisfies ShuttlePathMappingAccountLocationV2026R0; +} +export function serializeShuttlePathMappingAccountLocationV2026R0Input( + val: ShuttlePathMappingAccountLocationV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathMappingAccountLocationV2026R0TypeField(val.type), + ['path']: val.path, + ['path_id']: val.pathId, + ['account']: + val.account == void 0 + ? val.account + : serializeShuttlePathMappingAccountV2026R0(val.account), + ['is_directory']: val.isDirectory, + }; +} +export function deserializeShuttlePathMappingAccountLocationV2026R0Input( + val: SerializedData, +): ShuttlePathMappingAccountLocationV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingAccountLocationV2026R0Input"', + }); + } + const type: undefined | ShuttlePathMappingAccountLocationV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathMappingAccountLocationV2026R0TypeField(val.type); + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingAccountLocationV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingAccountLocationV2026R0Input"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingAccountLocationV2026R0Input"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + const account: undefined | ShuttlePathMappingAccountV2026R0 = + val.account == void 0 + ? void 0 + : deserializeShuttlePathMappingAccountV2026R0(val.account); + if (!(val.is_directory == void 0) && !sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathMappingAccountLocationV2026R0Input"', + }); + } + const isDirectory: undefined | boolean = + val.is_directory == void 0 ? void 0 : val.is_directory; + return { + type: type, + path: path, + pathId: pathId, + account: account, + isDirectory: isDirectory, + } satisfies ShuttlePathMappingAccountLocationV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingAccountV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingAccountV2026R0.ts new file mode 100644 index 00000000..25ea12bf --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingAccountV2026R0.ts @@ -0,0 +1,61 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttlePathMappingAccountV2026R0 { + /** + * The platform-native identifier of the account. `null` when the system + * does not provide one. */ + readonly id?: string | null; + /** + * The email address of the account. `null` when unknown. */ + readonly email?: string | null; + /** + * The display name of the account. `null` when unknown. */ + readonly name?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingAccountV2026R0( + val: ShuttlePathMappingAccountV2026R0, +): SerializedData { + return { ['id']: val.id, ['email']: val.email, ['name']: val.name }; +} +export function deserializeShuttlePathMappingAccountV2026R0( + val: SerializedData, +): ShuttlePathMappingAccountV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingAccountV2026R0"', + }); + } + if (!(val.id == void 0) && !sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttlePathMappingAccountV2026R0"', + }); + } + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + if (!(val.email == void 0) && !sdIsString(val.email)) { + throw new BoxSdkError({ + message: + 'Expecting string for "email" of type "ShuttlePathMappingAccountV2026R0"', + }); + } + const email: undefined | string = val.email == void 0 ? void 0 : val.email; + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttlePathMappingAccountV2026R0"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + return { + id: id, + email: email, + name: name, + } satisfies ShuttlePathMappingAccountV2026R0; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingCreateRequestV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingCreateRequestV2026R0.ts new file mode 100644 index 00000000..fe50ed0d --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingCreateRequestV2026R0.ts @@ -0,0 +1,102 @@ +import { serializeShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { deserializeShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { serializeShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { serializeShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { deserializeShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { serializeShuttlePathMappingLocationInputV2026R0 } from './shuttlePathMappingLocationInputV2026R0'; +import { deserializeShuttlePathMappingLocationInputV2026R0 } from './shuttlePathMappingLocationInputV2026R0'; +import { serializeShuttlePathMappingTargetLocationInputV2026R0 } from './shuttlePathMappingTargetLocationInputV2026R0'; +import { deserializeShuttlePathMappingTargetLocationInputV2026R0 } from './shuttlePathMappingTargetLocationInputV2026R0'; +import { ShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { ShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { ShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { ShuttlePathMappingLocationInputV2026R0 } from './shuttlePathMappingLocationInputV2026R0'; +import { ShuttlePathMappingTargetLocationInputV2026R0 } from './shuttlePathMappingTargetLocationInputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttlePathMappingCreateRequestV2026R0 { + /** + * The unique identifier of the shuttle job this mapping belongs to. */ + readonly jobId: string; + /** + * Whether this source path should be skipped during the migration. + * Defaults to `false`. */ + readonly isPathSkipped?: boolean; + readonly source: ShuttlePathMappingLocationInputV2026R0; + /** + * The destination location to migrate to. Omit or set to `null` when the + * source path is skipped. */ + readonly target?: ShuttlePathMappingTargetLocationInputV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingCreateRequestV2026R0( + val: ShuttlePathMappingCreateRequestV2026R0, +): SerializedData { + return { + ['job_id']: val.jobId, + ['is_path_skipped']: val.isPathSkipped, + ['source']: serializeShuttlePathMappingLocationInputV2026R0(val.source), + ['target']: + val.target == void 0 + ? val.target + : serializeShuttlePathMappingTargetLocationInputV2026R0(val.target), + }; +} +export function deserializeShuttlePathMappingCreateRequestV2026R0( + val: SerializedData, +): ShuttlePathMappingCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingCreateRequestV2026R0"', + }); + } + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttlePathMappingCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttlePathMappingCreateRequestV2026R0"', + }); + } + const jobId: string = val.job_id; + if (!(val.is_path_skipped == void 0) && !sdIsBoolean(val.is_path_skipped)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_path_skipped" of type "ShuttlePathMappingCreateRequestV2026R0"', + }); + } + const isPathSkipped: undefined | boolean = + val.is_path_skipped == void 0 ? void 0 : val.is_path_skipped; + if (val.source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source" of type "ShuttlePathMappingCreateRequestV2026R0" to be defined', + }); + } + const source: ShuttlePathMappingLocationInputV2026R0 = + deserializeShuttlePathMappingLocationInputV2026R0(val.source); + const target: ShuttlePathMappingTargetLocationInputV2026R0 | undefined = + val.target == void 0 + ? void 0 + : deserializeShuttlePathMappingTargetLocationInputV2026R0(val.target); + return { + jobId: jobId, + isPathSkipped: isPathSkipped, + source: source, + target: target, + } satisfies ShuttlePathMappingCreateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingImportCreateRequestV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingImportCreateRequestV2026R0.ts new file mode 100644 index 00000000..75691377 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingImportCreateRequestV2026R0.ts @@ -0,0 +1,65 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttlePathMappingImportCreateRequestV2026R0 { + /** + * The unique identifier of the shuttle job whose path mappings are + * replaced. */ + readonly jobId: string; + /** + * The unique identifier of the Box file holding the mapping workbook. The + * file is read as the calling user, so it must live somewhere that user can + * download from. */ + readonly fileId: string; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingImportCreateRequestV2026R0( + val: ShuttlePathMappingImportCreateRequestV2026R0, +): SerializedData { + return { ['job_id']: val.jobId, ['file_id']: val.fileId }; +} +export function deserializeShuttlePathMappingImportCreateRequestV2026R0( + val: SerializedData, +): ShuttlePathMappingImportCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingImportCreateRequestV2026R0"', + }); + } + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttlePathMappingImportCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttlePathMappingImportCreateRequestV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.file_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "file_id" of type "ShuttlePathMappingImportCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.file_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "file_id" of type "ShuttlePathMappingImportCreateRequestV2026R0"', + }); + } + const fileId: string = val.file_id; + return { + jobId: jobId, + fileId: fileId, + } satisfies ShuttlePathMappingImportCreateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingLocationInputV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingLocationInputV2026R0.ts new file mode 100644 index 00000000..c1af6ba2 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingLocationInputV2026R0.ts @@ -0,0 +1,46 @@ +import { serializeShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { deserializeShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { serializeShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { ShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { ShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingLocationInputV2026R0 = + | ShuttlePathMappingAccountLocationInputV2026R0 + | ShuttlePathMappingSharedSpaceLocationInputV2026R0; +export function serializeShuttlePathMappingLocationInputV2026R0( + val: any, +): SerializedData { + if (val.type == 'account') { + return serializeShuttlePathMappingAccountLocationInputV2026R0(val); + } + if (val.type == 'shared_space') { + return serializeShuttlePathMappingSharedSpaceLocationInputV2026R0(val); + } + throw new BoxSdkError({ message: 'unknown type' }); +} +export function deserializeShuttlePathMappingLocationInputV2026R0( + val: SerializedData, +): ShuttlePathMappingLocationInputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingLocationInputV2026R0"', + }); + } + if (val.type == 'account') { + return deserializeShuttlePathMappingAccountLocationInputV2026R0(val); + } + if (val.type == 'shared_space') { + return deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0(val); + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttlePathMappingLocationInputV2026R0", + }); +} diff --git a/src/schemas/v2026R0/shuttlePathMappingLocationV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingLocationV2026R0.ts new file mode 100644 index 00000000..7a7c767f --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingLocationV2026R0.ts @@ -0,0 +1,46 @@ +import { serializeShuttlePathMappingAccountLocationV2026R0 } from './shuttlePathMappingAccountLocationV2026R0'; +import { deserializeShuttlePathMappingAccountLocationV2026R0 } from './shuttlePathMappingAccountLocationV2026R0'; +import { serializeShuttlePathMappingSharedSpaceLocationV2026R0 } from './shuttlePathMappingSharedSpaceLocationV2026R0'; +import { deserializeShuttlePathMappingSharedSpaceLocationV2026R0 } from './shuttlePathMappingSharedSpaceLocationV2026R0'; +import { ShuttlePathMappingAccountLocationV2026R0 } from './shuttlePathMappingAccountLocationV2026R0'; +import { ShuttlePathMappingSharedSpaceLocationV2026R0 } from './shuttlePathMappingSharedSpaceLocationV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingLocationV2026R0 = + | ShuttlePathMappingAccountLocationV2026R0 + | ShuttlePathMappingSharedSpaceLocationV2026R0; +export function serializeShuttlePathMappingLocationV2026R0( + val: any, +): SerializedData { + if (val.type == 'account') { + return serializeShuttlePathMappingAccountLocationV2026R0(val); + } + if (val.type == 'shared_space') { + return serializeShuttlePathMappingSharedSpaceLocationV2026R0(val); + } + throw new BoxSdkError({ message: 'unknown type' }); +} +export function deserializeShuttlePathMappingLocationV2026R0( + val: SerializedData, +): ShuttlePathMappingLocationV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingLocationV2026R0"', + }); + } + if (val.type == 'account') { + return deserializeShuttlePathMappingAccountLocationV2026R0(val); + } + if (val.type == 'shared_space') { + return deserializeShuttlePathMappingSharedSpaceLocationV2026R0(val); + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttlePathMappingLocationV2026R0", + }); +} diff --git a/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationInputV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationInputV2026R0.ts new file mode 100644 index 00000000..57fed31f --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationInputV2026R0.ts @@ -0,0 +1,245 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField = + 'shared_space'; +export class ShuttlePathMappingSharedSpaceLocationInputV2026R0 { + /** + * The value will always be `shared_space`. */ + readonly type: ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField = + 'shared_space' as ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField; + /** + * The display name of the shared container. Required for systems with + * multiple containers. */ + readonly space?: string; + /** + * The human-readable path relative to the shared container. */ + readonly path!: string; + /** + * An optional stable identifier of the location, when obtained from + * browsing. */ + readonly pathId?: string; + /** + * Whether the location is a directory. When set, the destination must be + * the same kind of object. */ + readonly isDirectory?: boolean; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.space !== undefined) { + this.space = fields.space; + } + if (fields.path !== undefined) { + this.path = fields.path; + } + if (fields.pathId !== undefined) { + this.pathId = fields.pathId; + } + if (fields.isDirectory !== undefined) { + this.isDirectory = fields.isDirectory; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathMappingSharedSpaceLocationInputV2026R0Input { + /** + * The value will always be `shared_space`. */ + readonly type?: ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField; + /** + * The display name of the shared container. Required for systems with + * multiple containers. */ + readonly space?: string; + /** + * The human-readable path relative to the shared container. */ + readonly path: string; + /** + * An optional stable identifier of the location, when obtained from + * browsing. */ + readonly pathId?: string; + /** + * Whether the location is a directory. When set, the destination must be + * the same kind of object. */ + readonly isDirectory?: boolean; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField( + val: ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField { + if (val == 'shared_space') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField", + }); +} +export function serializeShuttlePathMappingSharedSpaceLocationInputV2026R0( + val: ShuttlePathMappingSharedSpaceLocationInputV2026R0, +): SerializedData { + return { + ['type']: + serializeShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField( + val.type, + ), + ['space']: val.space, + ['path']: val.path, + ['path_id']: val.pathId, + ['is_directory']: val.isDirectory, + }; +} +export function deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationInputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingSharedSpaceLocationInputV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0" to be defined', + }); + } + const type: ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField = + deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField( + val.type, + ); + if (!(val.space == void 0) && !sdIsString(val.space)) { + throw new BoxSdkError({ + message: + 'Expecting string for "space" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0"', + }); + } + const space: undefined | string = val.space == void 0 ? void 0 : val.space; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (!(val.is_directory == void 0) && !sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0"', + }); + } + const isDirectory: undefined | boolean = + val.is_directory == void 0 ? void 0 : val.is_directory; + return { + type: type, + space: space, + path: path, + pathId: pathId, + isDirectory: isDirectory, + } satisfies ShuttlePathMappingSharedSpaceLocationInputV2026R0; +} +export function serializeShuttlePathMappingSharedSpaceLocationInputV2026R0Input( + val: ShuttlePathMappingSharedSpaceLocationInputV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField( + val.type, + ), + ['space']: val.space, + ['path']: val.path, + ['path_id']: val.pathId, + ['is_directory']: val.isDirectory, + }; +} +export function deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0Input( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationInputV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingSharedSpaceLocationInputV2026R0Input"', + }); + } + const type: + undefined | ShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0TypeField( + val.type, + ); + if (!(val.space == void 0) && !sdIsString(val.space)) { + throw new BoxSdkError({ + message: + 'Expecting string for "space" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0Input"', + }); + } + const space: undefined | string = val.space == void 0 ? void 0 : val.space; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0Input"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0Input"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (!(val.is_directory == void 0) && !sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathMappingSharedSpaceLocationInputV2026R0Input"', + }); + } + const isDirectory: undefined | boolean = + val.is_directory == void 0 ? void 0 : val.is_directory; + return { + type: type, + space: space, + path: path, + pathId: pathId, + isDirectory: isDirectory, + } satisfies ShuttlePathMappingSharedSpaceLocationInputV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationTargetInputV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationTargetInputV2026R0.ts new file mode 100644 index 00000000..84f5570f --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationTargetInputV2026R0.ts @@ -0,0 +1,220 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField = + 'shared_space'; +export class ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 { + /** + * The value will always be `shared_space`. */ + readonly type: ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField = + 'shared_space' as ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField; + /** + * The display name of the shared container. Required for systems with + * multiple containers. */ + readonly space?: string; + /** + * The human-readable path relative to the shared container. */ + readonly path!: string; + /** + * An optional stable identifier of the location, when obtained from + * browsing. */ + readonly pathId?: string; + readonly rawData?: SerializedData; + constructor( + fields: Omit< + ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0, + 'type' + > & + Partial< + Pick + >, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.space !== undefined) { + this.space = fields.space; + } + if (fields.path !== undefined) { + this.path = fields.path; + } + if (fields.pathId !== undefined) { + this.pathId = fields.pathId; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input { + /** + * The value will always be `shared_space`. */ + readonly type?: ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField; + /** + * The display name of the shared container. Required for systems with + * multiple containers. */ + readonly space?: string; + /** + * The human-readable path relative to the shared container. */ + readonly path: string; + /** + * An optional stable identifier of the location, when obtained from + * browsing. */ + readonly pathId?: string; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField( + val: ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField { + if (val == 'shared_space') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField", + }); +} +export function serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0( + val: ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0, +): SerializedData { + return { + ['type']: + serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField( + val.type, + ), + ['space']: val.space, + ['path']: val.path, + ['path_id']: val.pathId, + }; +} +export function deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0" to be defined', + }); + } + const type: ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField = + deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField( + val.type, + ); + if (!(val.space == void 0) && !sdIsString(val.space)) { + throw new BoxSdkError({ + message: + 'Expecting string for "space" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0"', + }); + } + const space: undefined | string = val.space == void 0 ? void 0 : val.space; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + return { + type: type, + space: space, + path: path, + pathId: pathId, + } satisfies ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0; +} +export function serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input( + val: ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField( + val.type, + ), + ['space']: val.space, + ['path']: val.path, + ['path_id']: val.pathId, + }; +} +export function deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input"', + }); + } + const type: + | undefined + | ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0TypeField( + val.type, + ); + if (!(val.space == void 0) && !sdIsString(val.space)) { + throw new BoxSdkError({ + message: + 'Expecting string for "space" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input"', + }); + } + const space: undefined | string = val.space == void 0 ? void 0 : val.space; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + return { + type: type, + space: space, + path: path, + pathId: pathId, + } satisfies ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationV2026R0.ts new file mode 100644 index 00000000..5db97c68 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingSharedSpaceLocationV2026R0.ts @@ -0,0 +1,240 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingSharedSpaceLocationV2026R0TypeField = + 'shared_space'; +export class ShuttlePathMappingSharedSpaceLocationV2026R0 { + /** + * The value will always be `shared_space`. */ + readonly type: ShuttlePathMappingSharedSpaceLocationV2026R0TypeField = + 'shared_space' as ShuttlePathMappingSharedSpaceLocationV2026R0TypeField; + /** + * The display name of the shared container. `null` when the system has a + * single implicit container. */ + readonly space?: string | null; + /** + * The human-readable path relative to the shared container. */ + readonly path!: string; + /** + * The stable identifier of the location. `null` when the system does not + * provide one. */ + readonly pathId?: string | null; + /** + * Whether the location is a directory. `null` when unknown. */ + readonly isDirectory?: boolean | null; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.space !== undefined) { + this.space = fields.space; + } + if (fields.path !== undefined) { + this.path = fields.path; + } + if (fields.pathId !== undefined) { + this.pathId = fields.pathId; + } + if (fields.isDirectory !== undefined) { + this.isDirectory = fields.isDirectory; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathMappingSharedSpaceLocationV2026R0Input { + /** + * The value will always be `shared_space`. */ + readonly type?: ShuttlePathMappingSharedSpaceLocationV2026R0TypeField; + /** + * The display name of the shared container. `null` when the system has a + * single implicit container. */ + readonly space?: string | null; + /** + * The human-readable path relative to the shared container. */ + readonly path: string; + /** + * The stable identifier of the location. `null` when the system does not + * provide one. */ + readonly pathId?: string | null; + /** + * Whether the location is a directory. `null` when unknown. */ + readonly isDirectory?: boolean | null; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingSharedSpaceLocationV2026R0TypeField( + val: ShuttlePathMappingSharedSpaceLocationV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathMappingSharedSpaceLocationV2026R0TypeField( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationV2026R0TypeField { + if (val == 'shared_space') { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttlePathMappingSharedSpaceLocationV2026R0TypeField", + }); +} +export function serializeShuttlePathMappingSharedSpaceLocationV2026R0( + val: ShuttlePathMappingSharedSpaceLocationV2026R0, +): SerializedData { + return { + ['type']: serializeShuttlePathMappingSharedSpaceLocationV2026R0TypeField( + val.type, + ), + ['space']: val.space, + ['path']: val.path, + ['path_id']: val.pathId, + ['is_directory']: val.isDirectory, + }; +} +export function deserializeShuttlePathMappingSharedSpaceLocationV2026R0( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingSharedSpaceLocationV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathMappingSharedSpaceLocationV2026R0" to be defined', + }); + } + const type: ShuttlePathMappingSharedSpaceLocationV2026R0TypeField = + deserializeShuttlePathMappingSharedSpaceLocationV2026R0TypeField(val.type); + if (!(val.space == void 0) && !sdIsString(val.space)) { + throw new BoxSdkError({ + message: + 'Expecting string for "space" of type "ShuttlePathMappingSharedSpaceLocationV2026R0"', + }); + } + const space: undefined | string = val.space == void 0 ? void 0 : val.space; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingSharedSpaceLocationV2026R0" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingSharedSpaceLocationV2026R0"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingSharedSpaceLocationV2026R0"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (!(val.is_directory == void 0) && !sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathMappingSharedSpaceLocationV2026R0"', + }); + } + const isDirectory: undefined | boolean = + val.is_directory == void 0 ? void 0 : val.is_directory; + return { + type: type, + space: space, + path: path, + pathId: pathId, + isDirectory: isDirectory, + } satisfies ShuttlePathMappingSharedSpaceLocationV2026R0; +} +export function serializeShuttlePathMappingSharedSpaceLocationV2026R0Input( + val: ShuttlePathMappingSharedSpaceLocationV2026R0Input, +): SerializedData { + return { + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathMappingSharedSpaceLocationV2026R0TypeField( + val.type, + ), + ['space']: val.space, + ['path']: val.path, + ['path_id']: val.pathId, + ['is_directory']: val.isDirectory, + }; +} +export function deserializeShuttlePathMappingSharedSpaceLocationV2026R0Input( + val: SerializedData, +): ShuttlePathMappingSharedSpaceLocationV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingSharedSpaceLocationV2026R0Input"', + }); + } + const type: + undefined | ShuttlePathMappingSharedSpaceLocationV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathMappingSharedSpaceLocationV2026R0TypeField( + val.type, + ); + if (!(val.space == void 0) && !sdIsString(val.space)) { + throw new BoxSdkError({ + message: + 'Expecting string for "space" of type "ShuttlePathMappingSharedSpaceLocationV2026R0Input"', + }); + } + const space: undefined | string = val.space == void 0 ? void 0 : val.space; + if (val.path == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "path" of type "ShuttlePathMappingSharedSpaceLocationV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.path)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path" of type "ShuttlePathMappingSharedSpaceLocationV2026R0Input"', + }); + } + const path: string = val.path; + if (!(val.path_id == void 0) && !sdIsString(val.path_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "path_id" of type "ShuttlePathMappingSharedSpaceLocationV2026R0Input"', + }); + } + const pathId: undefined | string = + val.path_id == void 0 ? void 0 : val.path_id; + if (!(val.is_directory == void 0) && !sdIsBoolean(val.is_directory)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_directory" of type "ShuttlePathMappingSharedSpaceLocationV2026R0Input"', + }); + } + const isDirectory: undefined | boolean = + val.is_directory == void 0 ? void 0 : val.is_directory; + return { + type: type, + space: space, + path: path, + pathId: pathId, + isDirectory: isDirectory, + } satisfies ShuttlePathMappingSharedSpaceLocationV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingTargetLocationInputV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingTargetLocationInputV2026R0.ts new file mode 100644 index 00000000..d61927f6 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingTargetLocationInputV2026R0.ts @@ -0,0 +1,51 @@ +import { serializeShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { deserializeShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { ShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingTargetLocationInputV2026R0 = + | ShuttlePathMappingAccountLocationTargetInputV2026R0 + | ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0; +export function serializeShuttlePathMappingTargetLocationInputV2026R0( + val: any, +): SerializedData { + if (val.type == 'account') { + return serializeShuttlePathMappingAccountLocationTargetInputV2026R0(val); + } + if (val.type == 'shared_space') { + return serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0( + val, + ); + } + throw new BoxSdkError({ message: 'unknown type' }); +} +export function deserializeShuttlePathMappingTargetLocationInputV2026R0( + val: SerializedData, +): ShuttlePathMappingTargetLocationInputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttlePathMappingTargetLocationInputV2026R0"', + }); + } + if (val.type == 'account') { + return deserializeShuttlePathMappingAccountLocationTargetInputV2026R0(val); + } + if (val.type == 'shared_space') { + return deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0( + val, + ); + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttlePathMappingTargetLocationInputV2026R0", + }); +} diff --git a/src/schemas/v2026R0/shuttlePathMappingUpdateRequestV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingUpdateRequestV2026R0.ts new file mode 100644 index 00000000..920f8dc8 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingUpdateRequestV2026R0.ts @@ -0,0 +1,82 @@ +import { serializeShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { deserializeShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { serializeShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { deserializeShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { serializeShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { deserializeShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { serializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { deserializeShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { serializeShuttlePathMappingLocationInputV2026R0 } from './shuttlePathMappingLocationInputV2026R0'; +import { deserializeShuttlePathMappingLocationInputV2026R0 } from './shuttlePathMappingLocationInputV2026R0'; +import { serializeShuttlePathMappingTargetLocationInputV2026R0 } from './shuttlePathMappingTargetLocationInputV2026R0'; +import { deserializeShuttlePathMappingTargetLocationInputV2026R0 } from './shuttlePathMappingTargetLocationInputV2026R0'; +import { ShuttlePathMappingAccountLocationInputV2026R0 } from './shuttlePathMappingAccountLocationInputV2026R0'; +import { ShuttlePathMappingSharedSpaceLocationInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationInputV2026R0'; +import { ShuttlePathMappingAccountLocationTargetInputV2026R0 } from './shuttlePathMappingAccountLocationTargetInputV2026R0'; +import { ShuttlePathMappingSharedSpaceLocationTargetInputV2026R0 } from './shuttlePathMappingSharedSpaceLocationTargetInputV2026R0'; +import { ShuttlePathMappingLocationInputV2026R0 } from './shuttlePathMappingLocationInputV2026R0'; +import { ShuttlePathMappingTargetLocationInputV2026R0 } from './shuttlePathMappingTargetLocationInputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttlePathMappingUpdateRequestV2026R0 { + /** + * Whether this source path should be skipped during the migration. */ + readonly isPathSkipped?: boolean; + readonly source?: ShuttlePathMappingLocationInputV2026R0; + /** + * The destination location to migrate to. Set to `null` to clear the + * destination, for example when skipping the source path. */ + readonly target?: ShuttlePathMappingTargetLocationInputV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingUpdateRequestV2026R0( + val: ShuttlePathMappingUpdateRequestV2026R0, +): SerializedData { + return { + ['is_path_skipped']: val.isPathSkipped, + ['source']: + val.source == void 0 + ? val.source + : serializeShuttlePathMappingLocationInputV2026R0(val.source), + ['target']: + val.target == void 0 + ? val.target + : serializeShuttlePathMappingTargetLocationInputV2026R0(val.target), + }; +} +export function deserializeShuttlePathMappingUpdateRequestV2026R0( + val: SerializedData, +): ShuttlePathMappingUpdateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingUpdateRequestV2026R0"', + }); + } + if (!(val.is_path_skipped == void 0) && !sdIsBoolean(val.is_path_skipped)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_path_skipped" of type "ShuttlePathMappingUpdateRequestV2026R0"', + }); + } + const isPathSkipped: undefined | boolean = + val.is_path_skipped == void 0 ? void 0 : val.is_path_skipped; + const source: undefined | ShuttlePathMappingLocationInputV2026R0 = + val.source == void 0 + ? void 0 + : deserializeShuttlePathMappingLocationInputV2026R0(val.source); + const target: ShuttlePathMappingTargetLocationInputV2026R0 | undefined = + val.target == void 0 + ? void 0 + : deserializeShuttlePathMappingTargetLocationInputV2026R0(val.target); + return { + isPathSkipped: isPathSkipped, + source: source, + target: target, + } satisfies ShuttlePathMappingUpdateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingV2026R0.ts new file mode 100644 index 00000000..17c4b882 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingV2026R0.ts @@ -0,0 +1,280 @@ +import { serializeShuttlePathMappingAccountLocationV2026R0 } from './shuttlePathMappingAccountLocationV2026R0'; +import { deserializeShuttlePathMappingAccountLocationV2026R0 } from './shuttlePathMappingAccountLocationV2026R0'; +import { serializeShuttlePathMappingSharedSpaceLocationV2026R0 } from './shuttlePathMappingSharedSpaceLocationV2026R0'; +import { deserializeShuttlePathMappingSharedSpaceLocationV2026R0 } from './shuttlePathMappingSharedSpaceLocationV2026R0'; +import { serializeShuttlePathMappingLocationV2026R0 } from './shuttlePathMappingLocationV2026R0'; +import { deserializeShuttlePathMappingLocationV2026R0 } from './shuttlePathMappingLocationV2026R0'; +import { ShuttlePathMappingAccountLocationV2026R0 } from './shuttlePathMappingAccountLocationV2026R0'; +import { ShuttlePathMappingSharedSpaceLocationV2026R0 } from './shuttlePathMappingSharedSpaceLocationV2026R0'; +import { ShuttlePathMappingLocationV2026R0 } from './shuttlePathMappingLocationV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttlePathMappingV2026R0TypeField = 'shuttle_path_mapping'; +export class ShuttlePathMappingV2026R0 { + /** + * The unique identifier for the shuttle path mapping. */ + readonly id!: string; + /** + * The value will always be `shuttle_path_mapping`. */ + readonly type: ShuttlePathMappingV2026R0TypeField = + 'shuttle_path_mapping' as ShuttlePathMappingV2026R0TypeField; + /** + * The unique identifier of the shuttle job this mapping belongs to. */ + readonly jobId!: string; + /** + * Whether this source path is skipped during the migration. */ + readonly isPathSkipped!: boolean; + readonly source!: ShuttlePathMappingLocationV2026R0; + /** + * The destination location. `null` when the source path is skipped or + * the job has no destination, such as an analysis job. */ + readonly target?: ShuttlePathMappingLocationV2026R0; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.jobId !== undefined) { + this.jobId = fields.jobId; + } + if (fields.isPathSkipped !== undefined) { + this.isPathSkipped = fields.isPathSkipped; + } + if (fields.source !== undefined) { + this.source = fields.source; + } + if (fields.target !== undefined) { + this.target = fields.target; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttlePathMappingV2026R0Input { + /** + * The unique identifier for the shuttle path mapping. */ + readonly id: string; + /** + * The value will always be `shuttle_path_mapping`. */ + readonly type?: ShuttlePathMappingV2026R0TypeField; + /** + * The unique identifier of the shuttle job this mapping belongs to. */ + readonly jobId: string; + /** + * Whether this source path is skipped during the migration. */ + readonly isPathSkipped: boolean; + readonly source: ShuttlePathMappingLocationV2026R0; + /** + * The destination location. `null` when the source path is skipped or + * the job has no destination, such as an analysis job. */ + readonly target?: ShuttlePathMappingLocationV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingV2026R0TypeField( + val: ShuttlePathMappingV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttlePathMappingV2026R0TypeField( + val: SerializedData, +): ShuttlePathMappingV2026R0TypeField { + if (val == 'shuttle_path_mapping') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttlePathMappingV2026R0TypeField", + }); +} +export function serializeShuttlePathMappingV2026R0( + val: ShuttlePathMappingV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttlePathMappingV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['is_path_skipped']: val.isPathSkipped, + ['source']: serializeShuttlePathMappingLocationV2026R0(val.source), + ['target']: + val.target == void 0 + ? val.target + : serializeShuttlePathMappingLocationV2026R0(val.target), + }; +} +export function deserializeShuttlePathMappingV2026R0( + val: SerializedData, +): ShuttlePathMappingV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttlePathMappingV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttlePathMappingV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttlePathMappingV2026R0" to be defined', + }); + } + const type: ShuttlePathMappingV2026R0TypeField = + deserializeShuttlePathMappingV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttlePathMappingV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttlePathMappingV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.is_path_skipped == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "is_path_skipped" of type "ShuttlePathMappingV2026R0" to be defined', + }); + } + if (!sdIsBoolean(val.is_path_skipped)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_path_skipped" of type "ShuttlePathMappingV2026R0"', + }); + } + const isPathSkipped: boolean = val.is_path_skipped; + if (val.source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source" of type "ShuttlePathMappingV2026R0" to be defined', + }); + } + const source: ShuttlePathMappingLocationV2026R0 = + deserializeShuttlePathMappingLocationV2026R0(val.source); + const target: ShuttlePathMappingLocationV2026R0 | undefined = + val.target == void 0 + ? void 0 + : deserializeShuttlePathMappingLocationV2026R0(val.target); + return { + id: id, + type: type, + jobId: jobId, + isPathSkipped: isPathSkipped, + source: source, + target: target, + } satisfies ShuttlePathMappingV2026R0; +} +export function serializeShuttlePathMappingV2026R0Input( + val: ShuttlePathMappingV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttlePathMappingV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['is_path_skipped']: val.isPathSkipped, + ['source']: serializeShuttlePathMappingLocationV2026R0(val.source), + ['target']: + val.target == void 0 + ? val.target + : serializeShuttlePathMappingLocationV2026R0(val.target), + }; +} +export function deserializeShuttlePathMappingV2026R0Input( + val: SerializedData, +): ShuttlePathMappingV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttlePathMappingV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttlePathMappingV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttlePathMappingV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttlePathMappingV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttlePathMappingV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttlePathMappingV2026R0Input"', + }); + } + const jobId: string = val.job_id; + if (val.is_path_skipped == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "is_path_skipped" of type "ShuttlePathMappingV2026R0Input" to be defined', + }); + } + if (!sdIsBoolean(val.is_path_skipped)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_path_skipped" of type "ShuttlePathMappingV2026R0Input"', + }); + } + const isPathSkipped: boolean = val.is_path_skipped; + if (val.source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source" of type "ShuttlePathMappingV2026R0Input" to be defined', + }); + } + const source: ShuttlePathMappingLocationV2026R0 = + deserializeShuttlePathMappingLocationV2026R0(val.source); + const target: ShuttlePathMappingLocationV2026R0 | undefined = + val.target == void 0 + ? void 0 + : deserializeShuttlePathMappingLocationV2026R0(val.target); + return { + id: id, + type: type, + jobId: jobId, + isPathSkipped: isPathSkipped, + source: source, + target: target, + } satisfies ShuttlePathMappingV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttlePathMappingsV2026R0.ts b/src/schemas/v2026R0/shuttlePathMappingsV2026R0.ts new file mode 100644 index 00000000..3a8f5895 --- /dev/null +++ b/src/schemas/v2026R0/shuttlePathMappingsV2026R0.ts @@ -0,0 +1,99 @@ +import { serializeShuttlePathMappingV2026R0 } from './shuttlePathMappingV2026R0'; +import { deserializeShuttlePathMappingV2026R0 } from './shuttlePathMappingV2026R0'; +import { ShuttlePathMappingV2026R0 } from './shuttlePathMappingV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttlePathMappingsV2026R0 { + /** + * A list of shuttle path mappings. */ + readonly entries: readonly ShuttlePathMappingV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttlePathMappingsV2026R0( + val: ShuttlePathMappingsV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttlePathMappingV2026R0, + ): SerializedData { + return serializeShuttlePathMappingV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttlePathMappingsV2026R0( + val: SerializedData, +): ShuttlePathMappingsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttlePathMappingsV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "entries" of type "ShuttlePathMappingsV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: + 'Expecting array for "entries" of type "ShuttlePathMappingsV2026R0"', + }); + } + const entries: readonly ShuttlePathMappingV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function ( + itm: SerializedData, + ): ShuttlePathMappingV2026R0 { + return deserializeShuttlePathMappingV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: + 'Expecting number for "limit" of type "ShuttlePathMappingsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttlePathMappingsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttlePathMappingsV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttlePathMappingsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleReportCreateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleReportCreateRequestV2026R0.ts new file mode 100644 index 00000000..a4de6e2d --- /dev/null +++ b/src/schemas/v2026R0/shuttleReportCreateRequestV2026R0.ts @@ -0,0 +1,160 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleReportCreateRequestV2026R0FormatField = + 'xlsx' | 'csv' | string; +export type ShuttleReportCreateRequestV2026R0UsersScopeField = + 'migrated' | 'all' | string; +export interface ShuttleReportCreateRequestV2026R0 { + /** + * The unique identifier of the shuttle run to generate a report for. */ + readonly runId: string; + /** + * The output file format of the report. */ + readonly format: ShuttleReportCreateRequestV2026R0FormatField; + /** + * The sections to include in the report. Must be a non-empty subset of + * the run's `available_report_sections`. This is an open list whose set + * of values is expected to grow; the currently documented values include + * `files_and_folders`, `event_log`, `transfer_overview`, `source_users`, + * `target_users`, `source_collaborators`, `target_collaborators`, + * `source_collaborations`, and `target_collaborations`. */ + readonly sections: readonly string[]; + /** + * Which users to include in user-related report sections. Defaults to + * `migrated` when omitted. */ + readonly usersScope?: ShuttleReportCreateRequestV2026R0UsersScopeField; + readonly rawData?: SerializedData; +} +export function serializeShuttleReportCreateRequestV2026R0FormatField( + val: ShuttleReportCreateRequestV2026R0FormatField, +): SerializedData { + return val; +} +export function deserializeShuttleReportCreateRequestV2026R0FormatField( + val: SerializedData, +): ShuttleReportCreateRequestV2026R0FormatField { + if (val == 'xlsx') { + return val; + } + if (val == 'csv') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleReportCreateRequestV2026R0FormatField", + }); +} +export function serializeShuttleReportCreateRequestV2026R0UsersScopeField( + val: ShuttleReportCreateRequestV2026R0UsersScopeField, +): SerializedData { + return val; +} +export function deserializeShuttleReportCreateRequestV2026R0UsersScopeField( + val: SerializedData, +): ShuttleReportCreateRequestV2026R0UsersScopeField { + if (val == 'migrated') { + return val; + } + if (val == 'all') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleReportCreateRequestV2026R0UsersScopeField", + }); +} +export function serializeShuttleReportCreateRequestV2026R0( + val: ShuttleReportCreateRequestV2026R0, +): SerializedData { + return { + ['run_id']: val.runId, + ['format']: serializeShuttleReportCreateRequestV2026R0FormatField( + val.format, + ), + ['sections']: val.sections.map(function (item: string): SerializedData { + return item; + }) as readonly any[], + ['users_scope']: + val.usersScope == void 0 + ? val.usersScope + : serializeShuttleReportCreateRequestV2026R0UsersScopeField( + val.usersScope, + ), + }; +} +export function deserializeShuttleReportCreateRequestV2026R0( + val: SerializedData, +): ShuttleReportCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleReportCreateRequestV2026R0"', + }); + } + if (val.run_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "run_id" of type "ShuttleReportCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.run_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "run_id" of type "ShuttleReportCreateRequestV2026R0"', + }); + } + const runId: string = val.run_id; + if (val.format == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "format" of type "ShuttleReportCreateRequestV2026R0" to be defined', + }); + } + const format: ShuttleReportCreateRequestV2026R0FormatField = + deserializeShuttleReportCreateRequestV2026R0FormatField(val.format); + if (val.sections == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "sections" of type "ShuttleReportCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsList(val.sections)) { + throw new BoxSdkError({ + message: + 'Expecting array for "sections" of type "ShuttleReportCreateRequestV2026R0"', + }); + } + const sections: readonly string[] = sdIsList(val.sections) + ? (val.sections.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleReportCreateRequestV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + const usersScope: + undefined | ShuttleReportCreateRequestV2026R0UsersScopeField = + val.users_scope == void 0 + ? void 0 + : deserializeShuttleReportCreateRequestV2026R0UsersScopeField( + val.users_scope, + ); + return { + runId: runId, + format: format, + sections: sections, + usersScope: usersScope, + } satisfies ShuttleReportCreateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleReportOutputV2026R0.ts b/src/schemas/v2026R0/shuttleReportOutputV2026R0.ts new file mode 100644 index 00000000..0adde3f7 --- /dev/null +++ b/src/schemas/v2026R0/shuttleReportOutputV2026R0.ts @@ -0,0 +1,74 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleReportOutputV2026R0TypeField = 'file' | 'folder'; +export interface ShuttleReportOutputV2026R0 { + /** + * The unique identifier of the generated Box file or folder. */ + readonly id: string; + /** + * The Box object type of the generated file or folder. */ + readonly type: ShuttleReportOutputV2026R0TypeField; + readonly rawData?: SerializedData; +} +export function serializeShuttleReportOutputV2026R0TypeField( + val: ShuttleReportOutputV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleReportOutputV2026R0TypeField( + val: SerializedData, +): ShuttleReportOutputV2026R0TypeField { + if (val == 'file') { + return val; + } + if (val == 'folder') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleReportOutputV2026R0TypeField", + }); +} +export function serializeShuttleReportOutputV2026R0( + val: ShuttleReportOutputV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleReportOutputV2026R0TypeField(val.type), + }; +} +export function deserializeShuttleReportOutputV2026R0( + val: SerializedData, +): ShuttleReportOutputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleReportOutputV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleReportOutputV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleReportOutputV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleReportOutputV2026R0" to be defined', + }); + } + const type: ShuttleReportOutputV2026R0TypeField = + deserializeShuttleReportOutputV2026R0TypeField(val.type); + return { id: id, type: type } satisfies ShuttleReportOutputV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleReportV2026R0.ts b/src/schemas/v2026R0/shuttleReportV2026R0.ts new file mode 100644 index 00000000..1112cb23 --- /dev/null +++ b/src/schemas/v2026R0/shuttleReportV2026R0.ts @@ -0,0 +1,507 @@ +import { serializeShuttleReportOutputV2026R0 } from './shuttleReportOutputV2026R0'; +import { deserializeShuttleReportOutputV2026R0 } from './shuttleReportOutputV2026R0'; +import { serializeDateTime } from '../../internal/utils'; +import { deserializeDateTime } from '../../internal/utils'; +import { ShuttleReportOutputV2026R0 } from './shuttleReportOutputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { DateTime } from '../../internal/utils'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleReportV2026R0TypeField = 'shuttle_report'; +export type ShuttleReportV2026R0FormatField = 'xlsx' | 'csv' | string; +export type ShuttleReportV2026R0UsersScopeField = 'migrated' | 'all' | string; +export class ShuttleReportV2026R0 { + /** + * The unique identifier for the shuttle report. */ + readonly id!: string; + /** + * The value will always be `shuttle_report`. */ + readonly type: ShuttleReportV2026R0TypeField = + 'shuttle_report' as ShuttleReportV2026R0TypeField; + /** + * The unique identifier of the shuttle run this report was generated + * for. */ + readonly runId!: string; + /** + * The generation status of the report. This is an open string whose set + * of values is expected to grow; the currently documented values include + * `pending`, `processing`, `complete`, `failed`, `canceled`, and + * `unknown`. Keep polling `pending` and `processing`. Stop on + * `complete`, `failed`, `canceled`, and `unknown`. Treat any value that + * is not recognized the same as `unknown`: do not fail parsing, and do + * not keep polling. */ + readonly status!: string; + /** + * The output file format of the report. */ + readonly format!: ShuttleReportV2026R0FormatField; + /** + * The sections included in the report. Echoes the sections requested on + * create. This is an open list whose set of values is expected to grow; + * the currently documented values include `files_and_folders`, + * `event_log`, `transfer_overview`, `source_users`, `target_users`, + * `source_collaborators`, `target_collaborators`, + * `source_collaborations`, and `target_collaborations`. Omitted on + * older reports that have no stored section list. New reports always + * include this field. */ + readonly sections?: readonly string[]; + /** + * Which users are included in user-related report sections. */ + readonly usersScope?: ShuttleReportV2026R0UsersScopeField; + /** + * The generated Box file or folder. Always present; `null` until + * `status` is `complete`. */ + readonly output?: ShuttleReportOutputV2026R0; + /** + * When report generation was requested. */ + readonly createdAt?: DateTime; + /** + * When report generation finished. Always present; `null` while + * generation is still in progress. */ + readonly completedAt?: DateTime | null; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.runId !== undefined) { + this.runId = fields.runId; + } + if (fields.status !== undefined) { + this.status = fields.status; + } + if (fields.format !== undefined) { + this.format = fields.format; + } + if (fields.sections !== undefined) { + this.sections = fields.sections; + } + if (fields.usersScope !== undefined) { + this.usersScope = fields.usersScope; + } + if (fields.output !== undefined) { + this.output = fields.output; + } + if (fields.createdAt !== undefined) { + this.createdAt = fields.createdAt; + } + if (fields.completedAt !== undefined) { + this.completedAt = fields.completedAt; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleReportV2026R0Input { + /** + * The unique identifier for the shuttle report. */ + readonly id: string; + /** + * The value will always be `shuttle_report`. */ + readonly type?: ShuttleReportV2026R0TypeField; + /** + * The unique identifier of the shuttle run this report was generated + * for. */ + readonly runId: string; + /** + * The generation status of the report. This is an open string whose set + * of values is expected to grow; the currently documented values include + * `pending`, `processing`, `complete`, `failed`, `canceled`, and + * `unknown`. Keep polling `pending` and `processing`. Stop on + * `complete`, `failed`, `canceled`, and `unknown`. Treat any value that + * is not recognized the same as `unknown`: do not fail parsing, and do + * not keep polling. */ + readonly status: string; + /** + * The output file format of the report. */ + readonly format: ShuttleReportV2026R0FormatField; + /** + * The sections included in the report. Echoes the sections requested on + * create. This is an open list whose set of values is expected to grow; + * the currently documented values include `files_and_folders`, + * `event_log`, `transfer_overview`, `source_users`, `target_users`, + * `source_collaborators`, `target_collaborators`, + * `source_collaborations`, and `target_collaborations`. Omitted on + * older reports that have no stored section list. New reports always + * include this field. */ + readonly sections?: readonly string[]; + /** + * Which users are included in user-related report sections. */ + readonly usersScope?: ShuttleReportV2026R0UsersScopeField; + /** + * The generated Box file or folder. Always present; `null` until + * `status` is `complete`. */ + readonly output?: ShuttleReportOutputV2026R0; + /** + * When report generation was requested. */ + readonly createdAt?: DateTime; + /** + * When report generation finished. Always present; `null` while + * generation is still in progress. */ + readonly completedAt?: DateTime | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleReportV2026R0TypeField( + val: ShuttleReportV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleReportV2026R0TypeField( + val: SerializedData, +): ShuttleReportV2026R0TypeField { + if (val == 'shuttle_report') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleReportV2026R0TypeField", + }); +} +export function serializeShuttleReportV2026R0FormatField( + val: ShuttleReportV2026R0FormatField, +): SerializedData { + return val; +} +export function deserializeShuttleReportV2026R0FormatField( + val: SerializedData, +): ShuttleReportV2026R0FormatField { + if (val == 'xlsx') { + return val; + } + if (val == 'csv') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleReportV2026R0FormatField", + }); +} +export function serializeShuttleReportV2026R0UsersScopeField( + val: ShuttleReportV2026R0UsersScopeField, +): SerializedData { + return val; +} +export function deserializeShuttleReportV2026R0UsersScopeField( + val: SerializedData, +): ShuttleReportV2026R0UsersScopeField { + if (val == 'migrated') { + return val; + } + if (val == 'all') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleReportV2026R0UsersScopeField", + }); +} +export function serializeShuttleReportV2026R0( + val: ShuttleReportV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleReportV2026R0TypeField(val.type), + ['run_id']: val.runId, + ['status']: val.status, + ['format']: serializeShuttleReportV2026R0FormatField(val.format), + ['sections']: + val.sections == void 0 + ? val.sections + : (val.sections.map(function (item: string): SerializedData { + return item; + }) as readonly any[]), + ['users_scope']: + val.usersScope == void 0 + ? val.usersScope + : serializeShuttleReportV2026R0UsersScopeField(val.usersScope), + ['output']: + val.output == void 0 + ? val.output + : serializeShuttleReportOutputV2026R0(val.output), + ['created_at']: + val.createdAt == void 0 + ? val.createdAt + : serializeDateTime(val.createdAt), + ['completed_at']: + val.completedAt == void 0 + ? val.completedAt + : serializeDateTime(val.completedAt), + }; +} +export function deserializeShuttleReportV2026R0( + val: SerializedData, +): ShuttleReportV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleReportV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "ShuttleReportV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleReportV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "ShuttleReportV2026R0" to be defined', + }); + } + const type: ShuttleReportV2026R0TypeField = + deserializeShuttleReportV2026R0TypeField(val.type); + if (val.run_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "run_id" of type "ShuttleReportV2026R0" to be defined', + }); + } + if (!sdIsString(val.run_id)) { + throw new BoxSdkError({ + message: 'Expecting string for "run_id" of type "ShuttleReportV2026R0"', + }); + } + const runId: string = val.run_id; + if (val.status == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "status" of type "ShuttleReportV2026R0" to be defined', + }); + } + if (!sdIsString(val.status)) { + throw new BoxSdkError({ + message: 'Expecting string for "status" of type "ShuttleReportV2026R0"', + }); + } + const status: string = val.status; + if (val.format == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "format" of type "ShuttleReportV2026R0" to be defined', + }); + } + const format: ShuttleReportV2026R0FormatField = + deserializeShuttleReportV2026R0FormatField(val.format); + if (!(val.sections == void 0) && !sdIsList(val.sections)) { + throw new BoxSdkError({ + message: 'Expecting array for "sections" of type "ShuttleReportV2026R0"', + }); + } + const sections: undefined | readonly string[] = + val.sections == void 0 + ? void 0 + : sdIsList(val.sections) + ? (val.sections.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleReportV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + const usersScope: undefined | ShuttleReportV2026R0UsersScopeField = + val.users_scope == void 0 + ? void 0 + : deserializeShuttleReportV2026R0UsersScopeField(val.users_scope); + const output: ShuttleReportOutputV2026R0 | undefined = + val.output == void 0 + ? void 0 + : deserializeShuttleReportOutputV2026R0(val.output); + if (!(val.created_at == void 0) && !sdIsString(val.created_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "created_at" of type "ShuttleReportV2026R0"', + }); + } + const createdAt: undefined | DateTime = + val.created_at == void 0 ? void 0 : deserializeDateTime(val.created_at); + if (!(val.completed_at == void 0) && !sdIsString(val.completed_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "completed_at" of type "ShuttleReportV2026R0"', + }); + } + const completedAt: undefined | DateTime = + val.completed_at == void 0 ? void 0 : deserializeDateTime(val.completed_at); + return { + id: id, + type: type, + runId: runId, + status: status, + format: format, + sections: sections, + usersScope: usersScope, + output: output, + createdAt: createdAt, + completedAt: completedAt, + } satisfies ShuttleReportV2026R0; +} +export function serializeShuttleReportV2026R0Input( + val: ShuttleReportV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleReportV2026R0TypeField(val.type), + ['run_id']: val.runId, + ['status']: val.status, + ['format']: serializeShuttleReportV2026R0FormatField(val.format), + ['sections']: + val.sections == void 0 + ? val.sections + : (val.sections.map(function (item: string): SerializedData { + return item; + }) as readonly any[]), + ['users_scope']: + val.usersScope == void 0 + ? val.usersScope + : serializeShuttleReportV2026R0UsersScopeField(val.usersScope), + ['output']: + val.output == void 0 + ? val.output + : serializeShuttleReportOutputV2026R0(val.output), + ['created_at']: + val.createdAt == void 0 + ? val.createdAt + : serializeDateTime(val.createdAt), + ['completed_at']: + val.completedAt == void 0 + ? val.completedAt + : serializeDateTime(val.completedAt), + }; +} +export function deserializeShuttleReportV2026R0Input( + val: SerializedData, +): ShuttleReportV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleReportV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleReportV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleReportV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttleReportV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleReportV2026R0TypeField(val.type); + if (val.run_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "run_id" of type "ShuttleReportV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.run_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "run_id" of type "ShuttleReportV2026R0Input"', + }); + } + const runId: string = val.run_id; + if (val.status == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "status" of type "ShuttleReportV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.status)) { + throw new BoxSdkError({ + message: + 'Expecting string for "status" of type "ShuttleReportV2026R0Input"', + }); + } + const status: string = val.status; + if (val.format == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "format" of type "ShuttleReportV2026R0Input" to be defined', + }); + } + const format: ShuttleReportV2026R0FormatField = + deserializeShuttleReportV2026R0FormatField(val.format); + if (!(val.sections == void 0) && !sdIsList(val.sections)) { + throw new BoxSdkError({ + message: + 'Expecting array for "sections" of type "ShuttleReportV2026R0Input"', + }); + } + const sections: undefined | readonly string[] = + val.sections == void 0 + ? void 0 + : sdIsList(val.sections) + ? (val.sections.map(function (itm: SerializedData): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleReportV2026R0Input"', + }); + } + return itm; + }) as readonly any[]) + : []; + const usersScope: undefined | ShuttleReportV2026R0UsersScopeField = + val.users_scope == void 0 + ? void 0 + : deserializeShuttleReportV2026R0UsersScopeField(val.users_scope); + const output: ShuttleReportOutputV2026R0 | undefined = + val.output == void 0 + ? void 0 + : deserializeShuttleReportOutputV2026R0(val.output); + if (!(val.created_at == void 0) && !sdIsString(val.created_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "created_at" of type "ShuttleReportV2026R0Input"', + }); + } + const createdAt: undefined | DateTime = + val.created_at == void 0 ? void 0 : deserializeDateTime(val.created_at); + if (!(val.completed_at == void 0) && !sdIsString(val.completed_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "completed_at" of type "ShuttleReportV2026R0Input"', + }); + } + const completedAt: undefined | DateTime = + val.completed_at == void 0 ? void 0 : deserializeDateTime(val.completed_at); + return { + id: id, + type: type, + runId: runId, + status: status, + format: format, + sections: sections, + usersScope: usersScope, + output: output, + createdAt: createdAt, + completedAt: completedAt, + } satisfies ShuttleReportV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleReportsV2026R0.ts b/src/schemas/v2026R0/shuttleReportsV2026R0.ts new file mode 100644 index 00000000..662a9be2 --- /dev/null +++ b/src/schemas/v2026R0/shuttleReportsV2026R0.ts @@ -0,0 +1,95 @@ +import { serializeShuttleReportV2026R0 } from './shuttleReportV2026R0'; +import { deserializeShuttleReportV2026R0 } from './shuttleReportV2026R0'; +import { ShuttleReportV2026R0 } from './shuttleReportV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleReportsV2026R0 { + /** + * A list of shuttle reports. */ + readonly entries: readonly ShuttleReportV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleReportsV2026R0( + val: ShuttleReportsV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttleReportV2026R0, + ): SerializedData { + return serializeShuttleReportV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttleReportsV2026R0( + val: SerializedData, +): ShuttleReportsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleReportsV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "entries" of type "ShuttleReportsV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: 'Expecting array for "entries" of type "ShuttleReportsV2026R0"', + }); + } + const entries: readonly ShuttleReportV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function (itm: SerializedData): ShuttleReportV2026R0 { + return deserializeShuttleReportV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: 'Expecting number for "limit" of type "ShuttleReportsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttleReportsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttleReportsV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttleReportsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleRunV2026R0.ts b/src/schemas/v2026R0/shuttleRunV2026R0.ts new file mode 100644 index 00000000..35c4e0fb --- /dev/null +++ b/src/schemas/v2026R0/shuttleRunV2026R0.ts @@ -0,0 +1,574 @@ +import { serializeUserBaseV2026R0 } from './userBaseV2026R0'; +import { deserializeUserBaseV2026R0 } from './userBaseV2026R0'; +import { serializeDateTime } from '../../internal/utils'; +import { deserializeDateTime } from '../../internal/utils'; +import { UserBaseV2026R0 } from './userBaseV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { DateTime } from '../../internal/utils'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleRunV2026R0TypeField = 'shuttle_run'; +export interface ShuttleRunV2026R0StatsField { + /** + * Bytes transferred during the run. */ + readonly bytesSent?: number; + /** + * Files transferred during the run. */ + readonly filesSent?: number; + /** + * Folders created on the destination during the run. */ + readonly foldersCreated?: number; + /** + * Whether these figures are estimates rather than final counts. */ + readonly isEstimated?: boolean; + readonly rawData?: SerializedData; +} +export class ShuttleRunV2026R0 { + /** + * The unique identifier for the shuttle run, in the form + * `{job_id}:{run_number}`. */ + readonly id!: string; + /** + * The value will always be `shuttle_run`. */ + readonly type: ShuttleRunV2026R0TypeField = + 'shuttle_run' as ShuttleRunV2026R0TypeField; + /** + * The unique identifier of the shuttle job this run belongs to. */ + readonly jobId!: string; + /** + * The mode the run was started in. This is an open string whose set of + * values is expected to grow; the currently documented values include + * `transfer`, `simulation`, `analysis`, `scan`, and `unknown`. Clients + * should treat any value they do not recognize as `unknown`. */ + readonly runMode!: string; + /** + * The current state of the shuttle run. This is an open string whose set + * of values is expected to grow; the currently documented values include + * `running`, `stopping`, `completed`, `completed_with_errors`, `stopped`, + * `failed`, `timed_out`, and `unknown`. Clients should treat any value + * they do not recognize as `unknown`. */ + readonly state!: string; + /** + * When the run started. */ + readonly startedAt?: DateTime; + /** + * When the run ended. `null` while the run is still in progress. */ + readonly endedAt?: DateTime | null; + /** + * Total duration of the run in seconds. `null` while the run is still in + * progress. */ + readonly durationSeconds?: number | null; + /** + * Transfer statistics collected during the run. */ + readonly stats?: ShuttleRunV2026R0StatsField; + /** + * The user who started the run. `null` for schedule- or system-initiated + * runs. */ + readonly createdBy?: UserBaseV2026R0; + /** + * Report sections that can be requested for this run. This is an open + * list whose set of values is expected to grow; the currently documented + * values include `files_and_folders`, `event_log`, `transfer_overview`, + * `source_users`, `target_users`, `source_collaborators`, + * `target_collaborators`, `source_collaborations`, and + * `target_collaborations`. */ + readonly availableReportSections?: readonly string[]; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.jobId !== undefined) { + this.jobId = fields.jobId; + } + if (fields.runMode !== undefined) { + this.runMode = fields.runMode; + } + if (fields.state !== undefined) { + this.state = fields.state; + } + if (fields.startedAt !== undefined) { + this.startedAt = fields.startedAt; + } + if (fields.endedAt !== undefined) { + this.endedAt = fields.endedAt; + } + if (fields.durationSeconds !== undefined) { + this.durationSeconds = fields.durationSeconds; + } + if (fields.stats !== undefined) { + this.stats = fields.stats; + } + if (fields.createdBy !== undefined) { + this.createdBy = fields.createdBy; + } + if (fields.availableReportSections !== undefined) { + this.availableReportSections = fields.availableReportSections; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleRunV2026R0Input { + /** + * The unique identifier for the shuttle run, in the form + * `{job_id}:{run_number}`. */ + readonly id: string; + /** + * The value will always be `shuttle_run`. */ + readonly type?: ShuttleRunV2026R0TypeField; + /** + * The unique identifier of the shuttle job this run belongs to. */ + readonly jobId: string; + /** + * The mode the run was started in. This is an open string whose set of + * values is expected to grow; the currently documented values include + * `transfer`, `simulation`, `analysis`, `scan`, and `unknown`. Clients + * should treat any value they do not recognize as `unknown`. */ + readonly runMode: string; + /** + * The current state of the shuttle run. This is an open string whose set + * of values is expected to grow; the currently documented values include + * `running`, `stopping`, `completed`, `completed_with_errors`, `stopped`, + * `failed`, `timed_out`, and `unknown`. Clients should treat any value + * they do not recognize as `unknown`. */ + readonly state: string; + /** + * When the run started. */ + readonly startedAt?: DateTime; + /** + * When the run ended. `null` while the run is still in progress. */ + readonly endedAt?: DateTime | null; + /** + * Total duration of the run in seconds. `null` while the run is still in + * progress. */ + readonly durationSeconds?: number | null; + /** + * Transfer statistics collected during the run. */ + readonly stats?: ShuttleRunV2026R0StatsField; + /** + * The user who started the run. `null` for schedule- or system-initiated + * runs. */ + readonly createdBy?: UserBaseV2026R0; + /** + * Report sections that can be requested for this run. This is an open + * list whose set of values is expected to grow; the currently documented + * values include `files_and_folders`, `event_log`, `transfer_overview`, + * `source_users`, `target_users`, `source_collaborators`, + * `target_collaborators`, `source_collaborations`, and + * `target_collaborations`. */ + readonly availableReportSections?: readonly string[]; + readonly rawData?: SerializedData; +} +export function serializeShuttleRunV2026R0TypeField( + val: ShuttleRunV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleRunV2026R0TypeField( + val: SerializedData, +): ShuttleRunV2026R0TypeField { + if (val == 'shuttle_run') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleRunV2026R0TypeField", + }); +} +export function serializeShuttleRunV2026R0StatsField( + val: ShuttleRunV2026R0StatsField, +): SerializedData { + return { + ['bytes_sent']: val.bytesSent, + ['files_sent']: val.filesSent, + ['folders_created']: val.foldersCreated, + ['is_estimated']: val.isEstimated, + }; +} +export function deserializeShuttleRunV2026R0StatsField( + val: SerializedData, +): ShuttleRunV2026R0StatsField { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleRunV2026R0StatsField"', + }); + } + if (!(val.bytes_sent == void 0) && !sdIsNumber(val.bytes_sent)) { + throw new BoxSdkError({ + message: + 'Expecting number for "bytes_sent" of type "ShuttleRunV2026R0StatsField"', + }); + } + const bytesSent: undefined | number = + val.bytes_sent == void 0 ? void 0 : val.bytes_sent; + if (!(val.files_sent == void 0) && !sdIsNumber(val.files_sent)) { + throw new BoxSdkError({ + message: + 'Expecting number for "files_sent" of type "ShuttleRunV2026R0StatsField"', + }); + } + const filesSent: undefined | number = + val.files_sent == void 0 ? void 0 : val.files_sent; + if (!(val.folders_created == void 0) && !sdIsNumber(val.folders_created)) { + throw new BoxSdkError({ + message: + 'Expecting number for "folders_created" of type "ShuttleRunV2026R0StatsField"', + }); + } + const foldersCreated: undefined | number = + val.folders_created == void 0 ? void 0 : val.folders_created; + if (!(val.is_estimated == void 0) && !sdIsBoolean(val.is_estimated)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_estimated" of type "ShuttleRunV2026R0StatsField"', + }); + } + const isEstimated: undefined | boolean = + val.is_estimated == void 0 ? void 0 : val.is_estimated; + return { + bytesSent: bytesSent, + filesSent: filesSent, + foldersCreated: foldersCreated, + isEstimated: isEstimated, + } satisfies ShuttleRunV2026R0StatsField; +} +export function serializeShuttleRunV2026R0( + val: ShuttleRunV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleRunV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['run_mode']: val.runMode, + ['state']: val.state, + ['started_at']: + val.startedAt == void 0 + ? val.startedAt + : serializeDateTime(val.startedAt), + ['ended_at']: + val.endedAt == void 0 ? val.endedAt : serializeDateTime(val.endedAt), + ['duration_seconds']: val.durationSeconds, + ['stats']: + val.stats == void 0 + ? val.stats + : serializeShuttleRunV2026R0StatsField(val.stats), + ['created_by']: + val.createdBy == void 0 + ? val.createdBy + : serializeUserBaseV2026R0(val.createdBy), + ['available_report_sections']: + val.availableReportSections == void 0 + ? val.availableReportSections + : (val.availableReportSections.map(function ( + item: string, + ): SerializedData { + return item; + }) as readonly any[]), + }; +} +export function deserializeShuttleRunV2026R0( + val: SerializedData, +): ShuttleRunV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleRunV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "ShuttleRunV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleRunV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "ShuttleRunV2026R0" to be defined', + }); + } + const type: ShuttleRunV2026R0TypeField = + deserializeShuttleRunV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "job_id" of type "ShuttleRunV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: 'Expecting string for "job_id" of type "ShuttleRunV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.run_mode == void 0) { + throw new BoxSdkError({ + message: 'Expecting "run_mode" of type "ShuttleRunV2026R0" to be defined', + }); + } + if (!sdIsString(val.run_mode)) { + throw new BoxSdkError({ + message: 'Expecting string for "run_mode" of type "ShuttleRunV2026R0"', + }); + } + const runMode: string = val.run_mode; + if (val.state == void 0) { + throw new BoxSdkError({ + message: 'Expecting "state" of type "ShuttleRunV2026R0" to be defined', + }); + } + if (!sdIsString(val.state)) { + throw new BoxSdkError({ + message: 'Expecting string for "state" of type "ShuttleRunV2026R0"', + }); + } + const state: string = val.state; + if (!(val.started_at == void 0) && !sdIsString(val.started_at)) { + throw new BoxSdkError({ + message: 'Expecting string for "started_at" of type "ShuttleRunV2026R0"', + }); + } + const startedAt: undefined | DateTime = + val.started_at == void 0 ? void 0 : deserializeDateTime(val.started_at); + if (!(val.ended_at == void 0) && !sdIsString(val.ended_at)) { + throw new BoxSdkError({ + message: 'Expecting string for "ended_at" of type "ShuttleRunV2026R0"', + }); + } + const endedAt: undefined | DateTime = + val.ended_at == void 0 ? void 0 : deserializeDateTime(val.ended_at); + if (!(val.duration_seconds == void 0) && !sdIsNumber(val.duration_seconds)) { + throw new BoxSdkError({ + message: + 'Expecting number for "duration_seconds" of type "ShuttleRunV2026R0"', + }); + } + const durationSeconds: undefined | number = + val.duration_seconds == void 0 ? void 0 : val.duration_seconds; + const stats: undefined | ShuttleRunV2026R0StatsField = + val.stats == void 0 + ? void 0 + : deserializeShuttleRunV2026R0StatsField(val.stats); + const createdBy: UserBaseV2026R0 | undefined = + val.created_by == void 0 + ? void 0 + : deserializeUserBaseV2026R0(val.created_by); + if ( + !(val.available_report_sections == void 0) && + !sdIsList(val.available_report_sections) + ) { + throw new BoxSdkError({ + message: + 'Expecting array for "available_report_sections" of type "ShuttleRunV2026R0"', + }); + } + const availableReportSections: undefined | readonly string[] = + val.available_report_sections == void 0 + ? void 0 + : sdIsList(val.available_report_sections) + ? (val.available_report_sections.map(function ( + itm: SerializedData, + ): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleRunV2026R0"', + }); + } + return itm; + }) as readonly any[]) + : []; + return { + id: id, + type: type, + jobId: jobId, + runMode: runMode, + state: state, + startedAt: startedAt, + endedAt: endedAt, + durationSeconds: durationSeconds, + stats: stats, + createdBy: createdBy, + availableReportSections: availableReportSections, + } satisfies ShuttleRunV2026R0; +} +export function serializeShuttleRunV2026R0Input( + val: ShuttleRunV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleRunV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['run_mode']: val.runMode, + ['state']: val.state, + ['started_at']: + val.startedAt == void 0 + ? val.startedAt + : serializeDateTime(val.startedAt), + ['ended_at']: + val.endedAt == void 0 ? val.endedAt : serializeDateTime(val.endedAt), + ['duration_seconds']: val.durationSeconds, + ['stats']: + val.stats == void 0 + ? val.stats + : serializeShuttleRunV2026R0StatsField(val.stats), + ['created_by']: + val.createdBy == void 0 + ? val.createdBy + : serializeUserBaseV2026R0(val.createdBy), + ['available_report_sections']: + val.availableReportSections == void 0 + ? val.availableReportSections + : (val.availableReportSections.map(function ( + item: string, + ): SerializedData { + return item; + }) as readonly any[]), + }; +} +export function deserializeShuttleRunV2026R0Input( + val: SerializedData, +): ShuttleRunV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleRunV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "ShuttleRunV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleRunV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttleRunV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleRunV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleRunV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: 'Expecting string for "job_id" of type "ShuttleRunV2026R0Input"', + }); + } + const jobId: string = val.job_id; + if (val.run_mode == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "run_mode" of type "ShuttleRunV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.run_mode)) { + throw new BoxSdkError({ + message: + 'Expecting string for "run_mode" of type "ShuttleRunV2026R0Input"', + }); + } + const runMode: string = val.run_mode; + if (val.state == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "state" of type "ShuttleRunV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.state)) { + throw new BoxSdkError({ + message: 'Expecting string for "state" of type "ShuttleRunV2026R0Input"', + }); + } + const state: string = val.state; + if (!(val.started_at == void 0) && !sdIsString(val.started_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "started_at" of type "ShuttleRunV2026R0Input"', + }); + } + const startedAt: undefined | DateTime = + val.started_at == void 0 ? void 0 : deserializeDateTime(val.started_at); + if (!(val.ended_at == void 0) && !sdIsString(val.ended_at)) { + throw new BoxSdkError({ + message: + 'Expecting string for "ended_at" of type "ShuttleRunV2026R0Input"', + }); + } + const endedAt: undefined | DateTime = + val.ended_at == void 0 ? void 0 : deserializeDateTime(val.ended_at); + if (!(val.duration_seconds == void 0) && !sdIsNumber(val.duration_seconds)) { + throw new BoxSdkError({ + message: + 'Expecting number for "duration_seconds" of type "ShuttleRunV2026R0Input"', + }); + } + const durationSeconds: undefined | number = + val.duration_seconds == void 0 ? void 0 : val.duration_seconds; + const stats: undefined | ShuttleRunV2026R0StatsField = + val.stats == void 0 + ? void 0 + : deserializeShuttleRunV2026R0StatsField(val.stats); + const createdBy: UserBaseV2026R0 | undefined = + val.created_by == void 0 + ? void 0 + : deserializeUserBaseV2026R0(val.created_by); + if ( + !(val.available_report_sections == void 0) && + !sdIsList(val.available_report_sections) + ) { + throw new BoxSdkError({ + message: + 'Expecting array for "available_report_sections" of type "ShuttleRunV2026R0Input"', + }); + } + const availableReportSections: undefined | readonly string[] = + val.available_report_sections == void 0 + ? void 0 + : sdIsList(val.available_report_sections) + ? (val.available_report_sections.map(function ( + itm: SerializedData, + ): string { + if (!sdIsString(itm)) { + throw new BoxSdkError({ + message: 'Expecting string for "ShuttleRunV2026R0Input"', + }); + } + return itm; + }) as readonly any[]) + : []; + return { + id: id, + type: type, + jobId: jobId, + runMode: runMode, + state: state, + startedAt: startedAt, + endedAt: endedAt, + durationSeconds: durationSeconds, + stats: stats, + createdBy: createdBy, + availableReportSections: availableReportSections, + } satisfies ShuttleRunV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleRunsV2026R0.ts b/src/schemas/v2026R0/shuttleRunsV2026R0.ts new file mode 100644 index 00000000..06bcd323 --- /dev/null +++ b/src/schemas/v2026R0/shuttleRunsV2026R0.ts @@ -0,0 +1,94 @@ +import { serializeShuttleRunV2026R0 } from './shuttleRunV2026R0'; +import { deserializeShuttleRunV2026R0 } from './shuttleRunV2026R0'; +import { ShuttleRunV2026R0 } from './shuttleRunV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleRunsV2026R0 { + /** + * A list of shuttle runs. */ + readonly entries: readonly ShuttleRunV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleRunsV2026R0( + val: ShuttleRunsV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttleRunV2026R0, + ): SerializedData { + return serializeShuttleRunV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttleRunsV2026R0( + val: SerializedData, +): ShuttleRunsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleRunsV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: 'Expecting "entries" of type "ShuttleRunsV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: 'Expecting array for "entries" of type "ShuttleRunsV2026R0"', + }); + } + const entries: readonly ShuttleRunV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function (itm: SerializedData): ShuttleRunV2026R0 { + return deserializeShuttleRunV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: 'Expecting number for "limit" of type "ShuttleRunsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttleRunsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttleRunsV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttleRunsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleSubjectMappingCreateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleSubjectMappingCreateRequestV2026R0.ts new file mode 100644 index 00000000..e110b125 --- /dev/null +++ b/src/schemas/v2026R0/shuttleSubjectMappingCreateRequestV2026R0.ts @@ -0,0 +1,112 @@ +import { serializeShuttleTargetSubjectInputV2026R0 } from './shuttleTargetSubjectInputV2026R0'; +import { deserializeShuttleTargetSubjectInputV2026R0 } from './shuttleTargetSubjectInputV2026R0'; +import { ShuttleTargetSubjectInputV2026R0 } from './shuttleTargetSubjectInputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleSubjectMappingCreateRequestV2026R0 { + /** + * The unique identifier of the shuttle job this mapping belongs to. */ + readonly jobId: string; + /** + * The unique identifier of the discovered subject to map. */ + readonly discoveredSubjectId: string; + /** + * The discovery-requirements revision to resolve against. Omit to use the + * latest revision. */ + readonly revision?: number; + /** + * Whether this subject should be skipped during the migration. Defaults + * to `false`. */ + readonly isSubjectSkipped?: boolean; + /** + * The Box target to map to. Omit or set to `null` when the subject is + * skipped. */ + readonly target?: ShuttleTargetSubjectInputV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttleSubjectMappingCreateRequestV2026R0( + val: ShuttleSubjectMappingCreateRequestV2026R0, +): SerializedData { + return { + ['job_id']: val.jobId, + ['discovered_subject_id']: val.discoveredSubjectId, + ['revision']: val.revision, + ['is_subject_skipped']: val.isSubjectSkipped, + ['target']: + val.target == void 0 + ? val.target + : serializeShuttleTargetSubjectInputV2026R0(val.target), + }; +} +export function deserializeShuttleSubjectMappingCreateRequestV2026R0( + val: SerializedData, +): ShuttleSubjectMappingCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleSubjectMappingCreateRequestV2026R0"', + }); + } + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleSubjectMappingCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleSubjectMappingCreateRequestV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.discovered_subject_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "discovered_subject_id" of type "ShuttleSubjectMappingCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.discovered_subject_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "discovered_subject_id" of type "ShuttleSubjectMappingCreateRequestV2026R0"', + }); + } + const discoveredSubjectId: string = val.discovered_subject_id; + if (!(val.revision == void 0) && !sdIsNumber(val.revision)) { + throw new BoxSdkError({ + message: + 'Expecting number for "revision" of type "ShuttleSubjectMappingCreateRequestV2026R0"', + }); + } + const revision: undefined | number = + val.revision == void 0 ? void 0 : val.revision; + if ( + !(val.is_subject_skipped == void 0) && + !sdIsBoolean(val.is_subject_skipped) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_subject_skipped" of type "ShuttleSubjectMappingCreateRequestV2026R0"', + }); + } + const isSubjectSkipped: undefined | boolean = + val.is_subject_skipped == void 0 ? void 0 : val.is_subject_skipped; + const target: ShuttleTargetSubjectInputV2026R0 | undefined = + val.target == void 0 + ? void 0 + : deserializeShuttleTargetSubjectInputV2026R0(val.target); + return { + jobId: jobId, + discoveredSubjectId: discoveredSubjectId, + revision: revision, + isSubjectSkipped: isSubjectSkipped, + target: target, + } satisfies ShuttleSubjectMappingCreateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleSubjectMappingImportCreateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleSubjectMappingImportCreateRequestV2026R0.ts new file mode 100644 index 00000000..84b30d3b --- /dev/null +++ b/src/schemas/v2026R0/shuttleSubjectMappingImportCreateRequestV2026R0.ts @@ -0,0 +1,65 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleSubjectMappingImportCreateRequestV2026R0 { + /** + * The unique identifier of the shuttle job whose subject mappings are + * replaced. */ + readonly jobId: string; + /** + * The unique identifier of the Box file holding the mapping workbook. The + * file is read as the calling user, so it must live somewhere that user can + * download from. */ + readonly fileId: string; + readonly rawData?: SerializedData; +} +export function serializeShuttleSubjectMappingImportCreateRequestV2026R0( + val: ShuttleSubjectMappingImportCreateRequestV2026R0, +): SerializedData { + return { ['job_id']: val.jobId, ['file_id']: val.fileId }; +} +export function deserializeShuttleSubjectMappingImportCreateRequestV2026R0( + val: SerializedData, +): ShuttleSubjectMappingImportCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleSubjectMappingImportCreateRequestV2026R0"', + }); + } + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleSubjectMappingImportCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleSubjectMappingImportCreateRequestV2026R0"', + }); + } + const jobId: string = val.job_id; + if (val.file_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "file_id" of type "ShuttleSubjectMappingImportCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.file_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "file_id" of type "ShuttleSubjectMappingImportCreateRequestV2026R0"', + }); + } + const fileId: string = val.file_id; + return { + jobId: jobId, + fileId: fileId, + } satisfies ShuttleSubjectMappingImportCreateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleSubjectMappingUpdateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleSubjectMappingUpdateRequestV2026R0.ts new file mode 100644 index 00000000..6b7fb110 --- /dev/null +++ b/src/schemas/v2026R0/shuttleSubjectMappingUpdateRequestV2026R0.ts @@ -0,0 +1,62 @@ +import { serializeShuttleTargetSubjectInputV2026R0 } from './shuttleTargetSubjectInputV2026R0'; +import { deserializeShuttleTargetSubjectInputV2026R0 } from './shuttleTargetSubjectInputV2026R0'; +import { ShuttleTargetSubjectInputV2026R0 } from './shuttleTargetSubjectInputV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleSubjectMappingUpdateRequestV2026R0 { + /** + * Whether this subject should be skipped during the migration. */ + readonly isSubjectSkipped?: boolean; + /** + * The Box target to map to. Set to `null` only for a skipped subject. + * Setting it to `null` while the mapping is active fails validation. + * Updating `is_subject_skipped` alone preserves the existing target. */ + readonly target?: ShuttleTargetSubjectInputV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttleSubjectMappingUpdateRequestV2026R0( + val: ShuttleSubjectMappingUpdateRequestV2026R0, +): SerializedData { + return { + ['is_subject_skipped']: val.isSubjectSkipped, + ['target']: + val.target == void 0 + ? val.target + : serializeShuttleTargetSubjectInputV2026R0(val.target), + }; +} +export function deserializeShuttleSubjectMappingUpdateRequestV2026R0( + val: SerializedData, +): ShuttleSubjectMappingUpdateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "ShuttleSubjectMappingUpdateRequestV2026R0"', + }); + } + if ( + !(val.is_subject_skipped == void 0) && + !sdIsBoolean(val.is_subject_skipped) + ) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_subject_skipped" of type "ShuttleSubjectMappingUpdateRequestV2026R0"', + }); + } + const isSubjectSkipped: undefined | boolean = + val.is_subject_skipped == void 0 ? void 0 : val.is_subject_skipped; + const target: ShuttleTargetSubjectInputV2026R0 | undefined = + val.target == void 0 + ? void 0 + : deserializeShuttleTargetSubjectInputV2026R0(val.target); + return { + isSubjectSkipped: isSubjectSkipped, + target: target, + } satisfies ShuttleSubjectMappingUpdateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleSubjectMappingV2026R0.ts b/src/schemas/v2026R0/shuttleSubjectMappingV2026R0.ts new file mode 100644 index 00000000..592c0d70 --- /dev/null +++ b/src/schemas/v2026R0/shuttleSubjectMappingV2026R0.ts @@ -0,0 +1,348 @@ +import { serializeShuttleSubjectV2026R0 } from './shuttleSubjectV2026R0'; +import { deserializeShuttleSubjectV2026R0 } from './shuttleSubjectV2026R0'; +import { serializeShuttleTargetSubjectV2026R0 } from './shuttleTargetSubjectV2026R0'; +import { deserializeShuttleTargetSubjectV2026R0 } from './shuttleTargetSubjectV2026R0'; +import { ShuttleSubjectV2026R0 } from './shuttleSubjectV2026R0'; +import { ShuttleTargetSubjectV2026R0 } from './shuttleTargetSubjectV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleSubjectMappingV2026R0TypeField = 'shuttle_subject_mapping'; +export class ShuttleSubjectMappingV2026R0 { + /** + * The unique identifier for the shuttle subject mapping. */ + readonly id!: string; + /** + * The value will always be `shuttle_subject_mapping`. */ + readonly type: ShuttleSubjectMappingV2026R0TypeField = + 'shuttle_subject_mapping' as ShuttleSubjectMappingV2026R0TypeField; + /** + * The unique identifier of the shuttle job this mapping belongs to. */ + readonly jobId!: string; + /** + * The unique identifier of the discovered subject this mapping applies to. + * `null` for legacy mappings created before this field was tracked. */ + readonly discoveredSubjectId?: string | null; + /** + * The discovery-requirements revision this mapping was resolved against. + * `null` for legacy mappings. */ + readonly revision?: number | null; + /** + * Whether this subject is skipped during the migration. */ + readonly isSubjectSkipped!: boolean; + readonly source!: ShuttleSubjectV2026R0; + /** + * The Box target subject. `null` when the subject is skipped or not yet + * assigned. */ + readonly target?: ShuttleTargetSubjectV2026R0; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.jobId !== undefined) { + this.jobId = fields.jobId; + } + if (fields.discoveredSubjectId !== undefined) { + this.discoveredSubjectId = fields.discoveredSubjectId; + } + if (fields.revision !== undefined) { + this.revision = fields.revision; + } + if (fields.isSubjectSkipped !== undefined) { + this.isSubjectSkipped = fields.isSubjectSkipped; + } + if (fields.source !== undefined) { + this.source = fields.source; + } + if (fields.target !== undefined) { + this.target = fields.target; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleSubjectMappingV2026R0Input { + /** + * The unique identifier for the shuttle subject mapping. */ + readonly id: string; + /** + * The value will always be `shuttle_subject_mapping`. */ + readonly type?: ShuttleSubjectMappingV2026R0TypeField; + /** + * The unique identifier of the shuttle job this mapping belongs to. */ + readonly jobId: string; + /** + * The unique identifier of the discovered subject this mapping applies to. + * `null` for legacy mappings created before this field was tracked. */ + readonly discoveredSubjectId?: string | null; + /** + * The discovery-requirements revision this mapping was resolved against. + * `null` for legacy mappings. */ + readonly revision?: number | null; + /** + * Whether this subject is skipped during the migration. */ + readonly isSubjectSkipped: boolean; + readonly source: ShuttleSubjectV2026R0; + /** + * The Box target subject. `null` when the subject is skipped or not yet + * assigned. */ + readonly target?: ShuttleTargetSubjectV2026R0; + readonly rawData?: SerializedData; +} +export function serializeShuttleSubjectMappingV2026R0TypeField( + val: ShuttleSubjectMappingV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleSubjectMappingV2026R0TypeField( + val: SerializedData, +): ShuttleSubjectMappingV2026R0TypeField { + if (val == 'shuttle_subject_mapping') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleSubjectMappingV2026R0TypeField", + }); +} +export function serializeShuttleSubjectMappingV2026R0( + val: ShuttleSubjectMappingV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleSubjectMappingV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['discovered_subject_id']: val.discoveredSubjectId, + ['revision']: val.revision, + ['is_subject_skipped']: val.isSubjectSkipped, + ['source']: serializeShuttleSubjectV2026R0(val.source), + ['target']: + val.target == void 0 + ? val.target + : serializeShuttleTargetSubjectV2026R0(val.target), + }; +} +export function deserializeShuttleSubjectMappingV2026R0( + val: SerializedData, +): ShuttleSubjectMappingV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSubjectMappingV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleSubjectMappingV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleSubjectMappingV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleSubjectMappingV2026R0" to be defined', + }); + } + const type: ShuttleSubjectMappingV2026R0TypeField = + deserializeShuttleSubjectMappingV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleSubjectMappingV2026R0" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleSubjectMappingV2026R0"', + }); + } + const jobId: string = val.job_id; + if ( + !(val.discovered_subject_id == void 0) && + !sdIsString(val.discovered_subject_id) + ) { + throw new BoxSdkError({ + message: + 'Expecting string for "discovered_subject_id" of type "ShuttleSubjectMappingV2026R0"', + }); + } + const discoveredSubjectId: undefined | string = + val.discovered_subject_id == void 0 ? void 0 : val.discovered_subject_id; + if (!(val.revision == void 0) && !sdIsNumber(val.revision)) { + throw new BoxSdkError({ + message: + 'Expecting number for "revision" of type "ShuttleSubjectMappingV2026R0"', + }); + } + const revision: undefined | number = + val.revision == void 0 ? void 0 : val.revision; + if (val.is_subject_skipped == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "is_subject_skipped" of type "ShuttleSubjectMappingV2026R0" to be defined', + }); + } + if (!sdIsBoolean(val.is_subject_skipped)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_subject_skipped" of type "ShuttleSubjectMappingV2026R0"', + }); + } + const isSubjectSkipped: boolean = val.is_subject_skipped; + if (val.source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source" of type "ShuttleSubjectMappingV2026R0" to be defined', + }); + } + const source: ShuttleSubjectV2026R0 = deserializeShuttleSubjectV2026R0( + val.source, + ); + const target: ShuttleTargetSubjectV2026R0 | undefined = + val.target == void 0 + ? void 0 + : deserializeShuttleTargetSubjectV2026R0(val.target); + return { + id: id, + type: type, + jobId: jobId, + discoveredSubjectId: discoveredSubjectId, + revision: revision, + isSubjectSkipped: isSubjectSkipped, + source: source, + target: target, + } satisfies ShuttleSubjectMappingV2026R0; +} +export function serializeShuttleSubjectMappingV2026R0Input( + val: ShuttleSubjectMappingV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleSubjectMappingV2026R0TypeField(val.type), + ['job_id']: val.jobId, + ['discovered_subject_id']: val.discoveredSubjectId, + ['revision']: val.revision, + ['is_subject_skipped']: val.isSubjectSkipped, + ['source']: serializeShuttleSubjectV2026R0(val.source), + ['target']: + val.target == void 0 + ? val.target + : serializeShuttleTargetSubjectV2026R0(val.target), + }; +} +export function deserializeShuttleSubjectMappingV2026R0Input( + val: SerializedData, +): ShuttleSubjectMappingV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSubjectMappingV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleSubjectMappingV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleSubjectMappingV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttleSubjectMappingV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleSubjectMappingV2026R0TypeField(val.type); + if (val.job_id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "job_id" of type "ShuttleSubjectMappingV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.job_id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "job_id" of type "ShuttleSubjectMappingV2026R0Input"', + }); + } + const jobId: string = val.job_id; + if ( + !(val.discovered_subject_id == void 0) && + !sdIsString(val.discovered_subject_id) + ) { + throw new BoxSdkError({ + message: + 'Expecting string for "discovered_subject_id" of type "ShuttleSubjectMappingV2026R0Input"', + }); + } + const discoveredSubjectId: undefined | string = + val.discovered_subject_id == void 0 ? void 0 : val.discovered_subject_id; + if (!(val.revision == void 0) && !sdIsNumber(val.revision)) { + throw new BoxSdkError({ + message: + 'Expecting number for "revision" of type "ShuttleSubjectMappingV2026R0Input"', + }); + } + const revision: undefined | number = + val.revision == void 0 ? void 0 : val.revision; + if (val.is_subject_skipped == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "is_subject_skipped" of type "ShuttleSubjectMappingV2026R0Input" to be defined', + }); + } + if (!sdIsBoolean(val.is_subject_skipped)) { + throw new BoxSdkError({ + message: + 'Expecting boolean for "is_subject_skipped" of type "ShuttleSubjectMappingV2026R0Input"', + }); + } + const isSubjectSkipped: boolean = val.is_subject_skipped; + if (val.source == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "source" of type "ShuttleSubjectMappingV2026R0Input" to be defined', + }); + } + const source: ShuttleSubjectV2026R0 = deserializeShuttleSubjectV2026R0( + val.source, + ); + const target: ShuttleTargetSubjectV2026R0 | undefined = + val.target == void 0 + ? void 0 + : deserializeShuttleTargetSubjectV2026R0(val.target); + return { + id: id, + type: type, + jobId: jobId, + discoveredSubjectId: discoveredSubjectId, + revision: revision, + isSubjectSkipped: isSubjectSkipped, + source: source, + target: target, + } satisfies ShuttleSubjectMappingV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleSubjectMappingsV2026R0.ts b/src/schemas/v2026R0/shuttleSubjectMappingsV2026R0.ts new file mode 100644 index 00000000..a630ccf7 --- /dev/null +++ b/src/schemas/v2026R0/shuttleSubjectMappingsV2026R0.ts @@ -0,0 +1,99 @@ +import { serializeShuttleSubjectMappingV2026R0 } from './shuttleSubjectMappingV2026R0'; +import { deserializeShuttleSubjectMappingV2026R0 } from './shuttleSubjectMappingV2026R0'; +import { ShuttleSubjectMappingV2026R0 } from './shuttleSubjectMappingV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleSubjectMappingsV2026R0 { + /** + * A list of shuttle subject mappings. */ + readonly entries: readonly ShuttleSubjectMappingV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleSubjectMappingsV2026R0( + val: ShuttleSubjectMappingsV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttleSubjectMappingV2026R0, + ): SerializedData { + return serializeShuttleSubjectMappingV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttleSubjectMappingsV2026R0( + val: SerializedData, +): ShuttleSubjectMappingsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSubjectMappingsV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "entries" of type "ShuttleSubjectMappingsV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: + 'Expecting array for "entries" of type "ShuttleSubjectMappingsV2026R0"', + }); + } + const entries: readonly ShuttleSubjectMappingV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function ( + itm: SerializedData, + ): ShuttleSubjectMappingV2026R0 { + return deserializeShuttleSubjectMappingV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: + 'Expecting number for "limit" of type "ShuttleSubjectMappingsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttleSubjectMappingsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttleSubjectMappingsV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttleSubjectMappingsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleSubjectRoleV2026R0.ts b/src/schemas/v2026R0/shuttleSubjectRoleV2026R0.ts new file mode 100644 index 00000000..a452a219 --- /dev/null +++ b/src/schemas/v2026R0/shuttleSubjectRoleV2026R0.ts @@ -0,0 +1,53 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleSubjectRoleV2026R0 = + | 'owner' + | 'creator' + | 'updater' + | 'namespace_account' + | 'sharee' + | 'account_holder' + | 'unknown' + | string; +export function serializeShuttleSubjectRoleV2026R0( + val: ShuttleSubjectRoleV2026R0, +): SerializedData { + return val; +} +export function deserializeShuttleSubjectRoleV2026R0( + val: SerializedData, +): ShuttleSubjectRoleV2026R0 { + if (val == 'owner') { + return val; + } + if (val == 'creator') { + return val; + } + if (val == 'updater') { + return val; + } + if (val == 'namespace_account') { + return val; + } + if (val == 'sharee') { + return val; + } + if (val == 'account_holder') { + return val; + } + if (val == 'unknown') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleSubjectRoleV2026R0", + }); +} diff --git a/src/schemas/v2026R0/shuttleSubjectV2026R0.ts b/src/schemas/v2026R0/shuttleSubjectV2026R0.ts new file mode 100644 index 00000000..5531c9c8 --- /dev/null +++ b/src/schemas/v2026R0/shuttleSubjectV2026R0.ts @@ -0,0 +1,123 @@ +import { serializeShuttleSubjectRoleV2026R0 } from './shuttleSubjectRoleV2026R0'; +import { deserializeShuttleSubjectRoleV2026R0 } from './shuttleSubjectRoleV2026R0'; +import { ShuttleSubjectRoleV2026R0 } from './shuttleSubjectRoleV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleSubjectV2026R0TypeField = 'user' | 'group'; +export interface ShuttleSubjectV2026R0 { + /** + * Whether this subject is a user or a group. */ + readonly type: ShuttleSubjectV2026R0TypeField; + /** + * The platform-native identifier of the subject. `null` when the system + * does not provide one. */ + readonly id?: string | null; + /** + * The email address of the subject. `null` when unknown. */ + readonly email?: string | null; + /** + * The display name of the subject. `null` when unknown. */ + readonly name?: string | null; + /** + * Roles this subject holds on the source. `null` when no roles are known. */ + readonly roles?: readonly ShuttleSubjectRoleV2026R0[] | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleSubjectV2026R0TypeField( + val: ShuttleSubjectV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleSubjectV2026R0TypeField( + val: SerializedData, +): ShuttleSubjectV2026R0TypeField { + if (val == 'user') { + return val; + } + if (val == 'group') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleSubjectV2026R0TypeField", + }); +} +export function serializeShuttleSubjectV2026R0( + val: ShuttleSubjectV2026R0, +): SerializedData { + return { + ['type']: serializeShuttleSubjectV2026R0TypeField(val.type), + ['id']: val.id, + ['email']: val.email, + ['name']: val.name, + ['roles']: + val.roles == void 0 + ? val.roles + : (val.roles.map(function ( + item: ShuttleSubjectRoleV2026R0, + ): SerializedData { + return serializeShuttleSubjectRoleV2026R0(item); + }) as readonly any[]), + }; +} +export function deserializeShuttleSubjectV2026R0( + val: SerializedData, +): ShuttleSubjectV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSubjectV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "ShuttleSubjectV2026R0" to be defined', + }); + } + const type: ShuttleSubjectV2026R0TypeField = + deserializeShuttleSubjectV2026R0TypeField(val.type); + if (!(val.id == void 0) && !sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleSubjectV2026R0"', + }); + } + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + if (!(val.email == void 0) && !sdIsString(val.email)) { + throw new BoxSdkError({ + message: 'Expecting string for "email" of type "ShuttleSubjectV2026R0"', + }); + } + const email: undefined | string = val.email == void 0 ? void 0 : val.email; + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: 'Expecting string for "name" of type "ShuttleSubjectV2026R0"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + if (!(val.roles == void 0) && !sdIsList(val.roles)) { + throw new BoxSdkError({ + message: 'Expecting array for "roles" of type "ShuttleSubjectV2026R0"', + }); + } + const roles: undefined | readonly ShuttleSubjectRoleV2026R0[] = + val.roles == void 0 + ? void 0 + : sdIsList(val.roles) + ? (val.roles.map(function ( + itm: SerializedData, + ): ShuttleSubjectRoleV2026R0 { + return deserializeShuttleSubjectRoleV2026R0(itm); + }) as readonly any[]) + : []; + return { + type: type, + id: id, + email: email, + name: name, + roles: roles, + } satisfies ShuttleSubjectV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleSystemCreateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleSystemCreateRequestV2026R0.ts new file mode 100644 index 00000000..b4e5085c --- /dev/null +++ b/src/schemas/v2026R0/shuttleSystemCreateRequestV2026R0.ts @@ -0,0 +1,156 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleSystemCreateRequestV2026R0SystemTypeField = + 'windows' | string; +export class ShuttleSystemCreateRequestV2026R0 { + /** + * The display name for the new shuttle system. */ + readonly name!: string; + /** + * The public system type identifier for the new shuttle system. Only + * `windows` is currently supported through the public API. */ + readonly systemType: ShuttleSystemCreateRequestV2026R0SystemTypeField = + 'windows' as ShuttleSystemCreateRequestV2026R0SystemTypeField; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.name !== undefined) { + this.name = fields.name; + } + if (fields.systemType !== undefined) { + this.systemType = fields.systemType; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleSystemCreateRequestV2026R0Input { + /** + * The display name for the new shuttle system. */ + readonly name: string; + /** + * The public system type identifier for the new shuttle system. Only + * `windows` is currently supported through the public API. */ + readonly systemType?: ShuttleSystemCreateRequestV2026R0SystemTypeField; + readonly rawData?: SerializedData; +} +export function serializeShuttleSystemCreateRequestV2026R0SystemTypeField( + val: ShuttleSystemCreateRequestV2026R0SystemTypeField, +): SerializedData { + return val; +} +export function deserializeShuttleSystemCreateRequestV2026R0SystemTypeField( + val: SerializedData, +): ShuttleSystemCreateRequestV2026R0SystemTypeField { + if (val == 'windows') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: + "Can't deserialize ShuttleSystemCreateRequestV2026R0SystemTypeField", + }); +} +export function serializeShuttleSystemCreateRequestV2026R0( + val: ShuttleSystemCreateRequestV2026R0, +): SerializedData { + return { + ['name']: val.name, + ['system_type']: serializeShuttleSystemCreateRequestV2026R0SystemTypeField( + val.systemType, + ), + }; +} +export function deserializeShuttleSystemCreateRequestV2026R0( + val: SerializedData, +): ShuttleSystemCreateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSystemCreateRequestV2026R0"', + }); + } + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttleSystemCreateRequestV2026R0" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleSystemCreateRequestV2026R0"', + }); + } + const name: string = val.name; + if (val.system_type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "system_type" of type "ShuttleSystemCreateRequestV2026R0" to be defined', + }); + } + const systemType: ShuttleSystemCreateRequestV2026R0SystemTypeField = + deserializeShuttleSystemCreateRequestV2026R0SystemTypeField( + val.system_type, + ); + return { + name: name, + systemType: systemType, + } satisfies ShuttleSystemCreateRequestV2026R0; +} +export function serializeShuttleSystemCreateRequestV2026R0Input( + val: ShuttleSystemCreateRequestV2026R0Input, +): SerializedData { + return { + ['name']: val.name, + ['systemType']: + val.systemType == void 0 + ? val.systemType + : serializeShuttleSystemCreateRequestV2026R0SystemTypeField( + val.systemType, + ), + }; +} +export function deserializeShuttleSystemCreateRequestV2026R0Input( + val: SerializedData, +): ShuttleSystemCreateRequestV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSystemCreateRequestV2026R0Input"', + }); + } + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttleSystemCreateRequestV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleSystemCreateRequestV2026R0Input"', + }); + } + const name: string = val.name; + const systemType: + undefined | ShuttleSystemCreateRequestV2026R0SystemTypeField = + val.systemType == void 0 + ? void 0 + : deserializeShuttleSystemCreateRequestV2026R0SystemTypeField( + val.systemType, + ); + return { + name: name, + systemType: systemType, + } satisfies ShuttleSystemCreateRequestV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleSystemUpdateRequestV2026R0.ts b/src/schemas/v2026R0/shuttleSystemUpdateRequestV2026R0.ts new file mode 100644 index 00000000..e42eb40f --- /dev/null +++ b/src/schemas/v2026R0/shuttleSystemUpdateRequestV2026R0.ts @@ -0,0 +1,36 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleSystemUpdateRequestV2026R0 { + /** + * The updated display name for the shuttle system. */ + readonly name?: string; + readonly rawData?: SerializedData; +} +export function serializeShuttleSystemUpdateRequestV2026R0( + val: ShuttleSystemUpdateRequestV2026R0, +): SerializedData { + return { ['name']: val.name }; +} +export function deserializeShuttleSystemUpdateRequestV2026R0( + val: SerializedData, +): ShuttleSystemUpdateRequestV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSystemUpdateRequestV2026R0"', + }); + } + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleSystemUpdateRequestV2026R0"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + return { name: name } satisfies ShuttleSystemUpdateRequestV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleSystemV2026R0.ts b/src/schemas/v2026R0/shuttleSystemV2026R0.ts new file mode 100644 index 00000000..afc7ffd1 --- /dev/null +++ b/src/schemas/v2026R0/shuttleSystemV2026R0.ts @@ -0,0 +1,298 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleSystemV2026R0TypeField = 'shuttle_system'; +export type ShuttleSystemV2026R0StateField = + 'connected' | 'disconnected' | 'unknown' | string; +export class ShuttleSystemV2026R0 { + /** + * The unique identifier for the shuttle system. */ + readonly id!: string; + /** + * The value will always be `shuttle_system`. */ + readonly type: ShuttleSystemV2026R0TypeField = + 'shuttle_system' as ShuttleSystemV2026R0TypeField; + /** + * The display name of the shuttle system. */ + readonly name!: string; + /** + * Identifies the kind of source or destination this system represents, for + * example `box`, `windows`, `sharepoint`, or `amazon_s3`. New system types + * are added over time, so clients must tolerate values they do not + * recognize rather than treating this as a fixed set. */ + readonly systemType!: string; + /** + * A server-computed display label for the system. */ + readonly label?: string; + /** + * The current connection state of the shuttle system. */ + readonly state!: ShuttleSystemV2026R0StateField; + readonly rawData?: SerializedData; + constructor( + fields: Omit & + Partial>, + ) { + if (fields.id !== undefined) { + this.id = fields.id; + } + if (fields.type !== undefined) { + this.type = fields.type; + } + if (fields.name !== undefined) { + this.name = fields.name; + } + if (fields.systemType !== undefined) { + this.systemType = fields.systemType; + } + if (fields.label !== undefined) { + this.label = fields.label; + } + if (fields.state !== undefined) { + this.state = fields.state; + } + if (fields.rawData !== undefined) { + this.rawData = fields.rawData; + } + } +} +export interface ShuttleSystemV2026R0Input { + /** + * The unique identifier for the shuttle system. */ + readonly id: string; + /** + * The value will always be `shuttle_system`. */ + readonly type?: ShuttleSystemV2026R0TypeField; + /** + * The display name of the shuttle system. */ + readonly name: string; + /** + * Identifies the kind of source or destination this system represents, for + * example `box`, `windows`, `sharepoint`, or `amazon_s3`. New system types + * are added over time, so clients must tolerate values they do not + * recognize rather than treating this as a fixed set. */ + readonly systemType: string; + /** + * A server-computed display label for the system. */ + readonly label?: string; + /** + * The current connection state of the shuttle system. */ + readonly state: ShuttleSystemV2026R0StateField; + readonly rawData?: SerializedData; +} +export function serializeShuttleSystemV2026R0TypeField( + val: ShuttleSystemV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleSystemV2026R0TypeField( + val: SerializedData, +): ShuttleSystemV2026R0TypeField { + if (val == 'shuttle_system') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleSystemV2026R0TypeField", + }); +} +export function serializeShuttleSystemV2026R0StateField( + val: ShuttleSystemV2026R0StateField, +): SerializedData { + return val; +} +export function deserializeShuttleSystemV2026R0StateField( + val: SerializedData, +): ShuttleSystemV2026R0StateField { + if (val == 'connected') { + return val; + } + if (val == 'disconnected') { + return val; + } + if (val == 'unknown') { + return val; + } + if (sdIsString(val)) { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleSystemV2026R0StateField", + }); +} +export function serializeShuttleSystemV2026R0( + val: ShuttleSystemV2026R0, +): SerializedData { + return { + ['id']: val.id, + ['type']: serializeShuttleSystemV2026R0TypeField(val.type), + ['name']: val.name, + ['system_type']: val.systemType, + ['label']: val.label, + ['state']: serializeShuttleSystemV2026R0StateField(val.state), + }; +} +export function deserializeShuttleSystemV2026R0( + val: SerializedData, +): ShuttleSystemV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSystemV2026R0"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: 'Expecting "id" of type "ShuttleSystemV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleSystemV2026R0"', + }); + } + const id: string = val.id; + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "ShuttleSystemV2026R0" to be defined', + }); + } + const type: ShuttleSystemV2026R0TypeField = + deserializeShuttleSystemV2026R0TypeField(val.type); + if (val.name == void 0) { + throw new BoxSdkError({ + message: 'Expecting "name" of type "ShuttleSystemV2026R0" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: 'Expecting string for "name" of type "ShuttleSystemV2026R0"', + }); + } + const name: string = val.name; + if (val.system_type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "system_type" of type "ShuttleSystemV2026R0" to be defined', + }); + } + if (!sdIsString(val.system_type)) { + throw new BoxSdkError({ + message: + 'Expecting string for "system_type" of type "ShuttleSystemV2026R0"', + }); + } + const systemType: string = val.system_type; + if (!(val.label == void 0) && !sdIsString(val.label)) { + throw new BoxSdkError({ + message: 'Expecting string for "label" of type "ShuttleSystemV2026R0"', + }); + } + const label: undefined | string = val.label == void 0 ? void 0 : val.label; + if (val.state == void 0) { + throw new BoxSdkError({ + message: 'Expecting "state" of type "ShuttleSystemV2026R0" to be defined', + }); + } + const state: ShuttleSystemV2026R0StateField = + deserializeShuttleSystemV2026R0StateField(val.state); + return { + id: id, + type: type, + name: name, + systemType: systemType, + label: label, + state: state, + } satisfies ShuttleSystemV2026R0; +} +export function serializeShuttleSystemV2026R0Input( + val: ShuttleSystemV2026R0Input, +): SerializedData { + return { + ['id']: val.id, + ['type']: + val.type == void 0 + ? val.type + : serializeShuttleSystemV2026R0TypeField(val.type), + ['name']: val.name, + ['system_type']: val.systemType, + ['label']: val.label, + ['state']: serializeShuttleSystemV2026R0StateField(val.state), + }; +} +export function deserializeShuttleSystemV2026R0Input( + val: SerializedData, +): ShuttleSystemV2026R0Input { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSystemV2026R0Input"', + }); + } + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleSystemV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "ShuttleSystemV2026R0Input"', + }); + } + const id: string = val.id; + const type: undefined | ShuttleSystemV2026R0TypeField = + val.type == void 0 + ? void 0 + : deserializeShuttleSystemV2026R0TypeField(val.type); + if (val.name == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "name" of type "ShuttleSystemV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleSystemV2026R0Input"', + }); + } + const name: string = val.name; + if (val.system_type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "system_type" of type "ShuttleSystemV2026R0Input" to be defined', + }); + } + if (!sdIsString(val.system_type)) { + throw new BoxSdkError({ + message: + 'Expecting string for "system_type" of type "ShuttleSystemV2026R0Input"', + }); + } + const systemType: string = val.system_type; + if (!(val.label == void 0) && !sdIsString(val.label)) { + throw new BoxSdkError({ + message: + 'Expecting string for "label" of type "ShuttleSystemV2026R0Input"', + }); + } + const label: undefined | string = val.label == void 0 ? void 0 : val.label; + if (val.state == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "state" of type "ShuttleSystemV2026R0Input" to be defined', + }); + } + const state: ShuttleSystemV2026R0StateField = + deserializeShuttleSystemV2026R0StateField(val.state); + return { + id: id, + type: type, + name: name, + systemType: systemType, + label: label, + state: state, + } satisfies ShuttleSystemV2026R0Input; +} diff --git a/src/schemas/v2026R0/shuttleSystemsV2026R0.ts b/src/schemas/v2026R0/shuttleSystemsV2026R0.ts new file mode 100644 index 00000000..3bbdb59d --- /dev/null +++ b/src/schemas/v2026R0/shuttleSystemsV2026R0.ts @@ -0,0 +1,95 @@ +import { serializeShuttleSystemV2026R0 } from './shuttleSystemV2026R0'; +import { deserializeShuttleSystemV2026R0 } from './shuttleSystemV2026R0'; +import { ShuttleSystemV2026R0 } from './shuttleSystemV2026R0'; +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export interface ShuttleSystemsV2026R0 { + /** + * A list of shuttle systems. */ + readonly entries: readonly ShuttleSystemV2026R0[]; + /** + * The limit that was used for these entries. This will be the same as the + * `limit` query parameter unless that value exceeded the maximum value + * allowed. The maximum value varies by API. */ + readonly limit?: number; + /** + * The marker for the start of the next page of results. */ + readonly nextMarker?: string | null; + /** + * The marker for the start of the previous page of results. */ + readonly prevMarker?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleSystemsV2026R0( + val: ShuttleSystemsV2026R0, +): SerializedData { + return { + ['entries']: val.entries.map(function ( + item: ShuttleSystemV2026R0, + ): SerializedData { + return serializeShuttleSystemV2026R0(item); + }) as readonly any[], + ['limit']: val.limit, + ['next_marker']: val.nextMarker, + ['prev_marker']: val.prevMarker, + }; +} +export function deserializeShuttleSystemsV2026R0( + val: SerializedData, +): ShuttleSystemsV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleSystemsV2026R0"', + }); + } + if (val.entries == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "entries" of type "ShuttleSystemsV2026R0" to be defined', + }); + } + if (!sdIsList(val.entries)) { + throw new BoxSdkError({ + message: 'Expecting array for "entries" of type "ShuttleSystemsV2026R0"', + }); + } + const entries: readonly ShuttleSystemV2026R0[] = sdIsList(val.entries) + ? (val.entries.map(function (itm: SerializedData): ShuttleSystemV2026R0 { + return deserializeShuttleSystemV2026R0(itm); + }) as readonly any[]) + : []; + if (!(val.limit == void 0) && !sdIsNumber(val.limit)) { + throw new BoxSdkError({ + message: 'Expecting number for "limit" of type "ShuttleSystemsV2026R0"', + }); + } + const limit: undefined | number = val.limit == void 0 ? void 0 : val.limit; + if (!(val.next_marker == void 0) && !sdIsString(val.next_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "next_marker" of type "ShuttleSystemsV2026R0"', + }); + } + const nextMarker: undefined | string = + val.next_marker == void 0 ? void 0 : val.next_marker; + if (!(val.prev_marker == void 0) && !sdIsString(val.prev_marker)) { + throw new BoxSdkError({ + message: + 'Expecting string for "prev_marker" of type "ShuttleSystemsV2026R0"', + }); + } + const prevMarker: undefined | string = + val.prev_marker == void 0 ? void 0 : val.prev_marker; + return { + entries: entries, + limit: limit, + nextMarker: nextMarker, + prevMarker: prevMarker, + } satisfies ShuttleSystemsV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleTargetSubjectInputV2026R0.ts b/src/schemas/v2026R0/shuttleTargetSubjectInputV2026R0.ts new file mode 100644 index 00000000..02091ad2 --- /dev/null +++ b/src/schemas/v2026R0/shuttleTargetSubjectInputV2026R0.ts @@ -0,0 +1,75 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleTargetSubjectInputV2026R0TypeField = 'user' | 'group'; +export interface ShuttleTargetSubjectInputV2026R0 { + /** + * Whether the Box target is a user or a group. */ + readonly type: ShuttleTargetSubjectInputV2026R0TypeField; + /** + * The identifier of the target Box subject. */ + readonly id: string; + readonly rawData?: SerializedData; +} +export function serializeShuttleTargetSubjectInputV2026R0TypeField( + val: ShuttleTargetSubjectInputV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleTargetSubjectInputV2026R0TypeField( + val: SerializedData, +): ShuttleTargetSubjectInputV2026R0TypeField { + if (val == 'user') { + return val; + } + if (val == 'group') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleTargetSubjectInputV2026R0TypeField", + }); +} +export function serializeShuttleTargetSubjectInputV2026R0( + val: ShuttleTargetSubjectInputV2026R0, +): SerializedData { + return { + ['type']: serializeShuttleTargetSubjectInputV2026R0TypeField(val.type), + ['id']: val.id, + }; +} +export function deserializeShuttleTargetSubjectInputV2026R0( + val: SerializedData, +): ShuttleTargetSubjectInputV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleTargetSubjectInputV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleTargetSubjectInputV2026R0" to be defined', + }); + } + const type: ShuttleTargetSubjectInputV2026R0TypeField = + deserializeShuttleTargetSubjectInputV2026R0TypeField(val.type); + if (val.id == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "id" of type "ShuttleTargetSubjectInputV2026R0" to be defined', + }); + } + if (!sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleTargetSubjectInputV2026R0"', + }); + } + const id: string = val.id; + return { type: type, id: id } satisfies ShuttleTargetSubjectInputV2026R0; +} diff --git a/src/schemas/v2026R0/shuttleTargetSubjectV2026R0.ts b/src/schemas/v2026R0/shuttleTargetSubjectV2026R0.ts new file mode 100644 index 00000000..028abe46 --- /dev/null +++ b/src/schemas/v2026R0/shuttleTargetSubjectV2026R0.ts @@ -0,0 +1,99 @@ +import { BoxSdkError } from '../../box/errors'; +import { SerializedData } from '../../serialization/json'; +import { sdIsEmpty } from '../../serialization/json'; +import { sdIsBoolean } from '../../serialization/json'; +import { sdIsNumber } from '../../serialization/json'; +import { sdIsString } from '../../serialization/json'; +import { sdIsList } from '../../serialization/json'; +import { sdIsMap } from '../../serialization/json'; +export type ShuttleTargetSubjectV2026R0TypeField = 'user' | 'group'; +export interface ShuttleTargetSubjectV2026R0 { + /** + * Whether the Box target is a user or a group. */ + readonly type: ShuttleTargetSubjectV2026R0TypeField; + /** + * The Box user or group ID. `null` when the mapping was not created + * through this API and is identified by email (user) or name (group) + * instead. Skip is represented by `target: null`, not a missing `id`. + * Create and update always send `id`. */ + readonly id?: string | null; + /** + * The email address of the target. `null` when unknown. */ + readonly email?: string | null; + /** + * The display name of the target. `null` when unknown. */ + readonly name?: string | null; + readonly rawData?: SerializedData; +} +export function serializeShuttleTargetSubjectV2026R0TypeField( + val: ShuttleTargetSubjectV2026R0TypeField, +): SerializedData { + return val; +} +export function deserializeShuttleTargetSubjectV2026R0TypeField( + val: SerializedData, +): ShuttleTargetSubjectV2026R0TypeField { + if (val == 'user') { + return val; + } + if (val == 'group') { + return val; + } + throw new BoxSdkError({ + message: "Can't deserialize ShuttleTargetSubjectV2026R0TypeField", + }); +} +export function serializeShuttleTargetSubjectV2026R0( + val: ShuttleTargetSubjectV2026R0, +): SerializedData { + return { + ['type']: serializeShuttleTargetSubjectV2026R0TypeField(val.type), + ['id']: val.id, + ['email']: val.email, + ['name']: val.name, + }; +} +export function deserializeShuttleTargetSubjectV2026R0( + val: SerializedData, +): ShuttleTargetSubjectV2026R0 { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "ShuttleTargetSubjectV2026R0"', + }); + } + if (val.type == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "type" of type "ShuttleTargetSubjectV2026R0" to be defined', + }); + } + const type: ShuttleTargetSubjectV2026R0TypeField = + deserializeShuttleTargetSubjectV2026R0TypeField(val.type); + if (!(val.id == void 0) && !sdIsString(val.id)) { + throw new BoxSdkError({ + message: + 'Expecting string for "id" of type "ShuttleTargetSubjectV2026R0"', + }); + } + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + if (!(val.email == void 0) && !sdIsString(val.email)) { + throw new BoxSdkError({ + message: + 'Expecting string for "email" of type "ShuttleTargetSubjectV2026R0"', + }); + } + const email: undefined | string = val.email == void 0 ? void 0 : val.email; + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: + 'Expecting string for "name" of type "ShuttleTargetSubjectV2026R0"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + return { + type: type, + id: id, + email: email, + name: name, + } satisfies ShuttleTargetSubjectV2026R0; +} From 6bccc23ab436dcbe7670156714cf202bc2913d4f Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 28 Oct 2026 06:55:37 -0700 Subject: [PATCH 4/5] docs: (DDOC-1921) Note embed_url_external_user_id for suppress_notifications (box/box-openapi#623) --- .codegen.json | 2 +- src/schemas/signRequestCreateSigner.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.codegen.json b/.codegen.json index 08ec973f..bd5c0867 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "4c5a50b", "specHash": "ad8dbb8", "version": "10.17.0" } +{ "engineHash": "4c5a50b", "specHash": "a0e8038", "version": "10.17.0" } diff --git a/src/schemas/signRequestCreateSigner.ts b/src/schemas/signRequestCreateSigner.ts index 56f81a88..402657ba 100644 --- a/src/schemas/signRequestCreateSigner.ts +++ b/src/schemas/signRequestCreateSigner.ts @@ -69,7 +69,9 @@ export interface SignRequestCreateSigner { * instead for signers in the same signer group. */ readonly signerGroupId?: string | null; /** - * If true, no emails about the sign request will be sent. */ + * If true, no emails about the sign request are sent. + * The `embed_url_external_user_id` parameter is required when using + * `suppress_notifications` for a signer. */ readonly suppressNotifications?: boolean | null; /** * The language of the user, formatted in modified version of the From 849ed662c20fdce9806c67edc25774d7b60bd1af Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Wed, 28 Oct 2026 10:06:46 -0700 Subject: [PATCH 5/5] chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] --- .codegen.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codegen.json b/.codegen.json index bd5c0867..1963a676 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "4c5a50b", "specHash": "a0e8038", "version": "10.17.0" } +{ "engineHash": "976bbb9", "specHash": "a0e8038", "version": "10.17.0" }