diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index cd0a8e6a8b..bc875e8a02 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,9 +5,10 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-rust": "0.3.0" + "@azure-tools/typespec-rust": "0.4.0" }, "devDependencies": { + "@azure-tools/typespec-azure-rulesets": "0.48.0", "@azure-tools/typespec-client-generator-core": "0.48.4", "@typespec/compiler": "0.62.0", "@typespec/xml": "0.62.0" @@ -17,6 +18,7 @@ "version": "3.0.254", "resolved": "https://registry.npmjs.org/@azure-tools/async-io/-/async-io-3.0.254.tgz", "integrity": "sha512-X1C7XdyCuo50ch9FzKtTvmK18FgDxxf1Bbt3cSoknQqeDaRegHSSCO+zByq2YA4NvUzKXeZ1engh29IDxZXgpQ==", + "license": "MIT", "dependencies": { "@azure-tools/tasks": "~3.0.255", "proper-lockfile": "~2.0.1" @@ -29,6 +31,7 @@ "version": "2.9.2", "resolved": "https://registry.npmjs.org/@azure-tools/codegen/-/codegen-2.9.2.tgz", "integrity": "sha512-brVLyffOtPiEijYYBYgV+4q7IyAfqXIec7XbdEqvv7As6SeEdq5WtbtN9N0LdGVHDWtEfc+JArwIx9aYGFdMUg==", + "license": "MIT", "dependencies": { "@azure-tools/async-io": "~3.0.0", "js-yaml": "~4.0.0", @@ -42,6 +45,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -53,6 +57,7 @@ "version": "3.1.263", "resolved": "https://registry.npmjs.org/@azure-tools/linq/-/linq-3.1.263.tgz", "integrity": "sha512-r104pkF96Sk8MW+PgxWqwiwNXhPbJSkMDcmShu9EDEJem04SM7DnHWmDo8JZR08vHYaecZA126OoGQFe7WikSA==", + "license": "MIT", "engines": { "node": ">=10.12.0" } @@ -61,6 +66,7 @@ "version": "3.0.255", "resolved": "https://registry.npmjs.org/@azure-tools/tasks/-/tasks-3.0.255.tgz", "integrity": "sha512-GjALNLz7kWMEdRVbaN5g0cJHNAr3XVTbP0611Mv2UzMgGL6FOhNZJK+oPHJKLDR8EEDZNnkwPlyi7B+INXUSQA==", + "license": "MIT", "engines": { "node": ">=10.12.0" } @@ -69,6 +75,7 @@ "version": "0.48.0", "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.48.0.tgz", "integrity": "sha512-80qyqgTgBbrnCGXtz6eWAMBdEAjYVVL780L0Ye+rBEd6VoA0m3JrgzUqf5bC0Iwju6lEtBAb8o6sefKD/NGA7g==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" @@ -79,10 +86,50 @@ "@typespec/rest": "~0.62.0" } }, + "node_modules/@azure-tools/typespec-azure-resource-manager": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.48.0.tgz", + "integrity": "sha512-4JxPbKxd3EJ98sLbtfBlqyANWVrU6tT2nk3iLspg7MITPLhiMTeRT9BprsJXH18ks8qw8scR7/am5r57YERTmQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "change-case": "~5.4.4", + "pluralize": "^8.0.0" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.48.0", + "@typespec/compiler": "~0.62.0", + "@typespec/http": "~0.62.0", + "@typespec/openapi": "~0.62.0", + "@typespec/rest": "~0.62.0", + "@typespec/versioning": "~0.62.0" + } + }, + "node_modules/@azure-tools/typespec-azure-rulesets": { + "version": "0.48.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.48.0.tgz", + "integrity": "sha512-IkPxC8v9wVSl/eKU7N4NhqD3RPh+bIYpxDW5LBAhkuQVcE3RumAkWqh2pmkckihQRhgwiCXhcJVZAzBpVa5SUA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.48.0", + "@azure-tools/typespec-azure-resource-manager": "~0.48.0", + "@azure-tools/typespec-client-generator-core": "~0.48.0", + "@typespec/compiler": "~0.62.0" + } + }, "node_modules/@azure-tools/typespec-client-generator-core": { "version": "0.48.4", "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.4.tgz", "integrity": "sha512-TvX84FiQ3rax0e838m6kpVj8F24OzKAbyLgUXXZ/TjfxhvZb1u0ojMjSKAvmcal2klROJqRlj4d9tImidPYpgA==", + "license": "MIT", "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -100,9 +147,10 @@ } }, "node_modules/@azure-tools/typespec-rust": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-rust/-/typespec-rust-0.3.0.tgz", - "integrity": "sha512-Y2JXWG33a5G/RbMsg2JRrFdbl4UxrUEAQUa+/h2mLmmEGJTqnv0SzqAAEpo663N72njgGoz5J3vqZDcFb3uOpw==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-rust/-/typespec-rust-0.4.0.tgz", + "integrity": "sha512-sLiz9YvMeVct4Df3xz8BDfY3VY+A5ynaXVS69JJHHDZA180IHuIzQO4cGDSuZEKD1g1uDdOpQridI75kJ04npw==", + "license": "MIT", "dependencies": { "@azure-tools/codegen": "~2.9.2", "@azure-tools/linq": "~3.1.263", @@ -123,6 +171,7 @@ "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.9.tgz", "integrity": "sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ==", + "license": "MIT", "dependencies": { "@babel/highlight": "^7.25.9", "picocolors": "^1.0.0" @@ -135,6 +184,7 @@ "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -143,6 +193,7 @@ "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.9.tgz", "integrity": "sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==", + "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "chalk": "^2.4.2", @@ -160,6 +211,7 @@ "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "aix" @@ -175,6 +227,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -190,6 +243,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -205,6 +259,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -220,6 +275,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -235,6 +291,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -250,6 +307,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -265,6 +323,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -280,6 +339,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -295,6 +355,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -310,6 +371,7 @@ "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -325,6 +387,7 @@ "cpu": [ "loong64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -340,6 +403,7 @@ "cpu": [ "mips64el" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -355,6 +419,7 @@ "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -370,6 +435,7 @@ "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -385,6 +451,7 @@ "cpu": [ "s390x" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -400,6 +467,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -415,6 +483,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -430,6 +499,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -445,6 +515,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "sunos" @@ -460,6 +531,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -475,6 +547,7 @@ "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -490,6 +563,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -502,6 +576,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.27.8" }, @@ -512,12 +587,14 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "license": "MIT" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -530,6 +607,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", "engines": { "node": ">= 8" } @@ -538,6 +616,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -553,6 +632,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -565,6 +645,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -577,6 +658,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -589,6 +671,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -601,6 +684,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -613,6 +697,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -625,6 +710,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -637,6 +723,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -649,6 +736,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -661,6 +749,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -673,6 +762,7 @@ "cpu": [ "loong64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -685,6 +775,7 @@ "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -697,6 +788,7 @@ "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -709,6 +801,7 @@ "cpu": [ "s390x" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -721,6 +814,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -733,6 +827,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -745,6 +840,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -757,6 +853,7 @@ "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -769,6 +866,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -777,12 +875,14 @@ "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "license": "MIT" }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "license": "MIT", "engines": { "node": ">=18" }, @@ -793,12 +893,14 @@ "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "license": "MIT" }, "node_modules/@typespec/compiler": { "version": "0.62.0", "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.62.0.tgz", "integrity": "sha512-RfKJ/rF2Wjxu7dl74oJE8yEfSkeL7NopFlyJ4dW1JQXpRN2IOJYPxas12qZA6H9ZEIB8rBjyrHNxJSQbvn/UDQ==", + "license": "MIT", "dependencies": { "@babel/code-frame": "~7.25.7", "ajv": "~8.17.1", @@ -827,6 +929,7 @@ "version": "0.62.0", "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.62.0.tgz", "integrity": "sha512-6H9y9e32lb2s76MMy29ITCwSZNG42sa/qWthiByUvfbTEXMpu5a1fQHNj7RXg+xmDKmVIHv3gAfjGPAWfXhkaQ==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" @@ -845,6 +948,7 @@ "version": "0.62.0", "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.62.0.tgz", "integrity": "sha512-Xtm0Nd2BuSmEfSWGtc10ok22jyomYm9L2jY+kVTy+v5J89DrVh0o6+YpipUl1QhcItM1YMBphWHIHPfwkDRbnw==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" @@ -858,6 +962,7 @@ "version": "0.62.0", "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.62.0.tgz", "integrity": "sha512-ci5UjelEKFwsPTdpgysoUoDCcw02EnbG4GBuYJdR5mRrFCBZMxrbro+OJLgSN3g/TORSsWlW7dEOWLfbyrmlZQ==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" @@ -871,6 +976,7 @@ "version": "0.62.0", "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.62.0.tgz", "integrity": "sha512-M5KTCVH5fBniZU8eQlw+NV13vAmPr58HyBLDIyxeOuV+SHNlx+f+qanUEDIPaJheKlaSSNTEZKsDhs83/iIMMA==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" @@ -884,6 +990,7 @@ "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.62.0.tgz", "integrity": "sha512-DexGTQHB75fncDcYfs5CIbNwO6NOhjwCaaNoHYAsVVzs4T8qwzw6WQdEEMzZRbgsxwnllFkxKwGhLtRMQdv/cQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=18.0.0" }, @@ -895,6 +1002,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "license": "MIT", "dependencies": { "@vitest/spy": "1.6.0", "@vitest/utils": "1.6.0", @@ -908,6 +1016,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "license": "MIT", "dependencies": { "@vitest/utils": "1.6.0", "p-limit": "^5.0.0", @@ -921,6 +1030,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "license": "MIT", "dependencies": { "magic-string": "^0.30.5", "pathe": "^1.1.1", @@ -934,6 +1044,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "license": "MIT", "dependencies": { "tinyspy": "^2.2.0" }, @@ -945,6 +1056,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "license": "MIT", "dependencies": { "diff-sequences": "^29.6.3", "estree-walker": "^3.0.3", @@ -959,6 +1071,7 @@ "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -970,6 +1083,7 @@ "version": "8.3.4", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "license": "MIT", "dependencies": { "acorn": "^8.11.0" }, @@ -981,6 +1095,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -996,6 +1111,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1004,6 +1120,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -1014,12 +1131,14 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "license": "MIT", "engines": { "node": "*" } @@ -1028,6 +1147,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -1038,12 +1158,14 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1052,6 +1174,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "license": "MIT", "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.3", @@ -1069,6 +1192,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1081,12 +1205,14 @@ "node_modules/change-case": { "version": "5.4.4", "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", - "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==" + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "license": "MIT" }, "node_modules/check-error": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "license": "MIT", "dependencies": { "get-func-name": "^2.0.2" }, @@ -1098,6 +1224,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -1111,6 +1238,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", "dependencies": { "color-name": "1.1.3" } @@ -1118,17 +1246,20 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" }, "node_modules/confbox": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==" + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1142,6 +1273,7 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -1158,6 +1290,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz", "integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==", + "license": "MIT", "engines": { "node": ">=14.16" } @@ -1166,6 +1299,7 @@ "version": "4.1.4", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "license": "MIT", "dependencies": { "type-detect": "^4.0.0" }, @@ -1177,6 +1311,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -1184,13 +1319,15 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -1227,6 +1364,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -1235,6 +1373,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -1243,6 +1382,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } @@ -1251,6 +1391,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", @@ -1272,12 +1413,14 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1292,12 +1435,14 @@ "node_modules/fast-uri": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", - "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==" + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", + "license": "BSD-3-Clause" }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -1306,6 +1451,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1317,6 +1463,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", + "license": "MIT", "engines": { "node": ">=14.16" }, @@ -1329,6 +1476,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1341,6 +1489,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -1349,6 +1498,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "license": "MIT", "engines": { "node": "*" } @@ -1357,6 +1507,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "license": "MIT", "engines": { "node": ">=16" }, @@ -1368,6 +1519,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1379,6 +1531,7 @@ "version": "14.0.2", "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", + "license": "MIT", "dependencies": { "@sindresorhus/merge-streams": "^2.1.0", "fast-glob": "^3.3.2", @@ -1397,12 +1550,14 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", "engines": { "node": ">=4" } @@ -1411,6 +1566,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "license": "Apache-2.0", "engines": { "node": ">=16.17.0" } @@ -1419,6 +1575,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", "engines": { "node": ">= 4" } @@ -1427,6 +1584,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1435,6 +1593,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1443,6 +1602,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -1454,6 +1614,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1462,6 +1623,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -1472,17 +1634,20 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -1493,12 +1658,14 @@ "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "license": "MIT", "engines": { "node": ">=6" } @@ -1507,6 +1674,7 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.1.tgz", "integrity": "sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==", + "license": "MIT", "dependencies": { "mlly": "^1.7.3", "pkg-types": "^1.2.1" @@ -1522,14 +1690,16 @@ "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "license": "MIT", "dependencies": { "get-func-name": "^2.0.1" } }, "node_modules/magic-string": { - "version": "0.30.14", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.14.tgz", - "integrity": "sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==", + "version": "0.30.15", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.15.tgz", + "integrity": "sha512-zXeaYRgZ6ldS1RJJUrMrYgNJ4fdwnyI6tVqoiIhyCyv5IVTK9BU8Ic2l253GGETQHxI4HNUwhJ3fjDhKqEoaAw==", + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } @@ -1537,12 +1707,14 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", "engines": { "node": ">= 8" } @@ -1551,6 +1723,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -1563,6 +1736,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1574,6 +1748,7 @@ "version": "1.7.3", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.3.tgz", "integrity": "sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==", + "license": "MIT", "dependencies": { "acorn": "^8.14.0", "pathe": "^1.1.2", @@ -1584,12 +1759,14 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, "node_modules/mustache": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "license": "MIT", "bin": { "mustache": "bin/mustache" } @@ -1604,6 +1781,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1615,6 +1793,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -1629,6 +1808,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1640,6 +1820,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -1654,6 +1835,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "license": "MIT", "dependencies": { "yocto-queue": "^1.0.0" }, @@ -1668,6 +1850,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1676,6 +1859,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1686,12 +1870,14 @@ "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==" + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "license": "MIT" }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "license": "MIT", "engines": { "node": "*" } @@ -1699,12 +1885,14 @@ "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -1716,6 +1904,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.1.tgz", "integrity": "sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==", + "license": "MIT", "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.2", @@ -1726,6 +1915,7 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "license": "MIT", "engines": { "node": ">=4" } @@ -1748,6 +1938,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.1", @@ -1761,6 +1952,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -1775,6 +1967,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -1788,6 +1981,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -1799,6 +1993,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "license": "MIT", "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -1811,6 +2006,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-2.0.1.tgz", "integrity": "sha512-rjaeGbsmhNDcDInmwi4MuI6mRwJu6zq8GjYCLuSuE7GF+4UjgzkL69sVKKJ2T2xH61kK7rXvGYpvaTu909oXaQ==", + "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", "retry": "^0.10.0" @@ -1823,6 +2019,7 @@ "version": "9.1.1", "resolved": "https://registry.npmjs.org/query-string/-/query-string-9.1.1.tgz", "integrity": "sha512-MWkCOVIcJP9QSKU52Ngow6bsAWAPlPK2MludXvcrS2bGZSl+T1qX9MZvRIkqUIkGLJquMJHWfsT6eRqUpp4aWg==", + "license": "MIT", "dependencies": { "decode-uri-component": "^0.4.1", "filter-obj": "^5.1.0", @@ -1852,17 +2049,20 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1871,6 +2071,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1879,6 +2080,7 @@ "version": "0.10.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", "integrity": "sha512-ZXUSQYTHdl3uS7IuCehYfMzKyIDBNoAuUblvy5oGO5UJSUTmStUUVPXbA9Qxd173Bgre53yCQczQuHgRWAdvJQ==", + "license": "MIT", "engines": { "node": "*" } @@ -1887,6 +2089,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -1896,6 +2099,7 @@ "version": "4.28.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.28.1.tgz", "integrity": "sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==", + "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, @@ -1947,6 +2151,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -1955,6 +2160,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1966,6 +2172,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -1977,6 +2184,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1984,12 +2192,14 @@ "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==" + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "license": "ISC" }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", "engines": { "node": ">=14" }, @@ -2000,12 +2210,14 @@ "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT" }, "node_modules/slash": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "license": "MIT", "engines": { "node": ">=14.16" }, @@ -2017,6 +2229,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -2025,6 +2238,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -2033,6 +2247,7 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -2042,6 +2257,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz", "integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -2052,17 +2268,20 @@ "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==" + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "license": "MIT" }, "node_modules/std-env": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", - "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==" + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "license": "MIT" }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -2076,6 +2295,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2087,6 +2307,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -2098,6 +2319,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.1.tgz", "integrity": "sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==", + "license": "MIT", "dependencies": { "js-tokens": "^9.0.1" }, @@ -2108,12 +2330,14 @@ "node_modules/strip-literal/node_modules/js-tokens": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==" + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "license": "MIT" }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -2125,6 +2349,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.2.5.tgz", "integrity": "sha512-ye47xp8Cb0nDguAhrrDS1JT1SzwEV9e26sSsrWzVu+yPZ7LzceEcH0i2gci9jWfOfSCCgM3Qv5nOYShVUUFUXA==", + "license": "MIT", "dependencies": { "temporal-spec": "^0.2.4" } @@ -2132,17 +2357,20 @@ "node_modules/temporal-spec": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.2.4.tgz", - "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==" + "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==", + "license": "ISC" }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==" + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "license": "MIT" }, "node_modules/tinypool": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -2151,6 +2379,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -2159,6 +2388,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -2170,6 +2400,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "license": "MIT", "engines": { "node": ">=4" } @@ -2177,12 +2408,14 @@ "node_modules/ufo": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz", - "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==" + "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", + "license": "MIT" }, "node_modules/unicorn-magic": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "license": "MIT", "engines": { "node": ">=18" }, @@ -2194,6 +2427,7 @@ "version": "5.4.11", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -2252,6 +2486,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", @@ -2273,6 +2508,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", + "license": "MIT", "dependencies": { "@vitest/expect": "1.6.0", "@vitest/runner": "1.6.0", @@ -2337,6 +2573,7 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -2345,6 +2582,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "license": "MIT", "dependencies": { "vscode-languageserver-protocol": "3.17.5" }, @@ -2356,6 +2594,7 @@ "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "license": "MIT", "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" @@ -2364,17 +2603,20 @@ "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", - "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "license": "MIT" }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "license": "MIT" }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -2389,6 +2631,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "license": "MIT", "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" @@ -2404,6 +2647,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -2420,6 +2664,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -2434,6 +2679,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -2444,12 +2690,14 @@ "node_modules/wrap-ansi/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", "engines": { "node": ">=10" } @@ -2458,6 +2706,7 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "license": "ISC", "bin": { "yaml": "bin.mjs" }, @@ -2469,6 +2718,7 @@ "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -2486,6 +2736,7 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", "engines": { "node": ">=12" } @@ -2494,6 +2745,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "license": "MIT", "engines": { "node": ">=12.20" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 6ec6ca1361..968c5f0211 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,10 +1,11 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-rust": "0.3.0" + "@azure-tools/typespec-rust": "0.4.0" }, "devDependencies": { "@azure-tools/typespec-client-generator-core": "0.48.4", + "@azure-tools/typespec-azure-rulesets": "0.48.0", "@typespec/compiler": "0.62.0", "@typespec/xml": "0.62.0" } diff --git a/sdk/storage/storage_blob/Cargo.toml b/sdk/storage/storage_blob/Cargo.toml new file mode 100644 index 0000000000..da5b822e5b --- /dev/null +++ b/sdk/storage/storage_blob/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "storage_blob" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true + +[dependencies] +async-std = { workspace = true } +azure_core = { workspace = true } +serde = { workspace = true } +time = { workspace = true } +typespec_client_core = { workspace = true } diff --git a/sdk/storage/storage_blob/src/generated/clients/blob_append_blob_client.rs b/sdk/storage/storage_blob/src/generated/clients/blob_append_blob_client.rs new file mode 100644 index 0000000000..fb084be3c7 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/blob_append_blob_client.rs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + ClientMethodOptions, Context, Method, Pipeline, Request, RequestContent, Response, Result, Url, base64, +}; +use crate::models::{ + BlobImmutabilityPolicyMode, EncryptionAlgorithmType, +}; +use std::collections::HashMap; +use time::OffsetDateTime; + +pub struct BlobAppendBlobClient { + pub(crate) container_name: String, + pub(crate) endpoint: Url, + pub(crate) pipeline: Pipeline, + pub(crate) version: String, +} + +impl BlobAppendBlobClient { + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// The Append Block operation commits a new block of data to the end of an append blob. + pub async fn append_block(&self, version: String, container_name: String, blob: String, body: RequestContent>, content_length: i64, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "appendblock"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + if let Some(transactional_content_md5) = options.transactional_content_md5 { + request.insert_header("content-md5", transactional_content_md5); + } + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(append_position) = options.append_position { + request.insert_header("x-ms-blob-condition-appendpos", append_position.to_string()); + } + if let Some(max_size) = options.max_size { + request.insert_header("x-ms-blob-condition-maxsize", max_size.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(transactional_content_crc64) = options.transactional_content_crc64 { + request.insert_header("x-ms-content-crc64", transactional_content_crc64); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(structured_body_type) = options.structured_body_type { + request.insert_header("x-ms-structured-body", structured_body_type); + } + if let Some(structured_content_length) = options.structured_content_length { + request.insert_header("x-ms-structured-content-length", structured_content_length.to_string()); + } + request.insert_header("x-ms-version", version); + request.set_body(body); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Append Block From URL operation creates a new block to be committed as part of an append blob where the contents are +/// read from a URL. + pub async fn append_block_from_url(&self, version: String, container_name: String, blob: String, source_url: String, content_length: i64, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "appendblock").append_key_only("fromUrl"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + if let Some(transactional_content_md5) = options.transactional_content_md5 { + request.insert_header("content-md5", transactional_content_md5); + } + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(append_position) = options.append_position { + request.insert_header("x-ms-blob-condition-appendpos", append_position.to_string()); + } + if let Some(max_size) = options.max_size { + request.insert_header("x-ms-blob-condition-maxsize", max_size.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-copy-source", source_url); + if let Some(copy_source_authorization) = options.copy_source_authorization { + request.insert_header("x-ms-copy-source-authorization", copy_source_authorization); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(source_content_crc64) = options.source_content_crc64 { + request.insert_header("x-ms-source-content-crc64", base64::encode(source_content_crc64)); + } + if let Some(source_content_md5) = options.source_content_md5 { + request.insert_header("x-ms-source-content-md5", source_content_md5); + } + if let Some(source_if_match) = options.source_if_match { + request.insert_header("x-ms-source-if-match", source_if_match); + } + if let Some(source_if_modified_since) = options.source_if_modified_since { + request.insert_header("x-ms-source-if-modified-since", source_if_modified_since); + } + if let Some(source_if_none_match) = options.source_if_none_match { + request.insert_header("x-ms-source-if-none-match", source_if_none_match); + } + if let Some(source_if_unmodified_since) = options.source_if_unmodified_since { + request.insert_header("x-ms-source-if-unmodified-since", source_if_unmodified_since); + } + if let Some(source_range) = options.source_range { + request.insert_header("x-ms-source-range", source_range); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Create operation creates a new append blob. + pub async fn create(&self, version: String, container_name: String, blob: String, content_length: i64, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("AppendBlob"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + request.insert_header("content-type", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(blob_cache_control) = options.blob_cache_control { + request.insert_header("x-ms-blob-cache-control", blob_cache_control); + } + if let Some(blob_content_disposition) = options.blob_content_disposition { + request.insert_header("x-ms-blob-content-disposition", blob_content_disposition); + } + if let Some(blob_content_encoding) = options.blob_content_encoding { + request.insert_header("x-ms-blob-content-encoding", blob_content_encoding); + } + if let Some(blob_content_language) = options.blob_content_language { + request.insert_header("x-ms-blob-content-language", blob_content_language); + } + if let Some(blob_content_md5) = options.blob_content_md5 { + request.insert_header("x-ms-blob-content-md5", base64::encode(blob_content_md5)); + } + if let Some(blob_content_type) = options.blob_content_type { + request.insert_header("x-ms-blob-content-type", blob_content_type); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(immutability_policy_mode) = options.immutability_policy_mode { + request.insert_header("x-ms-immutability-policy-mode", immutability_policy_mode.to_string()); + } + if let Some(immutability_policy_expiry) = options.immutability_policy_expiry { + request.insert_header("x-ms-immutability-policy-until-date", immutability_policy_expiry); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(legal_hold) = options.legal_hold { + request.insert_header("x-ms-legal-hold", legal_hold.to_string()); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + if let Some(blob_tags_string) = options.blob_tags_string { + request.insert_header("x-ms-tags", blob_tags_string); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 version or +/// later. + pub async fn seal(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "seal"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(append_position) = options.append_position { + request.insert_header("x-ms-blob-condition-appendpos", append_position.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } +} + +#[derive(Clone, Debug, Default)] +pub struct BlobAppendBlobClientAppendBlockOptions<'a> { + pub append_position: Option, + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub max_size: Option, + pub method_options: ClientMethodOptions<'a>, + pub structured_body_type: Option, + pub structured_content_length: Option, + pub timeout: Option, + pub transactional_content_crc64: Option, + pub transactional_content_md5: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobAppendBlobClientAppendBlockFromUrlOptions<'a> { + pub append_position: Option, + pub client_request_id: Option, + pub copy_source_authorization: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub max_size: Option, + pub method_options: ClientMethodOptions<'a>, + pub source_content_crc64: Option>, + pub source_content_md5: Option, + pub source_if_match: Option, + pub source_if_modified_since: Option, + pub source_if_none_match: Option, + pub source_if_unmodified_since: Option, + pub source_range: Option, + pub timeout: Option, + pub transactional_content_md5: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobAppendBlobClientCreateOptions<'a> { + pub blob_cache_control: Option, + pub blob_content_disposition: Option, + pub blob_content_encoding: Option, + pub blob_content_language: Option, + pub blob_content_md5: Option>, + pub blob_content_type: Option, + pub blob_tags_string: Option, + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub immutability_policy_expiry: Option, + pub immutability_policy_mode: Option, + pub lease_id: Option, + pub legal_hold: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobAppendBlobClientSealOptions<'a> { + pub append_position: Option, + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + diff --git a/sdk/storage/storage_blob/src/generated/clients/blob_blob_client.rs b/sdk/storage/storage_blob/src/generated/clients/blob_blob_client.rs new file mode 100644 index 0000000000..353817b359 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/blob_blob_client.rs @@ -0,0 +1,1517 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + ClientMethodOptions, Context, Method, Pipeline, Request, RequestContent, Response, Result, Url, base64, +}; +use crate::models::{ + AccessTier, BlobDeleteType, BlobExpiryOptions, BlobImmutabilityPolicyMode, BlobTags, DeleteSnapshotsOptionType, EncryptionAlgorithmType, QueryRequest, RehydratePriority, +}; +use std::collections::HashMap; +use time::OffsetDateTime; + +pub struct BlobBlobClient { + pub(crate) container_name: String, + pub(crate) endpoint: Url, + pub(crate) pipeline: Pipeline, + pub(crate) version: String, +} + +impl BlobBlobClient { + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length +/// and full metadata. + pub async fn abort_copy_from_url(&self, version: String, container_name: String, blob: String, copy_id: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "copy").append_key_only("copyid"); + url.query_pairs_mut().append_pair("copyid", ©_id); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. + pub async fn acquire_lease(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("acquire").append_pair("comp", "lease"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(duration) = options.duration { + request.insert_header("x-ms-lease-duration", duration.to_string()); + } + if let Some(proposed_lease_id) = options.proposed_lease_id { + request.insert_header("x-ms-proposed-lease-id", proposed_lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. + pub async fn break_lease(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("break").append_pair("comp", "lease"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(break_period) = options.break_period { + request.insert_header("x-ms-lease-break-period", break_period.to_string()); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. + pub async fn change_lease(&self, version: String, container_name: String, blob: String, lease_id: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("change").append_pair("comp", "lease"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + request.insert_header("x-ms-lease-id", lease_id); + if let Some(proposed_lease_id) = options.proposed_lease_id { + request.insert_header("x-ms-proposed-lease-id", proposed_lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the +/// copy is complete. + pub async fn copy_from_url(&self, version: String, container_name: String, blob: String, copy_source: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "copy").append_key_only("sync"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(tier) = options.tier { + request.insert_header("x-ms-access-tier", tier.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-copy-source", copy_source); + if let Some(copy_source_authorization) = options.copy_source_authorization { + request.insert_header("x-ms-copy-source-authorization", copy_source_authorization); + } + if let Some(copy_source_tags) = options.copy_source_tags { + request.insert_header("x-ms-copy-source-tags", copy_source_tags); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(immutability_policy_mode) = options.immutability_policy_mode { + request.insert_header("x-ms-immutability-policy-mode", immutability_policy_mode.to_string()); + } + if let Some(immutability_policy_expiry) = options.immutability_policy_expiry { + request.insert_header("x-ms-immutability-policy-until-date", immutability_policy_expiry); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(legal_hold) = options.legal_hold { + request.insert_header("x-ms-legal-hold", legal_hold.to_string()); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + if let Some(source_content_md5) = options.source_content_md5 { + request.insert_header("x-ms-source-content-md5", source_content_md5); + } + if let Some(source_if_match) = options.source_if_match { + request.insert_header("x-ms-source-if-match", source_if_match); + } + if let Some(source_if_modified_since) = options.source_if_modified_since { + request.insert_header("x-ms-source-if-modified-since", source_if_modified_since); + } + if let Some(source_if_none_match) = options.source_if_none_match { + request.insert_header("x-ms-source-if-none-match", source_if_none_match); + } + if let Some(source_if_unmodified_since) = options.source_if_unmodified_since { + request.insert_header("x-ms-source-if-unmodified-since", source_if_unmodified_since); + } + if let Some(blob_tags_string) = options.blob_tags_string { + request.insert_header("x-ms-tags", blob_tags_string); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Create Snapshot operation creates a read-only snapshot of a blob + pub async fn create_snapshot(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "snapshot"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from +/// the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, it is marked +/// for deletion and becomes inaccessible immediately. However, the blob service retains the blob or snapshot for the number +/// of days specified by the DeleteRetentionPolicy section of [Storage service properties] (Set-Blob-Service-Properties.md). +/// After the specified number of days has passed, the blob's data is permanently removed from the storage account. Note that +/// you continue to be charged for the soft-deleted blob's storage until it is permanently removed. Use the List Blobs API +/// and specify the \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You +/// can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot +/// causes the service to return an HTTP status code of 404 (ResourceNotFound). + pub async fn delete(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + if let Some(blob_delete_type) = options.blob_delete_type { + url.query_pairs_mut().append_pair("deletetype", &blob_delete_type.to_string()); + } + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Delete); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(delete_snapshots) = options.delete_snapshots { + request.insert_header("x-ms-delete-snapshots", delete_snapshots.to_string()); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Delete Immutability Policy operation deletes the immutability policy on the blob. + pub async fn delete_immutability_policy(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "immutabilityPolicies"); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Delete); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also +/// call Download to read a snapshot. + pub async fn download(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(range) = options.range { + request.insert_header("x-ms-range", range); + } + if let Some(range_get_content_crc64) = options.range_get_content_crc64 { + request.insert_header("x-ms-range-get-content-crc64", range_get_content_crc64.to_string()); + } + if let Some(range_get_content_md5) = options.range_get_content_md5 { + request.insert_header("x-ms-range-get-content-md5", range_get_content_md5.to_string()); + } + if let Some(structured_body_type) = options.structured_body_type { + request.insert_header("x-ms-structured-body", structured_body_type); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Returns the sku name and account kind + pub async fn get_account_info(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("blob").append_pair("comp", "properties").append_pair("restype", "account"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the +/// blob. It does not return the content of the blob. + pub async fn get_properties(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Head); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Get Blob Tags operation enables users to get tags on a blob. + pub async fn get_tags(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "tags"); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Query operation enables users to select/project on blob data by providing simple query expressions. + pub async fn query(&self, version: String, container_name: String, blob: String, query_request: RequestContent, options: Option>) -> Result>> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "query"); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + request.set_body(query_request); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. + pub async fn release_lease(&self, version: String, container_name: String, blob: String, lease_id: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "lease").append_key_only("release"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + request.insert_header("x-ms-lease-id", lease_id); + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations. + pub async fn renew_lease(&self, version: String, container_name: String, blob: String, lease_id: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "lease").append_key_only("renew"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + request.insert_header("x-ms-lease-id", lease_id); + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Set the expiration time of a blob + pub async fn set_expiry(&self, version: String, container_name: String, blob: String, expiry_options: BlobExpiryOptions, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "expiry"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-expiry-option", expiry_options.to_string()); + if let Some(expires_on) = options.expires_on { + request.insert_header("x-ms-expiry-time", expires_on); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Set HTTP Headers operation sets system properties on the blob. + pub async fn set_http_headers(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("SetHTTPHeaders").append_pair("comp", "properties"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(blob_cache_control) = options.blob_cache_control { + request.insert_header("x-ms-blob-cache-control", blob_cache_control); + } + if let Some(blob_content_disposition) = options.blob_content_disposition { + request.insert_header("x-ms-blob-content-disposition", blob_content_disposition); + } + if let Some(blob_content_encoding) = options.blob_content_encoding { + request.insert_header("x-ms-blob-content-encoding", blob_content_encoding); + } + if let Some(blob_content_language) = options.blob_content_language { + request.insert_header("x-ms-blob-content-language", blob_content_language); + } + if let Some(blob_content_md5) = options.blob_content_md5 { + request.insert_header("x-ms-blob-content-md5", base64::encode(blob_content_md5)); + } + if let Some(blob_content_type) = options.blob_content_type { + request.insert_header("x-ms-blob-content-type", blob_content_type); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Set the immutability policy of a blob + pub async fn set_immutability_policy(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "immutabilityPolicies"); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(immutability_policy_mode) = options.immutability_policy_mode { + request.insert_header("x-ms-immutability-policy-mode", immutability_policy_mode.to_string()); + } + if let Some(immutability_policy_expiry) = options.immutability_policy_expiry { + request.insert_header("x-ms-immutability-policy-until-date", immutability_policy_expiry); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Set Legal Hold operation sets a legal hold on the blob. + pub async fn set_legal_hold(&self, version: String, container_name: String, blob: String, legal_hold: bool, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "legalhold"); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-legal-hold", legal_hold.to_string()); + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Set Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs. + pub async fn set_metadata(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "metadata"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Set Tags operation enables users to set tags on a blob. + pub async fn set_tags(&self, version: String, container_name: String, blob: String, tags: RequestContent, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "tags"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + if let Some(transactional_content_md5) = options.transactional_content_md5 { + request.insert_header("content-md5", transactional_content_md5); + } + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(transactional_content_crc64) = options.transactional_content_crc64 { + request.insert_header("x-ms-content-crc64", transactional_content_crc64); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + request.set_body(tags); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Set Tier operation sets the tier on a block blob. The operation is allowed on a page blob or block blob, but not on +/// an append blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's +/// ETag. + pub async fn set_tier(&self, version: String, container_name: String, blob: String, tier: AccessTier, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "tier"); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(version_id) = options.version_id { + url.query_pairs_mut().append_pair("versionid", &version_id); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + request.insert_header("x-ms-access-tier", tier.to_string()); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(rehydrate_priority) = options.rehydrate_priority { + request.insert_header("x-ms-rehydrate-priority", rehydrate_priority.to_string()); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Start Copy From URL operation copies a blob or an internet resource to a new blob. + pub async fn start_copy_from_url(&self, version: String, container_name: String, blob: String, copy_source: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "copy"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(tier) = options.tier { + request.insert_header("x-ms-access-tier", tier.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-copy-source", copy_source); + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(immutability_policy_mode) = options.immutability_policy_mode { + request.insert_header("x-ms-immutability-policy-mode", immutability_policy_mode.to_string()); + } + if let Some(immutability_policy_expiry) = options.immutability_policy_expiry { + request.insert_header("x-ms-immutability-policy-until-date", immutability_policy_expiry); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(legal_hold) = options.legal_hold { + request.insert_header("x-ms-legal-hold", legal_hold.to_string()); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + if let Some(rehydrate_priority) = options.rehydrate_priority { + request.insert_header("x-ms-rehydrate-priority", rehydrate_priority.to_string()); + } + if let Some(seal_blob) = options.seal_blob { + request.insert_header("x-ms-seal-blob", seal_blob.to_string()); + } + if let Some(source_if_match) = options.source_if_match { + request.insert_header("x-ms-source-if-match", source_if_match); + } + if let Some(source_if_modified_since) = options.source_if_modified_since { + request.insert_header("x-ms-source-if-modified-since", source_if_modified_since); + } + if let Some(source_if_none_match) = options.source_if_none_match { + request.insert_header("x-ms-source-if-none-match", source_if_none_match); + } + if let Some(source_if_tags) = options.source_if_tags { + request.insert_header("x-ms-source-if-tags", source_if_tags); + } + if let Some(source_if_unmodified_since) = options.source_if_unmodified_since { + request.insert_header("x-ms-source-if-unmodified-since", source_if_unmodified_since); + } + if let Some(blob_tags_string) = options.blob_tags_string { + request.insert_header("x-ms-tags", blob_tags_string); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Undelete a blob that was previously soft deleted + pub async fn undelete(&self, version: String, container_name: String, blob: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "undelete"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } +} + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientAbortCopyFromUrlOptions<'a> { + pub client_request_id: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientAcquireLeaseOptions<'a> { + pub client_request_id: Option, + pub duration: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub proposed_lease_id: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientBreakLeaseOptions<'a> { + pub break_period: Option, + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientChangeLeaseOptions<'a> { + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub proposed_lease_id: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientCopyFromUrlOptions<'a> { + pub blob_tags_string: Option, + pub client_request_id: Option, + pub copy_source_authorization: Option, + pub copy_source_tags: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub immutability_policy_expiry: Option, + pub immutability_policy_mode: Option, + pub lease_id: Option, + pub legal_hold: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub source_content_md5: Option, + pub source_if_match: Option, + pub source_if_modified_since: Option, + pub source_if_none_match: Option, + pub source_if_unmodified_since: Option, + pub tier: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientCreateSnapshotOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientDeleteOptions<'a> { + pub blob_delete_type: Option, + pub client_request_id: Option, + pub delete_snapshots: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub snapshot: Option, + pub timeout: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientDeleteImmutabilityPolicyOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub snapshot: Option, + pub timeout: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientDownloadOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub range: Option, + pub range_get_content_crc64: Option, + pub range_get_content_md5: Option, + pub snapshot: Option, + pub structured_body_type: Option, + pub timeout: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientGetAccountInfoOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientGetPropertiesOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub snapshot: Option, + pub timeout: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientGetTagsOptions<'a> { + pub client_request_id: Option, + pub if_tags: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub snapshot: Option, + pub timeout: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientQueryOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub snapshot: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientReleaseLeaseOptions<'a> { + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientRenewLeaseOptions<'a> { + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientSetExpiryOptions<'a> { + pub client_request_id: Option, + pub expires_on: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientSetHttpHeadersOptions<'a> { + pub blob_cache_control: Option, + pub blob_content_disposition: Option, + pub blob_content_encoding: Option, + pub blob_content_language: Option, + pub blob_content_md5: Option>, + pub blob_content_type: Option, + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientSetImmutabilityPolicyOptions<'a> { + pub client_request_id: Option, + pub if_unmodified_since: Option, + pub immutability_policy_expiry: Option, + pub immutability_policy_mode: Option, + pub method_options: ClientMethodOptions<'a>, + pub snapshot: Option, + pub timeout: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientSetLegalHoldOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub snapshot: Option, + pub timeout: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientSetMetadataOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientSetTagsOptions<'a> { + pub client_request_id: Option, + pub if_tags: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, + pub transactional_content_crc64: Option, + pub transactional_content_md5: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientSetTierOptions<'a> { + pub client_request_id: Option, + pub if_tags: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub rehydrate_priority: Option, + pub snapshot: Option, + pub timeout: Option, + pub version_id: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientStartCopyFromUrlOptions<'a> { + pub blob_tags_string: Option, + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub immutability_policy_expiry: Option, + pub immutability_policy_mode: Option, + pub lease_id: Option, + pub legal_hold: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub rehydrate_priority: Option, + pub seal_blob: Option, + pub source_if_match: Option, + pub source_if_modified_since: Option, + pub source_if_none_match: Option, + pub source_if_tags: Option, + pub source_if_unmodified_since: Option, + pub tier: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlobClientUndeleteOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + diff --git a/sdk/storage/storage_blob/src/generated/clients/blob_block_blob_client.rs b/sdk/storage/storage_blob/src/generated/clients/blob_block_blob_client.rs new file mode 100644 index 0000000000..3e3458c272 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/blob_block_blob_client.rs @@ -0,0 +1,666 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + ClientMethodOptions, Context, Method, Pipeline, Request, RequestContent, Response, Result, Url, base64, +}; +use crate::models::{ + AccessTier, BlobImmutabilityPolicyMode, BlockListType, BlockLookupList, EncryptionAlgorithmType, +}; +use std::collections::HashMap; +use time::OffsetDateTime; + +pub struct BlobBlockBlobClient { + pub(crate) container_name: String, + pub(crate) endpoint: Url, + pub(crate) pipeline: Pipeline, + pub(crate) version: String, +} + +impl BlobBlockBlobClient { + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be +/// written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation. You +/// can call Put Block List to update a blob by uploading only those blocks that have changed, then committing the new and +/// existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from +/// the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong +/// to. + pub async fn commit_block_list(&self, version: String, container_name: String, blob: String, blocks: RequestContent, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "blocklist"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + if let Some(transactional_content_md5) = options.transactional_content_md5 { + request.insert_header("content-md5", transactional_content_md5); + } + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(tier) = options.tier { + request.insert_header("x-ms-access-tier", tier.to_string()); + } + if let Some(blob_cache_control) = options.blob_cache_control { + request.insert_header("x-ms-blob-cache-control", blob_cache_control); + } + if let Some(blob_content_disposition) = options.blob_content_disposition { + request.insert_header("x-ms-blob-content-disposition", blob_content_disposition); + } + if let Some(blob_content_encoding) = options.blob_content_encoding { + request.insert_header("x-ms-blob-content-encoding", blob_content_encoding); + } + if let Some(blob_content_language) = options.blob_content_language { + request.insert_header("x-ms-blob-content-language", blob_content_language); + } + if let Some(blob_content_md5) = options.blob_content_md5 { + request.insert_header("x-ms-blob-content-md5", base64::encode(blob_content_md5)); + } + if let Some(blob_content_type) = options.blob_content_type { + request.insert_header("x-ms-blob-content-type", blob_content_type); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(transactional_content_crc64) = options.transactional_content_crc64 { + request.insert_header("x-ms-content-crc64", transactional_content_crc64); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(immutability_policy_mode) = options.immutability_policy_mode { + request.insert_header("x-ms-immutability-policy-mode", immutability_policy_mode.to_string()); + } + if let Some(immutability_policy_expiry) = options.immutability_policy_expiry { + request.insert_header("x-ms-immutability-policy-until-date", immutability_policy_expiry); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(legal_hold) = options.legal_hold { + request.insert_header("x-ms-legal-hold", legal_hold.to_string()); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + if let Some(blob_tags_string) = options.blob_tags_string { + request.insert_header("x-ms-tags", blob_tags_string); + } + request.insert_header("x-ms-version", version); + request.set_body(blocks); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. + pub async fn get_block_list(&self, version: String, container_name: String, blob: String, list_type: BlockListType, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "blocklist"); + url.query_pairs_mut().append_pair("blocklisttype", &list_type.to_string()); + if let Some(snapshot) = options.snapshot { + url.query_pairs_mut().append_pair("snapshot", &snapshot); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read from a given URL. This +/// API is supported beginning with the 2020-04-08 version. Partial updates are not supported with Put Blob from URL; the +/// content of an existing blob is overwritten with the content of the new blob. To perform partial updates to a block blob’s +/// contents using a source URL, use the Put Block from URL API in conjunction with Put Block List. + pub async fn put_blob_from_url(&self, version: String, container_name: String, blob: String, content_length: i64, copy_source: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("BlockBlob").append_key_only("fromUrl"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + if let Some(transactional_content_md5) = options.transactional_content_md5 { + request.insert_header("content-md5", transactional_content_md5); + } + request.insert_header("content-type", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(tier) = options.tier { + request.insert_header("x-ms-access-tier", tier.to_string()); + } + if let Some(blob_cache_control) = options.blob_cache_control { + request.insert_header("x-ms-blob-cache-control", blob_cache_control); + } + if let Some(blob_content_disposition) = options.blob_content_disposition { + request.insert_header("x-ms-blob-content-disposition", blob_content_disposition); + } + if let Some(blob_content_encoding) = options.blob_content_encoding { + request.insert_header("x-ms-blob-content-encoding", blob_content_encoding); + } + if let Some(blob_content_language) = options.blob_content_language { + request.insert_header("x-ms-blob-content-language", blob_content_language); + } + if let Some(blob_content_md5) = options.blob_content_md5 { + request.insert_header("x-ms-blob-content-md5", base64::encode(blob_content_md5)); + } + if let Some(blob_content_type) = options.blob_content_type { + request.insert_header("x-ms-blob-content-type", blob_content_type); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-copy-source", copy_source); + if let Some(copy_source_authorization) = options.copy_source_authorization { + request.insert_header("x-ms-copy-source-authorization", copy_source_authorization); + } + if let Some(copy_source_blob_properties) = options.copy_source_blob_properties { + request.insert_header("x-ms-copy-source-blob-properties", copy_source_blob_properties.to_string()); + } + if let Some(copy_source_tags) = options.copy_source_tags { + request.insert_header("x-ms-copy-source-tags", copy_source_tags); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + if let Some(source_content_md5) = options.source_content_md5 { + request.insert_header("x-ms-source-content-md5", source_content_md5); + } + if let Some(source_if_match) = options.source_if_match { + request.insert_header("x-ms-source-if-match", source_if_match); + } + if let Some(source_if_modified_since) = options.source_if_modified_since { + request.insert_header("x-ms-source-if-modified-since", source_if_modified_since); + } + if let Some(source_if_none_match) = options.source_if_none_match { + request.insert_header("x-ms-source-if-none-match", source_if_none_match); + } + if let Some(source_if_tags) = options.source_if_tags { + request.insert_header("x-ms-source-if-tags", source_if_tags); + } + if let Some(source_if_unmodified_since) = options.source_if_unmodified_since { + request.insert_header("x-ms-source-if-unmodified-since", source_if_unmodified_since); + } + if let Some(blob_tags_string) = options.blob_tags_string { + request.insert_header("x-ms-tags", blob_tags_string); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Stage Block operation creates a new block to be committed as part of a blob + pub async fn stage_block(&self, version: String, container_name: String, blob: String, block_id: String, content_length: i64, body: RequestContent>, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "block"); + url.query_pairs_mut().append_pair("blockid", &block_id); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + if let Some(transactional_content_md5) = options.transactional_content_md5 { + request.insert_header("content-md5", transactional_content_md5); + } + request.insert_header("content-type", "application/octet-stream"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(transactional_content_crc64) = options.transactional_content_crc64 { + request.insert_header("x-ms-content-crc64", transactional_content_crc64); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(structured_body_type) = options.structured_body_type { + request.insert_header("x-ms-structured-body", structured_body_type); + } + if let Some(structured_content_length) = options.structured_content_length { + request.insert_header("x-ms-structured-content-length", structured_content_length.to_string()); + } + request.insert_header("x-ms-version", version); + request.set_body(body); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Stage Block From URL operation creates a new block to be committed as part of a blob where the contents are read from +/// a URL. + pub async fn stage_block_from_url(&self, version: String, container_name: String, blob: String, block_id: String, content_length: i64, source_url: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "block").append_key_only("fromURL"); + url.query_pairs_mut().append_pair("blockid", &block_id); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-copy-source", source_url); + if let Some(copy_source_authorization) = options.copy_source_authorization { + request.insert_header("x-ms-copy-source-authorization", copy_source_authorization); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(source_content_crc64) = options.source_content_crc64 { + request.insert_header("x-ms-source-content-crc64", base64::encode(source_content_crc64)); + } + if let Some(source_content_md5) = options.source_content_md5 { + request.insert_header("x-ms-source-content-md5", source_content_md5); + } + if let Some(source_if_match) = options.source_if_match { + request.insert_header("x-ms-source-if-match", source_if_match); + } + if let Some(source_if_modified_since) = options.source_if_modified_since { + request.insert_header("x-ms-source-if-modified-since", source_if_modified_since); + } + if let Some(source_if_none_match) = options.source_if_none_match { + request.insert_header("x-ms-source-if-none-match", source_if_none_match); + } + if let Some(source_if_unmodified_since) = options.source_if_unmodified_since { + request.insert_header("x-ms-source-if-unmodified-since", source_if_unmodified_since); + } + if let Some(source_range) = options.source_range { + request.insert_header("x-ms-source-range", source_range); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites +/// any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the existing blob is +/// overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Put +/// Block List operation. + pub async fn upload(&self, version: String, container_name: String, blob: String, body: RequestContent>, content_length: i64, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("BlockBlob"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + if let Some(transactional_content_md5) = options.transactional_content_md5 { + request.insert_header("content-md5", transactional_content_md5); + } + request.insert_header("content-type", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(tier) = options.tier { + request.insert_header("x-ms-access-tier", tier.to_string()); + } + if let Some(blob_cache_control) = options.blob_cache_control { + request.insert_header("x-ms-blob-cache-control", blob_cache_control); + } + if let Some(blob_content_disposition) = options.blob_content_disposition { + request.insert_header("x-ms-blob-content-disposition", blob_content_disposition); + } + if let Some(blob_content_encoding) = options.blob_content_encoding { + request.insert_header("x-ms-blob-content-encoding", blob_content_encoding); + } + if let Some(blob_content_language) = options.blob_content_language { + request.insert_header("x-ms-blob-content-language", blob_content_language); + } + if let Some(blob_content_md5) = options.blob_content_md5 { + request.insert_header("x-ms-blob-content-md5", base64::encode(blob_content_md5)); + } + if let Some(blob_content_type) = options.blob_content_type { + request.insert_header("x-ms-blob-content-type", blob_content_type); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(transactional_content_crc64) = options.transactional_content_crc64 { + request.insert_header("x-ms-content-crc64", transactional_content_crc64); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(immutability_policy_mode) = options.immutability_policy_mode { + request.insert_header("x-ms-immutability-policy-mode", immutability_policy_mode.to_string()); + } + if let Some(immutability_policy_expiry) = options.immutability_policy_expiry { + request.insert_header("x-ms-immutability-policy-until-date", immutability_policy_expiry); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(legal_hold) = options.legal_hold { + request.insert_header("x-ms-legal-hold", legal_hold.to_string()); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + if let Some(structured_body_type) = options.structured_body_type { + request.insert_header("x-ms-structured-body", structured_body_type); + } + if let Some(structured_content_length) = options.structured_content_length { + request.insert_header("x-ms-structured-content-length", structured_content_length.to_string()); + } + if let Some(blob_tags_string) = options.blob_tags_string { + request.insert_header("x-ms-tags", blob_tags_string); + } + request.insert_header("x-ms-version", version); + request.set_body(body); + self.pipeline.send(&mut ctx, &mut request).await + + } +} + +#[derive(Clone, Debug, Default)] +pub struct BlobBlockBlobClientCommitBlockListOptions<'a> { + pub blob_cache_control: Option, + pub blob_content_disposition: Option, + pub blob_content_encoding: Option, + pub blob_content_language: Option, + pub blob_content_md5: Option>, + pub blob_content_type: Option, + pub blob_tags_string: Option, + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub immutability_policy_expiry: Option, + pub immutability_policy_mode: Option, + pub lease_id: Option, + pub legal_hold: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub tier: Option, + pub timeout: Option, + pub transactional_content_crc64: Option, + pub transactional_content_md5: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlockBlobClientGetBlockListOptions<'a> { + pub client_request_id: Option, + pub if_tags: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub snapshot: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlockBlobClientPutBlobFromUrlOptions<'a> { + pub blob_cache_control: Option, + pub blob_content_disposition: Option, + pub blob_content_encoding: Option, + pub blob_content_language: Option, + pub blob_content_md5: Option>, + pub blob_content_type: Option, + pub blob_tags_string: Option, + pub client_request_id: Option, + pub copy_source_authorization: Option, + pub copy_source_blob_properties: Option, + pub copy_source_tags: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub source_content_md5: Option, + pub source_if_match: Option, + pub source_if_modified_since: Option, + pub source_if_none_match: Option, + pub source_if_tags: Option, + pub source_if_unmodified_since: Option, + pub tier: Option, + pub timeout: Option, + pub transactional_content_md5: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlockBlobClientStageBlockOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub structured_body_type: Option, + pub structured_content_length: Option, + pub timeout: Option, + pub transactional_content_crc64: Option, + pub transactional_content_md5: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlockBlobClientStageBlockFromUrlOptions<'a> { + pub client_request_id: Option, + pub copy_source_authorization: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub source_content_crc64: Option>, + pub source_content_md5: Option, + pub source_if_match: Option, + pub source_if_modified_since: Option, + pub source_if_none_match: Option, + pub source_if_unmodified_since: Option, + pub source_range: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobBlockBlobClientUploadOptions<'a> { + pub blob_cache_control: Option, + pub blob_content_disposition: Option, + pub blob_content_encoding: Option, + pub blob_content_language: Option, + pub blob_content_md5: Option>, + pub blob_content_type: Option, + pub blob_tags_string: Option, + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub immutability_policy_expiry: Option, + pub immutability_policy_mode: Option, + pub lease_id: Option, + pub legal_hold: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub structured_body_type: Option, + pub structured_content_length: Option, + pub tier: Option, + pub timeout: Option, + pub transactional_content_crc64: Option, + pub transactional_content_md5: Option, +} + + diff --git a/sdk/storage/storage_blob/src/generated/clients/blob_client.rs b/sdk/storage/storage_blob/src/generated/clients/blob_client.rs new file mode 100644 index 0000000000..6c7294bfef --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/blob_client.rs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + ClientOptions, Pipeline, Result, Url, +}; +use crate::blob_append_blob_client::BlobAppendBlobClient; +use crate::blob_blob_client::BlobBlobClient; +use crate::blob_block_blob_client::BlobBlockBlobClient; +use crate::blob_container_client::BlobContainerClient; +use crate::blob_page_blob_client::BlobPageBlobClient; +use crate::blob_service_client::BlobServiceClient; + +pub struct BlobClient { + container_name: String, + endpoint: Url, + pipeline: Pipeline, + version: String, +} + +#[derive(Clone, Debug)] +pub struct BlobClientOptions { + pub client_options: ClientOptions, +} + +impl BlobClient { + pub fn with_no_credential(endpoint: &str, version: String, container_name: String, options: Option) -> Result { + let mut endpoint = Url::parse(endpoint.as_ref())?; + endpoint.set_query(None); + let options = options.unwrap_or_default(); + Ok(Self { + container_name, + endpoint, + version, + pipeline: Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options.client_options, + Vec::default(), + Vec::default(), + ), + }) + } + + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// Returns a new instance of BlobAppendBlobClient. + pub fn get_blob_append_blob_client(&self) -> BlobAppendBlobClient { + BlobAppendBlobClient { + container_name: self.container_name.clone(), + endpoint: self.endpoint.clone(), + pipeline: self.pipeline.clone(), + version: self.version.clone(), + } + } + + /// Returns a new instance of BlobBlobClient. + pub fn get_blob_blob_client(&self) -> BlobBlobClient { + BlobBlobClient { + container_name: self.container_name.clone(), + endpoint: self.endpoint.clone(), + pipeline: self.pipeline.clone(), + version: self.version.clone(), + } + } + + /// Returns a new instance of BlobBlockBlobClient. + pub fn get_blob_block_blob_client(&self) -> BlobBlockBlobClient { + BlobBlockBlobClient { + container_name: self.container_name.clone(), + endpoint: self.endpoint.clone(), + pipeline: self.pipeline.clone(), + version: self.version.clone(), + } + } + + /// Returns a new instance of BlobContainerClient. + pub fn get_blob_container_client(&self) -> BlobContainerClient { + BlobContainerClient { + container_name: self.container_name.clone(), + endpoint: self.endpoint.clone(), + pipeline: self.pipeline.clone(), + version: self.version.clone(), + } + } + + /// Returns a new instance of BlobPageBlobClient. + pub fn get_blob_page_blob_client(&self) -> BlobPageBlobClient { + BlobPageBlobClient { + container_name: self.container_name.clone(), + endpoint: self.endpoint.clone(), + pipeline: self.pipeline.clone(), + version: self.version.clone(), + } + } + + /// Returns a new instance of BlobServiceClient. + pub fn get_blob_service_client(&self) -> BlobServiceClient { + BlobServiceClient { + container_name: self.container_name.clone(), + endpoint: self.endpoint.clone(), + pipeline: self.pipeline.clone(), + version: self.version.clone(), + } + } +} + +impl Default for BlobClientOptions { + fn default() -> Self { + Self { + client_options: ClientOptions::default(), + } + } +} + + diff --git a/sdk/storage/storage_blob/src/generated/clients/blob_container_client.rs b/sdk/storage/storage_blob/src/generated/clients/blob_container_client.rs new file mode 100644 index 0000000000..64b45fa196 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/blob_container_client.rs @@ -0,0 +1,689 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + ClientMethodOptions, Context, Method, Pipeline, Request, RequestContent, Response, Result, Url, +}; +use crate::models::{ + FilterBlobSegment, FilterBlobsIncludeItem, PublicAccessType, SignedIdentifier, +}; +use std::collections::HashMap; + +pub struct BlobContainerClient { + pub(crate) container_name: String, + pub(crate) endpoint: Url, + pub(crate) pipeline: Pipeline, + pub(crate) version: String, +} + +impl BlobContainerClient { + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, +/// or can be infinite + pub async fn acquire_lease(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("acquire").append_pair("comp", "lease").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(duration) = options.duration { + request.insert_header("x-ms-lease-duration", duration.to_string()); + } + if let Some(proposed_lease_id) = options.proposed_lease_id { + request.insert_header("x-ms-proposed-lease-id", proposed_lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, +/// or can be infinite + pub async fn break_lease(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("break").append_pair("comp", "lease").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(break_period) = options.break_period { + request.insert_header("x-ms-lease-break-period", break_period.to_string()); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, +/// or can be infinite + pub async fn change_lease(&self, version: String, container_name: String, lease_id: String, proposed_lease_id: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("change").append_pair("comp", "lease").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-lease-id", lease_id); + request.insert_header("x-ms-proposed-lease-id", proposed_lease_id); + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Creates a new container under the specified account. If the container with the same name already exists, the operation +/// fails. + pub async fn create(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(access) = options.access { + request.insert_header("x-ms-blob-public-access", access.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(default_encryption_scope) = options.default_encryption_scope { + request.insert_header("x-ms-default-encryption-scope", default_encryption_scope); + } + if let Some(prevent_encryption_scope_override) = options.prevent_encryption_scope_override { + request.insert_header("x-ms-deny-encryption-scope-override", prevent_encryption_scope_override.to_string()); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// operation marks the specified container for deletion. The container and any blobs contained within it are later deleted +/// during garbage collection + pub async fn delete(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Delete); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Filter Blobs operation enables callers to list blobs in a container whose tags match a given search expression. Filter +/// blobs searches within the given container. + pub async fn filter_blobs(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "blobs").append_pair("restype", "container"); + if let Some(include) = options.include { + url.query_pairs_mut().append_pair("include", &include.iter().map(|i| i.to_string()).collect::>().join(",")); + } + if let Some(marker) = options.marker { + url.query_pairs_mut().append_pair("marker", &marker); + } + if let Some(maxresults) = options.maxresults { + url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(where_param) = options.where_param { + url.query_pairs_mut().append_pair("where", &where_param); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly. + pub async fn get_access_policy(&self, version: String, container_name: String, options: Option>) -> Result>> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "acl").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Returns the sku name and account kind + pub async fn get_account_info(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "properties").append_pair("restype", "account"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// returns all user-defined metadata and system properties for the specified container. The data returned does not include +/// the container's list of blobs + pub async fn get_properties(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, +/// or can be infinite + pub async fn release_lease(&self, version: String, container_name: String, lease_id: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "lease").append_key_only("release").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-lease-id", lease_id); + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Renames an existing container. + pub async fn rename(&self, version: String, container_name: String, source_container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "rename").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-source-container-name", source_container_name); + if let Some(source_lease_id) = options.source_lease_id { + request.insert_header("x-ms-source-lease-id", source_lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, +/// or can be infinite + pub async fn renew_lease(&self, version: String, container_name: String, lease_id: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "lease").append_key_only("renew").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-lease-id", lease_id); + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Restores a previously-deleted container. + pub async fn restore(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "undelete").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(deleted_container_name) = options.deleted_container_name { + request.insert_header("x-ms-deleted-container-name", deleted_container_name); + } + if let Some(deleted_container_version) = options.deleted_container_version { + request.insert_header("x-ms-deleted-container-version", deleted_container_version); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// sets the permissions for the specified container. The permissions indicate whether blobs in a container may be accessed +/// publicly. + pub async fn set_access_policy(&self, version: String, container_name: String, container_acl: RequestContent>, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "acl").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since); + } + if let Some(access) = options.access { + request.insert_header("x-ms-blob-public-access", access.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + request.set_body(container_acl); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// operation sets one or more user-defined name-value pairs for the specified container. + pub async fn set_metadata(&self, version: String, container_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "metadata").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Batch operation allows multiple API calls to be embedded into a single HTTP request. + pub async fn submit_batch(&self, container_name: String, body: RequestContent>, content_length: i64, version: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}"); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "batch").append_pair("restype", "container"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "multipart/mixed"); + request.insert_header("content-length", content_length.to_string()); + request.insert_header("content-type", "multipart/mixed"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + request.set_body(body); + self.pipeline.send(&mut ctx, &mut request).await + + } +} + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientAcquireLeaseOptions<'a> { + pub client_request_id: Option, + pub duration: Option, + pub if_modified_since: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub proposed_lease_id: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientBreakLeaseOptions<'a> { + pub break_period: Option, + pub client_request_id: Option, + pub if_modified_since: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientChangeLeaseOptions<'a> { + pub client_request_id: Option, + pub if_modified_since: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientCreateOptions<'a> { + pub access: Option, + pub client_request_id: Option, + pub default_encryption_scope: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub prevent_encryption_scope_override: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientDeleteOptions<'a> { + pub client_request_id: Option, + pub if_modified_since: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientFilterBlobsOptions<'a> { + pub client_request_id: Option, + pub include: Option>, + pub marker: Option, + pub maxresults: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, + pub where_param: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientGetAccessPolicyOptions<'a> { + pub client_request_id: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientGetAccountInfoOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientGetPropertiesOptions<'a> { + pub client_request_id: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientReleaseLeaseOptions<'a> { + pub client_request_id: Option, + pub if_modified_since: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientRenameOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub source_lease_id: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientRenewLeaseOptions<'a> { + pub client_request_id: Option, + pub if_modified_since: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientRestoreOptions<'a> { + pub client_request_id: Option, + pub deleted_container_name: Option, + pub deleted_container_version: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientSetAccessPolicyOptions<'a> { + pub access: Option, + pub client_request_id: Option, + pub if_modified_since: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientSetMetadataOptions<'a> { + pub client_request_id: Option, + pub if_modified_since: Option, + pub lease_id: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobContainerClientSubmitBatchOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + diff --git a/sdk/storage/storage_blob/src/generated/clients/blob_page_blob_client.rs b/sdk/storage/storage_blob/src/generated/clients/blob_page_blob_client.rs new file mode 100644 index 0000000000..8ed59fdd80 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/blob_page_blob_client.rs @@ -0,0 +1,658 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + ClientMethodOptions, Context, Method, Pipeline, Request, RequestContent, Response, Result, Url, base64, +}; +use crate::models::{ + BlobImmutabilityPolicyMode, EncryptionAlgorithmType, PremiumPageBlobAccessTier, SequenceNumberActionType, +}; +use std::collections::HashMap; +use time::OffsetDateTime; + +pub struct BlobPageBlobClient { + pub(crate) container_name: String, + pub(crate) endpoint: Url, + pub(crate) pipeline: Pipeline, + pub(crate) version: String, +} + +impl BlobPageBlobClient { + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// The Clear Pages operation clears a range of pages from a page blob + pub async fn clear_pages(&self, version: String, container_name: String, blob: String, content_length: i64, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("clear").append_pair("comp", "page"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + request.insert_header("content-type", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_sequence_number_equal_to) = options.if_sequence_number_equal_to { + request.insert_header("x-ms-if-sequence-number-eq", if_sequence_number_equal_to.to_string()); + } + if let Some(if_sequence_number_less_than_or_equal_to) = options.if_sequence_number_less_than_or_equal_to { + request.insert_header("x-ms-if-sequence-number-le", if_sequence_number_less_than_or_equal_to.to_string()); + } + if let Some(if_sequence_number_less_than) = options.if_sequence_number_less_than { + request.insert_header("x-ms-if-sequence-number-lt", if_sequence_number_less_than.to_string()); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(range) = options.range { + request.insert_header("x-ms-range", range); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot is copied +/// such that only the differential changes between the previously copied snapshot are transferred to the destination. The +/// copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. This API is supported +/// since REST version 2016-05-31. + pub async fn copy_incremental(&self, version: String, container_name: String, blob: String, copy_source: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "incrementalcopy"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-copy-source", copy_source); + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Create operation creates a new page blob. + pub async fn create(&self, version: String, container_name: String, blob: String, content_length: i64, blob_content_length: i64, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("PageBlob"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + request.insert_header("content-type", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(tier) = options.tier { + request.insert_header("x-ms-access-tier", tier.to_string()); + } + if let Some(blob_cache_control) = options.blob_cache_control { + request.insert_header("x-ms-blob-cache-control", blob_cache_control); + } + if let Some(blob_content_disposition) = options.blob_content_disposition { + request.insert_header("x-ms-blob-content-disposition", blob_content_disposition); + } + if let Some(blob_content_encoding) = options.blob_content_encoding { + request.insert_header("x-ms-blob-content-encoding", blob_content_encoding); + } + if let Some(blob_content_language) = options.blob_content_language { + request.insert_header("x-ms-blob-content-language", blob_content_language); + } + request.insert_header("x-ms-blob-content-length", blob_content_length.to_string()); + if let Some(blob_content_md5) = options.blob_content_md5 { + request.insert_header("x-ms-blob-content-md5", base64::encode(blob_content_md5)); + } + if let Some(blob_content_type) = options.blob_content_type { + request.insert_header("x-ms-blob-content-type", blob_content_type); + } + if let Some(blob_sequence_number) = options.blob_sequence_number { + request.insert_header("x-ms-blob-sequence-number", blob_sequence_number.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(immutability_policy_mode) = options.immutability_policy_mode { + request.insert_header("x-ms-immutability-policy-mode", immutability_policy_mode.to_string()); + } + if let Some(immutability_policy_expiry) = options.immutability_policy_expiry { + request.insert_header("x-ms-immutability-policy-until-date", immutability_policy_expiry); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(legal_hold) = options.legal_hold { + request.insert_header("x-ms-legal-hold", legal_hold.to_string()); + } + if let Some(metadata) = options.metadata { +for (k, v) in &metadata { + request.insert_header(format!("x-ms-meta-{}", k), v); + } + } + if let Some(blob_tags_string) = options.blob_tags_string { + request.insert_header("x-ms-tags", blob_tags_string); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Resize operation increases the size of the page blob to the specified size. + pub async fn resize(&self, version: String, container_name: String, blob: String, blob_content_length: i64, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("Resize").append_pair("comp", "properties"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + request.insert_header("x-ms-blob-content-length", blob_content_length.to_string()); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Update Sequence Number operation sets the blob's sequence number. The operation will fail if the specified sequence +/// number is less than the current sequence number of the blob. + pub async fn update_sequence_number(&self, version: String, container_name: String, blob: String, sequence_number_action: SequenceNumberActionType, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_key_only("UpdateSequenceNumber").append_pair("comp", "properties"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(blob_sequence_number) = options.blob_sequence_number { + request.insert_header("x-ms-blob-sequence-number", blob_sequence_number.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-sequence-number-action", sequence_number_action.to_string()); + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Upload Pages operation writes a range of pages to a page blob + pub async fn upload_pages(&self, version: String, container_name: String, blob: String, body: RequestContent>, content_length: i64, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "page").append_key_only("update"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + if let Some(transactional_content_md5) = options.transactional_content_md5 { + request.insert_header("content-md5", transactional_content_md5); + } + request.insert_header("content-type", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + if let Some(transactional_content_crc64) = options.transactional_content_crc64 { + request.insert_header("x-ms-content-crc64", transactional_content_crc64); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_sequence_number_equal_to) = options.if_sequence_number_equal_to { + request.insert_header("x-ms-if-sequence-number-eq", if_sequence_number_equal_to.to_string()); + } + if let Some(if_sequence_number_less_than_or_equal_to) = options.if_sequence_number_less_than_or_equal_to { + request.insert_header("x-ms-if-sequence-number-le", if_sequence_number_less_than_or_equal_to.to_string()); + } + if let Some(if_sequence_number_less_than) = options.if_sequence_number_less_than { + request.insert_header("x-ms-if-sequence-number-lt", if_sequence_number_less_than.to_string()); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + if let Some(range) = options.range { + request.insert_header("x-ms-range", range); + } + if let Some(structured_body_type) = options.structured_body_type { + request.insert_header("x-ms-structured-body", structured_body_type); + } + if let Some(structured_content_length) = options.structured_content_length { + request.insert_header("x-ms-structured-content-length", structured_content_length.to_string()); + } + request.insert_header("x-ms-version", version); + request.set_body(body); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL. + pub async fn upload_pages_from_url(&self, version: String, container_name: String, blob: String, source_url: String, source_range: String, content_length: i64, range: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("/{containerName}/{blob}"); + path = path.replace("{blob}", &blob); + path = path.replace("{containerName}", &container_name); + url.set_path(&path); + url.query_pairs_mut().append_pair("comp", "page").append_key_only("fromUrl").append_key_only("update"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-length", content_length.to_string()); + request.insert_header("content-type", "application/octet-stream"); + if let Some(if_match) = options.if_match { + request.insert_header("if-match", if_match); + } + if let Some(if_modified_since) = options.if_modified_since { + request.insert_header("if-modified-since", if_modified_since.to_string()); + } + if let Some(if_none_match) = options.if_none_match { + request.insert_header("if-none-match", if_none_match); + } + if let Some(if_unmodified_since) = options.if_unmodified_since { + request.insert_header("if-unmodified-since", if_unmodified_since.to_string()); + } + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-copy-source", source_url); + if let Some(copy_source_authorization) = options.copy_source_authorization { + request.insert_header("x-ms-copy-source-authorization", copy_source_authorization); + } + if let Some(encryption_algorithm) = options.encryption_algorithm { + request.insert_header("x-ms-encryption-algorithm", encryption_algorithm.to_string()); + } + if let Some(encryption_key) = options.encryption_key { + request.insert_header("x-ms-encryption-key", encryption_key); + } + if let Some(encryption_key_sha256) = options.encryption_key_sha256 { + request.insert_header("x-ms-encryption-key-sha256", encryption_key_sha256); + } + if let Some(encryption_scope) = options.encryption_scope { + request.insert_header("x-ms-encryption-scope", encryption_scope); + } + if let Some(if_sequence_number_equal_to) = options.if_sequence_number_equal_to { + request.insert_header("x-ms-if-sequence-number-eq", if_sequence_number_equal_to.to_string()); + } + if let Some(if_sequence_number_less_than_or_equal_to) = options.if_sequence_number_less_than_or_equal_to { + request.insert_header("x-ms-if-sequence-number-le", if_sequence_number_less_than_or_equal_to.to_string()); + } + if let Some(if_sequence_number_less_than) = options.if_sequence_number_less_than { + request.insert_header("x-ms-if-sequence-number-lt", if_sequence_number_less_than.to_string()); + } + if let Some(if_tags) = options.if_tags { + request.insert_header("x-ms-if-tags", if_tags); + } + if let Some(lease_id) = options.lease_id { + request.insert_header("x-ms-lease-id", lease_id); + } + request.insert_header("x-ms-range", range); + if let Some(source_content_crc64) = options.source_content_crc64 { + request.insert_header("x-ms-source-content-crc64", base64::encode(source_content_crc64)); + } + if let Some(source_content_md5) = options.source_content_md5 { + request.insert_header("x-ms-source-content-md5", source_content_md5); + } + if let Some(source_if_match) = options.source_if_match { + request.insert_header("x-ms-source-if-match", source_if_match); + } + if let Some(source_if_modified_since) = options.source_if_modified_since { + request.insert_header("x-ms-source-if-modified-since", source_if_modified_since); + } + if let Some(source_if_none_match) = options.source_if_none_match { + request.insert_header("x-ms-source-if-none-match", source_if_none_match); + } + if let Some(source_if_unmodified_since) = options.source_if_unmodified_since { + request.insert_header("x-ms-source-if-unmodified-since", source_if_unmodified_since); + } + request.insert_header("x-ms-source-range", source_range); + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } +} + +#[derive(Clone, Debug, Default)] +pub struct BlobPageBlobClientClearPagesOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_sequence_number_equal_to: Option, + pub if_sequence_number_less_than: Option, + pub if_sequence_number_less_than_or_equal_to: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub range: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobPageBlobClientCopyIncrementalOptions<'a> { + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobPageBlobClientCreateOptions<'a> { + pub blob_cache_control: Option, + pub blob_content_disposition: Option, + pub blob_content_encoding: Option, + pub blob_content_language: Option, + pub blob_content_md5: Option>, + pub blob_content_type: Option, + pub blob_sequence_number: Option, + pub blob_tags_string: Option, + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub immutability_policy_expiry: Option, + pub immutability_policy_mode: Option, + pub lease_id: Option, + pub legal_hold: Option, + pub metadata: Option>, + pub method_options: ClientMethodOptions<'a>, + pub tier: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobPageBlobClientResizeOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobPageBlobClientUpdateSequenceNumberOptions<'a> { + pub blob_sequence_number: Option, + pub client_request_id: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobPageBlobClientUploadPagesOptions<'a> { + pub client_request_id: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_sequence_number_equal_to: Option, + pub if_sequence_number_less_than: Option, + pub if_sequence_number_less_than_or_equal_to: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub range: Option, + pub structured_body_type: Option, + pub structured_content_length: Option, + pub timeout: Option, + pub transactional_content_crc64: Option, + pub transactional_content_md5: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobPageBlobClientUploadPagesFromUrlOptions<'a> { + pub client_request_id: Option, + pub copy_source_authorization: Option, + pub encryption_algorithm: Option, + pub encryption_key: Option, + pub encryption_key_sha256: Option, + pub encryption_scope: Option, + pub if_match: Option, + pub if_modified_since: Option, + pub if_none_match: Option, + pub if_sequence_number_equal_to: Option, + pub if_sequence_number_less_than: Option, + pub if_sequence_number_less_than_or_equal_to: Option, + pub if_tags: Option, + pub if_unmodified_since: Option, + pub lease_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub source_content_crc64: Option>, + pub source_content_md5: Option, + pub source_if_match: Option, + pub source_if_modified_since: Option, + pub source_if_none_match: Option, + pub source_if_unmodified_since: Option, + pub timeout: Option, +} + + diff --git a/sdk/storage/storage_blob/src/generated/clients/blob_service_client.rs b/sdk/storage/storage_blob/src/generated/clients/blob_service_client.rs new file mode 100644 index 0000000000..4c94f97ed7 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/blob_service_client.rs @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + ClientMethodOptions, Context, Method, Pipeline, Request, RequestContent, Response, Result, Url, +}; +use crate::models::{ + CorsRule, FilterBlobSegment, FilterBlobsIncludeItem, Logging, Metrics, RetentionPolicy, StaticWebsite, StorageServiceProperties, StorageServiceStats, UserDelegationKey, +}; +use super::internal_models::{ + GetUserDelegationKeyRequest, SetPropertiesRequest, +}; + +pub struct BlobServiceClient { + pub(crate) container_name: String, + pub(crate) endpoint: Url, + pub(crate) pipeline: Pipeline, + pub(crate) version: String, +} + +impl BlobServiceClient { + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// The Filter Blobs operation enables callers to list blobs across all containers whose tags match a given search expression. + pub async fn filter_blobs(&self, version: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url.set_path("/"); + url.query_pairs_mut().append_pair("comp", "blobs"); + if let Some(include) = options.include { + url.query_pairs_mut().append_pair("include", &include.iter().map(|i| i.to_string()).collect::>().join(",")); + } + if let Some(marker) = options.marker { + url.query_pairs_mut().append_pair("marker", &marker); + } + if let Some(maxresults) = options.maxresults { + url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + } + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + if let Some(where_param) = options.where_param { + url.query_pairs_mut().append_pair("where", &where_param); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Returns the sku name and account kind. + pub async fn get_account_info(&self, version: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url.set_path("/"); + url.query_pairs_mut().append_pair("comp", "properties").append_pair("restype", "account"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Retrieves properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin +/// Resource Sharing) rules. + pub async fn get_properties(&self, version: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url.set_path("/"); + url.query_pairs_mut().append_pair("comp", "properties").append_pair("restype", "service"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint +/// when read-access geo-redundant replication is enabled for the storage account. + pub async fn get_statistics(&self, version: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url.set_path("/"); + url.query_pairs_mut().append_pair("comp", "stats").append_pair("restype", "service"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token authentication. + pub async fn get_user_delegation_key(&self, version: String, start: String, expiry: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url.set_path("/"); + url.query_pairs_mut().append_pair("comp", "userdelegationkey").append_pair("restype", "service"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "application/xml"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + let body: RequestContent = GetUserDelegationKeyRequest { + start, + expiry, + }.try_into()?; + request.set_body(body); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin +/// Resource Sharing) rules + pub async fn set_properties(&self, version: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url.set_path("/"); + url.query_pairs_mut().append_pair("comp", "properties").append_pair("restype", "service"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/xml"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + let body: RequestContent = SetPropertiesRequest { + logging: options.logging, + hour_metrics: options.hour_metrics, + minute_metrics: options.minute_metrics, + cors: options.cors, + default_service_version: options.default_service_version, + delete_retention_policy: options.delete_retention_policy, + static_website: options.static_website, + }.try_into()?; + request.set_body(body); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// The Batch operation allows multiple API calls to be embedded into a single HTTP request. + pub async fn submit_batch(&self, version: String, content_length: i64, body: RequestContent>, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url.set_path("/"); + url.query_pairs_mut().append_pair("comp", "batch"); + if let Some(timeout) = options.timeout { + url.query_pairs_mut().append_pair("timeout", &timeout.to_string()); + } + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "multipart/mixed"); + request.insert_header("content-length", content_length.to_string()); + request.insert_header("content-type", "multipart/mixed"); + if let Some(client_request_id) = options.client_request_id { + request.insert_header("x-ms-client-request-id", client_request_id); + } + request.insert_header("x-ms-version", version); + request.set_body(body); + self.pipeline.send(&mut ctx, &mut request).await + + } +} + +#[derive(Clone, Debug, Default)] +pub struct BlobServiceClientFilterBlobsOptions<'a> { + pub client_request_id: Option, + pub include: Option>, + pub marker: Option, + pub maxresults: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, + pub where_param: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobServiceClientGetAccountInfoOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobServiceClientGetPropertiesOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobServiceClientGetStatisticsOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobServiceClientGetUserDelegationKeyOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobServiceClientSetPropertiesOptions<'a> { + pub client_request_id: Option, + pub cors: Option>, + pub default_service_version: Option, + pub delete_retention_policy: Option, + pub hour_metrics: Option, + pub logging: Option, + pub method_options: ClientMethodOptions<'a>, + pub minute_metrics: Option, + pub static_website: Option, + pub timeout: Option, +} + + +#[derive(Clone, Debug, Default)] +pub struct BlobServiceClientSubmitBatchOptions<'a> { + pub client_request_id: Option, + pub method_options: ClientMethodOptions<'a>, + pub timeout: Option, +} + + diff --git a/sdk/storage/storage_blob/src/generated/clients/internal_models.rs b/sdk/storage/storage_blob/src/generated/clients/internal_models.rs new file mode 100644 index 0000000000..63ecccf2be --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/internal_models.rs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + RequestContent, Result, +}; +use crate::generated::xml_helpers::CorsCorsRule; +use crate::models::{ + CorsRule, Logging, Metrics, RetentionPolicy, StaticWebsite, +}; +use serde::{ + Deserialize, Serialize, +}; +use typespec_client_core::xml::to_xml; + +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct GetUserDelegationKeyRequest { +/// The date-time the key expires. + #[serde(rename = "Expiry")] + pub expiry: String, + +/// The date-time the key is active. + #[serde(rename = "Start")] + pub start: String, + +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct SetPropertiesRequest { +/// The CORS properties. + #[serde(rename = "Cors", deserialize_with = "CorsCorsRule::unwrap", serialize_with = "CorsCorsRule::wrap", skip_serializing_if = "Option::is_none")] + pub cors: Option>, + +/// The default service version. + #[serde(rename = "DefaultServiceVersion", skip_serializing_if = "Option::is_none")] + pub default_service_version: Option, + +/// The delete retention policy. + #[serde(rename = "DeleteRetentionPolicy", skip_serializing_if = "Option::is_none")] + pub delete_retention_policy: Option, + +/// The hour metrics properties. + #[serde(rename = "HourMetrics", skip_serializing_if = "Option::is_none")] + pub hour_metrics: Option, + +/// The logging properties. + #[serde(rename = "Logging", skip_serializing_if = "Option::is_none")] + pub logging: Option, + +/// The minute metrics properties. + #[serde(rename = "MinuteMetrics", skip_serializing_if = "Option::is_none")] + pub minute_metrics: Option, + +/// The static website properties. + #[serde(rename = "StaticWebsite", skip_serializing_if = "Option::is_none")] + pub static_website: Option, + +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: GetUserDelegationKeyRequest) -> Result { + RequestContent::try_from(to_xml(&value)?) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: SetPropertiesRequest) -> Result { + RequestContent::try_from(to_xml(&value)?) + } +} + diff --git a/sdk/storage/storage_blob/src/generated/clients/mod.rs b/sdk/storage/storage_blob/src/generated/clients/mod.rs new file mode 100644 index 0000000000..af98c30a33 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/clients/mod.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod blob_append_blob_client; +pub mod blob_blob_client; +pub mod blob_block_blob_client; +pub mod blob_client; +pub mod blob_container_client; +pub mod blob_page_blob_client; +pub mod blob_service_client; +mod internal_models; diff --git a/sdk/storage/storage_blob/src/generated/enums.rs b/sdk/storage/storage_blob/src/generated/enums.rs new file mode 100644 index 0000000000..df7bb53468 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/enums.rs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use typespec_client_core::{ + create_enum, create_extensible_enum, +}; + +create_extensible_enum!( + AccessTier, + (Archive, "Archive"), + (Cold, "Cold"), + (Cool, "Cool"), + (Hot, "Hot"), + (P10, "P10"), + (P15, "P15"), + (P20, "P20"), + (P30, "P30"), + (P4, "P4"), + (P40, "P40"), + (P50, "P50"), + (P6, "P6"), + (P60, "P60"), + (P70, "P70"), + (P80, "P80"), + (Premium, "Premium") +); + +create_extensible_enum!( + AccountKind, + (BlobStorage, "BlobStorage"), + (BlockBlobStorage, "BlockBlobStorage"), + (FileStorage, "FileStorage"), + (Storage, "Storage"), + (StorageV2, "StorageV2") +); + +create_extensible_enum!( + ArchiveStatus, + (RehydratePendingToCold, "rehydrate-pending-to-cold"), + (RehydratePendingToCool, "rehydrate-pending-to-cool"), + (RehydratePendingToHot, "rehydrate-pending-to-hot") +); + +create_extensible_enum!( + BlobDeleteType, + (Permanent, "Permanent") +); + +create_extensible_enum!( + BlobExpiryOptions, + (Absolute, "Absolute"), + (NeverExpire, "NeverExpire"), + (RelativeToCreation, "RelativeToCreation"), + (RelativeToNow, "RelativeToNow") +); + +create_extensible_enum!( + BlobImmutabilityPolicyMode, + (Locked, "Locked"), + (Mutable, "Mutable"), + (Unlocked, "Unlocked") +); + +create_extensible_enum!( + BlobType, + (AppendBlob, "AppendBlob"), + (BlockBlob, "BlockBlob"), + (PageBlob, "PageBlob") +); + +create_extensible_enum!( + BlockListType, + (All, "all"), + (Committed, "committed"), + (Uncomitted, "uncommitted") +); + +create_extensible_enum!( + CopyStatus, + (Aborted, "aborted"), + (Failed, "failed"), + (Pending, "pending"), + (Success, "success") +); + +create_extensible_enum!( + DeleteSnapshotsOptionType, + (Include, "include"), + (Only, "only") +); + +create_extensible_enum!( + EncryptionAlgorithmType, + (AES256, "AES256") +); + +create_extensible_enum!( + FilterBlobsIncludeItem, + (None, "none"), + (Versions, "versions") +); + +create_extensible_enum!( + GeoReplicationStatusType, + (Bootstrap, "bootstrap"), + (Live, "live"), + (Unavailable, "unavailable") +); + +create_extensible_enum!( + LeaseState, + (Available, "available"), + (Breaking, "breaking"), + (Broken, "broken"), + (Expired, "expired"), + (Leased, "leased") +); + +create_extensible_enum!( + LeaseStatus, + (Locked, "locked"), + (Unlocked, "unlocked") +); + +create_extensible_enum!( + PremiumPageBlobAccessTier, + (P10, "P10"), + (P15, "P15"), + (P20, "P20"), + (P30, "P30"), + (P4, "P4"), + (P40, "P40"), + (P50, "P50"), + (P6, "P6"), + (P60, "P60"), + (P70, "P70"), + (P80, "P80") +); + +create_extensible_enum!( + PublicAccessType, + (Blob, "blob"), + (Container, "container") +); + +create_extensible_enum!( + QueryRequestType, + (SQL, "SQL") +); + +create_extensible_enum!( + QueryType, + (Arrow, "arrow"), + (Delimited, "delimited"), + (JSON, "json"), + (Parquet, "parquet") +); + +create_extensible_enum!( + RehydratePriority, + (High, "High"), + (Standard, "Standard") +); + +create_extensible_enum!( + SequenceNumberActionType, + (Increment, "increment"), + (Max, "max"), + (Update, "update") +); + +create_extensible_enum!( + SkuName, + (PremiumLRS, "Premium_LRS"), + (StandardGRS, "Standard_GRS"), + (StandardLRS, "Standard_LRS"), + (StandardRAGRS, "Standard_RAGRS"), + (StandardZRS, "Standard_ZRS") +); + diff --git a/sdk/storage/storage_blob/src/generated/mod.rs b/sdk/storage/storage_blob/src/generated/mod.rs new file mode 100644 index 0000000000..774008d9e7 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/mod.rs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod clients; +pub mod enums; +pub mod models; +pub mod models_serde; +mod xml_helpers; diff --git a/sdk/storage/storage_blob/src/generated/models.rs b/sdk/storage/storage_blob/src/generated/models.rs new file mode 100644 index 0000000000..7bf6e5f9ba --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/models.rs @@ -0,0 +1,486 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use crate::{ + generated::xml_helpers::Blob_tag_setBlobTag, generated::xml_helpers::BlobsFilterBlobItem, generated::xml_helpers::CorsCorsRule, generated::xml_helpers::SchemaArrowField, +}; +use crate::models::{ + GeoReplicationStatusType, QueryRequestType, QueryType, +}; +use serde::{ + Deserialize, Serialize, +}; +use time::OffsetDateTime; + +/// Represents an access policy. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct AccessPolicy { +/// The date-time the policy expires. + #[serde(rename = "Expiry", skip_serializing_if = "Option::is_none")] + pub expiry: Option, + +/// The permissions for acl the policy. + #[serde(rename = "Permission", skip_serializing_if = "Option::is_none")] + pub permission: Option, + +/// The date-time the policy is active. + #[serde(rename = "Start", skip_serializing_if = "Option::is_none")] + pub start: Option, + +} + +/// Represents the Apache Arrow configuration. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct ArrowConfiguration { +/// The Apache Arrow schema + #[serde(rename = "Schema", deserialize_with = "SchemaArrowField::unwrap", serialize_with = "SchemaArrowField::wrap", skip_serializing_if = "Option::is_none")] + pub schema: Option>, + +} + +/// Represents an Apache Arrow field. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +#[serde(rename = "Field")] +pub struct ArrowField { +/// The arrow field name. + #[serde(rename = "Name", skip_serializing_if = "Option::is_none")] + pub name: Option, + +/// The arrow field precision. + #[serde(rename = "Precision", skip_serializing_if = "Option::is_none")] + pub precision: Option, + +/// The arrow field scale. + #[serde(rename = "Scale", skip_serializing_if = "Option::is_none")] + pub scale: Option, + +/// The arrow field type. + #[serde(rename = "Type", skip_serializing_if = "Option::is_none")] + pub type_prop: Option, + +} + +/// The blob tags. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +#[serde(rename = "Tag")] +pub struct BlobTag { +/// The key of the tag. + #[serde(rename = "Key", skip_serializing_if = "Option::is_none")] + pub key: Option, + +/// The value of the tag. + #[serde(rename = "Value", skip_serializing_if = "Option::is_none")] + pub value: Option, + +} + +/// Represents blob tags. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +#[serde(rename = "Tags")] +pub struct BlobTags { +/// Represents the blob tags. + #[serde(rename = "TagSet", deserialize_with = "Blob_tag_setBlobTag::unwrap", serialize_with = "Blob_tag_setBlobTag::wrap", skip_serializing_if = "Option::is_none")] + pub blob_tag_set: Option>, + +} + +/// The Block lookup list. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +#[serde(rename = "BlockList")] +pub struct BlockLookupList { +/// The committed blocks + #[serde(rename = "Committed", skip_serializing_if = "Option::is_none")] + pub committed: Option>, + +/// The latest blocks + #[serde(rename = "Latest", skip_serializing_if = "Option::is_none")] + pub latest: Option>, + +/// The uncommitted blocks + #[serde(rename = "Uncommitted", skip_serializing_if = "Option::is_none")] + pub uncommitted: Option>, + +} + +/// CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. +/// Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in +/// a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct CorsRule { +/// The allowed headers. + #[serde(rename = "AllowedHeaders", skip_serializing_if = "Option::is_none")] + pub allowed_headers: Option, + +/// The allowed methods. + #[serde(rename = "AllowedMethods", skip_serializing_if = "Option::is_none")] + pub allowed_methods: Option, + +/// The allowed origins. + #[serde(rename = "AllowedOrigins", skip_serializing_if = "Option::is_none")] + pub allowed_origins: Option, + +/// The exposed headers. + #[serde(rename = "ExposedHeaders", skip_serializing_if = "Option::is_none")] + pub exposed_headers: Option, + +/// The maximum age in seconds. + #[serde(rename = "MaxAgeInSeconds", skip_serializing_if = "Option::is_none")] + pub max_age_in_seconds: Option, + +} + +/// Represents the delimited text configuration. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct DelimitedTextConfiguration { +/// The string used to separate columns. + #[serde(rename = "ColumnSeparator", skip_serializing_if = "Option::is_none")] + pub column_separator: Option, + +/// The string used to escape a quote character in a field. + #[serde(rename = "EscapeChar", skip_serializing_if = "Option::is_none")] + pub escape_char: Option, + +/// The string used to quote a specific field. + #[serde(rename = "FieldQuote", skip_serializing_if = "Option::is_none")] + pub field_quote: Option, + +/// Represents whether the data has headers. + #[serde(rename = "HasHeaders", skip_serializing_if = "Option::is_none")] + pub headers_present: Option, + +/// The string used to separate records. + #[serde(rename = "RecordSeparator", skip_serializing_if = "Option::is_none")] + pub record_separator: Option, + +} + +/// The filter blob item. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +#[serde(rename = "Blob")] +pub struct FilterBlobItem { +/// The properties of the blob. + #[serde(rename = "ContainerName", skip_serializing_if = "Option::is_none")] + pub container_name: Option, + +/// Whether it is the current version of the blob + #[serde(rename = "IsCurrentVersion", skip_serializing_if = "Option::is_none")] + pub is_current_version: Option, + +/// The name of the blob. + #[serde(rename = "Name", skip_serializing_if = "Option::is_none")] + pub name: Option, + +/// The metadata of the blob. + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option, + +/// The version ID of the blob. + #[serde(rename = "VersionId", skip_serializing_if = "Option::is_none")] + pub version_id: Option, + +} + +/// The result of a Filter Blobs API call +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +#[serde(rename = "EnumerationResults")] +pub struct FilterBlobSegment { +/// The blob segment. + #[serde(rename = "Blobs", deserialize_with = "BlobsFilterBlobItem::unwrap", serialize_with = "BlobsFilterBlobItem::wrap", skip_serializing_if = "Option::is_none")] + pub blobs: Option>, + +/// The next marker of the blobs. + #[serde(rename = "NextMarker", skip_serializing_if = "Option::is_none")] + pub next_marker: Option, + +/// The service endpoint. + #[serde(rename = "@ServiceEndpoint", skip_serializing_if = "Option::is_none")] + pub service_endpoint: Option, + +/// The filter for the blobs. + #[serde(rename = "Where", skip_serializing_if = "Option::is_none")] + pub where_prop: Option, + +} + +/// Geo-Replication information for the Secondary Storage Service +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct GeoReplication { +/// A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read +/// operations at the secondary. Primary writes after this point in time may or may not be available for reads. + #[serde(rename = "LastSyncTime", skip_serializing_if = "Option::is_none")] + pub last_sync_time: Option, + +/// The status of the secondary location + #[serde(rename = "Status", skip_serializing_if = "Option::is_none")] + pub status: Option, + +} + +/// Represents the JSON text configuration. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct JsonTextConfiguration { +/// The string used to separate records. + #[serde(rename = "RecordSeparator", skip_serializing_if = "Option::is_none")] + pub record_separator: Option, + +} + +/// Azure Analytics Logging settings. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct Logging { +/// Whether delete operation is logged. + #[serde(rename = "Delete", skip_serializing_if = "Option::is_none")] + pub delete: Option, + +/// Whether read operation is logged. + #[serde(rename = "Read", skip_serializing_if = "Option::is_none")] + pub read: Option, + +/// The retention policy of the logs. + #[serde(rename = "RetentionPolicy", skip_serializing_if = "Option::is_none")] + pub retention_policy: Option, + +/// The version of the logging properties. + #[serde(rename = "Version", skip_serializing_if = "Option::is_none")] + pub version: Option, + +/// Whether write operation is logged. + #[serde(rename = "Write", skip_serializing_if = "Option::is_none")] + pub write: Option, + +} + +/// The metrics properties. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct Metrics { +/// Whether it is enabled. + #[serde(rename = "Enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + +/// Whether to include API in the metrics. + #[serde(rename = "IncludeAPIs", skip_serializing_if = "Option::is_none")] + pub include_apis: Option, + +/// The retention policy of the metrics. + #[serde(rename = "RetentionPolicy", skip_serializing_if = "Option::is_none")] + pub retention_policy: Option, + +/// The version of the metrics properties. + #[serde(rename = "Version", skip_serializing_if = "Option::is_none")] + pub version: Option, + +} + +/// Represents the Parquet configuration. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct ParquetConfiguration { +} + +/// The query format settings. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct QueryFormat { +/// The Apache Arrow configuration. + #[serde(rename = "ArrowConfiguration", skip_serializing_if = "Option::is_none")] + pub arrow_configuration: Option, + +/// The delimited text configuration. + #[serde(rename = "DelimitedTextConfiguration", skip_serializing_if = "Option::is_none")] + pub delimited_text_configuration: Option, + +/// The JSON text configuration. + #[serde(rename = "JsonTextConfiguration", skip_serializing_if = "Option::is_none")] + pub json_text_configuration: Option, + +/// The Parquet configuration. + #[serde(rename = "ParquetConfiguration", skip_serializing_if = "Option::is_none")] + pub parquet_text_configuration: Option, + +/// The query type. + #[serde(rename = "Type", skip_serializing_if = "Option::is_none")] + pub type_prop: Option, + +} + +/// Groups the set of query request settings. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct QueryRequest { +/// The query expression in SQL. The maximum size of the query expression is 256KiB. + #[serde(rename = "Expression", skip_serializing_if = "Option::is_none")] + pub expression: Option, + +/// The input serialization settings. + #[serde(rename = "InputSerialization", skip_serializing_if = "Option::is_none")] + pub input_serialization: Option, + +/// The output serialization settings. + #[serde(rename = "OutputSerialization", skip_serializing_if = "Option::is_none")] + pub output_serialization: Option, + +/// Required. The type of the provided query expression. + #[serde(rename = "QueryType", skip_serializing_if = "Option::is_none")] + pub query_type: Option, + +} + +/// The query serialization settings. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct QuerySerialization { +/// The query format. + #[serde(rename = "Format", skip_serializing_if = "Option::is_none")] + pub format: Option, + +} + +/// The retention policy. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct RetentionPolicy { +/// Whether to allow permanent delete. + #[serde(rename = "AllowPermanentDelete", skip_serializing_if = "Option::is_none")] + pub allow_permanent_delete: Option, + +/// The number of days to retain the logs. + #[serde(rename = "Days", skip_serializing_if = "Option::is_none")] + pub days: Option, + +/// Whether to enable the retention policy. + #[serde(rename = "Enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + +} + +/// The signed identifier. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +#[serde(rename = "SignedIdentifier")] +pub struct SignedIdentifier { +/// The access policy for the signed identifier. + #[serde(rename = "AccessPolicy", skip_serializing_if = "Option::is_none")] + pub access_policy: Option, + +/// The unique ID for the signed identifier. + #[serde(rename = "Id", skip_serializing_if = "Option::is_none")] + pub id: Option, + +} + +/// The properties that enable an account to host a static website +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct StaticWebsite { +/// Absolute path of the default index page + #[serde(rename = "DefaultIndexDocumentPath", skip_serializing_if = "Option::is_none")] + pub default_index_document_path: Option, + +/// Indicates whether this account is hosting a static website + #[serde(rename = "Enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + +/// The error document. + #[serde(rename = "ErrorDocument404Path", skip_serializing_if = "Option::is_none")] + pub error_document404_path: Option, + +/// The index document. + #[serde(rename = "IndexDocument", skip_serializing_if = "Option::is_none")] + pub index_document: Option, + +} + +/// The service properties. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct StorageServiceProperties { +/// The CORS properties. + #[serde(rename = "Cors", deserialize_with = "CorsCorsRule::unwrap", serialize_with = "CorsCorsRule::wrap", skip_serializing_if = "Option::is_none")] + pub cors: Option>, + +/// The default service version. + #[serde(rename = "DefaultServiceVersion", skip_serializing_if = "Option::is_none")] + pub default_service_version: Option, + +/// The delete retention policy. + #[serde(rename = "DeleteRetentionPolicy", skip_serializing_if = "Option::is_none")] + pub delete_retention_policy: Option, + +/// The hour metrics properties. + #[serde(rename = "HourMetrics", skip_serializing_if = "Option::is_none")] + pub hour_metrics: Option, + +/// The logging properties. + #[serde(rename = "Logging", skip_serializing_if = "Option::is_none")] + pub logging: Option, + +/// The minute metrics properties. + #[serde(rename = "MinuteMetrics", skip_serializing_if = "Option::is_none")] + pub minute_metrics: Option, + +/// The static website properties. + #[serde(rename = "StaticWebsite", skip_serializing_if = "Option::is_none")] + pub static_website: Option, + +} + +/// Stats for the storage service. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct StorageServiceStats { +/// The geo replication stats. + #[serde(rename = "GeoReplication", skip_serializing_if = "Option::is_none")] + pub geo_replication: Option, + +} + +/// A user delegation key. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct UserDelegationKey { +/// The date-time the key expires. + #[serde(rename = "SignedExpiry", skip_serializing_if = "Option::is_none")] + pub signed_expiry: Option, + +/// The Azure Active Directory object ID in GUID format. + #[serde(rename = "SignedOid", skip_serializing_if = "Option::is_none")] + pub signed_oid: Option, + +/// Abbreviation of the Azure Storage service that accepts the key. + #[serde(rename = "SignedService", skip_serializing_if = "Option::is_none")] + pub signed_service: Option, + +/// The date-time the key is active. + #[serde(rename = "SignedStart", skip_serializing_if = "Option::is_none")] + pub signed_start: Option, + +/// The Azure Active Directory tenant ID in GUID format. + #[serde(rename = "SignedTid", skip_serializing_if = "Option::is_none")] + pub signed_tid: Option, + +/// The service version that created the key. + #[serde(rename = "SignedVersion", skip_serializing_if = "Option::is_none")] + pub signed_version: Option, + +/// The key as a base64 string. + #[serde(rename = "Value", skip_serializing_if = "Option::is_none")] + pub value: Option, + +} + diff --git a/sdk/storage/storage_blob/src/generated/models_serde.rs b/sdk/storage/storage_blob/src/generated/models_serde.rs new file mode 100644 index 0000000000..850ac98f8f --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/models_serde.rs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use async_std::task::block_on; +use azure_core::{ + RequestContent, Response, Result, +}; +use crate::models::{ + BlobTags, BlockLookupList, FilterBlobSegment, QueryRequest, StorageServiceProperties, StorageServiceStats, UserDelegationKey, +}; +use typespec_client_core::xml::to_xml; + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: BlobTags) -> Result { + RequestContent::try_from(to_xml(&value)?) + } +} + +impl TryFrom> for BlobTags { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_body().xml::(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: BlockLookupList) -> Result { + RequestContent::try_from(to_xml(&value)?) + } +} + +impl TryFrom> for BlockLookupList { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_body().xml::(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom> for FilterBlobSegment { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_body().xml::(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: QueryRequest) -> Result { + RequestContent::try_from(to_xml(&value)?) + } +} + +impl TryFrom> for StorageServiceProperties { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_body().xml::(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom> for StorageServiceStats { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_body().xml::(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom> for UserDelegationKey { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_body().xml::(); + let r = block_on(f())?; + Ok(r) + } +} + diff --git a/sdk/storage/storage_blob/src/generated/xml_helpers.rs b/sdk/storage/storage_blob/src/generated/xml_helpers.rs new file mode 100644 index 0000000000..e1d6fb9933 --- /dev/null +++ b/sdk/storage/storage_blob/src/generated/xml_helpers.rs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +use crate::models::{ + ArrowField, BlobTag, CorsRule, FilterBlobItem, +}; +use serde::{ + Deserialize, Deserializer, Serialize, Serializer, +}; + +#[derive(Deserialize, Serialize)] +#[serde(rename = "TagSet")] +pub struct Blob_tag_setBlobTag { + #[serde(default)] + BlobTag: Option>, +} + +impl Blob_tag_setBlobTag { + pub fn unwrap<'de, D>(deserializer: D) -> Result>, D::Error> where D: Deserializer<'de> { + Ok(Blob_tag_setBlobTag::deserialize(deserializer)?.BlobTag) + } + + pub fn wrap(to_serialize: &Option>, serializer: S) -> Result where S: Serializer { + Blob_tag_setBlobTag { + BlobTag: to_serialize.to_owned(), + } + .serialize(serializer) + } +} + +#[derive(Deserialize, Serialize)] +#[serde(rename = "Blobs")] +pub struct BlobsFilterBlobItem { + #[serde(default)] + FilterBlobItem: Option>, +} + +impl BlobsFilterBlobItem { + pub fn unwrap<'de, D>(deserializer: D) -> Result>, D::Error> where D: Deserializer<'de> { + Ok(BlobsFilterBlobItem::deserialize(deserializer)?.FilterBlobItem) + } + + pub fn wrap(to_serialize: &Option>, serializer: S) -> Result where S: Serializer { + BlobsFilterBlobItem { + FilterBlobItem: to_serialize.to_owned(), + } + .serialize(serializer) + } +} + +#[derive(Deserialize, Serialize)] +#[serde(rename = "Cors")] +pub struct CorsCorsRule { + #[serde(default)] + CorsRule: Option>, +} + +impl CorsCorsRule { + pub fn unwrap<'de, D>(deserializer: D) -> Result>, D::Error> where D: Deserializer<'de> { + Ok(CorsCorsRule::deserialize(deserializer)?.CorsRule) + } + + pub fn wrap(to_serialize: &Option>, serializer: S) -> Result where S: Serializer { + CorsCorsRule { + CorsRule: to_serialize.to_owned(), + } + .serialize(serializer) + } +} + +#[derive(Deserialize, Serialize)] +#[serde(rename = "Schema")] +pub struct SchemaArrowField { + #[serde(default)] + ArrowField: Option>, +} + +impl SchemaArrowField { + pub fn unwrap<'de, D>(deserializer: D) -> Result>, D::Error> where D: Deserializer<'de> { + Ok(SchemaArrowField::deserialize(deserializer)?.ArrowField) + } + + pub fn wrap(to_serialize: &Option>, serializer: S) -> Result where S: Serializer { + SchemaArrowField { + ArrowField: to_serialize.to_owned(), + } + .serialize(serializer) + } +} + diff --git a/sdk/storage/storage_blob/src/lib.rs b/sdk/storage/storage_blob/src/lib.rs new file mode 100644 index 0000000000..ec2d89e66b --- /dev/null +++ b/sdk/storage/storage_blob/src/lib.rs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; + +pub use crate::generated::clients::*; + +pub mod models { + pub use crate::generated::enums::*; + pub use crate::generated::models::*; +} + +pub use blob_client::BlobClient; diff --git a/sdk/storage/storage_blob/tsp-location.yaml b/sdk/storage/storage_blob/tsp-location.yaml new file mode 100644 index 0000000000..20656c66c6 --- /dev/null +++ b/sdk/storage/storage_blob/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/storage/Microsoft.BlobStorage +commit: 0082f7bb59cbfdfde45dd7f54f51f5d20ba5baa4 +repo: Azure/azure-rest-api-specs +additionalDirectories: